Toward an understanding of bug fix patterns

  • Authors:
  • Kai Pan;Sunghun Kim;E. James Whitehead, Jr.

  • Affiliations:
  • Department of Computer Science, University of California, Santa Cruz, Santa Cruz, USA;Department of Computer Science and Engineering, The Hong Kong University of Science and Technology, Kowloon, Hong Kong;Department of Computer Science, University of California, Santa Cruz, Santa Cruz, USA

  • Venue:
  • Empirical Software Engineering
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

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.