Introduction
Naming is a fundamental yet notoriously difficult aspect of software development. Because code is read far more often than it is written, names serve as the primary vehicle for conveying a developer's intent. However, naming remains highly subjective. A landmark study by Feitelson et al. (2022) previously explored how developers choose names, revealing significant diversity in their choices but also suggesting an underlying "3-step model" of name construction.
This paper presents a comprehensive reproduction and extension of that work. By conducting three independent experiments with methodological variations, the researchers aimed to validate previous findings, understand the root causes of naming diversity, and determine whether developers can be trained to produce higher-quality names through structured interventions.
Methodological Approach
To ensure the robustness of the original findings, the researchers addressed potential "accessibility bias"—the tendency for developers to simply reuse words found in a problem description.
Experiments 1 and 2: Reproduction through Reverse Engineering
Instead of providing verbal descriptions, Experiments 1 and 2 required participants to "reverse engineer" the intent of existing code.
- Experiment 1 utilized custom-written Python code (e.g., a quiz scoring program) where all meaningful variable names were replaced with single letters.
- Experiment 2 applied the same methodology to real-world code snippets sourced from GitHub utility libraries, including functions for list filtering and string manipulation.
By forcing participants to infer the purpose of variables from logic alone, the researchers could observe naming choices uninfluenced by external textual cues.
Experiment 3: The Intervention Study
The third experiment focused on whether naming quality could be improved through instruction. Participants were divided into three groups:
- Control Group: Received no specific naming instructions.
- Simple Advice Group: Instructed that "longer, more detailed names are better."
- 3-Step Model Group: Trained to follow a specific workflow: (1) Select the concepts to include, (2) Select specific words for those concepts, and (3) Decide how to combine them.
A Taxonomy of Naming Concepts
One of the paper's primary contributions is a new framework for understanding why developers choose different names for the same object. By dissecting names into their constituent concepts (e.g., correct_answer_score consists of [Correct], [Answer], and [Score]), the authors classified concepts into four categories:
- Universal: Concepts that almost all developers agree are essential (e.g., "score" in a grading script).
- Alternative: Concepts where developers have divergent views on the same topic (e.g., choosing between "question" and "answer" to describe the same variable).
- Optional: Concepts that some developers include for extra detail while others omit for brevity (e.g., adding "per_question" to a score variable).
- Rare: Niche concepts or unique interpretations used by only a small minority.
This taxonomy explains why name diversity is so high: even if developers agree on the "Universal" concepts, their differing choices regarding "Alternative" and "Optional" concepts lead to a wide variety of final names.
Key Findings
The Persistence of Diversity
The results corroborated the original study’s findings regarding naming diversity. The probability of two developers choosing the exact same name (P2hit) remained low, typically between 5% and 10%. Diversity scores—the ratio of distinct names to total names—ranged from 40% to 90% across different variables.
Experience and Name Length
The study confirmed that professional experience influences naming style. Experienced developers tended to use slightly longer and more descriptive names, averaging 1.8 words per name compared to 1.6 words for students, suggesting that as developers mature, they prioritize descriptiveness over brevity.
The Efficacy of the 3-Step Model
The intervention study yielded the most significant practical insight: naming is a cognitive skill that can be improved through structured frameworks.
- Quality Scores: Names generated using the 3-step model were rated as "the best" by expert judges in 41.3% of cases. In contrast, the "longer names" group (30.9%) and the control group (27.7%) performed significantly worse.
- Length vs. Quality: While there is a correlation (0.49) between name length and quality, simply telling developers to write longer names was ineffective. Each additional word increased a name's quality score by an average of 1.14 points on a 10-point scale, but only when those words were chosen through the structured 3-step process.
Conclusion and Future Directions
This research demonstrates that naming diversity is an inherent property of software development, driven by the inclusion of optional and alternative concepts. However, this diversity does not preclude quality. By teaching developers the 3-step model of concept selection, word choice, and combination, organizations can measurably improve the clarity of their codebases.
Future work suggests that development tools, such as IDE plugins, should move beyond simple length checks. Instead, tools could help identify "naming pain-points"—variables where there is no dominant concept—signaling to the developer that the variable's purpose may be poorly defined and requires refactoring.
Summary updated