【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 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号