Using Stack Overflow content to assist in code review
Authors:
Open Access
- 27 May 2019
- journal article
- research article
- Published by Wiley in Software: Practice and Experience
- Vol. 49 (8) , 1255-1277
Abstract
Summary: An essential goal for programmers is to minimize the cost of identifying and correcting defects in source code. Code review is commonly used for identifying programming defects. However, manual code review has some shortcomings: (1) it is time‐consuming and (2) outcomes are subjective and depend on the skills of reviewers. An automated approach for assisting in code reviews is thus highly desirable. We present a tool for assisting in code review and results from our experiments evaluating the tool in different scenarios. The tool leveraged content available from professional programmer support forums (eg, StackOverflow.com) to determine potential defectiveness of a given piece of source code. The defectiveness is expressed on the scale of {Likely defective, neutral, unlikely to be defective}. The basic idea employed in the tool is (1) to identify a set P of discussion posts on Stack Overflow such that each p∈P contains source code fragment(s), which sufficiently resemble the input code C being reviewed, and (2) to determine the likelihood of C being defective by considering all p∈P. A novel aspect of our approach is to use document fingerprinting for comparing two pieces of source code. Our choice of document fingerprinting technique is inspired by source code plagiarism detection tools where it has proven to be very successful. In the experiments that we performed to verify the effectiveness of our approach, source code samples from more than 300 GitHub open‐source repositories were taken as input. An F1 score of 0.94 has been achieved in identifying correct/relevant results.Keywords
All Related Versions
This publication has 22 references indexed in Scilit:
- Intuition vs. Truth: Evaluation of Common Myths about StackOverflow Posts2015
- Mining StackOverflow to turn the IDE into a self-confident programming prompter2014
- Jumping NLP Curves: A Review of Natural Language Processing Research [Review Article]IEEE Computational Intelligence Magazine, 2014
- The Stanford CoreNLP Natural Language Processing Toolkit2014
- Analysis of the reputation system and user contributions on a question answering website2013
- An empirical study on developer interactions in StackOverflow2013
- Typestate-based semantic code search over partial programsACM SIGPLAN Notices, 2012
- Parseweb2007
- Winnowing2003
- Some conservative stopping rules for the operational testing of safety critical softwareIEEE Transactions on Software Engineering, 1997