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.