修复Dockerfile气味:一项实证研究
Fixing Dockerfile Smells: An Empirical Study
摘要:
背景容器化技术在DevOps工作流中被广泛采用。最常用的是Docker,它要求开发人员定义一个规范文件(Dockerfile)来构建用于创建容器的镜像。编写Dockerfiles有几个最佳实践规则,但开发人员并不总是遵循它们。违反这种做法,称为Dockerfile气味,可能会对Docker映像的可靠性和性能产生负面影响。之前的研究表明,Dockerfile气味广泛传播,并且缺乏支持开发人员修复它们的自动工具。然而,目前还不清楚开发人员修复了Dockerfile的哪些气味,以及开发人员愿意在多大程度上首先修复气味。Objective.我们的探索性研究有两个目的。首先,我们想了解Dockerfiles的气味受到开发人员的更多关注,即,在开源项目的历史上更频繁地被修复。其次,我们想检查开发人员是否愿意接受旨在修复Dockerfile气味的更改(例如,由自动化工具生成),以了解他们是否关心他们。法在研究的第一部分中,我们将在由940万个独特的Dockerfiles组成的最先进的数据集上评估Dockerfile气味的生存能力。我们依靠最先进的工具(hadolint)来检测Dockerfile的气味在Dockerfiles的演变过程中消失,我们将手动分析大量此类案例,以了解开发人员是否修复了它们,以及他们是否意识到了气味。在第二部分中,我们将在一组GitHub项目中检测有异味的Dockerfile,并使用基于规则的工具自动修复它们。最后,我们将打开pull requests,向开发人员提出修改,我们将定量和定性地评估他们的结果。
英文摘要:
Background. Containerization technologies are widely adopted in the DevOps workflow. The most commonly used one is Docker, which requires developers to define a specification file (Dockerfile) to build the image used for creating containers. There are several best practice rules for writing Dockerfiles, but the developers do not always follow them. Violations of such practices, known as Dockerfile smells, can negatively impact the reliability and the performance of Docker images. Previous studies showed that Dockerfile smells are widely diffused, and there is a lack of automatic tools that support developers in fixing them. However, it is still unclear what Dockerfile smells get fixed by developers and to what extent developers would be willing to fix smells in the first place. Objective. The aim of our exploratory study is twofold. First, we want to understand what Dockerfiles smells receive more attention from developers, i.e., are fixed more frequently in the history of open-source projects. Second, we want to check if developers are willing to accept changes aimed at fixing Dockerfile smells (e.g., generated by an automated tool), to understand if they care about them. Method. In the first part of the study, we will evaluate the survivability of Dockerfile smells on a state-of-the-art dataset composed of 9.4M unique Dockerfiles. We rely on a state-of-the-art tool (hadolint) for detecting which Dockerfile smells disappear during the evolution of Dockerfiles, and we will manually analyze a large sample of such cases to understand if developers fixed them and if they were aware of the smell. In the second part, we will detect smelly Dockerfiles on a set of GitHub projects, and we will use a rule-based tool to automatically fix them. Finally, we will open pull requests proposing the modifications to developers, and we will quantitatively and qualitatively evaluate their outcome.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。