On the Utility of Marrying GIN and PMD for Improving Stack Overflow Code Snippets
Sherlock A. Licorish, Markus Wagner

TL;DR
This paper explores combining static analysis with automated program mutation to improve the quality of Stack Overflow Java snippets, demonstrating that such integration can effectively reduce code faults with minimal resources.
Contribution
It introduces a novel approach that marries static analysis (PMD) with automated code mutations (GIN) to enhance online code snippets, which has not been extensively studied before.
Findings
PMD detected performance faults in Stack Overflow snippets.
GIN successfully mutated code snippets, removing violations.
Automated mutations significantly reduced code faults with low resource use.
Abstract
Software developers are increasingly dependent on question and answer portals and blogs for coding solutions. While such interfaces provide useful information, there are concerns that code hosted here is often incorrect, insecure or incomplete. Previous work indeed detected a range of faults in code provided on Stack Overflow through the use of static analysis. Static analysis may go a far way towards quickly establishing the health of software code available online. In addition, mechanisms that enable rapid automated program improvement may then enhance such code. Accordingly, we present this proof of concept. We use the PMD static analysis tool to detect performance faults for a sample of Stack Overflow Java code snippets, before performing mutations on these snippets using GIN. We then re-analyse the performance faults in these snippets after the GIN mutations. GIN's RandomSampler…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software System Performance and Reliability · Software Reliability and Analysis Research
