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.
Similar content being viewed by others
Notes
References
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.
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 Press
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–394
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–409
Basili VR, Briand LC, Melo WL (1996) A validation of object-oriented design metrics as quality indicators. IEEE Trans Soft Eng 22(10):751–761
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. ACM
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–34
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éal
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.
Brown WJ, Malveau RC, Brown WH, McCormick III H.W., Mowbray TJ (1998) Anti Patterns: Refactoring Software, Architectures, and Projects in Crisis, 1st edn. Wiley
Chidamber SR, Kemerer CF (1994) A metrics suite for object oriented design. IEEE Trans Softw Eng 20(6):476–493
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–144
Dasarathy B (1991) Nearest Neighbor ({NN}) Norms: {NN} Pattern Classification Techniques. IEEE Computer Society Press, Washington, DC
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 Press
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–200
Gamma E, Helm R, Johnson R, Vlissides J (1994) Design Patterns – Elements of Reusable Object-Oriented Software, 1st edn. Addison-Wesley
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. IEEE
Gerlec C, Hericko M (2012) Analyzing structural software changes: A case study. In: The 5th Balkan Conference in Informatics, pp 117–120
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–89
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 Press
Guéhéneuc YG, Antoniol G (2008) DeMIMA: A multi-layered framework for design pattern identification. IEEE Trans Softw Eng 34(5):667–684
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–181
Halstead MH (1977) Elements of Software Science (Operating and Programming Systems Series). Elsevier Science Inc., New York, NY
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–88
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 Society
Hosmer DW, Lemeshow S (2000) Applied logistic regression (Wiley Series in probability and statistics) Wiley-Interscience Publication
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. ACM
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–334
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–26
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–360
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.
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–275
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.
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.
Lanza M, Marinescu R (2006) Object-Oriented Metrics in Practice. Springer-Verlag
Lethbridge NAT (1998) Extracting concepts from file names; a new file clustering criterion In: Proceedings of the International Conference on Software Engineering, pp 84–93
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–300
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–74
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–417
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–36
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–190
Nagappan N, Ball T (2005) Use of relative code churn measures to predict system defect density In: The 27th International Conference on Software Engineering, ACM
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–540
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–823
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–355
Pedersen T (1996) Fishing for exactness In: Proceedings of the South-Central SAS Users Group Conference cmp-lg/9608010, pp 188–200
Pietrzak B, Walter B (2006) Leveraging code smell detection with inter-smell relations. Extreme Programming and Agile Processes in Software Engineering, pp 75–84
Quilici A, Yang Q, Woods S (1997) Applying plan recognition algorithms to program understanding. J Autom Softw Eng 5(3):347–372.
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–233
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– 446
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–523
Settas D, Cerone A, Fenz S (2012) Enhancing ontology-based antipattern detection using bayesian networks. Expert Syst Appl 39(10):9041–9053
Sheskin DJ (2007) Handbook of Parametric and Nonparametric Statistical Procedures. Chapman & Hall/CRC
Sliwerski J, Zimmermann T, Zeller A (2005) When do changes induce fixes?. SIGSOFT Softw Eng Notes 30(4):1–5
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–310
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-4
Tsantalis N, Chatzigeorgiou A, Stephanides G, Halkidis S (2006) Design pattern detection using similarity scoring. IEEE Trans Softw Eng 32(11):896–909
Vokac M (2004) Defect frequency and design patterns: An empirical study of industrial code. IEEE Transaction on Software Engineering, pp 904–917
Webster BF (1995) Pitfalls of Object Oriented Development, 1st edn. M & T Books.
Wuyts R (1998) Declarative reasoning about the structure of object-oriented systems. Proceedings of Technology of Object-Oriented Systems (TOOLS’98), pp 112–124
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–315
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–2242
Yin RK (2002) Case Study Research: Design and Methods - Third Edition. SAGE Publications, London
Ying ATT, Murphy GC, Ng R, Chu-Carroll MC (2004) Predicting source code changes by mining change history, vol 30, pp 574–586
Yinn RK (2002) Case study research: design and methods. SAGE, London, England
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. ACM
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–16
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 Society
Acknowledgments
This research was partially supported by FQRNT, NSERC, the Canada Research Chair in Software Patterns and Patterns of Software, and the Canada Research Chair in Software Dependability.
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by: Romain Robbes, Massimiliano Di Penta and Rocco Oliveto
Rights and permissions
About this article
Cite this article
Jaafar, F., Guéhéneuc, YG., Hamel, S. et al. Evaluating the impact of design pattern and anti-pattern dependencies on changes and faults. Empir Software Eng 21, 896–931 (2016). https://doi.org/10.1007/s10664-015-9361-0
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10664-015-9361-0