Precise Traffic Filtering for Ctrip Hotel Automated Testing Platform
This article describes the design and implementation of a precise traffic filtering system integrated with Ctrip's automated comparison platform, detailing manual and automatic filtering modules, Jaccard‑based similarity calculations, smart test case recommendation, and the resulting improvements in coverage, stability, and efficiency.
The Ctrip hotel team developed an automated comparison platform that greatly improved testing efficiency but revealed several issues such as large data volumes, long execution times, unstable runs, lack of coverage metrics, and manual discovery of new scenarios.
To address these problems, a precise traffic filtering solution was created, comprising manual traffic filtering, automatic traffic filtering, and intelligent test case recommendation modules, which together enhance testing precision and efficiency.
Overall Introduction
The solution leverages the internal code‑coverage platform (built on the open‑source JaCoCo) to obtain coverage data for replayed traffic scenarios, then applies the Jaccard similarity algorithm to filter out redundant traffic based on coverage similarity.
Key formulas and a module relationship diagram illustrate the three‑module architecture.
Manual Traffic Filtering
Manual filtering allows users to select specific traffic for replay, obtaining coverage information and discarding flows with similar coverage, leaving only distinct cases; configuration includes request address, headers, and filter block count, with distributed multi‑threaded execution.
Automatic Traffic Filtering
Automatic filtering runs nightly, pulling configured traffic sources, replaying them, calculating coverage similarity, and retaining unique cases; it shares the same configuration and execution model as the manual module.
Intelligent Test Case Recommendation
The recommendation module extracts newly discovered scenarios from both manual and automatic filtering results and suggests them to users for precise automated test case creation.
Usage Effect
In a real‑world scenario, 1,000 new scenes were identified from over 40,000 traffic items, raising code coverage from 23% to 41% and improving stability and efficiency.
Conclusion
After six months of stable operation, the platform shows steady coverage growth, higher execution efficiency, increased stability, and continuous discovery of valuable new test scenarios, with ongoing iterations planned.
Ctrip Technology
Official Ctrip Technology account, sharing and discussing growth.
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.