Empirical Software Engineering

, Volume 14, Issue 3, pp 286–315 | Cite as

Toward an understanding of bug fix patterns

Article

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.

Keywords

Software bugs Bug fix changes Categorization of software faults Software fault taxonomy Software fault Software error Causes of software bugs Algorithms Measurement Experimentation 

References

  1. Basili VR, Perricone BT (1984) Software errors and complexity: an empirical investigation. Commun ACM 27(1):42–52CrossRefGoogle Scholar
  2. Bevan J, Whitehead EJ Jr (2003) Identification of software instabilities. Proceedings of the 10th Working Conference on Reverse Engineering. Victoria, BC, Canada, pp 134–145Google Scholar
  3. 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–956CrossRefGoogle Scholar
  4. Courtney RE, Gustafson DA (1992) Shotgun correlations in software measures. Softw Eng J 8(1):5–13CrossRefGoogle Scholar
  5. Cubranic D, Murphy GC (2003) Hipikat: Recommending pertinent software development artifacts. Proceedings of the 25th International Conference on Software Engineering. Portland, Oregon, pp 408–418Google Scholar
  6. Duraes JA, Madeira HS (2006) Emulation of software faults: a field data study and a practical approach. IEEE Trans Softw Eng 32(11):849–867CrossRefGoogle Scholar
  7. Eclipse (2006) Eclipse Java Development Tools (JDT) Subproject Home Page. http://www.eclipse.org/jdt/
  8. 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–336Google Scholar
  9. 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–32Google Scholar
  10. 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–245Google Scholar
  11. GNU (2003) GNU Diffutils. http://www.gnu.org/software/diffutils/
  12. Graves TL, Karr AF, Marron JS, Siy H (2000) Predicting fault incidence using software change history. IEEE Trans Softw Eng 26(7):653–661CrossRefGoogle Scholar
  13. 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–272Google Scholar
  14. Hovemeyer D, Pugh W (2004) Finding bugs is easy. ACM SIGPLAN Notices 39(12):92–106CrossRefGoogle Scholar
  15. IEEE (1993) IEEE standard classification for software anomalies: IEEE Standard 1044–1993Google Scholar
  16. 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, JapanGoogle Scholar
  17. 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–437Google Scholar
  18. 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–33Google Scholar
  19. 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–305Google Scholar
  20. Marick B (1990) A survey of software fault surveys. Technical Report, University of Illinois at Urbana-Champaign UIUCDCS-R-90-1651, DecemberGoogle Scholar
  21. 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–130Google Scholar
  22. Ostrand TJ, Weyuker EJ (1984) Collecting and categorizing software error data in an industrial environment. J Syst Softw 4(4):289–300CrossRefGoogle Scholar
  23. Pan K (2006) Using evolution patterns to find duplicated bugs. PhD dissertation. Department of Computer Science, UC Santa Cruz, p 61Google Scholar
  24. 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–67Google Scholar
  25. PMD (2006) PMD home page. http://pmd.sourceforge.net/
  26. 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–103Google Scholar
  27. 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–28Google Scholar
  28. Williams CC, Hollingsworth JK (2005) Automatic mining of source code repositories to improve bug finding techniques. IEEE Trans Softw Eng 31(6):466–480CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2008

Authors and Affiliations

  1. 1.Department of Computer ScienceUniversity of California, Santa CruzSanta CruzUSA
  2. 2.Department of Computer Science and EngineeringThe Hong Kong University of Science and TechnologyKowloonHong Kong

Personalised recommendations