---
title: "Retrieve unified test quality metrics for a workspace"
method: GET
path: "/workspaces/{workspace_id}/reports/testQuality"
tags: ["Report"]
---

# Retrieve unified test quality metrics for a workspace

`GET /workspaces/{workspace_id}/reports/testQuality`

Returns multiple quality dimensions for tests in a workspace over a specified time range.
V1 includes flake rate and breakage rate. Flakiness is calculated by grouping test runs
by execution context and identifying groups with mixed outcomes. Breakage rate measures
how often a test transitions from passing to failing between consecutive runs.

The summary statistics reflect ALL matching tests in the workspace, while the
tests array is paginated. Use the cursor parameter to fetch additional pages.

## Path parameters

- `workspace_id` string, required

## Query parameters

- `start_time` integer, required
- `end_time` integer, required
- `application_id` string
- `plan_id` string
- `environment_id` string
- `test_id` string
- `test_type` 'api' | 'browser' | 'performance' | 'mobile' — Type of test
- `browser` string
- `execution_source` 'mabl_cloud' | 'external' | 'mabl_local' | 'mabl_agent' — Where the test lives
- `plan_labels` string[]
- `sort_by_stability` boolean
- `min_plan_runs` integer
- `limit` integer
- `cursor` string

## Response `200`

Unified test quality metrics for the specified time range

- TestQualityResult — Unified test quality metrics for a workspace over a time range
  - `workspace_id` string — ID of the workspace
  - `interval_start` integer — Starting time of the reporting window in epoch milliseconds
  - `interval_end` integer — Ending time of the reporting window in epoch milliseconds
  - `summary` TestQualitySummary — Aggregate quality statistics across ALL matching tests (not limited by pagination)
    - `total_tests` integer — Total number of tests matching the filters with sufficient data in the time range
    - `flaky_tests` integer — Number of tests with any flakiness (flake_rate > 0)
    - `tests_above_flakiness_threshold` integer — Number of tests with flake_rate >= 10%
    - `average_flake_rate` number, double — Average flake rate across all tests (0.0 to 1.0)
    - `total_flaky_plan_runs` integer — Total number of plan runs with mixed outcomes across all tests
    - `breakage_tests` integer — Number of tests with any breakage (breakage_rate > 0)
    - `average_breakage_rate` number, double — Average breakage rate across all tests (0.0 to 1.0)
    - `total_pass_to_fail_transitions` integer — Total number of pass-to-fail transitions across all tests
    - `average_stability_rate` number, double — Average stability rate across all tests (0.0 to 1.0). Stability = 1 - flake_rate.
    - `average_reliability_rate` number, double — Average reliability rate across all tests (0.0 to 1.0). Reliability = 1 - breakage_rate.
    - `average_quality_score` number, double — Average composite quality score across all tests (0 to 100).
  - `tests` TestQualityItem[] — List of tests with their quality metrics, ordered by quality score ascending then flake rate descending
    - `test_id` string — The test's invariant ID
    - `total_plan_runs` integer — Total number of plan runs that included this test in the time range. Capped at the per-test analysis limit; see runs_capped.
    - `runs_capped` boolean — True if this test had more runs than the per-test analysis limit in the time range, so its metrics (including total_plan_runs and the transition counts) reflect only the most recent runs rather than the full history. False when the full history was analyzed.
    - `flake_rate` number, double — True flake rate (0.0 to 1.0). Calculated as flaky_plan_runs / total_plan_runs.
    - `flaky_plan_runs` integer — Number of plan runs with mixed outcomes (both passes and fails)
    - `consistent_pass_runs` integer — Number of plan runs where all attempts passed
    - `consistent_fail_runs` integer — Number of plan runs where all attempts failed
    - `last_flaky_time` integer — Timestamp of the most recent flaky plan run in epoch milliseconds. Null if no flaky runs.
    - `breakage_rate` number, double — Breakage rate (0.0 to 1.0). Calculated as pass_to_fail_transitions / passing_plan_runs.
    - `passing_plan_runs` integer — Number of plan runs where the previous run was passing (opportunities to break)
    - `pass_to_fail_transitions` integer — Number of times this test went from passing to failing between consecutive runs
    - `fail_to_pass_transitions` integer — Number of times this test went from failing to passing between consecutive runs
    - `last_breakage_time` integer — Timestamp of the most recent pass-to-fail transition in epoch milliseconds. Null if no breakages.
    - `pass_rate` number, double — Pass rate (0.0 to 1.0). Fraction of plan runs where all attempts passed.
    - `stability_rate` number, double — Stability rate (0.0 to 1.0). Calculated as 1 - flake_rate. Higher is better.
    - `reliability_rate` number, double — Reliability rate (0.0 to 1.0). Calculated as 1 - breakage_rate. Higher is better.
    - `quality_score` integer — Composite quality score (0-100). Geometric mean with aggressive exponents, calculated as round(100 * pass_rate^1.2 * stability_rate^1.0 * reliability_rate^0.9).
  - `cursor` string — Cursor for fetching the next page of results. Null if no more results.

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `default` — Unexpected error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
