代码可验证性与可理解性之间关系的研究
On the Relationship between Code Verifiability and Understandability
AI总结:
本文通过实证分析211个Java代码片段在四个验证工具上的警告数与人类可理解性指标的关系,发现两者存在较小相关性(r=0.23),表明易验证代码往往更易理解,并指出验证工具可能带来可理解性方面的附带益处。
摘要:
软件验证的支持者认为,更简单的代码更容易验证:也就是说,验证工具在分析更简单的代码时会产生更少的误报,并且需要更少的人工干预。我们通过比较四个最先进的验证工具在211个Java代码片段上产生的警告数量,以及来自六项先前研究中人类受试者的20个代码可理解性指标,对这一假设进行了实证验证。我们的实验基于统计(元)分析,结果表明,总体而言,可理解性与可验证性之间存在较小的相关性(r = 0.23)。这些结果支持了这样的说法:易于验证的代码通常比需要更多验证努力的代码更容易理解。我们的工作对验证工具的用户和设计者以及未来自动测量代码可理解性的尝试具有启示意义:验证工具可能对可理解性具有附带益处,而测量可理解性可能需要推理代码的语义属性,而不仅仅是语法属性。
英文摘要:
Proponents of software verification have argued that simpler code is easier to verify: that is, that verification tools issue fewer false positives and require less human intervention when analyzing simpler code. We empirically validate this assumption by comparing the number of warnings produced by four state-of-the-art verification tools on 211 snippets of Java code with 20 metrics of code comprehensibility from human subjects in six prior studies. Our experiments, based on a statistical (meta-)analysis, show that, in aggregate, there is a small correlation (r = 0.23) between understandability and verifiability. The results support the claim that easy-to-verify code is often easier to understand than code that requires more effort to verify. Our work has implications for the users and designers of verification tools and for future attempts to automatically measure code comprehensibility: verification tools may have ancillary benefits to understandability, and measuring understandability may require reasoning about semantic, not just syntactic, code properties.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。