Cataloging Dependency Injection Anti-Patterns in Software Systems

09/09/2021
by   Rodrigo Laigner, et al.
0

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 Java 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 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 Java 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/30/2020

The 'as Code' Activities: Development Anti-patterns for Infrastructure as Code

Context: The 'as code' suffix in infrastructure as code (IaC) refers to ...
research
10/19/2020

Warrior1: A Performance Sanitizer for C++

This paper presents Warrior1, a tool that detects performance anti-patte...
research
08/12/2019

Microservices Anti-Patterns: A Taxonomy

Several companies are re-architecting their monolithic information syste...
research
05/12/2022

Analyzing Impact of Dependency Injection on Software Maintainability

Dependency injection (DI) is generally known to improve maintainability ...
research
07/18/2021

IDEAL: An Open-Source Identifier Name Appraisal Tool

Developers must comprehend the code they will maintain, meaning that the...
research
01/29/2019

A Machine-learning Based Ensemble Method For Anti-patterns Detection

Anti-patterns are poor solutions to recurring design problems. Several e...
research
04/30/2021

Technical Reports Compilation: Detecting the Fire Drill anti-pattern using Source Code and issue-tracking data

Detecting the presence of project management anti-patterns (AP) currentl...

Please sign up or login with your details

Forgot password? Click here to reset