Free HTML5 by November 2, 2016

Searching Stack Overflow for API-usage-related Bug Fixes Using Snippet-based Queries

Project-specific bugs are related to the misunderstanding or incomplete implementation of functional requirements. API-usage-related bugs are independent of the functional requirements. Usually they cause an unexpected and wrong output or behavior because of an incorrect usage of an API (Application Programming Interface).

We propose an approach to find fixes for API-usage-related bugs, which is based on matching snippets being debugged against related snippets in a Q&A website (Stack Overflow). We analyzed real code excerpts from OHLOH Code Search containing API method calls that may lead to API-usage-related bugs depending on how they are used by developers.

We conducted a study with these excerpts to verify to what extent the proposed approach provides proper information from Stack Overflow to fix these potential API-usage-related bugs. The results are encouraging: 66.67% of Java excerpts with potential API-usage-related bugs had their fixes found in the top-10 query results.

Considering JavaScript excerpts, fixes were found in the top-10 results for 40% of them. These results indicate that our approaches (i.e., lsab-java and lsab-js combined with the keyword filter) outperform Google and Stack Overflow in searching for API-usage-related bug fixes.