Abstract

Because software emerged, locating software faults has been intensively researched, culminating in various approaches and tools that have been applied in real development. Despite the success of these developments, improved tools are still demanded by programmers. Meanwhile, some programmers are reluctant to use any tools when locating faults in their development. The state-of-the-art situation can be naturally improved by learning how programmers locate faults. The rapid development of open-source software has accumulated many bug fixes. A bug fix is a specific type of comments containing a set of buggy files and their corresponding fixed files, which reveal how programmers repair bugs. Feasibly, an automatic model can learn fault locations from bug fixes, but prior attempts to achieve this vision have been prevented by various technical challenges. For example, most bug fixes are not compilable after checking out, which hinders analyzing bug fixes by most advanced static/dynamic tools. This paper proposes an approach called ClaFaxspace that trains a graph-based fault classifier from bug fixes. ClaFaxspace is built on a recent partial-code tool called Grapa which enables the analysis of partial programs by the complete code tool called WALA. Once Grapahas built a program dependency graph from a bug fix, ClaFaxspace compares the graph from the buggy code with the graph from the fixed code, locates the buggy nodes, and extracts the various graph features of the buggy and clean nodes. Based on the extraction result, ClaFaxspace trains a classifier that combines Adaboost and decision tree learning. The trained ClaFaxspace can predict whether a node of a program dependency graph is buggy or clean. We evaluate ClaFaxspace on thousands of buggy files collected from four open-source projects: Aries, Mahout, Derby, and Cassandra. The $f$-scores of ClaFaxspace achieves are approximately 80% on all projects.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call