Learning Quick Fixes from Code Repositories
Not on the map. Why?
Abstract (arXiv)
Code analyzers such as Error Prone and FindBugs detect code patterns symptomatic of bugs, performance issues, or bad style. These tools express patterns as quick fixes that detect and rewrite unwanted code. However, it is difficult to come up with new quick fixes and decide which ones are useful and frequently appear in real code. We propose to rely on the collective wisdom of programmers and learn quick fixes from revision histories in software repositories. We present REVISAR, a tool for discovering common Java edit patterns in code repositories. Given code repositories and their revision histories, REVISAR (i) identifies code edits from revisions and (ii) clusters edits into sets that can be described using an edit pattern. The designers of code analyzers can then inspect the patterns and add the corresponding quick fixes to their tools. We ran REVISAR on nine popular GitHub projects, and it discovered 89 useful edit patterns that appeared in 3 or more projects. Moreover, 64% of the discovered patterns did not appear in existing tools. We then conducted a survey with 164 programmers from 124 projects and found that programmers significantly preferred eight out of the nine of the discovered patterns. Finally, we submitted 16 pull requests applying our patterns to 9 projects and, at the time of the writing, programmers accepted 6 (60%) of them. The results of this work aid toolsmiths in discovering quick fixes and making informed decisions about which quick fixes to prioritize based on patterns programmers actually apply in practice.
Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). First posted on arXiv 10 Mar 2018.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 2; 2023: 4; 2024: 2.
8 papers.
- 2023GrACE: Generation using Associated Code Editscited by 16
- 2023Towards Generating Functionally Correct Code Edits from Natural Language Issue Descriptionscited by 14
- 2022Overwatch: Learning Patterns in Code Edit Sequencescited by 8
- 2023Anti-unification and Generalization: A Surveycited by 7
- 2023Frustrated with Code Quality Issues? LLMs can Help!cited by 5
- 2022Example-based Synthesis of Static Analysis Rulescited by 0
- 2024Machine Learning Techniques for Python Source Code Vulnerability Detectioncited by 0
- 2024Algebraic anti-unificationcited by 0
- 2024Algebraic anti-unification22 Jul 2024
- 2024Machine Learning Techniques for Python Source Code Vulnerability Detection15 Apr 2024
- 2023Frustrated with Code Quality Issues? LLMs can Help!22 Sep 2023
- 2023GrACE: Generation using Associated Code Edits23 May 2023
- 2023Towards Generating Functionally Correct Code Edits from Natural Language Issue Descriptions7 Apr 2023
- 2023Anti-unification and Generalization: A Survey1 Feb 2023
- 2022Overwatch: Learning Patterns in Code Edit Sequences25 Jul 2022
- 2022Example-based Synthesis of Static Analysis Rules19 Apr 2022