TL;DR
Automated program repair (APR) tools promise to fix bugs automatically, but developers don't trust them. This paper surveys over 100 software practitioners to understand what's needed to build trust, finding that developers want fast, minimal-interaction tools that provide clear explanations and evidence of correctness. An empirical evaluation of existing APR tools under these constraints reveals significant limitations, highlighting the need for better search space representations and patch ranking mechanisms.
What Problem Does This Paper Address?
Automated program repair (APR) aims to automatically fix bugs and vulnerabilities in software. While promising, its widespread adoption is hindered by a lack of developer trust. Developers are hesitant to rely on code generated by machines, especially when the intended behavior of the software isn't formally documented, making it difficult to verify if an automatically generated patch truly fixes the bug without introducing new issues. This paper investigates the factors influencing developer trust in APR and evaluates how well current APR techniques meet these expectations.
Methods
The authors employed a two-pronged approach:
- Qualitative and Quantitative Survey: They surveyed over 100 software practitioners (developers, architects, etc.) using a 35-question questionnaire. The survey explored developer expectations regarding APR usage, the types of inputs they're willing to provide, and the evidence they need to trust generated patches.
- Quantitative Evaluation of APR Tools: They conducted an empirical study evaluating several state-of-the-art APR tools (ANGELIX, PROPHET, GENPROG, FIX2FIT, CPR) on the MANYBUGS benchmark. This evaluation was performed under realistic constraints derived from the survey, specifically a 1-hour timeout and a focus on the top-10 ranked patches, to assess their performance in a developer-friendly setting.
Datasets
The primary dataset used for the empirical evaluation was the MANYBUGS benchmark. This benchmark consists of 60 defects from 6 open-source projects, filtered to include only those fixed by developers at a single location. The authors note that this benchmark is well-established in APR research and includes test suites created by the original developers.
Key Insights and Ideas
- Trust is Paramount: Developers are willing to use APR, but only if they trust the generated patches. This trust is not inherent and requires specific conditions to be met.
- Minimal Interaction, Maximum Speed: Developers prefer APR tools that require minimal interaction after the initial input. They expect patches to be generated quickly, ideally within an hour, and are only willing to review a small number of patches (5-10).
- Evidence is Key: Developers need clear explanations and evidence to validate patches. This includes information like code coverage, the ratio of the input space tested, identified fault/fix locations, and auto-generated test cases.
- Artifacts as Bridges: Developers are open to providing additional artifacts like test cases, assertions, and logical constraints to improve APR. These can also serve as valuable outputs from APR tools.
- Search Space Matters More Than Algorithms (Sometimes): While efficient search algorithms are important, the representation of the search space itself plays a crucial role in finding plausible patches within time constraints. Abstracting the search space can be more effective than brute-force exploration.
- Ranking is the Final Hurdle: Even if a correct patch is found, its ranking is critical. Developers won't sift through hundreds of patches, so effective ranking mechanisms are essential.
Key Results
- Developer Willingness: A strong majority (72%) of surveyed developers are willing to review auto-generated patches.
- Time Constraints: 63% of developers expect patches within one hour, with a majority preferring under 30 minutes.
- Patch Limit: 72% of developers are willing to review up to 5 patches before losing interest.
- Artifact Impact: 80% of developers agree that additional artifacts (like test cases) increase trust in generated patches.
- APR Tool Performance Under Constraints: Under a 1-hour timeout and top-10 ranking, current state-of-the-art APR techniques struggle to identify many plausible patches. For example, ANGELIX, despite exploring its search space extensively, could only generate a plausible patch for one defect in the EC1 configuration. FIX2FIT showed better results in finding plausible patches, but often failed to rank them within the top-10.
- Fix Location Impact: Providing the exact developer-specified fix location improved results for some tools (PROPHET, FIX2FIT, CPR) but not others (ANGELIX, GENPROG), highlighting limitations in their search space or exploration strategies.
- Test Case Impact: The effect of varying passing test cases depended on the APR technique's characteristics, sometimes leading to more plausible (but potentially overfitting) patches and other times having little effect.
Limitations and Future Work
- Survey Generalizability: While the survey reached diverse participants, generalizing results to all software developers is a challenge. The authors mitigated this by making their artifacts public for replication.
- APR Tool Coverage: The empirical evaluation covered representative APR concepts but not all existing tools.
- Parameter Tuning: The experiments used default parameter settings to simulate novice user experience. Fine-tuning parameters could yield significantly better results, which is a direction for future work.
- Timeout Sensitivity: The 1-hour timeout is based on survey responses but might not be universally applicable.
- Intelligent Test Selection: The authors suggest that APR techniques should incorporate intelligent test selection or filtering mechanisms to improve repair efficiency and reduce overfitting.
- Abstract Search Space Representations: The paper emphasizes the need for better abstract representations of search spaces to improve exploration.
- Automated Code Generation Trust: The findings have implications for the broader field of automated code generation, like GitHub Copilot, and suggest research into technologies that support mixed manual and auto-generated code.
Summary updated