Quick revision
The short answer
Every pipeline uploads its results in one standard format, JUnit XML, which both TestNG and JUnit builds produce, to a central store together with the repository, commit, branch and pipeline stage. On top of that we build dashboards of failures, flaky tests, durations and skips per repository and owning team, alert on growing skips and slow tests rather than only on failures, and feed the data into test selection and quarantine. Data retention stays reasonable, and we avoid personal performance metrics, which encourage gaming.
What to remember
In this answer, we designed a central system for test results from 100 repositories: one standard format, JUnit XML, uploaded by a shared CI step with repository, commit, branch and stage, parsed into one row per execution in an analytical store, and shown in a few dashboards of failures, flaky tests, durations and skips by owning team. We alerted on growing skips, slowing suites and dropping test counts, fed the data into quarantine and test selection, kept retention limited, and refused to build per-person metrics that encourage gaming.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Every pipeline uploads its results in one standard format, JUnit XML, which both TestNG and JUnit builds produce, to a central store together with the repository, commit, branch and pipeline stage. On top of that we build dashboards of failures, flaky tests, durations and skips per repository and owning team, alert on growing skips and slow tests rather than only on failures, and feed the data into test selection and quarantine. Data retention stays reasonable, and we avoid personal performance metrics, which encourage gaming.
Why this question is asked
With 100 repositories, test results are scattered across 100 pipelines, and each one is only looked at when it is red. That means nobody can answer simple questions: which tests are flaky, which suites are getting slower, which teams have hundreds of skipped tests nobody noticed. Interviewers ask this design question because it is about turning existing data into decisions, and because the human side, what we measure and how people react to it, matters as much as the plumbing. In this answer, we will choose the format, design the collection and storage, decide what to show and what to alert on, connect the data to selection and quarantine, and finish with retention and the metrics we deliberately do not build.
1One Format: JUnit XML
The first decision is the format, and it is an easy one. The JUnit XML report format is the common language of test tooling: Maven Surefire and Failsafe write it for both JUnit and TestNG runs, Gradle writes it for every framework it runs, TestNG can produce it itself, and every CI server can read it. It describes each test case with its class, name, duration, and whether it failed, errored or was skipped, with the message.
Notice that durations and skips are already in the file. We do not need any new instrumentation in the tests, only a rule that every pipeline keeps these files and uploads them.
2Collecting and Storing the Results
Each pipeline gets a final step, provided as a shared CI template so teams add one line, that uploads the XML files together with context the XML does not contain: repository, commit, branch, pipeline stage, CI job id, start time and whether this was a rerun. The step runs even when tests fail, which is the case we care about most.
The receiving service parses the files into rows, one per test execution, and stores them in an analytical database or a data warehouse. At 100 repositories with, say, 3,000 tests each and 20 runs a day, that is about 6 million rows a day, which is ordinary for a columnar store and too much for a spreadsheet. The owner of each test is derived from the repository and package through the same ownership file used for code review, so the data can be grouped by team without adding anything to the tests.
- Builds in 100 repositoriesSurefire, Gradle, TestNG write JUnit XML
- Shared CI upload stepadds repo, commit, branch, stage, rerun flag
- Ingestion serviceparses XML into one row per test execution
- Analytical storeabout 6 million rows a day, 90 days of detail
- Dashboards and alertsfailures, flaky tests, durations, skips
- Consumersquarantine, test selection, team reviews
6 layers, from the top down. Step through them one at a time.
3What the Dashboards Show
We build a few views and resist building many. The first is failures by repository and team on the main branch, since failures on feature branches are mostly normal work in progress. The second is flaky tests: a test that both passed and failed on the same commit is flaky by definition, so the data identifies them automatically, ranked by how often they disrupt pipelines. The third is durations: the slowest tests and suites and how their time changes week by week. The fourth is skips: how many tests are skipped per repository and why, since a skipped test protects nothing.
Each view is filtered by owning team by default, so a team lead sees their own list of work first, and the company-wide view sums it up for leadership.
4Alerting on Trends, Not Just Failures
A failing build already alerts its author, so the central system adds value by alerting on what nobody notices otherwise. Skips that grow, for example a repository that went from 10 skipped tests to 300 in a week, usually mean a broken setup method or a failed dependency chain. Tests that get slower, such as a suite whose 90th percentile duration rose by 40 percent in a month, show creeping cost before it becomes a four-hour pipeline. A test count that drops sharply usually means tests stopped being discovered. These alerts go to the owning team's channel with a link to the evidence, not to a central inbox.
| Signal | Typical cause | Action |
|---|---|---|
| Pass and fail on the same commit | Flaky test | Quarantine, assign owner |
| Skips grow sharply | Broken setup or dependency chain | Alert the owning team |
| Test count drops | Tests no longer discovered | Alert, compare with last build |
| p90 duration up 40 percent | Slow test or environment | Add to the team's review |
| Test never fails in a year | Low value or duplicate | Candidate for deletion |
5Feeding Selection and Quarantine
The same data drives two processes. Quarantine uses the flaky-test detection to move a test into a non-blocking group within a day and open a ticket for its owner, with the failure history attached. Test selection uses historical results and durations: which tests tend to fail for changes in which modules, and how long each takes, so a pull request stage can run the most informative tests first and balance shards by real durations. Without central data, both processes would rely on guesswork.
6Retention and Metrics We Do Not Build
We keep detailed rows for a limited period, for example 90 days, which covers trends and flakiness analysis, and keep aggregates such as daily counts per repository for a few years. Full failure messages and logs can contain test data, so they get the shortest retention and are never copied into broader analytics.
We also decide what not to measure. A dashboard of tests written per engineer, failures caused per person, or coverage per developer turns quality data into a performance review, and people respond predictably: they write trivial tests, avoid touching risky code, or mark failing tests as skipped. So the data is grouped by repository and team, used to find work, and never used to rank individuals.
7Follow-up questions
Why not use a commercial test analytics product?
That can be a good choice, and many CI vendors offer one. The design stays the same: a standard format, context attached at upload, flaky detection, trends and alerts. Building or buying is a cost decision; what matters is that every repository uploads consistently and that the data is connected to ownership.
How do you get 100 repositories to upload?
By making it one line: a shared CI template or a step in the common pipeline library, rolled out by the platform team. We publish which repositories report and which do not, and once the dashboards are useful, teams ask for it themselves.
How do you handle tests renamed or moved between classes?
History is keyed by class and method name, so a rename starts a new history. For most purposes that is acceptable. For flaky tracking, we can match on a stable test id if the framework provides one, or simply accept that a renamed flaky test is re-detected within a few runs.
8Conclusion
In this answer, we designed a central system for test results from 100 repositories: one standard format, JUnit XML, uploaded by a shared CI step with repository, commit, branch and stage, parsed into one row per execution in an analytical store, and shown in a few dashboards of failures, flaky tests, durations and skips by owning team. We alerted on growing skips, slowing suites and dropping test counts, fed the data into quarantine and test selection, kept retention limited, and refused to build per-person metrics that encourage gaming.
Open with
I would standardise on JUnit XML, because Surefire, Failsafe and Gradle already write it for both JUnit and TestNG, and every CI server reads it. Each pipeline gets a shared upload step, one line in the common CI template, that sends the XML files plus the context the XML lacks: repository, commit, branch, pipeline stage and whether it was a rerun, and it runs even when tests fail.
Then, if they want more
A small ingestion service parses that into one row per test execution in an analytical store; at 100 repositories that is a few million rows a day, which is normal for a columnar database. Ownership comes from the same ownership file we use for code review, so everything can be grouped by team.
On top I would build a few dashboards: failures on main, flaky tests detected as pass and fail on the same commit, durations and their trend, and skips. The alerts that add value are not failures, which authors already see, but trends: skips growing sharply, test counts dropping, suites getting much slower.
The same data feeds quarantine, which moves flaky tests into a non-blocking group with an owner, and test selection, which uses historical durations and failures to pick and balance tests.
I would keep detailed rows for about 90 days and aggregates longer, and I would not build per-person metrics, because people game them, by writing trivial tests or skipping failing ones.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- JUnit user guide, Mockito documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Design how test results from TestNG and JUnit suites across 100 repositories are...": https://scrivio-interview-library.netlify.app/java/testng/1920c8a365/