{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,2,13]],"date-time":"2026-02-13T23:47:40Z","timestamp":1771026460995,"version":"3.50.1"},"reference-count":26,"publisher":"MDPI AG","issue":"9","license":[{"start":{"date-parts":[[2022,9,18]],"date-time":"2022-09-18T00:00:00Z","timestamp":1663459200000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Computers"],"abstract":"<jats:p>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 evidence more difficult to be produced. In this paper, we propose two novel metrics, dependency injection-weighted afferent couplings (DCE) and dependency injection-weighted coupling between objects (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 assessing maintainability when DI is also considered. The metric is implemented in the CKJM-Analyzer, an extension of the CKJM tool to perform static analysis on DI detection. We discuss the algorithmic approach behind the static analysis and prove the soundness of the tool using a set of open-source Java projects.<\/jats:p>","DOI":"10.3390\/computers11090141","type":"journal-article","created":{"date-parts":[[2022,9,18]],"date-time":"2022-09-18T22:12:43Z","timestamp":1663539163000},"page":"141","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":6,"title":["Measuring Impact of Dependency Injection on Software Maintainability"],"prefix":"10.3390","volume":"11","author":[{"given":"Peter","family":"Sun","sequence":"first","affiliation":[{"name":"Department of Computer Science and Engineering, Oakland University, Rochester, MI 48309, USA"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-7133-9111","authenticated-orcid":false,"given":"Dae-Kyoo","family":"Kim","sequence":"additional","affiliation":[{"name":"Department of Computer Science and Engineering, Oakland University, Rochester, MI 48309, USA"}]},{"given":"Hua","family":"Ming","sequence":"additional","affiliation":[{"name":"Department of Computer Science and Engineering, Oakland University, Rochester, MI 48309, USA"}]},{"given":"Lunjin","family":"Lu","sequence":"additional","affiliation":[{"name":"Department of Computer Science and Engineering, Oakland University, Rochester, MI 48309, USA"}]}],"member":"1968","published-online":{"date-parts":[[2022,9,18]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","unstructured":"Murgia, A., Tonelli, R., Counsell, S., Concas, G., and Marchesi, M. (2011, January 17\u201320). An empirical study of refactoring in the context of FanIn and FanOut coupling. Proceedings of the 18th Working Conference on Reverse Engineering, Limerick, Ireland.","DOI":"10.1109\/WCRE.2011.52"},{"key":"ref_2","unstructured":"Johnson, R., and Hoeller, J. (2004). Expert One-on-One J2EE Development without EJB, Wiley Publishing."},{"key":"ref_3","unstructured":"Razina, E., and Janzen, D.S. (2007, January 19\u201321). Effects of dependency injection on maintainability. Proceedings of the 11th IASTED International Conference on Software Engineering and Applications, Cambridge, MA, USA."},{"key":"ref_4","doi-asserted-by":"crossref","unstructured":"Yang, H.Y., Tempero, E., and Melton, H. (2008, January 26\u201328). An empirical study into use of dependency injection in java. Proceedings of the 19th Australian Conference on Software Engineering, Perth, WA, Australia.","DOI":"10.1109\/ASWEC.2008.4483212"},{"key":"ref_5","doi-asserted-by":"crossref","unstructured":"Lee, Y., and Chang, K.H. (2000, January 7\u20138). Reusability and maintainability metrics for object-oriented software. Proceedings of the 38th Annual on Southeast Regional Conference, Clemson, SC, USA.","DOI":"10.1145\/1127716.1127737"},{"key":"ref_6","first-page":"66","article-title":"Empirically assessing the impact of dependency injection on the development of Web Service applications","volume":"9","author":"Crasso","year":"2010","journal-title":"J. Web Eng."},{"key":"ref_7","doi-asserted-by":"crossref","unstructured":"Roubtsov, S., Serebrenik, A., and van den Brand, M. (2010, January 15\u201318). Detecting modularity \u201csmells\u201d in dependencies injected with Java annotations. Proceedings of the 14th European Conference on Software Maintenance and Engineering, Madrid, Spain.","DOI":"10.1109\/CSMR.2010.45"},{"key":"ref_8","doi-asserted-by":"crossref","unstructured":"Laigner, R., Kalinowski, M., Carvalho, L., Mendon\u00e7a, D., and Garcia, A. (2019, January 23\u201327). Towards a Catalog of Java Dependency Injection Anti-Patterns. Proceedings of the 33rd Brazilian Symposium on Software Engineering, Salvador, Brazil.","DOI":"10.1145\/3350768.3350771"},{"key":"ref_9","unstructured":"Spinellis, D. (2020, September 22). Chidamber and Kemerer Java Metrics. Available online: http:\/\/www.spinellis.gr\/sw\/ckjm\/."},{"key":"ref_10","unstructured":"(2022, June 01). CKJM-Analyzer. Available online: https:\/\/github.com\/Narnian12\/ckjm-analyzer."},{"key":"ref_11","unstructured":"Fowler, M. (2020, August 06). Inversion of Control Containers and the Dependency Injection Pattern. Available online: https:\/\/martinfowler.com\/articles\/injection.html."},{"key":"ref_12","first-page":"35","article-title":"An Evaluation of Chidamber and Kemerer\u2019s Lack of Cohesion in Method (LCOM) Metric Using Different Normalization Approaches","volume":"1","author":"Okike","year":"2008","journal-title":"Afr. J. Comput. ICT"},{"key":"ref_13","unstructured":"(2022, August 01). ckjm-di. Available online: https:\/\/github.com\/Narnian12\/ckjm-di."},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"Lincke, R., Lundberg, J., and L\u00f6we, W. (2008, January 20\u201324). Comparing Software Metrics Tools. Proceedings of the 2008 International Symposium on Software Testing and Analysis, Seattle, WA, USA.","DOI":"10.1145\/1390630.1390648"},{"key":"ref_15","unstructured":"Oman, P., and Hagemeister, J. (1992, January 9\u201312). Metrics for assessing a software system\u2019s maintainability. Proceedings of the Proceedings Conference on Software Maintenance, Orlando, FL, USA."},{"key":"ref_16","doi-asserted-by":"crossref","unstructured":"Wagey, B.C., Hendradjaya, B., and Mardiyanto, M.S. (2015, January 25\u201326). A proposal of software maintainability model using code smell measurement. Proceedings of the International Conference on Data and Software Engineering, Yogyakarta, Indonesia.","DOI":"10.1109\/ICODSE.2015.7436966"},{"key":"ref_17","doi-asserted-by":"crossref","first-page":"630","DOI":"10.1109\/32.935855","article-title":"The confounding effect of class size on the validity of object-oriented metrics","volume":"27","author":"Emam","year":"2001","journal-title":"IEEE Trans. Softw. Eng."},{"key":"ref_18","unstructured":"(2022, August 01). ckjm-di-projects. Available online: https:\/\/github.com\/Narnian12\/ckjm-di-projects."},{"key":"ref_19","doi-asserted-by":"crossref","unstructured":"Tempero, E., Anslow, C., Dietrich, J., Han, T., Li, J., Lumpe, M., Melton, H., and Noble, J. (December, January 30). The Qualitas Corpus: A curated collection of Java code for empirical studies. Proceedings of the 2010 Asia Pacific Software Engineering Conference, Sydney, NSW, Australia.","DOI":"10.1109\/APSEC.2010.46"},{"key":"ref_20","first-page":"2677","article-title":"An Extension on \u2018Statistical Comparisons of Classifiers over Multiple Data Sets\u2019 for all Pairwise Comparisons","volume":"9","author":"Garcia","year":"2008","journal-title":"J. Mach. Learn. Res."},{"key":"ref_21","doi-asserted-by":"crossref","unstructured":"Anwer, S., Adbellatif, A., Alshayeb, M., and Anjum, M.S. (2017, January 8\u20139). Effect of coupling on software faults: An empirical study. Proceedings of the 2017 International Conference on Communication, Computing and Digital Systems, Islamabad, Pakistan.","DOI":"10.1109\/C-CODE.2017.7918930"},{"key":"ref_22","doi-asserted-by":"crossref","unstructured":"\u00dajh\u00e1zi, B., Ferenc, R., Poshyvanyk, D., and Gyim\u00f3thy, T. (2010, January 12\u201313). New conceptual coupling and cohesion metrics for object-oriented systems. Proceedings of the 2010 10th IEEE Working Conference on Source Code Analysis and Manipulation, Timisoara, Romania.","DOI":"10.1109\/SCAM.2010.14"},{"key":"ref_23","first-page":"35","article-title":"Assessing Weight of the Coupling between Objects towards Defect Forecasting in Object Oriented Programming","volume":"14","author":"Saidulu","year":"2014","journal-title":"Glob. J. Comput. Sci. Technol."},{"key":"ref_24","doi-asserted-by":"crossref","first-page":"e590","DOI":"10.7717\/peerj-cs.590","article-title":"Vovel metrics\u2014novel coupling metrics for improved software fault prediction","volume":"7","author":"Muhammad","year":"2021","journal-title":"PeerJ Comput. Sci."},{"key":"ref_25","first-page":"27","article-title":"The spring framework-reference documentation","volume":"21","author":"Johnson","year":"2004","journal-title":"Interface"},{"key":"ref_26","unstructured":"Gamma, E., Helm, R., Johnson, R., Johnson, R.E., and Vlissides, J. (1995). Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley."}],"container-title":["Computers"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2073-431X\/11\/9\/141\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,11]],"date-time":"2025-10-11T00:33:44Z","timestamp":1760142824000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2073-431X\/11\/9\/141"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2022,9,18]]},"references-count":26,"journal-issue":{"issue":"9","published-online":{"date-parts":[[2022,9]]}},"alternative-id":["computers11090141"],"URL":"https:\/\/doi.org\/10.3390\/computers11090141","relation":{},"ISSN":["2073-431X"],"issn-type":[{"value":"2073-431X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2022,9,18]]}}}