Exploring the Impact of Source Code Linearity on the Programmers' Comprehension of API Code Examples

被引:0
|
作者
Alharbi, Seham [1 ]
Kolovos, Dimitris [1 ]
机构
[1] Univ York, York, N Yorkshire, England
关键词
API comprehension; API code examples; source code linearity; human factors in software engineering; controlled experiment;
D O I
10.1145/3643916.3644395
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:236 / 240
页数:5
相关论文
共 50 条
  • [21] Indexing the Java']Java API using source code
    Ma, Homan
    Amor, Robert
    Tempero, Ewan
    ASWEC 2008: 19TH AUSTRALIAN SOFTWARE ENGINEERING CONFERENCE, PROCEEDINGS, 2008, : 451 - 460
  • [22] API Deprecation: A Retrospective Analysis and Detection Method for Code Examples on the Web
    Zhou, Jing
    Walker, Robert J.
    FSE'16: PROCEEDINGS OF THE 2016 24TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON FOUNDATIONS OF SOFTWARE ENGINEERING, 2016, : 266 - 277
  • [23] API Deprecation: A retrospective analysis and detection method for code examples on the web
    Laboratory for Software Modification Research, Department of Computer Science, University of Calgary, Calgary, Canada
    Proc ACM SIGSOFT Symp Found Software Eng, (266-277):
  • [24] Exploring Algorithm Comprehension: Linking Proof and Program Code
    Kather, Philipp
    Vahrenhold, Jan
    PROCEEDINGS OF 21ST KOLI CALLING CONFERENCE ON COMPUTING EDUCATION RESEARCH, KOLI CALLING 2021,, 2021,
  • [25] A3: Assisting Android API Migrations Using Code Examples
    Lamothe, Maxime
    Shang, Weiyi
    Chen, Tse-Hsun
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2022, 48 (02) : 417 - 431
  • [26] A transformation from POSIX based source code to OSEK/VDX source code based on API and OIL translation
    Song Y.-H.
    Lee T.-Y.
    Lee J.-D.
    Moon C.-W.
    Jeong G.-M.
    Ahn H.-S.
    Journal of Institute of Control, Robotics and Systems, 2010, 16 (06) : 559 - 565
  • [27] Reusing Bugged Source Code to Support Novice Programmers in Debugging Tasks
    Ardimento, Pasquale
    Bernardi, Mario Luca
    Cimitile, Marta
    De Ruvo, Giuseppe
    ACM TRANSACTIONS ON COMPUTING EDUCATION, 2020, 20 (01):
  • [28] React example viability for efficient API learning (REVEAL): A tool to help programmers utilize incompatible code examples in React.js']js
    Allen, John
    Kelleher, Caitlin
    JOURNAL OF COMPUTER LANGUAGES, 2023, 75
  • [29] Detecting Important Terms in Source Code for Program Comprehension
    Rodeghero, Paige
    McMillan, Collin
    PROCEEDINGS OF THE 52ND ANNUAL HAWAII INTERNATIONAL CONFERENCE ON SYSTEM SCIENCES, 2019, : 7493 - 7502
  • [30] An Empirical Study Assessing Source Code Readability in Comprehension
    Johnson, John C.
    Lubo, Sergio
    Yedla, Nishitha
    Aponte, Jairo
    Sharif, Bonita
    2019 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2019), 2019, : 513 - 523