Track Your Test Coverage With Datadog RUM and Synthetic Monitoring | Datadog

Track your test coverage with Datadog RUM and Synthetic Monitoring

Author Thomas Sobolik
Author Hugo Puceat

Published: 8月 11, 2022

The modern standards of the web demand that user-facing applications be highly usable and satisfying. When deploying frontends, it’s important to implement a comprehensive testing strategy to ensure your customers are getting the best possible user experience. It can be difficult, however, to gauge the effectiveness of your test suite. For instance, all of your tests may be passing, but they might not cover a specific UI element that is crucial to a critical workflow.

Datadog Synthetic Monitoring and RUM address this challenge by enabling teams to build their testing suites based on real user data, helping answer the following questions:

  • What are the most critical workflows to test?
  • What workflows are currently untested, and how often do customers use them?
  • What percentage of user actions are covered by your testing?

In this post, we’ll show you how our new out-of-the-box test coverage dashboard can provide crucial insight to help you optimize your test suite and ensure your application’s most important workflows are covered.

Understand your test coverage

Datadog now leverages user actions, which are tracked by Datadog RUM, to assess your test coverage. A RUM action refers to a key interaction in your frontend, such as a button click or test input. You can also define and track custom actions, which contain strings of related actions that make up specific workflows, such as creating a profile, checking out from an e-commerce store, or recovering a lost password. Our new out-of-the-box dashboard enables you to easily compare the total number of actions and custom actions to the number of those covered by your Datadog Synthetic tests, so you can determine the overall effectiveness of your test suite.

See your test coverage in the new Test Coverage dashboard

The dashboard also visualizes how many tests cover your actions, as well as how many user interactions have been recorded overall. This data, which can be scoped to a specific time frame, can be used to alert you to issues such as test sprawl, in which you have a low percentage of covered actions but a large number of tests covering them. You can also use the included template variable to filter your dashboard’s data to isolate custom actions, which can help you gauge how efficiently you are testing your most critical workflows.

Identify untested workflows

If you discover that your test coverage is low, you can use the test coverage dashboard to view a list of all the untested actions in your environment, sorted by how frequently they are used. This way, you can quickly see which untested actions your users perform most often—and prioritize testing them.

Discover untested custom actions in the dashboard

The dashboard also shows a breakdown of test coverage for each of your application’s views, which can help you further determine where to focus your test development efforts. For instance, if you observe that a particular view has low test coverage, you can use template variables to scope the entire dashboard to the related actions and coverage metrics for that view. This way, you can determine which actions have slipped through the cracks.

Create new tests to expand coverage

Once you’ve found an action that needs to be tested, you can click on it in order to navigate directly to the test creation page (as shown in the screenshot below).

Pivot to create a new Synthetic test or view related RUM events

You can also pivot to RUM to view all of the events recorded for that action, which can provide useful insight into how your customers are interacting with the UI. For example, by viewing the Session Replays recorded for an action, you can spot bugs and better understand sources of user confusion.

Own your test coverage

By monitoring your Synthetic test coverage with Datadog, you can characterize the effectiveness of your test suite and identify key workflows that are overlooked in your testing. Test coverage monitoring is now generally available for all Datadog RUM and Synthetic Monitoring customers—see our documentation for more details. Or, if you’re brand new to Datadog, sign up for a to get started.