Creating partial tests
About partial tests
The test does not have assertions.
The test does not always pass when executed.
The Arrange or Act sections produce an error when executed.
The test may execute code that is potentially harmful to your system, leaks resources or times out.
Creating such tests is useful to developers for two reasons:
Firstly, it will save developers time. Instead of writing tests from scratch, they'll be able to use the partial tests as a starting point.
Secondly, it may help developers understand why Diffblue Cover was not able to complete the test automatically, especially in cases where the reason for not producing a test is lack of testability.
For example, for the method increment
in the following class:
Diffblue Cover will create a partial test:
The problem is clearly that Diffblue Cover has no opportunity to assert on the side effect of the increment
method on field x
, which is marked private
. The developer could add a getter to MyClass
:
Disabling the creation of partial tests
Last updated