CCTS checks whether the messages exchanged by an event-driven microservice system satisfy its published consumer contracts and follow the state transitions expected for a business scenario.
In a checkout, two services can agree on the format of a payment request and a payment confirmation, even if a particular execution emits the confirmation first. CCTS checks both the Pact Broker evidence for the selected application versions and the order of matching RabbitMQ event records.
繁體中文 CCTS 源自國立臺灣海洋大學碩士研究「事件驅動微服務系統之契約測試及端到端測試方法研究」。它結合消費者驅動契約、狀態模型與事件紀錄,檢查跨服務交易中的訊息相容性與執行順序。學位論文書目與摘要 · 研究方法與實驗範圍
You need Git, Docker Engine or Docker Desktop, and Docker Compose v2. Java, Maven, and Python run in containers.
git clone https://github.com/DF-wu/CCTS.git
cd CCTS
sh scripts/smoke.shThe script builds CCTS and runs its unit tests, starts a temporary Pact Broker, PostgreSQL, RabbitMQ, and MongoDB stack, and publishes a synthetic two-message checkout. It checks that the ordered run passes and that CCTS rejects reversed events, equal timestamps, evidence split across runs, and an application version without successful contract verification. On exit it removes the test stack and its volumes.
For an end-to-end application example, run sh scripts/document-pipeline.sh document-pipeline.json. The experiment uses n8n to receive a document and publish a RabbitMQ request. A second workflow sends the document to Apache Tika and publishes the extracted text. CCTS evaluates the recorded messages and Pact verification results, and the script saves the evidence and verdicts. Document pipeline experiment
To keep a stack running and try the API yourself:
docker compose up --build --wait
docker compose --profile smoke run --rm --no-deps smoke
curl -fsS http://127.0.0.1:58080/actuator/health
curl -fsS 'http://127.0.0.1:58080/api/v1/evidence?runId=ordered'
curl -fsS http://127.0.0.1:58080/api/v1/verifications \
-H 'Content-Type: application/json' \
-d '{"runId":"ordered","serviceVersions":{"order":"1.0.0","payment":"1.0.0"}}'
docker compose downThe example returns "passed": true and per-stage verdicts. The fixture uses fixed run IDs. Run the fixture once per fresh demo stack. See the operations guide for port overrides, storage, and cleanup. Operations guide
- CCTS reads a YAML state model and enumerates paths between a start state and terminal states. Edges name a provider, a consumer, and the Pact message description.
- CCTS retrieves the published message Pact and checks the Pact Broker compatibility matrix for the declared application versions.
- CCTS finds matching event records for the requested run. Each modeled path needs an observed subsequence with strictly increasing timestamps. The JSON report includes the outcome of the document, path, contract, and event checks.
The verifier operates on recorded evidence. A pass is conditional on accurate producer timestamps, complete instrumentation, and correct run and version identifiers. The engine supports directed acyclic models and all-path coverage, with explicit limits on model and path size. API, YAML model, and event headers · Assumptions and limitations
| Reader | Start here |
|---|---|
| I want to run CCTS against an application | n8n and Tika experiment · Reproduction guide |
| I want to model my own services | API and inputs · Checkout YAML |
| I want to operate CCTS | Configuration, migration, and troubleshooting |
| I want to understand the thesis | Research background · Related work and open-source implementations |
| I want to contribute | Contribution guide · Changelog · Security policy |
The thesis-era handbook, developer notes, sample models, and MongoDB exports are retained for historical reference.
Cite the software using the exact Git commit or release tag you used. The citation file includes the APSEC paper. The thesis has a separate catalog record. CITATION.cff · APSEC paper · Master's thesis
CCTS is distributed under Apache-2.0. Publications and separately linked repositories carry their own terms. License