Visualizing API usage examples at scale
Proceedings of the 2018 CHI Conference on Human Factors in Computing Systems, 2018•dl.acm.org
Using existing APIs properly is a key challenge in programming, given that libraries and
APIs are increasing in number and complexity. Programmers often search for online code
examples in Q&A forums and read tutorials and blog posts to learn how to use a given API.
However, there are often a massive number of related code examples and it is difficult for a
user to understand the commonalities and variances among them, while being able to drill
down to concrete details. We introduce an interactive visualization for exploring a large …
APIs are increasing in number and complexity. Programmers often search for online code
examples in Q&A forums and read tutorials and blog posts to learn how to use a given API.
However, there are often a massive number of related code examples and it is difficult for a
user to understand the commonalities and variances among them, while being able to drill
down to concrete details. We introduce an interactive visualization for exploring a large …
Using existing APIs properly is a key challenge in programming, given that libraries and APIs are increasing in number and complexity. Programmers often search for online code examples in Q&A forums and read tutorials and blog posts to learn how to use a given API. However, there are often a massive number of related code examples and it is difficult for a user to understand the commonalities and variances among them, while being able to drill down to concrete details. We introduce an interactive visualization for exploring a large collection of code examples mined from open-source repositories at scale. This visualization summarizes hundreds of code examples in one synthetic code skeleton with statistical distributions for canonicalized statements and structures enclosing an API call. We implemented this interactive visualization for a set of Java APIs and found that, in a lab study, it helped users (1) answer significantly more API usage questions correctly and comprehensively and (2) explore how other programmers have used an unfamiliar API.
ACM Digital Library