Towards Building API Usage Example Metrics
Authors:
- Stevche RadevskiSRStevche Radevski
- Hideaki HataHHHideaki Hata
- Kenichi MatsumotoKMKenichi Matsumoto
- 1 March 2016
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- Vol. 1, 619-623
Abstract
It is not unreasonable to say that examples are one of the most commonly used knowledge sources when learning the usage and best practices of a new API. That being said, in many cases the examples provided on the APIs' Web site are lacking in quantity or quality, so developers have to resort to other information sources, namely blogs and coding forums. Moreover, there is no good way for API developers to measure anything concerning the examples they are creating. In order to resolve the problem of lacking examples information and feedback in their creation, our goal is to develop metrics for empirical measurement of examples and to offer support during the APIs example creation steps, and this paper represents the starting point towards that aim. We have analyzed the source code examples provided on the API's Web site or GitHub directory for seven popular API libraries written in Java and measured certain metrics, such as example coverage, example code to source code ratio, class coverage percentage, and problems that occur with the compilation and execution of existing examples. The purpose of this paper is to investigate the current situation of examples and provide a starting knowledge base for building an automatic tool for source code example metrics analysis.Keywords
This publication has 12 references indexed in Scilit:
- Documenting APIs with examples: Lessons learned with the APIMiner platform2013
- What makes a good code example?: A study of programming Q&A in StackOverflow2012
- Synthesizing API usage examples2012
- APIExample: An effective web search based usage example recommendation system for java APIs2011
- Measuring API documentation on the web2011
- A field study of API learning obstaclesEmpirical Software Engineering, 2010
- Unit tests as API usage examples2010
- Two studies of opportunistic programming2009
- Composing Tests from Examples.The Journal of Object Technology, 2007
- Investigating reading techniques for object-oriented framework learningIEEE Transactions on Software Engineering, 2000