一句话:通过 49 名专业开发者的在线实验发现,显式特征注解能改善程序理解,而特征分解会负面影响缺陷定位。
开发者常需通过阅读源码来理解程序,显式特征追溯(如注解与按特征分解)被视为能快速识别功能的手段,但其对程序理解的实证效果尚不明确。本文对 49 名专业软件开发者开展在线实验,将带特征注解、按特征分解以及无追溯的纯面向对象代码进行对比,并收集定量任务表现与定性意见。结果表明:注解对程序理解有正向作用;分解反而对缺陷定位产生负面影响;参与者主观上认为两种技术均有益;三种代码版本在任务完成时间上均无显著改善。整体而言,轻量级追溯(如注解)无需大量培训或工具即可为开发维护带来即时收益,并可改进依赖重型追溯工具与事后合规的工业实践。
Developers spend a substantial amount of their time with program comprehension. To improve their comprehension and refresh their memory, developers need to communicate with other developers, read the documentation, and analyze the source code. Many studies show that developers focus primarily on the source code and that small improvements can have a strong impact. As such, it is crucial to bring the code itself into a more comprehensible form. A particular technique for this purpose are explicit feature traces to easily identify a program’s functionalities. To improve our empirical understanding about the effects of feature traces, we report an online experiment with 49 professional software developers. We studied the impact of explicit feature traces, namely annotations and decomposition, on program comprehension and compared them to the same code without traces. Besides this experiment, we also asked our participants about their opinions in order to combine quantitative and qualitative data. Our results indicate that, as opposed to purely object-oriented code: (1) annotations can have positive effects on program comprehension; (2) decomposition can have a negative impact on bug localization; and (3) our participants perceive both techniques as beneficial. Moreover, none of the three code versions yields significant improvements on task completion time. Overall, our results indicate that lightweight traceability, such as using annotations, provides immediate benefits to developers during software development and maintenance without extensive training or tooling; and can improve current industrial practices that rely on heavyweight traceability tools (e.g., DOORS) and retroactive fulfillment of standards (e.g., ISO-26262, DO-178B).
@inproceedings{paperbot5149,
title = {Effects of explicit feature traceability on program comprehension},
author = {Jacob Krüger and Gül Çalıklı and Thorsten Berger and Thomas Leich and Gunter Saake},
booktitle = {FSE},
year = {2019},
doi = {10.1145/3338906.3338968}
}