Empirical Software Engineering

, Volume 21, Issue 3, pp 896–931 | Cite as

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

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 

References

  1. Alencar PSC, Cowan DD, Morales-Germán D, Lichtner KJ, Pereira de Lucena CJ, Nova LC (1995) A formal approach to design pattern definition and application. Tech Rep CS-95-29, Computer Systems Group, University of Waterloo.Google Scholar
  2. Antoniol G, Fiutem R, Cristoforetti L (1998) Design pattern recovery in object-oriented software. In: Tilley S, Visaggio G (eds) Proceedings of the 6th International Workshop on Program Comprehension, pp 153–160. IEEE Computer Society PressGoogle Scholar
  3. Aversano L, Canfora G, Cerulo L, Del Grosso C, Di Penta M (2007) An empirical study on the evolution of design patterns. In: Foundations of Software Engineering. ACM Press, New York, NY, pp 385–394Google Scholar
  4. Aversano L, Cerulo L, Di Penta M (2009) Relationship between design patterns defects and crosscutting concern scattering degree: an empirical study. Institu Eng Technol 3(5):395–409Google Scholar
  5. Basili VR, Briand LC, Melo WL (1996) A validation of object-oriented design metrics as quality indicators. IEEE Trans Soft Eng 22(10):751–761CrossRefGoogle Scholar
  6. Bernstein A, Ekanayake J, Pinzger M (2007) Improving defect prediction using temporal features and non linear models, In: Ninth International Workshop on Principles of Software Evolution, pp 11–18. ACMGoogle Scholar
  7. Binkley D, Gold N, Harman M, Li Z, Mahdavi K, Wegener J (2008) Dependence anti patterns. In: 4th International ERCIM Workshop on Software Evolution and Evolvability, pp 25–34Google Scholar
  8. Bouktif S, Antoniol G, Merlo E, Neteler M (2006) A plugin based architecture for software maintenance. Tech. Rep. EPM-RT-2006-03, Department of Computer Science École Polytechnique de MontréalGoogle Scholar
  9. Brown K (1996) Design reverse-engineering and automated design pattern detection in Smalltalk. Tech. Rep. TR-96-07, Department of Computer Science, University of Illinois at Urbana-Champaign.Google Scholar
  10. Brown WJ, Malveau RC, Brown WH, McCormick III H.W., Mowbray TJ (1998) Anti Patterns: Refactoring Software, Architectures, and Projects in Crisis, 1st edn. WileyGoogle Scholar
  11. Chidamber SR, Kemerer CF (1994) A metrics suite for object oriented design. IEEE Trans Softw Eng 20(6):476–493CrossRefGoogle Scholar
  12. D’Ambros M, Lanza M, Robbes R (2009) On the relationship between change coupling and software defects In: Proceedings of the 16th Working Conference on Reverse Engineering. IEEE Computer Society, Washington, DC, pp 135–144Google Scholar
  13. Dasarathy B (1991) Nearest Neighbor ({NN}) Norms: {NN} Pattern Classification Techniques. IEEE Computer Society Press, Washington, DCGoogle Scholar
  14. Emden EV, Moonen L (2002) Java quality assurance by detecting code smells In: The 9th Working Conference on Reverse Engineering IEEE Computer, pp 97–107. Society PressGoogle Scholar
  15. Gall H, Hajek K, Jazayeri M (1998) Detection of logical coupling based on product release history In: The International Conference on Software Maintenance. IEEE Computer Society, Washington, DC, pp 190–200Google Scholar
  16. Gamma E, Helm R, Johnson R, Vlissides J (1994) Design Patterns – Elements of Reusable Object-Oriented Software, 1st edn. Addison-WesleyGoogle Scholar
  17. Gatrell M, Counsell S (2011) Design patterns and fault-proneness a study of commercial C# software. In: Research Challenges in Information Science (RCIS) pp 1–8. IEEEGoogle Scholar
  18. Gerlec C, Hericko M (2012) Analyzing structural software changes: A case study. In: The 5th Balkan Conference in Informatics, pp 117–120Google Scholar
  19. Gîrba T, Ducasse S, Kuhn A, Marinescu R, Daniel R (2007) Using concept analysis to detect co-change patterns In: International Workshop on Principles of Software Evolution. ACM, New York, NY, pp 83–89Google Scholar
  20. Guéhéneuc YG, Albin-Amiot H (2004) Recovering binary class relationships: Putting icing on the UML cake. In: Schmidt DC (ed) Proceedings of the 19th Conference on Object-Oriented Programming, Systems, Languages, and Applications pp 301–314. ACM PressGoogle Scholar
  21. Guéhéneuc YG, Antoniol G (2008) DeMIMA: A multi-layered framework for design pattern identification. IEEE Trans Softw Eng 34(5):667–684CrossRefGoogle Scholar
  22. Guéhéneuc YG, Sahraoui H, Zaidi F (2004) Fingerprinting design patterns In: Proceedings of the 11th Working Conference on Reverse Engineering. IEEE Computer Society, Washington, DC, pp 172–181Google Scholar
  23. Halstead MH (1977) Elements of Software Science (Operating and Programming Systems Series). Elsevier Science Inc., New York, NYMATHGoogle Scholar
  24. Hassan AE (2009) Predicting faults using the complexity of code changes In: Proceedings of the 31st International Conference on Software Engineering. IEEE Computer Society, Washington, DC, pp 78–88Google Scholar
  25. Hassan AE, Holt RC (2005) The top ten list: Dynamic fault prediction In: Proceedings of the 21st IEEE International Conference on Software Maintenance, pp 263–272. IEEE Computer SocietyGoogle Scholar
  26. Hosmer DW, Lemeshow S (2000) Applied logistic regression (Wiley Series in probability and statistics) Wiley-Interscience PublicationGoogle Scholar
  27. Iacob C. (2011) A design pattern mining method for interaction design. In: The 3rd ACM SIGCHI Symposium on Engineering Interactive Computing Systems, pp 217–222. ACMGoogle Scholar
  28. Jaafar F, Guéhéneuc YG, Hamel S, Antoniol G (2011) An exploratory study of macro co-changes. In: Proceedings of the 18th Working Conference on Reverse Engineering, pp 325–334Google Scholar
  29. Jaafar F, Guéhéneuc YG, Hamel S, Khomh F (2013) Analysing anti-patterns static relationships with design patterns. Electronic Communications of the European Association of Software Science and Technology 59:1–26Google Scholar
  30. Jaafar F., Guéhéneuc YG, Hamel S, Khomh F (2013) Mining the relationship between anti-patterns dependencies and fault-proneness. In: Proceedings of the 20th Working Conference on Reverse Engineering:351–360Google Scholar
  31. Jahnke JH, Schäfer W, Zündorf A (1997) Generic fuzzy reasoning nets as a basis for reverse engineering relational database applications. In: Jazayeri M (ed) Proceedings of the 6th European Software Engineering Conference pp 193–210. ACM Press.Google Scholar
  32. Khomh F, Penta MD, Guéhéneuc YG, Antoniol G (2012) An exploratory study of the impact of antipatterns on class change- and fault-proneness. Empirical Software Engineering, pp 243–275Google Scholar
  33. Krämer C, Prechelt L (1996) Design recovery by automated search for structural design patterns in object-oriented software. In: Wills LM, Baxter I (eds) Proceedings of the 3rd Working Conference on Reverse Engineering. IEEE Computer Society Press, pp 208–215.Google Scholar
  34. Kullbach B, Winter A (1999) Querying as an enabling technology in software reengineering. In: Nesi P, Verhoef C (eds) Proceedings of the 3rd Conference on Software Maintenance and Reengineering. IEEE Computer Society Press, pp 42–50.Google Scholar
  35. Lanza M, Marinescu R (2006) Object-Oriented Metrics in Practice. Springer-VerlagGoogle Scholar
  36. Lethbridge NAT (1998) Extracting concepts from file names; a new file clustering criterion In: Proceedings of the International Conference on Software Engineering, pp 84–93Google Scholar
  37. Marcus A, Poshyvanyk D, Ferenc R (2008) Using the conceptual cohesion of classes for fault prediction in object-oriented systems. IEEE Transactions On Software Engineering, pp 287–300Google Scholar
  38. Marinescu R, Marinescu C (2011) Are the clients of flawed classes (also) defect prone? In: Proceedings of the IEEE 11th International Working Conference on Source Code Analysis and Manipulation. IEEE Computer Society, Washington, DC, pp 65–74Google Scholar
  39. McCabe TJ (1976) A complexity measure In: Proceedings of the 2Nd International Conference on Software Engineering. IEEE Computer Society Press, Los Alamitos, CA, pp 407–417Google Scholar
  40. Moha N, Guéhéneuc YG, Duchien L, Le Meur AF (2010) DECOR: A method for the specification and detection of code and design smells. Trans Softw Eng:20–36Google Scholar
  41. Moser R, Pedrycz W, Succi G (2008) A comparative analysis of the efficiency of change metrics and static code attributes for defect prediction In: The 30th International Conference on Software Engineering. ACM, New York, NY, pp 181–190Google Scholar
  42. Nagappan N, Ball T (2005) Use of relative code churn measures to predict system defect density In: The 27th International Conference on Software Engineering, ACMGoogle Scholar
  43. Neuhaus S, Zimmermann T, Holler C, Zeller A (2007) Predicting vulnerable software components. In: The 14th Conference on Computer and Communications Security. ACM, pp 529–540Google Scholar
  44. Oliveto R, Gethers M, Bavota G, Poshyvanyk D, De Lucia A (2011) Identifying method friendships to remove the feature envy bad smell (nier track) In: Proceedings of the 33rd International Conference on Software Engineering. ACM, New York, NY, pp 820–823Google Scholar
  45. Ostrand T, Weyuker E, Bell R (2005) Predicting the location and number of faults in large software systems. IEEE Transactions on Software Engineering, pp 340–355Google Scholar
  46. Pedersen T (1996) Fishing for exactness In: Proceedings of the South-Central SAS Users Group Conference cmp-lg/9608010, pp 188–200Google Scholar
  47. Pietrzak B, Walter B (2006) Leveraging code smell detection with inter-smell relations. Extreme Programming and Agile Processes in Software Engineering, pp 75–84Google Scholar
  48. Quilici A, Yang Q, Woods S (1997) Applying plan recognition algorithms to program understanding. J Autom Softw Eng 5(3):347–372.CrossRefGoogle Scholar
  49. Ratiu D, Ducasse S, Gîrba T, Marinescu R (2004) Using history information to improve design flaws detection. In: Proceedings of the Eighth Euromicro Working Conference on Software Maintenance and Reengineering. IEEE Computer Society, pp 223–233Google Scholar
  50. Romano D, Raila P, Pinzger M, Khomh F (2012) Analyzing the impact of antipatterns on change-proneness using fine-grained source code changes Working Conference on Reverse Engineering, pp 437– 446Google Scholar
  51. Rothman KJ, Lanes S, Sacks ST (2004) The reporting odds ratio and its advantages over the proportional reporting ratio. Pharmacoepidemiol Drug Safety 13(8):519–523CrossRefGoogle Scholar
  52. Settas D, Cerone A, Fenz S (2012) Enhancing ontology-based antipattern detection using bayesian networks. Expert Syst Appl 39(10):9041–9053CrossRefGoogle Scholar
  53. Sheskin DJ (2007) Handbook of Parametric and Nonparametric Statistical Procedures. Chapman & Hall/CRCGoogle Scholar
  54. Sliwerski J, Zimmermann T, Zeller A (2005) When do changes induce fixes?. SIGSOFT Softw Eng Notes 30(4):1–5CrossRefGoogle Scholar
  55. Subramanyam R, Krishnan MS (2003) Empirical analysis of ck metrics for object-oriented design complexity: Implications for software defects. IEEE Trans Softw Eng 29(4):297–310CrossRefGoogle Scholar
  56. Tatsubori M, Chiba S (1998) Programming support of design patterns with compile-time reflection. In: Fabre JC, Chiba S (eds) Proceedings of the 1st OOPSLA workshop on Reflective Programming in C++ and Java. Center for Computational Physics, University of Tsukuba, pp 56–60. UTCCP Report 98-4Google Scholar
  57. Tsantalis N, Chatzigeorgiou A, Stephanides G, Halkidis S (2006) Design pattern detection using similarity scoring. IEEE Trans Softw Eng 32(11):896–909CrossRefGoogle Scholar
  58. Vokac M (2004) Defect frequency and design patterns: An empirical study of industrial code. IEEE Transaction on Software Engineering, pp 904–917Google Scholar
  59. Webster BF (1995) Pitfalls of Object Oriented Development, 1st edn. M & T Books.Google Scholar
  60. Wuyts R (1998) Declarative reasoning about the structure of object-oriented systems. Proceedings of Technology of Object-Oriented Systems (TOOLS’98), pp 112–124Google Scholar
  61. Yamashita A, Moonen L (2012) Do code smells reflect important maintainability aspects? In: Software Maintenance (ICSM), 2012 28th IEEE International Conference on. IEEE, pp 306–315Google Scholar
  62. Yamashita A, Moonen L (2013) To what extent can maintenance problems be predicted by code smell detection? - an empirical study. Info Softw Technol 55(12):2223–2242CrossRefGoogle Scholar
  63. Yin RK (2002) Case Study Research: Design and Methods - Third Edition. SAGE Publications, LondonGoogle Scholar
  64. Ying ATT, Murphy GC, Ng R, Chu-Carroll MC (2004) Predicting source code changes by mining change history, vol 30, pp 574–586Google Scholar
  65. Yinn RK (2002) Case study research: design and methods. SAGE, London, EnglandGoogle Scholar
  66. Zimmermann T, Nagappan N (2008) Predicting defects using network analysis on dependency graphs. In: Proceedings of the 30th International Conference on Software Engineering, pp 531–540. ACMGoogle Scholar
  67. Zimmermann T, Premraj R, Zeller A (2007) Predicting defects for eclipse In: Proceedings of the Third International Workshop on Predictor Models in Software Engineering. IEEE Computer Society, Washington, DC, pp 9–16Google Scholar
  68. Zimmermann T, Weisgerber P, Diehl S, Zeller A (2004) Mining version histories to guide software changes. In: Proceedings of the 26th International Conference on Software Engineering, pp 563–572. IEEE Computer SocietyGoogle Scholar

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