Synthesising Linear API Usage Examples for API Documentation

被引:1
作者
Alharbi, Seham [1 ,3 ]
Kolovos, Dimitris [1 ]
Matragkas, Nicholas [2 ]
机构
[1] Univ York, Dept Comp Sci, York, N Yorkshire, England
[2] Univ Paris Saclay, CEA List, Palaiseau, France
[3] Qassim Univ, Coll Comp, Buraydah, Saudi Arabia
来源
2022 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2022) | 2022年
关键词
API; documentation generation; API learnability; code comprehension; linear code; usage examples;
D O I
10.1109/ICSME55016.2022.00084
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Code examples are essential resources for learning application programming interfaces (APIs). The shortage of such examples can be a major learning obstacle for API users. Writing and maintaining effective API usage examples can also be an effort-intensive and repetitive process for API developers because API users ideally want such examples to be simple, standalone, and linear. To address these challenges, several approaches have been proposed to automatically extract API code examples from various resources and embed them into official API documents; however, little emphasis has been placed on addressing the underlying issue directly and helping API developers write and maintain API usage examples. In this paper, we present a new approach for automatically synthesising linear code examples from less repetitive versions by in-lining reusable utility methods. The proposed approach aims to benefit API developers in terms of productivity and maintainability, as well as API users in terms of API learnability and comprehension. We have implemented the proposed approach in a prototype for the Java programming language, which we also discuss in this paper.
引用
收藏
页码:607 / 611
页数:5
相关论文
共 29 条
[1]   Information correspondence between types of documentation for APIs [J].
Arya, Deeksha M. ;
Guo, Jin L. C. ;
Robillard, Martin P. .
EMPIRICAL SOFTWARE ENGINEERING, 2020, 25 (05) :4069-4096
[2]  
Buse RPL, 2012, PROC INT CONF SOFTW, P782, DOI 10.1109/ICSE.2012.6227140
[3]  
Campbell A, 2018, COGNITIVE COMPLEXITY
[4]  
eclipse, ECLIPSE JAVA DEV TOO
[5]   API documentation with executable examples [J].
Hoffman, D ;
Strooper, P .
JOURNAL OF SYSTEMS AND SOFTWARE, 2003, 66 (02) :143-156
[6]  
Jiang J, 2007, INT C PROGRAM COMPRE, P259
[7]   Docio: Documenting API Input/Output Examples [J].
Jiang, Siyuan ;
Armaly, Ameer ;
McMillan, Collin ;
Zhi, Qiyu ;
Metoyer, Ronald .
2017 IEEE/ACM 25TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION (ICPC), 2017, :364-367
[8]   Adding Examples into Java']Java Documents [J].
Kim, Jinhan ;
Lee, Sanghoon ;
Hwang, Seung-won ;
Kim, Sunghun .
2009 IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, PROCEEDINGS, 2009, :540-544
[9]   Enriching Documents with Examples: A Corpus Mining Approach [J].
Kim, Jinhan ;
Lee, Sanghoon ;
Hwang, Seung-Won ;
Kim, Sunghun .
ACM TRANSACTIONS ON INFORMATION SYSTEMS, 2013, 31 (01)
[10]  
Lijie Wang, 2011, 2011 26th IEEE/ACM International Conference on Automated Software Engineering, P592, DOI 10.1109/ASE.2011.6100133