arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2205.06381cs.SE
收藏

依赖注入对软件可维护性的影响分析

Analyzing Impact of Dependency Injection on Software Maintainability

Peter Sun, Dae-Kyoo Kim

摘要:

依赖注入(DI)通常通过将应用程序类与库分离来提高可维护性。特别是在Java环境中,有许多应用程序使用DI的原则来提高可维护性。有一些工作,提供了一个推理的影响DI的可维护性,但没有提供确凿的证据。由于没有公开可用的工具来量化直接投资,因此更难以提供此类证据。在本文中,我们提出了一种新的度量,DCBO,衡量DI的比例在一个项目的基础上加权耦合。我们描述了如何DCBO可以作为一个更有意义的度量在计算可维护性时,DI也被认为是。该指标在CKJM分析器中实现,CKJM分析器是CKJM工具的扩展,它利用静态代码分析来检测DI。我们讨论了背后的静态分析的算法方法,并证明了使用一组开源Java项目的工具的可靠性。

英文摘要:

Dependency injection (DI) is generally known to improve maintainability by keeping application classes separate from the library. Particularly within the Java environment, there are many applications using the principles of DI with the aim to improve maintainability. There exists some work that provides an inference on the impact of DI on maintainability, but no conclusive evidence is provided. The fact that there are no publicly available tools for quantifying DI makes such an evidence more difficult to be produced. In this paper, we propose a novel metric, DCBO, to measure the proportion of DI in a project based on weighted couplings. We describe how DCBO can serve as a more meaningful metric in computing maintainability when DI is also considered. The metric is implemented in the CKJM-Analyzer, an extension of the CKJM tool that utilizes static code analysis to detect DI. We discuss the algorithmic approach behind the static analysis and prove the soundness of the tool using a set of open-source Java projects.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑