arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1911.07988cs.SE
收藏

不变差

Invariant Diffs

Ashwin Kallingal Joshy, Wei Le

摘要:

软件开发本质上是增量的。如今,许多软件公司采用敏捷过程和更短的发布周期,软件需要在质量保证的情况下更快地交付。另一方面,大多数现有的程序分析工具仍然针对程序的单个版本,并且处理变化缓慢且不灵活。在流行的版本控制系统中,如git,程序更改仍然使用源代码差异来表示。很难理解哪些程序条件发生了变化,以及哪些源代码行导致了这些变化。在本文中,我们建议计算“不变的差异”,以指定的变化。与报告常见代码和代码扰动的源差异类似,我们定义了版本不变量来表示版本之间常见的程序条件,以及不变的扰动来显示版本之间程序条件的变化。我们设计了一个静态的需求驱动,路径敏感的分析计算和比较不变量的多版本的程序使用多版本控制流图。我们报告不变的差异在匹配的程序点比较不变量是有意义的。重要的是,我们的分析将源代码差异与不变差异相关联,以解释源代码更改导致属性更改的原因。我们实现了我们的算法在一个工具称为$H_2$和104个版本的程序进行实验。我们的研究结果表明,我们能够在合理的时间内正确计算不变的差异。版本不变量可以捕获甚至由不同的人构造的程序版本的共同属性,并且不变量搅动可以指定更改的语义,例如补丁如何将错误条件更改为正确条件。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑