In this paper, we propose an assertion-based approach to capture software evolution, through the notion of commit-relevant specification. A commit-relevant specification summarises the program properties that have changed as a consequence of a commit (understood as a specific software modification), via two sets of assertions, the delta-added assertions, properties that did not hold in the pre-commit version but hold on the post-commit, and the delta-removed assertions, those that were valid in the pre-commit, but no longer hold after the code change. We also present DeltaSpec, an approach that combines test generation and dynamic specification inference to automatically compute commit-relevant specifications from given commits. We evaluate DeltaSpec on two datasets that include a total of 57 commits (63 classes and 797 methods). We show that commit-relevant assertions can precisely describe the semantic deltas of code changes, providing a useful mechanism for validating the behavioural evolution of software. We also show that DeltaSpec can infer 88% of the manually written commit-relevant assertions expressible in the language supported by the tool. Moreover, our experiments demonstrate that DeltaSpec's inferred assertions are effective to detect regression faults. More precisely, we show that commit-relevant assertions can detect, on average, 78.3% of the artificially seeded faults that interact with the code changes. We also show that assertions in the delta are 58.3% more effective in detecting commit-relevant mutants than assertions outside the delta, and that it takes on average 169% fewer assertions when these are commit-relevant, compared to using general valid assertions, to achieve a same commit-relevant mutation score.
翻译:在本文中,我们提出一种基于断言的方法,通过承诺相关规格的概念来捕捉软件的演变。一个与承诺相关的规格,通过两套说法,即三角洲增加的断言、未在承诺前版本中持有但保留在承诺后阶段的属性,以及三角洲删除的断言,那些在承诺前阶段有效,但在代码修改后不再维持下去的主张,来捕捉软件的演变。我们还提出三角洲Spec,一种结合测试生成和动态规格的方法,以自动计算某项承诺的与承诺相关的规格。我们评估两套数据集的变化,其中包括总共57项承诺(63类和797种方法)。我们表明,承诺相关的断言可以准确描述代码变化的语义,为验证软件的行为演变提供了有用的机制。我们还表明,三角洲Spec公司可以将88 % 的手工书面承诺相关声明与被该工具支持的语言所显示的与承诺的与承诺相关的规格。此外,我们评估了两个数据集的数值,我们用更准确的数值来测量,我们用更准确的数值来显示,我们测测算的三角洲的直值的数值,我们用更准确的数值来测算的直值来测算。