Learning Quick Fixes from Code Repositories

03/10/2018
by   Reudismam Rolim, et al.
0

Code analyzers such as ErrorProne 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 patterns. However, it is hard 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 propose 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, (ii) clusters edits into sets that can be described using an edit pattern, (iii) compiles, when possible, the edit patterns into executable plugins for the Google's ErrorProne tool. The patterns can then be inspected by the designers of code analyzers. We ran Revisar on nine popular GitHub projects, and it discovered 920 edit patterns across projects. We then acted as designers of code analyzers, inspected the most common 381 patterns and classified 32 as quick fixes. To assess the quality of the quick fixes, we performed a survey with 164 programmers from 124 projects, showing the 10 edit patterns that appeared in most projects. Programmers supported 9 (90 requests applying our patterns to 9 projects and, at the time of the writing, programmers supported 17 (85

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/22/2020

DevReplay: Automatic Repair with Editable Fix Pattern

Static analysis tools, or linters, detect violation of source code conve...
research
01/27/2020

Ammonia: An Approach for Deriving Project-specific Bug Patterns

Finding and fixing buggy code is an important and cost-intensive mainten...
research
11/26/2020

On the diversity and frequency of code related to mathematical formulas in real-world Java projects

In this paper, the term formula code refers to fragments of source code ...
research
07/12/2020

Editable AI: Mixed Human-AI Authoring of Code Patterns

Developers authoring HTML documents define elements following patterns w...
research
09/30/2021

Towards a modern CMake workflow

Modern CMake offers the features to manage versatile and complex project...
research
05/21/2021

Changes from the Trenches: Should We Automate Them?

Code changes constitute one of the most important features of software e...
research
01/12/2018

Can Who-Edits-What Predict Edit Survival?

The Internet has enabled the emergence of massive online collaborative p...

Please sign up or login with your details

Forgot password? Click here to reset