【24h】

Shorter identifier names take longer to comprehend

机译:较短的标识符名称需要更长的时间才能理解

获取原文

摘要

Developers spend the majority of their time comprehending code, a process in which identifier names play a key role. Although many identifier naming styles exist, they often lack an empirical basis and it is not quite clear whether short or long identifier names facilitate comprehension. In this paper, we investigate the effect of different identifier naming styles (letters, abbreviations, words) on program comprehension, and whether these effects arise because of their length or their semantics. We conducted an experimental study with 72 professional C# developers, who looked for defects in source-code snippets. We used a within-subjects design, such that each developer saw all three versions of identifier naming styles and we measured the time it took them to find a defect. We found that words lead to, on average, 19% faster comprehension speed compared to letters and abbreviations, but we did not find a significant difference in speed between letters and abbreviations. The results of our study suggest that defects in code are more difficult to detect when code contains only letters and abbreviations. Words as identifier names facilitate program comprehension and can help to save costs and improve software quality.
机译:开发人员将大部分时间都花在理解代码上,在此过程中,标识符名称起着关键作用。尽管存在许多标识符命名样式,但是它们常常缺乏经验基础,而且不清楚短标识符标识符还是长标识符标识符是否有助于理解。在本文中,我们研究了不同的标识符命名方式(字母,缩写,单词)对程序理解的影响,以及这些影响是否由于其长度或语义而产生。我们与72位专业C#开发人员进行了一项实验研究,他们在源代码段中寻找缺陷。我们使用了主题内设计,这样每个开发人员都可以看到标识符命名样式的所有三个版本,并且可以测量发现缺陷所需的时间。我们发现,与字母和缩写词相比,单词平均可提高19%的理解速度,但我们发现字母和缩写词之间的速度没有显着差异。我们的研究结果表明,当代码仅包含字母和缩写时,更难以检测代码中的缺陷。单词作为标识符名称有助于程序理解,并且可以帮助节省成本和提高软件质量。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号