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%. At the same time, given that a specific name is chosen, it is usually 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.


翻译:变量和函数的名称是隐含的文档,有助于程序理解。 但是选择有意义的好名称很难。 我们进行一系列实验, 总共需要334个对象在特定编程情景中选择名称。 第一个实验显示, 两位开发者选择相同名称的概率很低: 在我们的实验中的47个例子中, 中位概率仅为6.9%。 同时, 由于选择了特定名称, 它通常为大多数开发者所理解。 对实验中给出的名称的分析表明, 命名是一个( 不一定知道或序列) 三步过程的模型:(1) 选择要包含在名称中的概念, (2) 选择代表每个概念的词, (3) 使用这些词构建名称。 后续实验, 使用同样的实验设置, 然后检查使用这个模型是否明确可以提高名称的质量。 结果是, 两位独立法官对使用模型选择的名称的评分优于最初实验中选择的名称, 比例为二比一。 使用模型似乎鼓励使用更多概念和更长的名称。

0
下载
关闭预览

相关内容

ACM/IEEE第23届模型驱动工程语言和系统国际会议,是模型驱动软件和系统工程的首要会议系列,由ACM-SIGSOFT和IEEE-TCSE支持组织。自1998年以来,模型涵盖了建模的各个方面,从语言和方法到工具和应用程序。模特的参加者来自不同的背景,包括研究人员、学者、工程师和工业专业人士。MODELS 2019是一个论坛,参与者可以围绕建模和模型驱动的软件和系统交流前沿研究成果和创新实践经验。今年的版本将为建模社区提供进一步推进建模基础的机会,并在网络物理系统、嵌入式系统、社会技术系统、云计算、大数据、机器学习、安全、开源等新兴领域提出建模的创新应用以及可持续性。 官网链接:http://www.modelsconference.org/
专知会员服务
86+阅读 · 2020年12月5日
【经典书】C语言傻瓜式入门(第二版),411页pdf
专知会员服务
54+阅读 · 2020年8月16日
Transformer文本分类代码
专知会员服务
118+阅读 · 2020年2月3日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
159+阅读 · 2019年10月12日
强化学习最新教程,17页pdf
专知会员服务
181+阅读 · 2019年10月11日
【新书】Python编程基础,669页pdf
专知会员服务
196+阅读 · 2019年10月10日
[综述]深度学习下的场景文本检测与识别
专知会员服务
78+阅读 · 2019年10月10日
机器学习入门的经验与建议
专知会员服务
94+阅读 · 2019年10月10日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
41+阅读 · 2019年10月9日
意识是一种数学模式
CreateAMind
3+阅读 · 2019年6月24日
深度自进化聚类:Deep Self-Evolution Clustering
我爱读PAMI
15+阅读 · 2019年4月13日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
【TED】生命中的每一年的智慧
英语演讲视频每日一推
10+阅读 · 2019年1月29日
Unsupervised Learning via Meta-Learning
CreateAMind
43+阅读 · 2019年1月3日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
分布式TensorFlow入门指南
机器学习研究会
4+阅读 · 2017年11月28日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
【推荐】SVM实例教程
机器学习研究会
17+阅读 · 2017年8月26日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Arxiv
7+阅读 · 2020年9月17日
Arxiv
3+阅读 · 2018年11月14日
Arxiv
3+阅读 · 2018年2月24日
Arxiv
3+阅读 · 2018年2月22日
VIP会员
相关VIP内容
专知会员服务
86+阅读 · 2020年12月5日
【经典书】C语言傻瓜式入门(第二版),411页pdf
专知会员服务
54+阅读 · 2020年8月16日
Transformer文本分类代码
专知会员服务
118+阅读 · 2020年2月3日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
159+阅读 · 2019年10月12日
强化学习最新教程,17页pdf
专知会员服务
181+阅读 · 2019年10月11日
【新书】Python编程基础,669页pdf
专知会员服务
196+阅读 · 2019年10月10日
[综述]深度学习下的场景文本检测与识别
专知会员服务
78+阅读 · 2019年10月10日
机器学习入门的经验与建议
专知会员服务
94+阅读 · 2019年10月10日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
41+阅读 · 2019年10月9日
相关资讯
意识是一种数学模式
CreateAMind
3+阅读 · 2019年6月24日
深度自进化聚类:Deep Self-Evolution Clustering
我爱读PAMI
15+阅读 · 2019年4月13日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
【TED】生命中的每一年的智慧
英语演讲视频每日一推
10+阅读 · 2019年1月29日
Unsupervised Learning via Meta-Learning
CreateAMind
43+阅读 · 2019年1月3日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
分布式TensorFlow入门指南
机器学习研究会
4+阅读 · 2017年11月28日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
【推荐】SVM实例教程
机器学习研究会
17+阅读 · 2017年8月26日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Top
微信扫码咨询专知VIP会员