Abstract
Twenty-seven automatically extractable bug fix patterns are defined using the syntax components and context of the source code involved in bug fix changes. Bug fix patterns are extracted from the configuration management repositories of seven open source projects, all written in Java (Eclipse, Columba, JEdit, Scarab, ArgoUML, Lucene, and MegaMek). Defined bug fix patterns cover 45.7% to 63.3% of the total bug fix hunk pairs in these projects. The frequency of occurrence of each bug fix pattern is computed across all projects. The most common individual patterns are MC-DAP (method call with different actual parameter values) at 14.9–25.5%, IF-CC (change in if conditional) at 5.6–18.6%, and AS-CE (change of assignment expression) at 6.0–14.2%. A correlation analysis on the extracted pattern instances on the seven projects shows that six have very similar bug fix pattern frequencies. Analysis of if conditional bug fix sub-patterns shows a trend towards increasing conditional complexity in if conditional fixes. Analysis of five developers in the Eclipse projects shows overall consistency with project-level bug fix pattern frequencies, as well as distinct variations among developers in their rates of producing various bug patterns. Overall, data in the paper suggest that developers have difficulty with specific code situations at surprisingly consistent rates. There appear to be broad mechanisms causing the injection of bugs that are largely independent of the type of software being produced.



Similar content being viewed by others
References
Basili VR, Perricone BT (1984) Software errors and complexity: an empirical investigation. Commun ACM 27(1):42–52
Bevan J, Whitehead EJ Jr (2003) Identification of software instabilities. Proceedings of the 10th Working Conference on Reverse Engineering. Victoria, BC, Canada, pp 134–145
Chillarege R, Bhandari IS, Chaar JK, Halliday MJ, Moebus DS, Ray BK, Wong MY (1992) Orthogonal defect classification—a concept for in-process measurements. IEEE Trans Softw Eng 18(11):943–956
Courtney RE, Gustafson DA (1992) Shotgun correlations in software measures. Softw Eng J 8(1):5–13
Cubranic D, Murphy GC (2003) Hipikat: Recommending pertinent software development artifacts. Proceedings of the 25th International Conference on Software Engineering. Portland, Oregon, pp 408–418
Duraes JA, Madeira HS (2006) Emulation of software faults: a field data study and a practical approach. IEEE Trans Softw Eng 32(11):849–867
Eclipse (2006) Eclipse Java Development Tools (JDT) Subproject Home Page. http://www.eclipse.org/jdt/
Endres A (1975) An analysis of errors and their causes in system programs. Proceedings of the International Conference on Reliable Software. Los Angeles, California, pp 327–336
Fischer M, Pinzger M, Gall H (2003) Populating a release history database from version control and bug tracking systems. Proceedings of 2003 Int’l Conference on Software Maintenance (ICSM’03). Amsterdam, The Netherlands, pp 23–32
Flanagan C, Leino K, Lillibridge M, Nelson C, Saxe J, Stata R (2002) Extended static checking for java. Proceedings of the 2002 ACM SIGPLAN Conference on Programming Language Desing and Implementation. Berlin, Germany, pp 234–245
GNU (2003) GNU Diffutils. http://www.gnu.org/software/diffutils/
Graves TL, Karr AF, Marron JS, Siy H (2000) Predicting fault incidence using software change history. IEEE Trans Softw Eng 26(7):653–661
Hassan AE, Holt RC (2005) The top ten list: Dynamic fault prediction. Proceedings of the 21st IEEE International Conference on Software Maintenance (ICSM’05). Budapest, Hungary, pp 263–272
Hovemeyer D, Pugh W (2004) Finding bugs is easy. ACM SIGPLAN Notices 39(12):92–106
IEEE (1993) IEEE standard classification for software anomalies: IEEE Standard 1044–1993
Kim S, Zimmermann T, Pan K, Whitehead EJ Jr (2006) Automatic identification of bug-introducing changes. Proceedings of the 21st IEEE/ACM International Conference on Automated Software Engineering. Tokyo, Japan
Leszak M, Perry DE, Stoll D (2000) A case study in root cause defect analysis. Proceedings of the 22nd International Conference on Software Engineering. Limerick, Ireland, pp 428–437
Li Z, Tan V, Wang X, Lu S, Zhou Y, Zhai C (2006) Have things changed now? An empirical study of bug characteristics in modern open source software. Proceedings of 1st Workshop on Architectural and System Support for Improving Software Dependability. San Jose, California, pp 25–33
Livshits B, Zimmermann T (2005) DynaMine: Finding common error patterns by mining software revision histories. Proceedings of the 2005 European Software Engineering Conference and 2005 Foundations of Software Engineering (ESEC/FSE 2005). Lisbon, Portugal, pp 296–305
Marick B (1990) A survey of software fault surveys. Technical Report, University of Illinois at Urbana-Champaign UIUCDCS-R-90-1651, December
Mockus A, Votta LG (2000) Identifying reasons for software changes using historic databases. Proceedings of International Conference on Software Maintenance (ICSM 2000). San Jose, California, pp 120–130
Ostrand TJ, Weyuker EJ (1984) Collecting and categorizing software error data in an industrial environment. J Syst Softw 4(4):289–300
Pan K (2006) Using evolution patterns to find duplicated bugs. PhD dissertation. Department of Computer Science, UC Santa Cruz, p 61
Perry DE, Stieg CS (1993) Software faults in evolving a large. Real-time system: a case study. Proceedings of the Fourth European Software Engineering Conference. Garmisch, Germany, pp 48–67
PMD (2006) PMD home page. http://pmd.sourceforge.net/
Potier D, Albin JL, Ferreol R, Bilodeau A (1982) Experiments with computer software complexity and reliability. Proceedings of 6th International Conference on Software Engineering. Tokyo, Japan, pp 94–103
Sliwerski J, Zimmermann T, Zeller A (2005) When do changes induce fixes? Proceedings of the International Workshop on Mining Software Repositories (MSR 2005). Saint Louis, Missouri, pp 24–28
Williams CC, Hollingsworth JK (2005) Automatic mining of source code repositories to improve bug finding techniques. IEEE Trans Softw Eng 31(6):466–480
Author information
Authors and Affiliations
Corresponding author
Additional information
Editors:A. Hassan, S. Diehl and H. Gall
Rights and permissions
About this article
Cite this article
Pan, K., Kim, S. & Whitehead, E.J. Toward an understanding of bug fix patterns. Empir Software Eng 14, 286–315 (2009). https://doi.org/10.1007/s10664-008-9077-5
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10664-008-9077-5