An Online Stack Overflow Code Recommender
Pooya Nikbakht, Amir Mahdi Nassiri

Stack Overflow Code Recommender

Abstract: Stack Overflow has become one of the main sources for developers to learn how to use different libraries, Application Programming Interfaces (APIs), and other programming concepts. Although Stack Overflow tries to rank the answers in a way that the more relevant ones are shown at top of the returned list, there are still many cases that the developers have to go through a large number of search results to find what they are really looking for, causing extra expenses in terms of both cost and time for the individuals and the companies that deal with developing software programs. Some tools such as Google Code Search, MAPO, and Strathcona have tried to re-rank the code snippets within the Stack Overflow answers, however, they have some shortages such as working only over certain projects, certain APIs, or certain programming languages, or being accessible only through a certain IDE (Integrated Development Environment). We have developed a desktop application, called SCoR (Stack-Overflow Code Recommender), that takes the user's Stack Overflow queries online, and outputs a ranked list of code snippets, while overcoming the aforementioned drawbacks.

Briefly speaking, SCoR takes the user's query together with some other inputs (through a graphical user interface), and then:

  1. collects the results of Stack~Overflow in real-time,

  2. extracts the code snippets and other features from all answers,

  3. ranks the collected code snippets based on the extracted features,

  4. clusters the similar answers into some groups, and

  5. recommends the clusters containing refined code snippets together with their related comments (if any) to the developer.

Our initial evaluations showed very promising results in terms of achieving a considerable amount of effort reduction for developers who seek for retrieving code snippets among Stack~Overflow's results to learn new libraries, APIs, or other programming-related concepts.

Project's Full Paper: Click Here

Project's Source Codes (GitLab): Click Here