论文标题
Bluecov:与JBMC集成测试覆盖范围和模型检查
BlueCov: Integrating Test Coverage and Model Checking with JBMC
论文作者
论文摘要
自动测试案例生成工具可帮助企业编写测试,并增加对代码更改时高回归测试覆盖的安全网。测试生成需要尽可能多地覆盖未发现的代码,同时避免生成现有测试套件已经涵盖的代码的冗余测试。 在本文中,我们介绍了用于将正式分析与自动测试案例生成整合的现实世界应用工具的工作。测试案例生成基于使用Java有限模型检查器(JBMC)的覆盖范围分析。模型检查器的反示例可将其转换为具有特定参数的Java方法调用。 为了避免产生冗余测试,有必要以与JBMC生成其覆盖目标完全相同的方式测量覆盖范围。每个现有的覆盖范围测量工具都使用略有不同的仪器,从而使用不同的覆盖标准。这使基于正式分析的测试案例生成器的集成变得困难。因此,我们开发了BlueCov作为特定的运行时覆盖范围测量工具,该工具使用与JBMC完全相同的覆盖标准。这种方法还允许生成增量的测试案例,仅生成先前未经测试的代码(例如,完成现有测试套件)的测试覆盖范围。
Automated test case generation tools help businesses to write tests and increase the safety net provided by high regression test coverage when making code changes. Test generation needs to cover as much as possible of the uncovered code while avoiding generating redundant tests for code that is already covered by an existing test-suite. In this paper we present our work on a tool for the real world application of integrating formal analysis with automatic test case generation. The test case generation is based on coverage analysis using the Java bounded model checker (JBMC). Counterexamples of the model checker can be translated into Java method calls with specific parameters. In order to avoid the generation of redundant tests, it is necessary to measure the coverage in the exact same way as JBMC generates its coverage goals. Each existing coverage measurement tool uses a slightly different instrumentation and thus a different coverage criterion. This makes integration with a test case generator based on formal analysis difficult. Therefore, we developed BlueCov as a specific runtime coverage measurement tool which uses the exact same coverage criteria as JBMC does. This approach also allows for incremental test-case generation, only generating test coverage for previously untested code, e.g., to complete existing test suites.