一句话:将依赖更新建模为多目标线性规划,全局优化质量与成本并生成更新策略。
保持依赖更新是重要的软件维护任务,开发者需选择更新哪些依赖、目标版本,并减少破坏性变更和不兼容。本文把依赖更新问题形式化为多目标优化问题,从全局视角考虑所有直接与间接依赖,并允许开发者指定希望最大化的质量因素和最小化的成本。该问题被编码为线性规划,其解给出与开发者优先级一致且尽量减少不兼容的最优更新策略。作者使用107个测试良好的开源Java项目,在多种真实更新场景配置下评估,并考虑依赖新鲜度、时间窗口流行度和CVE漏洞评分三个质量指标。结果表明,该方法生成的更新在编译和测试通过方面与依赖机器人中的朴素方法相当,且在新鲜度上最多可优两个数量级;通过综合考虑新鲜度、流行度和漏洞的质量债概念,该方法能降低质量债,同时保持合理的内存与时间消耗。
Keeping dependencies up to date is a crucial software maintenance task that requires significant effort. Developers must choose which dependencies to update, select appropriate target versions, and minimize the impact of updates in terms of breaking changes and incompatibilities. Several factors influence the choice of a new dependency version, including its freshness, popularity, absence of vulnerabilities, and compatibility.In this paper, we formulate the dependency update problem as a multi-objective optimization problem. This approach allows for updating dependencies with a global perspective, considering all direct and indirect dependencies. It also enables developers to specify their preferences regarding the quality factors to maximize and the costs to minimize when updating. The update problem is encoded as a linear program whose solution provides an optimal update strategy that aligns with developer priorities and minimizes incompatibilities.We evaluate our approach using a dataset of 107 well-tested open-source Java projects using various configurations that reflect real-world update scenarios and consider three quality metrics: dependency freshness, a time-window popularity measure, and a vulnerability score related to CVEs. Our findings indicate that our approach generates updates that compile and pass tests as well as the naive approaches typically implemented in dependency bots. Furthermore, our approach can be up to two orders of magnitude better in terms of freshness. By considering a more comprehensive concept of quality debt, which accounts for freshness, popularity, and vulnerabilities, our approach is able to reduce quality debt while maintaining reasonable memory and time consumption.CCS CONCEPTS • Software and its engineering → Software libraries and repositories; Software maintenance tools; Software evolution.