一句话:通过两项人类研究检验常见代码理解代理指标的相对可靠性,发现输入输出题与反应时指标较可靠,语法题指标不可靠。
既有代码理解研究常用不同代理指标(如 Likert 评分或程序片段的输入输出问题)来近似代码对工程师的可理解性,但其相对可靠性未知。本文开展两项人类研究:先用德尔菲专家共识协议,由五名专业工程师对八个代码片段建立可理解性真值排序;再让 44 名学生完成理解任务,在同一组片段上测量文献中的 14 种代理指标,并进行相关性分析。结果表明,源自输入输出问题以及测量反应时间而非正确率的代理指标尤其可靠;而源自程序语法而非语义问题的代理指标尤其不可靠,这质疑了现有可理解性文献的部分结论。
Prior work on code comprehension uses different comprehension proxies—for example, Likert-scale ratings or answers to input-output questions about program snippets, usually collected from students, to approximate whether code is comprehensible to software engineers, but the relative reliability of these proxies is not known. This paper investigates the relative reliability of a collection of proxies common in the extant literature with a pair of human studies. First, we conducted an expert-consensus study with a panel of five professional software engineers to establish a ground-truth comprehensibility ranking of eight code snippets by adapting the Delphi expert-consensus protocol. The Delphi protocol is widely used for expert consensus under conditions of uncertainty in other domains such as medicine and national-security forecasting, but to our knowledge, this is its first application to code comprehension research. Second, we conducted a study with 44 student participants who completed comprehension tasks, allowing us to measure 14 comprehension proxies derived from the literature on the same set of eight code snippets. Finally, we conducted a correlation analysis on the results, concluding that proxies 1) derived from input-output questions and 2) that measure response time rather than accuracy are especially reliable. We also found that proxies derived from questions about program syntax (rather than semantics) are especially unreliable, regardless of measurement strategy, which draws into question the reliability of parts of the existing comprehensibility literature.