Invariant Diffs

11/18/2019
by   Ashwin Kallingal Joshy, et al.
0

Software development is inherently incremental. Nowadays, many software companies adopt an agile process and a shorter release cycle, where software needs to be delivered faster with quality assurances. On the other hand, the majority of existing program analysis tools still target single versions of programs and are slow and inflexible to handle changes. In the popular version control systems such as git, the program changes are still presented using source code diffs. It is hard to understand what program conditions are changed and which source code lines cause them. In this paper, we propose to compute "invariant diffs" to specify changes. Similar to source diffs that report common code and code churns, we define version invariants to represent program conditions that are common across versions, and invariant churns to show the changes of program conditions between versions. We designed a static demand-driven, path-sensitive analysis to compute and compare invariants for multiple versions of programs using multiversion control flow graphs. We report invariant diffs at the matched program points where comparing invariants are meaningful. Importantly, our analysis correlates source diffs with invariant diffs to explain what source code changes lead to the property changes. We implemented our algorithms in a tool called H_2 and performed experiments on 104 versions of programs. Our results show that we are able to compute invariant diffs correctly within reasonable amount of time. The version invariants can capture the common properties of program versions even constructed by different persons, and the invariant churns can specify the semantics of changes such as how a patch changed a buggy condition to a correct condition.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/28/2019

A Counterexample-guided Approach to Finding Numerical Invariants

Numerical invariants, e.g., relationships among numerical variables in a...
research
03/14/2019

Are My Invariants Valid? A Learning Approach

Ensuring that a program operates correctly is a difficult task in large,...
research
06/27/2019

Invariant Detection with Program Verification Tools

Compilers can specialize programs having invariants for performance impr...
research
08/04/2017

BDCI: Behavioral Driven Conflict Identification

Source Code Management (SCM) systems support software evolution by provi...
research
10/24/2022

Scalable Program Clone Search Through Spectral Analysis

We consider the problem of program clone search, i.e. given a target pro...
research
12/20/2022

Augmenting Diffs With Runtime Information

Source code diffs are used on a daily basis as part of code review, insp...
research
08/27/2018

AutoFrame: Automatic Frame Inference for Object-Oriented Languages

Automatic program verification has made tremendous strides, but is not y...

Please sign up or login with your details

Forgot password? Click here to reset