How Zhongtong Boosted Software Quality with a Scalable Code Coverage System
This article explains how Zhongtong implemented a Java‑based code‑coverage service using Jacoco, integrated it into their CI pipeline, generated multi‑dimensional coverage reports, and refined testing workflows to improve software quality and reduce untested code.
Overview
Code coverage measures the proportion of source lines executed during testing, helping to identify gaps in test cases and improve software quality. Analyzing coverage reports reveals untested code and highlights newly added or modified code, prompting timely updates to test suites.
Zhongtong Code Coverage Implementation
Before describing the concrete solution, Zhongtong uses the open‑source tool Jacoco, which works with Java server projects and provides clear coverage statistics without modifying source code, thanks to its on‑the‑fly instrumentation mode.
The overall service flow is illustrated below:
The process works as follows:
When a project is deployed, Jacoco injects probes into the JVM to record which lines are executed by manual or automated test cases.
After deployment, the release platform (Stellar) pushes version information (Git URL, branch, commit ID, etc.) to the quality‑control platform for storage.
Testers trigger the coverage service from the quality‑control platform by selecting a branch and comparison mode.
The service retrieves the corresponding source code from Git and the probe‑generated dump file to produce a coverage report.
Additional features were developed to suit Zhongtong’s business scenarios, improving usability:
During release, users can optionally enable Jacoco instrumentation, embedding the probe insertion seamlessly into the deployment workflow.
The platform supports generating full, branch‑incremental, and incremental reports, each offering different granularity for coverage analysis.
Multiple execution agents are clustered to boost efficiency, and data is transferred between services via queues for reliability.
Testing Process and Practical Application
The typical testing workflow at Zhongtong, combined with code coverage, is shown below:
1. Developers create a feature branch from master, develop and self‑test, then submit for testing. 2. After smoke approval, testers run manual and automated tests, generate a branch‑incremental coverage report, and add test cases for uncovered code. 3. After code merge, regression testing is performed and another incremental report is generated to address any missed areas. 4. Once regression passes, the code is released.
Summary
In practice, code coverage helps discover missing test cases, refine test design, detect dead code, and highlight design flaws, thereby improving code quality. Zhongtong’s coverage service is now running in over 200 services across several departments, aiming for 70% statement coverage overall and 100% for core modules, with plans to roll out center‑wide within the next year.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Zhongtong Tech
Integrating industry and information for digital efficiency, advancing Zhongtong Express's high-quality development through digitalization. This is the public channel of Zhongtong's tech team, delivering internal tech insights, product news, job openings, and event updates. Stay tuned!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
