Design patterns are object oriented software design practices for solving common design problems and they affect software quality. In this study, we investigate the relationship of design patterns and software defects in a number of open source software projects. Design pattern instances are extracted from the source code repository of these open source software projects. Software defect metrics are extracted from the bug tracking systems of these projects. Using correlation and regression analysis on extracted data, we examine the relationship between design patterns and software defects. Our findings indicate that there is little correlation between the total number of design pattern instances and the number of defects. However, our regression analysis reveals that individual design pattern instances as a group have strong influences on the number of defects. Furthermore, we find that the number of design pattern instances is positively correlated to defect priority. Individual design pattern instances may have positive or negative impacts on defect priority.
References
[1]
Gamma, E., Helm, R., Johnson, R. and Vlissides, J. (1995) Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Boston.
[2]
Riehle, D. (2011) Lessons Learned from Using Design Patterns in Industry Projects. Transactions on Pattern Languages of Programming II: Special Issue on Applying Patterns, Springer-Verlag, Berlin, Heidelberg.
[3]
Beck, K., Coplien, J.O., Crocker, R., Dominick, L., Meszaros, G., Paunlisch, F. and Vlissides, J. (1996) Industrial Experience with Design Patterns. In: 18th Intl. Conf. on Software Engineering, IEEE CS Press, Berlin, 103-114.
https://doi.org/10.1109/ICSE.1996.493406
[4]
Prechelt, L. and Liesenberg, M. (2011) Design Patterns in Software Maintenance: An Experiment Replication at Freie Universität Berlin. In: Proceedings of the 2011 Second International Workshop on Replication in Empirical Software Engineering Research, IEEE Computer Society, Washington DC, 1-6.
https://doi.org/10.1109/RESER.2011.12
[5]
Vokác, M., Tichy, W., SjØberg, D.I.K., Arisholm, E. and Aldrin, M. (2004) A Controlled Experiment Comparing the Maintainability of Programs Designed with and without Design Patterns—A Replication in a Real Programming Environment. Empirical Software Engineering, 9, 149-195.
[6]
Bieman, J.M., Straw, G., Wang, H., Munger, P.W. and Alexander, R.T. (2003) Design Patterns and Change Proneness: An Examination of Five Evolving Systems. In: Proceedings of the 9th International Symposium on Software Metrics, IEEE Computer Society, Washington DC, 40.
[7]
Prechelt, L., Unger, B., Philippsen, M. and Tichy, W.F. (2002) Two Controlled Experiments Assessing the Usefulness of Design Pattern Documentation in Program Maintenance. IEEE Transactions on Software Engineering, 28, 595-606.
https://doi.org/10.1109/TSE.2002.1010061
[8]
Vokác, M. (2004) Defect Frequency and Design Patterns: An Empirical Study of Industrial Code. IEEE Transactions on Software Engineering, 30, 904-917.
https://doi.org/10.1109/TSE.2004.99
[9]
Aversano, L., Cerulo, L. and Di Penta, M. (2009) The Relationship between Design Patterns Defects and Crosscutting Concern Scattering Degree: An Empirical Study. IET Software, 3, 395-409. https://doi.org/10.1049/iet-sen.2008.0105
[10]
Gatrell, M. and Counsell, S. (2011) Design Patterns and Fault-Proneness a Study of Commercial C# Software. Research Challenges in Information Science—RCIS, Gosier, 1-8. https://doi.org/10.1109/RCIS.2011.6006827
[11]
Xie, T., Thummalapenta, S., Lo, D. and Liu, C. (2009) Data Mining for Software Engineering. Computer, 42, 55-62. https://doi.org/10.1109/MC.2009.256
[12]
Ampatzoglou, A., Charalampidou, S. and Stamelos, I. (2013) Research State of the Art on GoF Design Patterns: A Mapping Study. Journal of Systems and Software, 86, 1945-1964. https://doi.org/10.1016/j.jss.2013.03.063
[13]
Zhang, C. and Budgen, D. (2012) What Do We Know about the Effectiveness of Software Design Patterns? IEEE Transactions on Software Engineering, 38, 1213-1231.
[14]
Zhang, C. and Budgen, D. (2013) A Survey of Experienced User Perceptions about Software Design Patterns. Information and Software Technology, 55, 822-835.
[15]
Bafandeh Mayvan, B., Rasoolzadegan, A. and Ghavidel Yazdi, Z. (2017) The State of the Art on Design Patterns: A Systematic Mapping of the Literature. Journal of Systems and Software, 125, 93-118. https://doi.org/10.1016/j.jss.2016.11.030
[16]
Ampatzoglou, A. and Chatzigeorgiou, A. (2007) Evaluation of Object-Oriented Design Patterns in Game Development. Information and Software Technology, 49, 445-454. https://doi.org/10.1016/j.infsof.2006.07.003
[17]
Ampatzoglou, A., Frantzeskou, G. and Stamelos, I. (2012) A Methodology to Assess the Impact of Design Patterns on Software Quality. Information and Software Technology, 54, 331-346. https://doi.org/10.1016/j.infsof.2011.10.006
[18]
Ampatzoglou, A., Chatzigeorgiou, A., Charalampidou, S. and Avgeriou, P. (2015) The Effect of GoF Design Patterns on Stability: A Case Study. IEEE Transactions on Software Engineering, 41, 781-802.
[19]
Elish, M. (2006) Do Structural Design Patterns Promote Design Stability? 30th Annual International Computer Software and Applications Conference, Chicago, September 2006, 215-220. https://doi.org/10.1109/COMPSAC.2006.39
[20]
Di Penta, M., Cerulo, L., Gueheneuc, Y.G. and Antoniol, G. (2008) An Empirical Study of the Relationships between Design Pattern Roles and Class Change Proneness. IEEE International Conference on Software Maintenance, Beijing, 217-226.
https://doi.org/10.1109/ICSM.2008.4658070
[21]
Huston, B. (2001) The Effects of Design Pattern Application on Metric Scores. Journal of Systems and Software, 58, 261-269.
[22]
Hsueh, N.-L., Chu, P.-H. and Chu, W. (2008) A Quantitative Approach for Evaluating the Quality of Design Patterns. Journal of Systems and Software, 81, 1430-1439.
[23]
Posnett, D., Bird, C. and Dévanbu, P. (2011) An Empirical Study on the Influence of Pattern Roles on Change-Proneness. Empirical Software Engineering, 16, 396-423.
[24]
Feitosa, D., Avgeriou, P., Ampatzoglou, A. and Nakagawa, E. (2017) The Evolution of Design Pattern Grime: An Industrial Case Study.
https://doi.org/10.1007/978-3-319-69926-4_13
[25]
Izurieta, C. and Bieman, J.M. (2008) Testing Consequences of Grime Buildup in Object Oriented Design Patterns, 1st International Conference on Software Testing, Verification, and Validation, Lillehammer, 171-179.
[26]
Izurieta, C. and Bieman, J.M. (2013) A Multiple Case Study of Design Pattern Decay, Grime, and Rot in Evolving Software Systems. Software Quality Journal, 21, 289-323.
[27]
Ampatzoglou, A., Kritikos, A., Kakarontzas, G. and Stamelos, I. (2011) An Empirical Investigation on the Reusability of Design Patterns and Software Packages. Journal of Systems and Software, 84, 2265-2283.
https://doi.org/10.1016/j.jss.2011.06.047
[28]
Ampatzoglou, A., Michou, O. and Stamelos, I. (2013) Building and Mining a Repository of Design Pattern Instances: Practical and Research Benefits. Entertainment Computing, 4, 131-142.
[29]
Aversano, L., Canfora, G., Cerulo, L., Del Grosso, C. and Di Penta, M. (2007) An Empirical Study on the Evolution of Design Patterns. In: Proceedings of the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on The Foundations of Software Engineering, ACM Press, New York, 385-394. https://doi.org/10.1145/1287624.1287680
[30]
Prechelt, L., Unger, B., Tichy, W.F., Brössler, P. and Votta, L.G. (2001) A Controlled Experiment in Maintenance Comparing Design Patterns to Simpler Solutions. IEEE Transactions on Software Engineering, 27, 1134-1144.
[31]
Krein, J.L., Pratt, L.J., Swenson, A.B., MacLean, A.C., Knutson, C.D. and Eggett, D.L. (2011) Design Patterns in Software Maintenance: An Experiment Replication at Brigham Young University. In: Proceedings of the 2011 Second International Workshop on Replication in Empirical Software Engineering Research, IEEE Computer Society, Washington DC, 25-34. https://doi.org/10.1109/RESER.2011.10
[32]
Ng, T.H., Cheung, S.C., Chan, W.K. and Yu, Y.T. (2007) Do Maintainers Utilize Deployed Design Patterns Effectively? In: Proceedings of the 29th International Conference on Software Engineering, IEEE Computer Society, Washington DC, 168-177. https://doi.org/10.1109/ICSE.2007.33
[33]
Ng, T.H., Yuen, T.Y., Cheung, S.C. and Chan, W.K. (2012) Human and Program Factors Affecting the Maintenance of Programs with Deployed Design Patterns. Information and Software Technology, 54, 99-118.
[34]
Feitosa, D., Alders, R., Ampatzoglou, A., Avgeriou, P. and Nakagawa, E.Y. (2017) Investigating the Effect of Design Patterns on Energy Consumption. Journal of Software: Evolution and Process, 29, e1851. https://doi.org/10.1002/smr.1851
[35]
Sahin, C., Cayci, F., Lizeth, I., et al. (2012) Initial Explorations on Design Pattern Energy Usage. 2012 First International Workshop on Green and Sustainable Software, Zurich, 55-61. https://doi.org/10.1109/GREENS.2012.6224257
[36]
Bunse, C. and Stiemer, S. (2013) On the Energy Consumption of Design Patterns. 2nd Workshop Energy Aware Software Engineering and Development.
https://doi.org/10.1007/s40568-013-0020-6
[37]
Litke, A., Zotos, K., Chatzigeorgiou, A. and Stephanides, G. (2005) Energy Consumption Analysis of Design Patterns. World Academy of Science, Engineering and Technology, 86-90.
[38]
Elish, M.O. and Mohammed, M.A. (2015) Quantitative Analysis of Fault Density in Design Patterns: An Empirical Study. Information and Software Technology, 66, 58-72. https://doi.org/10.1016/j.infsof.2015.05.006
[39]
Ampatzoglou, A., Kritikos, A., Arvanitou, E.M., Gortzis, A., Chatziasimidis, F. and Stamelos, I. (2011) An Empirical Investigation on the Impact of Design Pattern Application on Computer Game Defects. In: Proceedings of the 15th International Academic MindTrek Conference: Envisioning Future Media Environments, ACM, New York, 214-221. https://doi.org/10.1145/2181037.2181074
[40]
Tsantalis, N., Chatzigeorgiou, A., Stephanides, G. and Halkidis, S.T. (2006) Design Pattern Detection using Similarity Scoring. IEEE Transactions on Software Engineering, 32, 896-909. https://doi.org/10.1109/TSE.2006.112
[41]
Bicho Homepage. http://metricsgrimoire.github.io/
[42]
Kan, S. (2002) Metrics and Models for Software Reliability Engineering. 2nd Edition, Addison-Wesley, Boston.