背景:应用程序编程接口(API)代码示例是学习 API 的重要知识资源。然而,很少有用户研究探讨代码示例中源代码的结构特征如何影响其可理解性和可复用性。目标:我们研究了 API 代码示例中源代码的(a)线性度和(b)长度是否会影响用户在正确性和所花费时间方面的表现。我们还收集了主观评分。方法:我们进行了一项在线受控代码理解实验,共有 61 名 Java 开发人员参与。作为案例研究,我们使用了 Joda-Time Java 库中的 API 代码示例。我们让参与者在具有不同长度和线性度的示例变体上执行代码理解和复用任务。发现:参与者在接触线性代码示例时表现出更快的反应时间。然而,在正确性或主观评分方面未观察到实质性差异。启示:我们的发现表明,源代码的线性呈现可能会增强对示例的初步理解和可复用性。这反过来可能为 API 开发人员有效组织其 API 代码示例提供一些见解。然而,我们强调需要进一步研究。
英文摘要:
Context: Application Programming Interface (API) code examples are an essential knowledge resource for learning APIs. However, a few user studies have explored how the structural characteristics of the source code in code examples impact their comprehensibility and reusability. Objectives: We investigated whether the (a) linearity and (b) length of the source code in API code examples affect users performance in terms of correctness and time spent. We also collected subjective ratings. Methods: We conducted an online controlled code comprehension experiment with 61 Java developers. As a case study, we used the API code examples from the Joda-Time Java library. We had participants perform code comprehension and reuse tasks on variants of the example with different lengths and degrees of linearity. Findings: Participants demonstrated faster reaction times when exposed to linear code examples. However, no substantial differences in correctness or subjective ratings were observed. Implications: Our findings suggest that the linear presentation of a source code may enhance initial example understanding and reusability. This, in turn, may provide API developers with some insights into the effective structuring of their API code examples. However, we highlight the need for further investigation.
Empirical Study of Phased Model of Software Change
软件变更是软件演化和维护的基本任务。PMSC(Phased Model for Software Change)是一个软件变更的过程模型,它是在代码中本地化的。它由几个阶段组成,涵盖了程序理解和代码修改。本文提出了一个实证研究的制定私营军事和安保服务公司,加强了使用工具JRipples。受试者是具有不同程度编程经验的研究生。实证研究结果表明,程序员与知识的PMSC和支持JRipples执行完善的软件变化,在不熟悉的软件在显着更少的时间(约一半的时间)比独立的程序员。在代码理解和实施工作方面都有了实质性的时间改进。
Towards Leveraging Large Language Model Summaries for Topic Modeling in Source Code
Dept. of Informatics, Systems and Communication, University of Milano-Bicocca(信息与通信系统系,米兰-比科卡大学);Dept. of Human and Social Sciences, University of Bergamo(人文与社会科学系,贝拉戈莫大学)