Exploiting Defect Prediction for Automatic Software Repair (Fixie)

Lead Research Organisation: Lancaster University
Department Name: Computing & Communications

Abstract

Software is now at the heart of almost everything we do in the world. This software remains largely handmade, and as such, is prone to defects. Testing detects only a sub-set of software defects with the rest laying dormant, sometimes for years. When these defects emerge in software systems the safety and business consequences can be severe. Software failures and their damaging consequences are regularly reported in the press. Finding and fixing defects has been an intransigent problem over many years. The traditional approach to this problem relies on finding defects during testing then developers manually fixing those defects afterwards.

In this project we establish a new technique to automatically fix predicted defects in software code before testing. We use machine learning-based defect prediction information to generate automatic fixes using Genetic Improvement. Our approach aims to offer developers effective fixes to code which is predicted as defective. A higher proportion of the fixes our approach offers to developers should be acceptable, generated quicker and available earlier in the development cycle than previous attempts at automated repair. Importantly, our approach targets a wider pool of defects as it specifically includes targeting those dormant defects which are not identified by testing.

Using our approach the developer will always remain in control of the code produced. Fixes are suggested, and the developer is the 'gate-keeper', deciding if a suggested fix is accepted, rejected, or can itself be modified to improve the code. One of the tangible outputs of the project will be a defect fixing tool (Fixie), which will provide support to developers in their daily coding activities. The tool will be developed in collaboration with several industrial partners and will be empirically evaluated throughout the project.

Planned Impact

The impact of high-quality software development cannot be underestimated as so many human activities rely on software these days. However, writing software that is correct, or even largely defect-free is extremely difficult. It is estimated that most software packages contain a large number of latent or dormant defects.

Defects can be identified by test cases which fail when the code is executed. But by using the propensity of code to be defective, we are able to identify and fix defects earlier in the development cycle, resulting in less defective code and software which is delivered quicker and at a reduced cost.

It is important to emphasise that we are advocating a system that guides the software developer. Our vision is to build a tool which will assist software developers but automatically suggest corrections to predicted defects. This will be similar to a spell checker in a word processor, i.e. it is semi automated decision support. A system which leaves the developer in full control of the code is more likely to have up-take in the community and therefore longer term impact than a tool which boasts full-automation.

This project builds on two existing successful pieces of software; the ELFF tool which brings possible bugs to the attention of the developer, and the JM tool which fixes bugs overnight. By bringing these tools together we can exploit the synergy of these two methodologies.

The cost of production software is high and so our approach is likely to reduce the cost of producing software in the first place. In addition our approach could reduce the overall time and cost to fix defects in already-released software which were not detected at release time.
 
Description On-going relationship with Bloomberg 
Form Of Engagement Activity A formal working group, expert panel or dialogue
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Industry/Business
Results and Impact On going regular meetings/engagements with industrial users of the technology being developed by the project by two of the project's PDRAs.
Year(s) Of Engagement Activity 2021