RECORD
Improving Semantic Consistency of Variable Names with Use-Flow Graph Analysis
Software Engineering · Submitted 18 Mar 2022
abstract compiled · 2026-09-23 · no language-model review
The authors' main claim Our system proposed alternative variable names for 416 out of 1080 (39%) instances that are considered better than ones originally used by the developers.
The compiled record
The paper's own sentences, arranged. Each label is drawn from a closed vocabulary; the number beside it is the probability the classifier gave that label. Numbers in the tables are the authors', checked by code. No sentence in this record was written by a model.
Open the compiled record
The abstract, sentence by sentence
Consistency is one of the keys to maintainable source code and hence a successful software project. We propose a novel method of extracting the intent of programmers from source code of a large project (~300kLOC) and checking the semantic consistency of its variable names. Our system learns a project-specific naming convention for variables based on its role solely from source code, and suggest alternatives when it violates its internal consistency. The system can also show the reasoning why a certain variable should be named in a specific way. The system does not rely on any external knowledge. We applied our method to 12 open-source projects and evaluated its results with human reviewers. Our system proposed alternative variable names for 416 out of 1080 (39%) instances that are considered better than ones originally used by the developers. Based on the results, we created patches to correct the inconsistent names and sent them to its developers. Three open-source projects adopted it.
background contribution method result interpretation main claim
| # | sentence | role | the authors' own work | states the main conclusion | strength |
|---|---|---|---|---|---|
| s0 | Consistency is one of the keys to maintainable source code and hence a successful software project. | background 1.00 | 0.04 | 0.03 | asserted 1.00 |
| s1 | We propose a novel method of extracting the intent of programmers from source code of a large project (~300kLOC) and checking the semantic consistency of its variable names. | contribution 0.99 | 0.93 | 0.09 | asserted 0.99 |
| s2 | Our system learns a project-specific naming convention for variables based on its role solely from source code, and suggest alternatives when it violates its internal consistency. | method 0.91 | 0.89 | 0.10 | asserted 0.99 |
| s3 | The system can also show the reasoning why a certain variable should be named in a specific way. | contribution 0.56 | 0.82 | 0.05 | asserted 0.90 |
| s4 | The system does not rely on any external knowledge. | method 0.74 | 0.56 | 0.03 | asserted 1.00 |
| s5 | We applied our method to 12 open-source projects and evaluated its results with human reviewers. | method 0.92 | 0.97 | 0.04 | asserted 1.00 |
| s6 | Our system proposed alternative variable names for 416 out of 1080 (39%) instances that are considered better than ones originally used by the developers. | result 1.00 | 0.97 | 0.42 | asserted 1.00 |
| s7 | Based on the results, we created patches to correct the inconsistent names and sent them to its developers. | contribution 0.42 | 0.95 | 0.09 | asserted 1.00 |
| s8 | Three open-source projects adopted it. | result 0.98 | 0.86 | 0.15 | asserted 1.00 |
What was examined, and what was not
- arXiv listing abstract v1
- full text
- figures and tables
- references and citing sentences
- relations to other papers
- P abstract
- S sections
- T body sentences
- C citations
- R cross-paper relations
The paper
Original abstract
Consistency is one of the keys to maintainable source code and hence a successful software project. We propose a novel method of extracting the intent of programmers from source code of a large project (~300kLOC) and checking the semantic consistency of its variable names. Our system learns a project-specific naming convention for variables based on its role solely from source code, and suggest alternatives when it violates its internal consistency. The system can also show the reasoning why a certain variable should be named in a specific way. The system does not rely on any external knowledge. We applied our method to 12 open-source projects and evaluated its results with human reviewers. Our system proposed alternative variable names for 416 out of 1080 (39%) instances that are considered better than ones originally used by the developers. Based on the results, we created patches to correct the inconsistent names and sent them to its developers. Three open-source projects adopted it.
Human review
How the literature uses it
What this paper does with the arXiv papers it cites
Discussion
Know something about this paper? Leave a comment, or highlight any passage above to comment on it.