A study of the effectiveness of usage examples in REST API documentation

Generating and maintaining REST API documentation with usage examples can be a time consuming and expensive process for evolving APIs. Most REST API documentation tools focus on automating the documentation of the API objects, but require manual effort for capturing usage examples. Consequently, REST API developers need to know the cost vs. benefit of providing usage examples in the documentation to prioritize the documentation efforts. To this end, we have performed a controlled study with 26 experienced software engineers to understand problems that REST API client developers face while using an API without usage examples. We found that REST API client developers face productivity problems with using correct data types, data formats, required HTTP headers and request body when documentation lacks usage examples. By following the REST API documentation suggestions from this paper, REST API developers can reduce the errors, improve success rate and satisfaction of API client developers.

[1]  Brad A. Myers,et al.  Improving API documentation using API usage information , 2009, 2009 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC).

[2]  Christoph Treude,et al.  Augmenting API Documentation with Insights from Stack Overflow , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[3]  Lu Fang,et al.  An Exploratory Study of API Usage Examples on the Web , 2012, 2012 19th Asia-Pacific Software Engineering Conference.

[4]  Avinash C. Kak,et al.  Some structural measures of API usability , 2015, Softw. Pract. Exp..

[5]  Manfred Tscheligi,et al.  Methods towards API Usability: A Structural Analysis of Usability Problem Categories , 2012, HCSE.

[6]  Seung-won Hwang,et al.  Adding Examples into Java Documents , 2009, 2009 IEEE/ACM International Conference on Automated Software Engineering.

[7]  Frank Maurer,et al.  What makes a good code example?: A study of programming Q&A in StackOverflow , 2012, 2012 28th IEEE International Conference on Software Maintenance (ICSM).

[8]  Stefan Hanenberg,et al.  How do API documentation and static typing affect API usability? , 2014, ICSE.

[9]  Martin P. Robillard,et al.  How API Documentation Fails , 2015, IEEE Software.

[10]  Martin P. Robillard,et al.  What Makes APIs Hard to Learn? Answers from Developers , 2009, IEEE Software.

[11]  RamaGirish Maskeri,et al.  Some structural measures of API usability , 2015 .

[12]  Martin P. Robillard,et al.  Asking and answering questions about unfamiliar APIs: An exploratory study , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[13]  eva Kühn,et al.  Automated measurement of API usability: The API Concepts Framework , 2015, Inf. Softw. Technol..

[14]  Umer Farooq,et al.  API usability peer reviews: a method for evaluating the usability of application programming interfaces , 2010, CHI.

[15]  Hewijin Christine Jiau,et al.  Facing up to the inequality of crowdsourced API documentation , 2012, SOEN.

[16]  Martin P. Robillard,et al.  A field study of API learning obstacles , 2011, Empirical Software Engineering.

[17]  SchellerThomas,et al.  Automated measurement of API usability , 2015 .

[18]  Sae Young Jeong,et al.  Studying the Documentation of an API for Enterprise Service-Oriented Architecture , 2010, J. Organ. End User Comput..

[19]  Frank Maurer,et al.  Unit tests as API usage examples , 2010, 2010 IEEE International Conference on Software Maintenance.