Augmenting Diffs With Runtime Information

12/20/2022
by   Khashayar Etemadi, et al.
0

Source code diffs are used on a daily basis as part of code review, inspection, and auditing. To facilitate understanding, they are typically accompanied by explanations that describe the essence of what is changed in the program. As manually crafting high-quality explanations is a cumbersome task, researchers have proposed automatic techniques to generate code diff explanations. Existing explanation generation methods solely focus on static analysis, i.e., they do not take advantage of runtime information to explain code changes. In this paper, we propose Collector-Sahab, a novel tool that augments code diffs with runtime difference information. Collector-Sahab compares the program states of the original (old) and patched (new) versions of a program to find unique variable values. Then, Collector-Sahab adds this novel runtime information to the source code diff as shown, for instance, in code reviewing systems. As an evaluation, we run Collector-Sahab on 587 code diffs for Defects4J bugs and find it successfully augments the code diff for 90.6% (532/587) of them. We also perform a manual analysis on 29 code diffs from 10 real-world projects and conclude that Collector-Sahab generates correct, causally relevant, and understandable augmented diffs. Overall, our experiments show the effectiveness and usefulness of Collector-Sahab in augmenting code diffs with runtime difference information. Collector-Sahab: https://github.com/algomaster99/collector-sahab

READ FULL TEXT
research
11/10/2021

Counterfactual Explanations for Models of Code

Machine learning (ML) models play an increasingly prevalent role in many...
research
12/18/2018

Integrating Runtime Values with Source Code to Facilitate Program Comprehension

An inherently abstract nature of source code makes programs difficult to...
research
06/19/2018

Augmenting Source Code Lines with Sample Variable Values

Source code is inherently abstract, which makes it difficult to understa...
research
11/18/2019

Invariant Diffs

Software development is inherently incremental. Nowadays, many software ...
research
06/24/2021

An extended and more practical mwp flow analysis

We improve and refine a method for certifying that the values' sizes com...
research
09/20/2022

An Information-Theoretic and Contrastive Learning-based Approach for Identifying Code Statements Causing Software Vulnerability

Software vulnerabilities existing in a program or function of computer s...
research
09/18/2020

Out of Sight, Out of Place: Detecting and Assessing Swapped Arguments

Programmers often add meaningful information about program semantics whe...

Please sign up or login with your details

Forgot password? Click here to reset