Be it in debugging, testing, code review or, more recently, pair programming with AI assistance: in all these activities, software engineers need to understand source code. Accordingly, plenty of research is taking place in the field to find out, for example, what makes code easy to understand and which tools can best support developers in their comprehension process. And while any code comprehension researcher certainly has a rough idea of what they mean when they mention a developer having a good understanding of a piece of code, to date, the research community has not managed to define source code comprehension as a concept. Instead, in primary research on code comprehension, an implicit definition by task prevails, i.e., code comprehension is what the experimental tasks measure. This approach has two negative consequences. First, it makes it difficult to conduct secondary research. Currently, each code comprehension primary study uses different comprehension tasks and measures, and thus it is not clear whether different studies intend to measure the same construct. Second, authors of a primary study run into the difficulty of justifying their design decisions without a definition of what they attempt to measure. An operationalization of an insufficiently described construct occurs, which poses a threat to construct validity. The task of defining code comprehension considering the theory of the past fifty years is not an easy one. Nor is it a task that every author of a primary study must accomplish on their own. Therefore, this paper constitutes a reference work that defines source code comprehension and presents a conceptual framework in which researchers can anchor their empirical code comprehension research.
翻译:无论是调试、测试、代码审查,还是近年来与人工智能辅助的结对编程,在这些活动中,软件工程师都需要理解源代码。因此,该领域开展了大量研究,例如探究是什么让代码易于理解,以及哪些工具能最好地支持开发者的理解过程。尽管任何代码理解研究者对于"开发者对一段代码有良好理解"这一说法都有粗略的概念,但迄今为止,研究界尚未成功将源代码理解定义为一个概念。相反,在关于代码理解的原始研究中,普遍采用任务隐含定义,即代码理解就是实验任务所测量的内容。这种方法有两个负面后果。首先,它使二次研究难以开展。目前,每项代码理解原始研究都采用不同的理解任务和测量指标,因此不清楚不同研究是否旨在测量相同的构念。其次,原始研究的作者在缺乏对所测量内容定义的情况下,难以论证其设计决策的合理性。这导致了描述不充分的构念的操作化,对构念效度构成威胁。考虑过去五十年理论来定义代码理解并非易事,也不是每项原始研究的作者必须独自完成的任务。因此,本文作为一项参考工作,定义了源代码理解,并提出了一个概念框架,使研究者能够将其实证代码理解研究锚定于此。