This is a collaborative project with Lin Tan's group at University of Waterloo.
An overwhelming number of bugs are reported everyday. For example, Mozilla bug database receives an average of 135 bug reports daily (As of December 2012, the database contains over 600,000 bugs). Many bugs, even those that are known and documented in bug reports, remain unfixed for a long time because of lack of development resources.
We proposed a general approach, R2Fix, to automatically to automatically generate bug fixing patches from free-form bug reports. R2Fix applies machine learning techniques to identify the type of bug from bug reports. We have identified a set of fix patterns for each classified bug type. Our semantic patch generator creates patches following the bug fix patterns. It generates a small number of patches per bug, in our evaluation only 1.33 patches per bug, which can then be manually verified and applied by developers.
The following is a real bug from Linux kernel and the patch generated by R2Fix.

We evaluated R2Fix on three large and popular software: the Linux kernel, Mozilla, and Apache. We were interested in three types of bugs: buffer overflows, null pointer bugs, and memory leaks. R2fix generated 60 patches correctly, 5 of which were new patches for bug reports that had not been fixed. Our patches were accepted and committed by the developers. The 60 pathes could have shortened and saved an average of 68 days of bug diagnosis and patch generation time.
Publications
R2Fix: Automatically Generating Bug Fixes from Bug Reports
Chen Liu, Jinqiu Yang, Lin Tan and Munawar Hafiz
In Proceedings of the 6th IEEE International Conference on Software Testing, Verification and Validation, ICST 2013
Luxembourg, March 2013
Last modified: Dec 16, 2012
Conceived and Maintained by: Munawar Hafiz