How Developers Choose Names

03/12/2021
by   Dror G. Feitelson, et al.
0

The names of variables and functions serve as implicit documentation and are instrumental for program comprehension. But choosing good meaningful names is hard. We perform a sequence of experiments in which a total of 334 subjects are required to choose names in given programming scenarios. The first experiment shows that the probability that two developers would select the same name is low: in the 47 instances in our experiments the median probability was only 6.9 understood by the majority of developers. Analysis of the names given in the experiment suggests a model where naming is a (not necessarily cognizant or serial) three-step process: (1) selecting the concepts to include in the name, (2) choosing the words to represent each concept, and (3) constructing a name using these words. A followup experiment, using the same experimental setup, then checked whether using this model explicitly can improve the quality of names. The results were that names selected by subjects using the model were judged by two independent judges to be superior to names chosen in the original experiment by a ratio of two-to-one. Using the model appears to encourage the use of more concepts and longer names.

READ FULL TEXT

page 4

page 5

research
03/15/2021

Using Non-Verbal Expressions as a Tool in Naming Research

Variable and function names are extremely important for program comprehe...
research
03/19/2021

Does Code Structure Affect Comprehension? On Using and Naming Intermediate Variables

Intermediate variables can be used to break complex expressions into mor...
research
09/07/2022

When Are Names Similar Or the Same? Introducing the Code Names Matcher Library

Program code contains functions, variables, and data structures that are...
research
02/22/2023

Rename Chains: An Exploratory Study on the Occurrence and Characteristics of Identifiers Undergoing Multiple Renamings

Identifier names play a significant role in program comprehension activi...
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
07/12/2019

Mercem: Method Name Recommendation Based on Call Graph Embedding

Comprehensibility of source code is strongly affected by identifier name...
research
05/11/2020

A Pattern-based Approach to Detect and Improve Non-descriptive Test Names

Unit tests are an important artifact that supports the software developm...

Please sign up or login with your details

Forgot password? Click here to reset