Cover Refactor: Getting Started
Diffblue Cover Refactor makes your code more testable. It provides refactoring patches to your code that allow Diffblue Cover to create more and better tests for your code.
To use the Diffblue Cover Refactor feature, you need an appropriate license. Further installation details can be found here.
Using Cover Refactor
Diffblue Cover reports Output Codes when running
dcover create. Each of these output codes identifies a potential issue with your environment or your code base, which could potentially be fixed automatically. Performing these fixes is the purpose of Diffblue Cover Refactor.
dcover createon a module, a file
refactorings.ymlis stored in the
.diffbluedirectory of the module. This file contains a description of the refactorings that Diffblue Cover Refactor can perform on your code base.
dcover refactorapplies these refactorings to your code base. You can view the code changes performed by Diffblue Cover Refactor using
git diffand commit them to your code base if you are satisfied with them.
If you run
dcover createagain after recompiling your project, Diffblue Cover will take into account the refactorings made, potentially producing more and better tests for your code base.
Note: Steps 1 and 2 can be performed jointly using
dcover create --refactor.
Diffblue Cover Refactor currently only supports Maven projects. Gradle support will be provided soon.
Diffblue Cover Refactor currently only supports Java 8 and 11 projects. Java 17 support will be provided soon.
Diffblue Cover Refactor currently only supports the refactoring of R002. We will extend the support to refactorings of further output codes.