Diffblue Cover Replay

Shift more tests left to accelerate development

The code isn’t always enough

Diffblue Cover Replay uses existing functional tests and live runtime behavior to automatically create new unit tests for data-driven code and applications, and applications with complex internal states.

Some code is difficult to unit test effectively because the way it behaves at runtime depends on variables which can’t easily be inferred from the code itself. Using functional (or end-to-end) tests instead is a common approach, but compared to unit tests they’re unwieldy, slow, and identify issues too late in the development process.

Cover Replay helps to solve this problem. It instruments your application to capture the information needed to write effective unit tests that validate real-world application behavior. No matter how complex your code is, if you can record an execution that covers a method, you can extract a test for that method. Testing automatically becomes faster and more effective without any changes to your code.

Increase unit test coverage

Cover Replay provides the information needed for Cover Core to automatically write new unit tests that improve overall software qualty and help you meet coverage gates.

Reduce regressions and risk

Shifting more testing left means you can find and fix regressions sooner, and more easily. Some behavior captured by Cover Replay may never have been tested before - even later in the process.

Speed up software delivery

The closer you get to production, the harder and slower effective testing becomes. That’s the point of shift left and power of unit testing. Cover Replay accelerates software delivery by reducing the time spent on QA.

Go beyond the happy path

Cover Replay gives you the means to identify and unit test a range of runtime scenarios that might not otherwise be thought of, reducing the risk of change even further. 

Fit your workflow

Like most features of Diffblue Cover, Cover Replay can be used locally by a developer (e.g. on their laptop) or integrated into a CI pipeline for more predictable, repeatable, low-effort unit testing.

How It Works

Cover Replay instruments your application and captures actual runtime code behavior - typically via functional, integration or end-to-end tests - which provides Cover Core with the information needed to automatically write more unit tests.

Cover Replay Example

The Netflix-Graph project uses graphs to represent a database. The method getConnection requires a NFBuildGraph object, which in turn depends on the NFGraphSpec object, which represents a database schema. A complete unit test for this complex chain of objects cannot be created by code analysis alone. Without Cover Replay, Diffblue Cover was able to write this test:

Using Replay, a much more comprehensive unit test can be written automatically because Diffblue Core can now see all the objects required to write the test:

Ready to try Diffblue Cover?

Try free for 14 days

FAQs

What is Diffblue Cover?

Diffblue Cover creates suites of unit tests that run in your continuous integration pipeline between versions and protect against regressions, so you can catch errors faster and earlier in the software development lifecycle. To learn more, see our our product page.

What are the benefits of using Diffblue Cover?

Diffblue Cover helps your team increase automation of your CI pipeline.

For development teams, this:

  • improves velocity and quality of the software you deliver
  • frees up time to focus on creating new features

For DevOps teams, this:

  • helps catch errors and issues earlier (shift left!)
  • improves deployment frequency, lead time, and mean time to repair (MTTR)

Will the tests find regressions in my code?

Yes. Diffblue Cover quickly generates tests that will allow you to adopt CI. The generated tests will help developers quickly identify regressions in subsequent commits before committing new versions.

What are the requirements for running Diffblue Cover?

See the product datasheet for more information.

How can I learn more about customers using Diffblue Cover?

See our case study on how Goldman Sachs has benefited from using Diffblue Cover to increase coverage and create a safety net against regressions.

For example of other ways our customers use Diffblue Cover, click here.

How do we maintain Diffblue unit tests in the future?

Diffblue regression suites are maintained automatically and updated with each new code version to capture the current behavior of the code.

How does Diffblue Cover help me adopt Continuous Integration?

Diffblue Cover AI analyzes your code and writes Java unit tests that run in a CI pipeline after each commit. Cover’s tests:

  • Always compile
  • Run quickly
  • Detect regressions from previous versions
  • Improve coverage
  • Are easy to understand

Should our team stop writing unit tests after adopting Diffblue Cover?

No. Diffblue Cover is meant to complement your own unit tests and help you catch regressions.

How is a unit test different from a Diffblue regression suite?

Developers write individual unit tests to test specific functionality. Diffblue regression suites are generated automatically to help find regressions early in the development cycle. Find out more in our Unit Regression Tests eBook.