Improving Semantic Consistency of Variable Names with Use-Flow Graph Analysis

03/18/2022
by   Yusuke Shinyama, et al.
0

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 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.

READ FULL TEXT
research
09/19/2019

DIRE: A Neural Approach to Decompiled Identifier Naming

The decompiler is one of the most common tools for examining binaries wi...
research
02/27/2021

A Context-based Automated Approach for Method Name Consistency Checking and Suggestion

Misleading method names in software projects can confuse developers, whi...
research
04/06/2020

Embedding Java Classes with code2vec: Improvements from Variable Obfuscation

Automatic source code analysis in key areas of software engineering, suc...
research
07/12/2019

Mercem: Method Name Recommendation Based on Call Graph Embedding

Comprehensibility of source code is strongly affected by identifier name...
research
03/25/2021

Towards a Model to Appraise and Suggest Identifier Names

Unknowingly, identifiers in the source code of a software system play a ...
research
05/28/2023

RefBERT: A Two-Stage Pre-trained Framework for Automatic Rename Refactoring

Refactoring is an indispensable practice of improving the quality and ma...
research
06/25/2022

Implementation of SquashFS Support in U-Boot

U-Boot is a notorious bootloader and Open Source project. This work had ...

Please sign up or login with your details

Forgot password? Click here to reset