APIMiner Automatically Adds Examples To Android Docs
Written by Alex Armstrong   
Tuesday, 17 September 2013

APIMiner has just reached version 2.0, and if you don't know about it you might be missing out on a useful tool and a really good idea. 

When you are documenting an API the least you can do is to list the classes, methods and properties. Each method also needs to have its parameters documented and JavaDoc is a good way to make your code more or less autodocumenting. But... wouldn't it be nice to add an example of the use of each of the API methods?  

The big problem is that it takes time to find examples - a lot of time if the API you are documenting is a large one - like the Android API. This is where APIMiner comes in. It will automatically add an example taken from the code that implements or uses the API. 

It scans through the API and makes a list of methods. It then scans a code repository to find uses of the methods. It then finds a block of code that shows the method in use and picks the best from all such examples. Finally, it inserts the examples into the JavaDoc.

 

apiminer1

 

At the moment APIMiner has only been applied to the Android API and you can use it either as a website or as an add-on to either Eclipse or Android Studio. In either case what you get is the usual JavaDoc plus a button that shows you an example of the method's use if you click on it.

 

apiminerexample

 

APIMiner seems like a good idea, although carefully created documentation is still going to be a better option in all cases. It is a shame that currently it has only been applied to Android documentation. Perhaps the solution would be to turn it into an open source project. Currently the system is developed and maintained by the Applied Software Engineering Research Group (ASERG) of the Department of Computer Science, at the Federal University of Minas Gerais, Brazil, and is the product of work for an MSc thesis. 

 

apiminericon

More Information

APIMiner

Documenting APIs with Examples: Lessons Learned with the APIMiner Recommendation Tool

Related Articles

Unit Testing - The Advantages

Eclipse Kepler - The New Eclipse

NetBeans 7.4 Beta Released

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.

 

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info

 

 

Banner


Run WebAssembly Components Inside Node.js With Jco
28/03/2024

Jco 1.0 has been just announced by the Bytecode Alliance.It's a native JavaScript WebAssembly toolchain and runtime that runs Wasm components inside Node.js. Why is that useful?



The University of Tübingen's Self-Driving Cars Course
22/03/2024

The recorded lectures and the written material of a course on Self-Driving Cars at the University of Tübingen have been made available for free. It's a first class opportunity to learn the in an [ ... ]


More News

Last Updated ( Tuesday, 17 September 2013 )