大脑是一个强大的地方:显示代码可理解性如何影响代码理解
The Mind Is a Powerful Place: How Showing Code Comprehensibility Metrics Influences Code Understanding
摘要:
静态代码分析工具和集成开发环境为开发人员提供了与质量相关的软件度量,其中一些度量描述了源代码的可理解性。软件度量影响着影响公司未来的总体战略决策和日常软件开发任务的优先级。然而,一些软件度量标准缺乏验证:我们只是选择相信它们反映了它们应该度量的东西。其中一些甚至没有衡量他们打算衡量的质量方面。然而,它们通过我们认知驱动行为中的偏见影响我们。特别是,它们可能会在我们的决定中锚定我们。软件度量中是否存在锚定效应尚未得到研究。我们进行了一个随机和双盲实验,以调查在何种程度上显示的源代码可理解性指标值锚定开发人员在他们的主观评级的源代码可理解性,性能是否受到锚定效应时,工作的理解任务,以及个人特征可能发挥作用的锚定效应。我们发现,可理解性度量的显示值对开发人员的代码可理解性评级具有显著且较大的锚定效应。在处理与所研究的代码片段相关的理解问题时,该效果似乎不会影响时间或正确性。由于锚定效应是最强大的认知偏差之一,我们对未经验证的指标对开发人员的操纵后果的理解有限,我们呼吁提高对代码质量报告责任的认识,并呼吁相应的工具以科学证据为基础。
英文摘要:
Static code analysis tools and integrated development environments present developers with quality-related software metrics, some of which describe the understandability of source code. Software metrics influence overarching strategic decisions that impact the future of companies and the prioritization of everyday software development tasks. Several software metrics, however, lack in validation: we just choose to trust that they reflect what they are supposed to measure. Some of them were even shown to not measure the quality aspects they intend to measure. Yet, they influence us through biases in our cognitive-driven actions. In particular, they might anchor us in our decisions. Whether the anchoring effect exists with software metrics has not been studied yet. We conducted a randomized and double-blind experiment to investigate the extent to which a displayed metric value for source code comprehensibility anchors developers in their subjective rating of source code comprehensibility, whether performance is affected by the anchoring effect when working on comprehension tasks, and which individual characteristics might play a role in the anchoring effect. We found that the displayed value of a comprehensibility metric has a significant and large anchoring effect on a developer's code comprehensibility rating. The effect does not seem to affect the time or correctness when working on comprehension questions related to the code snippets under study. Since the anchoring effect is one of the most robust cognitive biases, and we have limited understanding of the consequences of the demonstrated manipulation of developers by non-validated metrics, we call for an increased awareness of the responsibility in code quality reporting and for corresponding tools to be based on scientific evidence.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。