Alharbi, Seham, Kolovos, Dimitris orcid.org/0000-0002-1724-6563 and Matragkas, Nicholas (2024) Towards Generating Maintainable and Comprehensible API Code Examples. In: Proceedings - 2024 IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2024. 31st IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2024, 12-15 Mar 2024 Proceedings - 2024 IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2024 . Institute of Electrical and Electronics Engineers Inc. , FIN , pp. 830-834.
Abstract
One of the most effective resources for learning application programming interfaces (APIs) is code examples. The shortage of such examples can pose a significant learning obstacle for API users. API users desire simple, understandable, self-contained examples that are easy to reuse in their applications. However, writing and maintaining code examples that meet the preferences of API users can be a tedious and repetitive activity for API developers. To address this issue, we present a new approach that aims to ease the writing and maintenance of code examples for API developers, while also improving learnability and comprehension for API users. The approach automatically synthesises linear and more comprehensible API code examples from less repetitive and more maintainable versions by inlining reusable utility methods. We implement this approach in a prototype for the Java programming language. We also evaluate its usefulness in terms of conciseness on a dataset of 600 API code examples extracted from nine open-source Java libraries. The results are encouraging and show that the proposed approach can reduce code repetition and bring a decrease of up to 37% in the lines of code of the evaluated API code examples.
Metadata
Item Type: | Proceedings Paper |
---|---|
Authors/Creators: |
|
Copyright, Publisher and Additional Information: | Publisher Copyright: © 2024 IEEE. This is an author-produced version of the published paper. Uploaded in accordance with the University’s Research Publications and Open Access policy. |
Keywords: | APIs,code examples,software maintainability |
Dates: |
|
Institution: | The University of York |
Academic Units: | The University of York > Faculty of Sciences (York) > Computer Science (York) |
Depositing User: | Pure (York) |
Date Deposited: | 23 Oct 2024 08:30 |
Last Modified: | 21 Nov 2024 00:22 |
Published Version: | https://doi.org/10.1109/SANER60148.2024.00090 |
Status: | Published |
Publisher: | Institute of Electrical and Electronics Engineers Inc. |
Series Name: | Proceedings - 2024 IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2024 |
Identification Number: | 10.1109/SANER60148.2024.00090 |
Related URLs: | |
Open Archives Initiative ID (OAI ID): | oai:eprints.whiterose.ac.uk:218769 |
Download
Filename: SANER_2024_Conference_Paper_ERA_.pdf
Description: SANER_2024_Conference_Paper__ERA_
Licence: CC-BY 2.5