Empirical Software Engineering

, Volume 21, Issue 3, pp 896–931

Evaluating the impact of design pattern and anti-pattern dependencies on changes and faults

  • Fehmi Jaafar
  • Yann-Gaël Guéhéneuc
  • Sylvie Hamel
  • Foutse Khomh
  • Mohammad Zulkernine
Article

DOI: 10.1007/s10664-015-9361-0

Cite this article as:
Jaafar, F., Guéhéneuc, YG., Hamel, S. et al. Empir Software Eng (2016) 21: 896. doi:10.1007/s10664-015-9361-0

Abstract

On the one hand, design patterns are solutions to recurring design problems, aimed at increasing reuse, flexibility, and maintainability. However, much prior work found that some patterns, such as the Observer and Singleton, are correlated with large code structures and argued that they are more likely to be fault prone. On the other hand, anti-patterns describe poor solutions to design and implementation problems that highlight weaknesses in the design of software systems and that may slow down maintenance and increase the risk of faults. They have been found to negatively impact change and fault-proneness. Classes participating in design patterns and anti-patterns have dependencies with other classes, e.g., static and co-change dependencies, that may propagate problems to other classes. We investigate the impact of such dependencies in object-oriented systems by studying the relations between the presence of static and co-change dependencies and (1) the fault-proneness, (2) the types of changes, and (3) the types of faults that these classes exhibit. We analyze six design patterns and 10 anti-patterns in 39 releases of ArgoUML, JFreeChart, and XercesJ, and investigate to what extent classes having dependencies with design patterns or anti-patterns have higher odds of faults than other classes. We show that in almost all releases of the three systems, classes having dependencies with anti-patterns are more fault-prone than others while this is not always true for classes with dependencies with design patterns. We also observe that structural changes are the most common changes impacting classes having dependencies with anti-patterns. Software developers could use this knowledge about the impact of design pattern and anti-pattern dependencies to better focus their testing and reviewing activities towards the most risky classes and to propagate changes adequately.

Keywords

Anti-patterns Design patterns Faults proneness Change proneness Static relationships Co-change 

Copyright information

© Springer Science+Business Media New York 2015

Authors and Affiliations

  • Fehmi Jaafar
    • 1
  • Yann-Gaël Guéhéneuc
    • 3
  • Sylvie Hamel
    • 2
  • Foutse Khomh
    • 3
  • Mohammad Zulkernine
    • 1
  1. 1.School of ComputingQueen’s UniversityOntarioCanada
  2. 2.DIROUniversité de MontréalQuébecCanada
  3. 3.DGIGLÉcole Polytechnique de MontréalQuébecCanada

Personalised recommendations