2025-07-01
This release of Diffblue Cover enhances test generation for complex scenarios, particularly around error handling and mocking. This version also improves overall stability, strengthens the test generation sandbox, and introduces official support for Gradle 8.14.3.
Enhanced Test Generation & Mocking:
Exception Handling: Diffblue Cover now writes more comprehensive tests for exception handling, with new support for methods containing
catch
blocks and for methods that call superclass methods which throw exceptions.Mocking: Mocking behavior is now more predictable and reliable. This is due to a higher priority being given to the
@InTestMock
annotation and a fix for an issue that prevented test creation for some methods involvingverify
mock assertions.
Improved Stability & Sandboxing:
Stability: Overall stability has been improved by resolving several internal errors (
F009
) that could interrupt test creation.Sandboxing: The robustness of the sandbox has been enhanced to better prevent the execution of potentially harmful code during test generation.
Distribution & Compatibility:
Distribution: All release artifacts, including the CLI and plugins, are now published directly to the Diffblue Maven repository for easier download and integration.
Compatibility: Official support has been added for projects built using Gradle 8.14.3.
Enhancements
Diffblue Cover now officially supports Gradle version 8.14.3. This update ensures compatibility and allows Diffblue Cover to correctly write tests for projects built with the latest Gradle release. [Ref: TG-23473]
Diffblue now publish release artifacts, including the CLI, plugin, and Cover Reports, to the Diffblue Maven repository for direct download and integration. [Ref: TG-23290]
Diffblue Cover now writes tests using
DiffblueRules
factories and@InTestsMock
; the necessary parameters for the factory methods can now be omitted and will be automatically generated, streamlining advanced test creation. [Ref: TG-23236]Diffblue Cover now generates tests for methods containing
catch
blocks for unchecked exceptions. To trigger these error-handling paths, Diffblue Cover creates tests with mocked calls that are configured to throw the appropriate exceptions. [Ref: TG-23043]Diffblue Cover now gives higher priority to creating mocks when guided by the
@InTestMock
annotation withMockDecision.RECOMMENDED
. This also applies when no decision is specified, asRECOMMENDED
is the default, making annotation-based mocking more predictable. [Ref: TG-22843]
Resolved Issues
Resolved an issue that prevented test generation for some methods involving mocks. Diffblue Cover now successfully writes tests for these cases, which will include the relevant
verify
mock assertions. [Ref: TG-23449]Resolved an issue where Diffblue Cover would encounter an 'IllegalStateException: Recording is already in progress' error, leading to an F009 failure. Test generation will now continue successfully in these scenarios. [Ref: TG-23409]
Resolved an issue where the security manager sandbox could fail to prevent certain dangerous operations during test generation. Diffblue Cover's sandbox is now more robust, better preventing the execution of potentially harmful code while writing tests. [Ref: TG-23373]
Resolved an issue that could cause Diffblue Cover to fail with an F009 internal error when encountering a malformed exception during test generation. Cover now handles this situation gracefully, unblocking test creation for the affected code. [Ref: TG-23277]
Resolved an issue where Diffblue Cover would incorrectly discard tests involving exceptions from a superclass. Tests for methods that call superclass methods which throw exceptions are now correctly generated and asserted. [Ref: TG-22657]
Known Issues
Plugin: Diffblue Cover incorrectly displays a menu option to write tests for existing test files. [Ref: TG-17163]
Cover supports Open JDK and Oracle JDK; results with other JDKs may differ due to the variability in their implementations of Java. [Ref: TG-19345]
Reports: Cover only counts Java code towards the total line count metrics. Kotlin code is not currently included. [Ref: TG-22088]
Reports: Total lines of code metric can incorrectly count a multi-line comment at the end of a line of code, resulting in fewer than expected lines counted. [Ref: TG-22089]
Reports: Following an upgrade, the 'Total Lines of Code' card may show 0 until a new reports bundle has been uploaded. [Ref: TG-22094]
In some circumstances, Cover may write more simplistic tests with less meaningful assertions when Spring Boot dependency injection is disabled. [Ref: TG-22102]
In some circumstances, Cover will still write Spring Boot tests when Spring Boot dependency injection is disabled. [Ref: TG-22103]
Cover may write failing TestNG tests when Spring Boot dependency injection is disabled. [Ref: TG-22107]
Plugin: On some displays, the Test Review subsection title "Tests for review" can be malformed. [Ref: TG-22805]
Diffblue Cover does not currently support test creation for projects using Java 24; please use JDK 21 or lower. [Ref: TG-22920]
Last updated
Was this helpful?