Cataloging dependency injection anti-patterns in software systems

Research output: Contribution to journalJournal articleResearchpeer-review

Standard

Cataloging dependency injection anti-patterns in software systems. / Laigner, Rodrigo; Mendonça, Diogo; Garcia, Alessandro; Kalinowski, Marcos.

In: Journal of Systems and Software, Vol. 184, 111125, 2022.

Research output: Contribution to journalJournal articleResearchpeer-review

Harvard

Laigner, R, Mendonça, D, Garcia, A & Kalinowski, M 2022, 'Cataloging dependency injection anti-patterns in software systems', Journal of Systems and Software, vol. 184, 111125. https://doi.org/10.1016/j.jss.2021.111125

APA

Laigner, R., Mendonça, D., Garcia, A., & Kalinowski, M. (2022). Cataloging dependency injection anti-patterns in software systems. Journal of Systems and Software, 184, [111125]. https://doi.org/10.1016/j.jss.2021.111125

Vancouver

Laigner R, Mendonça D, Garcia A, Kalinowski M. Cataloging dependency injection anti-patterns in software systems. Journal of Systems and Software. 2022;184. 111125. https://doi.org/10.1016/j.jss.2021.111125

Author

Laigner, Rodrigo ; Mendonça, Diogo ; Garcia, Alessandro ; Kalinowski, Marcos. / Cataloging dependency injection anti-patterns in software systems. In: Journal of Systems and Software. 2022 ; Vol. 184.

Bibtex

@article{5ca551ce531f4c7d89a8b8b9b7197146,
title = "Cataloging dependency injection anti-patterns in software systems",
abstract = "Context: Dependency Injection (DI) is a commonly applied mechanism to decouple classes from their dependencies in order to provide higher modularization. However, bad DI practices often lead to negative consequences, such as increasing coupling. Although white literature conjectures about the existence of DI anti-patterns, there is no evidence on their practical relevance, usefulness, and generality. Objective: The objective of this study is to propose and evaluate a catalog of DI anti-patterns and associated refactorings. Methodology: We reviewed existing reported DI anti-patterns in order to analyze their completeness. The limitations found in literature motivated proposing a novel catalog of 12 DI anti-patterns. We developed a tool to statically analyze the occurrence level of the candidate DI anti-patterns in both open-source and industry projects. Next, we survey practitioners to assess their perception on the relevance, usefulness, and their willingness on refactoring anti-pattern instances of the catalog. Results: Our static code analyzer tool showed a relative recall of 92.19% and high average precision. It revealed that at least 9 different DI anti-patterns appeared frequently in the analyzed projects. Besides, our survey confirmed the perceived relevance of the catalog and developers expressed their willingness to refactor instances of anti-patterns from source code. Conclusion: The catalog contains DI anti-patterns that occur in practice and that are perceived as useful. Sharing it with practitioners may help them to avoid such anti-patterns, thus improving source-code quality.",
keywords = "Anti-pattern, Dependency injection, Dependency inversion, Inversion of control",
author = "Rodrigo Laigner and Diogo Mendon{\c c}a and Alessandro Garcia and Marcos Kalinowski",
note = "Publisher Copyright: {\textcopyright} 2021 The Authors",
year = "2022",
doi = "10.1016/j.jss.2021.111125",
language = "English",
volume = "184",
journal = "Journal of Systems and Software",
issn = "0164-1212",
publisher = "Elsevier",

}

RIS

TY - JOUR

T1 - Cataloging dependency injection anti-patterns in software systems

AU - Laigner, Rodrigo

AU - Mendonça, Diogo

AU - Garcia, Alessandro

AU - Kalinowski, Marcos

N1 - Publisher Copyright: © 2021 The Authors

PY - 2022

Y1 - 2022

N2 - Context: Dependency Injection (DI) is a commonly applied mechanism to decouple classes from their dependencies in order to provide higher modularization. However, bad DI practices often lead to negative consequences, such as increasing coupling. Although white literature conjectures about the existence of DI anti-patterns, there is no evidence on their practical relevance, usefulness, and generality. Objective: The objective of this study is to propose and evaluate a catalog of DI anti-patterns and associated refactorings. Methodology: We reviewed existing reported DI anti-patterns in order to analyze their completeness. The limitations found in literature motivated proposing a novel catalog of 12 DI anti-patterns. We developed a tool to statically analyze the occurrence level of the candidate DI anti-patterns in both open-source and industry projects. Next, we survey practitioners to assess their perception on the relevance, usefulness, and their willingness on refactoring anti-pattern instances of the catalog. Results: Our static code analyzer tool showed a relative recall of 92.19% and high average precision. It revealed that at least 9 different DI anti-patterns appeared frequently in the analyzed projects. Besides, our survey confirmed the perceived relevance of the catalog and developers expressed their willingness to refactor instances of anti-patterns from source code. Conclusion: The catalog contains DI anti-patterns that occur in practice and that are perceived as useful. Sharing it with practitioners may help them to avoid such anti-patterns, thus improving source-code quality.

AB - Context: Dependency Injection (DI) is a commonly applied mechanism to decouple classes from their dependencies in order to provide higher modularization. However, bad DI practices often lead to negative consequences, such as increasing coupling. Although white literature conjectures about the existence of DI anti-patterns, there is no evidence on their practical relevance, usefulness, and generality. Objective: The objective of this study is to propose and evaluate a catalog of DI anti-patterns and associated refactorings. Methodology: We reviewed existing reported DI anti-patterns in order to analyze their completeness. The limitations found in literature motivated proposing a novel catalog of 12 DI anti-patterns. We developed a tool to statically analyze the occurrence level of the candidate DI anti-patterns in both open-source and industry projects. Next, we survey practitioners to assess their perception on the relevance, usefulness, and their willingness on refactoring anti-pattern instances of the catalog. Results: Our static code analyzer tool showed a relative recall of 92.19% and high average precision. It revealed that at least 9 different DI anti-patterns appeared frequently in the analyzed projects. Besides, our survey confirmed the perceived relevance of the catalog and developers expressed their willingness to refactor instances of anti-patterns from source code. Conclusion: The catalog contains DI anti-patterns that occur in practice and that are perceived as useful. Sharing it with practitioners may help them to avoid such anti-patterns, thus improving source-code quality.

KW - Anti-pattern

KW - Dependency injection

KW - Dependency inversion

KW - Inversion of control

U2 - 10.1016/j.jss.2021.111125

DO - 10.1016/j.jss.2021.111125

M3 - Journal article

AN - SCOPUS:85118586545

VL - 184

JO - Journal of Systems and Software

JF - Journal of Systems and Software

SN - 0164-1212

M1 - 111125

ER -

ID: 306677621