Replacements and Replaceables: Making the Case for Code Variants

06/06/2020
by   Venkatesh Vinayakarao, et al.
0

There are often multiple ways to implement the same requirement in source code. Different implementation choices can result in code snippets that are similar, and have been defined in multiple ways: code clones, examples, simions and variants. Currently, there is a lack of a consistent and unambiguous definition of such types of code snippets. Here we present a characterization study of code variants - a specific type of code snippets that differ from each other by at least one desired property, within a given code context. We distinguish code variants from other types of redundancies in source code, and demonstrate the significant role that they play: about 25 discussions (in a set of nine open source projects) were about variants. We characterize different types of variants based on their code context and desired properties. As a demonstration of the possible use of our characterization of code variants, we show how search results can be ranked based on a desired property (e.g., speed of execution).

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/04/2018

Hygienic Source-Code Generation Using Functors

Existing source-code-generating tools such as Lex and Yacc suffer from p...
research
03/02/2021

Apples, Oranges Fruits – Understanding Similarity of Software Projects Through The Lens of Dissimilar Artifacts

The growing availability of open source projects has facilitated develop...
research
08/14/2009

View-based Propagator Derivation

When implementing a propagator for a constraint, one must decide about v...
research
01/06/2022

Source Code Anti-Plagiarism: a C# Implementation using the Routing Approach

Despite the approaches proposed so far, software plagiarism is still a p...
research
06/11/2020

Backdoors in Neural Models of Source Code

Deep neural networks are vulnerable to a range of adversaries. A particu...
research
11/09/2022

Representing LLVM-IR in a Code Property Graph

In the past years, a number of static application security testing tools...
research
07/20/2021

On the Interplay of Smells Large Class, Complex Class and Duplicate Code

Bad smells have been defined to describe potential problems in code, pos...

Please sign up or login with your details

Forgot password? Click here to reset