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 条
  • [1] Exploring the Impact of Code Style in Identifying Good Programmers
    Yasir, Rafed Muhammad
    Kabir, Ahmedul
    arXiv, 2022,
  • [2] Examples of Unsuccessful Use of Code Comprehension Strategies: A Resource for Developing Code Comprehension Pedagogy
    Lewis, Colleen M.
    PROCEEDINGS OF THE 2023 ACM CONFERENCE ON INTERNATIONAL COMPUTING EDUCATION RESEARCH V.1, ICER 2023 V1, 2023, : 15 - 28
  • [3] Novice Programmers Strategies for Online Resource Use and Their Impact on Source Code
    Alghamdi, Omar
    Clinch, Sarah
    Alhamadi, Mohammad
    Jay, Caroline
    2023 IEEE/ACM 16TH INTERNATIONAL CONFERENCE ON COOPERATIVE AND HUMAN ASPECTS OF SOFTWARE ENGINEERING, CHASE, 2023, : 92 - 104
  • [4] DESIGN SOURCE CODE FOR COMPREHENSION
    TAYLOR, JL
    IEEE SOFTWARE, 1990, 7 (02) : 117 - 117
  • [5] "C"ing the light - assessing code comprehension in novice programmers using C code patterns
    Glasauer, Christina
    Yeh, Martin K.
    DeLong, Lois Anne
    Yan, Yu
    Zhuang, Yanyan
    COMPUTER SCIENCE EDUCATION, 2024,
  • [6] Recommending Proper API Code Examples for Documentation Purpose
    Mar, Lee Wei
    Wu, Ye-Chi
    Jiau, Hewijin Christine
    2011 18TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC 2011), 2011, : 331 - 338
  • [7] Mining API Usage Examples from Test Code
    Zhu, Zixiao
    Zou, Yanzhen
    Xie, Bing
    Jin, Yong
    Lin, Zeqi
    Zhang, Lu
    2014 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME), 2014, : 301 - 310
  • [8] A Socratic Tutor for Source Code Comprehension
    Alshaikh, Zeyad
    Tamang, Lasagn
    Rus, Vasile
    ARTIFICIAL INTELLIGENCE IN EDUCATION (AIED 2020), PT II, 2020, 12164 : 15 - 19
  • [9] Helping Programmers Improve the Energy Efficiency of Source Code
    Pereira, Rui
    Carcao, Tiago
    Couto, Marco
    Cunha, Jacome
    Fernandes, Joao Paulo
    Saraiva, Joao
    PROCEEDINGS OF THE 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING COMPANION (ICSE-C 2017), 2017, : 238 - 240
  • [10] Static analysis of source code written by novice programmers
    Delev, Tomche
    Gjorgjevikj, Dejan
    PROCEEDINGS OF 2017 IEEE GLOBAL ENGINEERING EDUCATION CONFERENCE (EDUCON2017), 2017, : 824 - 830