Optimising the Fit of Stack Overflow Code Snippets into Existing Code

04/16/2020
by   Brittany Reid, et al.
0

Software developers often reuse code from online sources such as Stack Overflow within their projects. However, the process of searching for code snippets and integrating them within existing source code can be tedious. In order to improve efficiency and reduce time spent on code reuse, we present an automated code reuse tool for the Eclipse IDE (Integrated Developer Environment), NLP2TestableCode. NLP2TestableCode can not only search for Java code snippets using natural language tasks, but also evaluate code snippets based on a user's existing code, modify snippets to improve fit and correct errors, before presenting the user with the best snippet, all without leaving the editor. NLP2TestableCode also includes functionality to automatically generate customisable test cases and suggest argument and return types, in order to further evaluate code snippets. In evaluation, NLP2TestableCode was capable of finding compilable code snippets for 82.9 code snippets for 42.9

READ FULL TEXT

page 7

page 8

research
06/20/2018

Toxic Code Snippets on Stack Overflow

Online code clones are code fragments that are copied from software proj...
research
07/07/2020

From API to NLI: A New Interface for Library Reuse

Developers frequently reuse APIs from existing libraries to implement ce...
research
05/12/2023

Opti Code Pro: A Heuristic Search-based Approach to Code Refactoring

This paper presents an approach that evaluates best-first search methods...
research
07/22/2020

DeepClone: Modeling Clones to Generate Code Predictions

During software development, programmers often tend to reuse the code fo...
research
09/02/2021

APIzation: Generating Reusable APIs from StackOverflow Code Snippets

Developer forums like StackOverflow have become essential resources to m...
research
07/03/2019

Towards Automated Application-Specific Software Stacks

Software complexity has increased over the years. One common way to tack...
research
02/04/2020

Code Duplication on Stack Overflow

Despite the unarguable importance of Stack Overflow (SO) for the daily w...

Please sign up or login with your details

Forgot password? Click here to reset