Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

AI-Driven Automated Testing Governance: 87% Assertion Adoption, 62% More Defects Intercepted

This article details an AI-driven automated testing governance system that upgrades assertion quality diagnosis, eliminates redundant test cases, and improves coverage through production traffic analysis, achieving 87% AI assertion adoption rate, 62% increase in defect interception, and 90%+ automation conversion rate.

Background: VibeCoding Accelerates Code Production but Amplifies Bug Density

As VibeCoding deepens in development, code generation speed rises but so does bug density per unit time. AI execution speed amplifies error propagation; if testing cannot keep pace, a vicious cycle of "faster but messier" emerges. Automated testing, the core quality safeguard, faces four pains: uneven case quality (weak assertions, redundancy, zombie cases), uncontrollable coverage (business code grows faster than case coverage), unquantifiable automation value, and maintenance cost exploding with case count.

AI Diagnosis Core Coverage: Two Dimensions

Case quality quantification : eliminate invalid maintenance, ensure every case has risk identification ability and business value.

Scenario coverage & diversity cleaning : shift from "counting cases" to "covering business value"; use online traffic, coverage reports, interface contracts, and business scenarios to expose high-risk uncovered areas and guide case supplementation.

3.1 AI Precise Diagnosis: Static/Dynamic Case Quality Intelligence

3.1.1 Assertion Quality Diagnosis Upgrade

Why Assertion Quality Matters

Effective assertions catch logic defects and block production risks during code changes. Ineffective assertions not only fail to intercept but also transmit false "tested, no risk" signals, burying severe quality hazards. Three core pains observed: (1) new AI-generated cases lack assertions, inflating pass rates; (2) manual cases often only check code=200 or success=true, missing data consistency, business rules, state transitions; (3) historical assertions decay as interfaces change, and manual maintenance is slow and massive.

Required Capabilities

Incremental assertion intelligent recommendation for new cases.

Stock assertion intelligent optimization using latest code logic and business rules.

Invalid assertion intelligent cleaning via periodic batch wash against latest code.

Challenges and Solutions

How to diagnose assertions? Initially relied only on response data — if assertion appeared in response, deemed valid. But this missed backend business logic; many "passing" cases skipped key rule checks. Shifted to source code offline flow analysis combining interface definitions, core business methods, data structures, and service call chains to give AI complete, objective, project-specific business context.

Improve recommendation accuracy? Abandoned pure response-based diagnosis; adopted code-based analysis. Real code logic reasoning yields assertions fitting current business scenes, significantly raising precision.

Platform data consistency? Test platforms (Deeptest, DongTest) update continuously; scheduled sync alone yields stale data. Built a "scheduled sync + real-time verification + reverse write-back" closed loop : daily sync, real-time pull before each AI task, and auto write-back of adopted assertions to platforms.

Identify invalid assertions precisely? Defined clear rules: assertions on deprecated/non-existent fields, or always-true logic with no verification meaning, are invalid. Multi-threaded batch cleaning against latest code structure uncovered all hidden invalid assertions.

Self-correction: will AI-recommended assertions be washed away? Discovered AI recommendations aren't fully reliable — code parsing gaps and LLM hallucinations produce false assertions. Innovated AI self-cleaning iteration mechanism : all AI-generated assertions re-enter the cleaning system for secondary verification, auto-filtering inaccurate ones.

Push recommendation precision further? Mid-term used "code analysis engine + AI agent" dual-layer, but layering caused data/logic loss. Fully restructured to DongCC integrated processing architecture , unifying code chain parsing, semantic understanding, business decomposition, assertion diagnosis, and smart recommendation in one system, eliminating intermediate loss.

Achievements & Roadmap

Case diagnosis coverage 24.1%; AI assertion adoption 71% overall (old chain 70.29% → DongCC 87.53%).

Automation defect interception up 62% .

Interface average assertion density 1.5 → 3.15+ ; verification depth upgraded from single status code to data consistency, business rules, state transitions, field compliance.

17% (20k+) effective assertions AI-generated, 70% direct adoption, freeing human effort for core scenario deepening.

Assertion snapshot versioning enables full traceability, quantification, and control.

Future : assertion auto-repair on contract change; assertion effectiveness scoring integrated into quantitative evaluation.

3.1.2 Low-Value Case Diagnosis Upgrade

Industry Duplication Reality

Tricentis 2024: 18–25% functional duplicates in mature enterprise suites (2+ years).

Medium projects (1k–5k cases): 30–40% redundancy (full duplicate, logic equivalent, scene overlap).

Uncontrolled AI-generated libraries: semantic redundancy up to 40%; one bank audit showed 38% scene redundancy; legacy libraries with zombie cases reach 30–50% invalid+redundant execution.

Multi-Dimensional Efficiency Loss

Execution time : 30–40% redundancy → 40%+ build time increase; 1,250 redundant cases × 90s = 31.25h extra per regression.

Maintenance cost : ~60% teams exceed expected maintenance; 20–30% of total automation maintenance spent on duplicates. One interface field change × 5 duplicate cases = 5× modification effort.

Result analysis : one failure → N duplicate failures amplifying triage; key info drowned; "cry wolf" effect erodes report trust.

Governance System & Gains

Built "periodic auto-inventory → visualization → one-click pause → continuous scan auto-close" loop. Inventoried 13 pipelines, 12,758 cases, 2% redundancy; at 3+ weekly regressions, saves ≥30 min per run.

Future Plans

Advance from "text duplicate" to logical semantic equivalence identification : feature extraction (path, method, core params, assertions, dependencies) → semantic vectorization via Embedding → clustering combining structural + semantic similarity → output merge suggestions.

Low-value case filtering : correlate execution history (failures, valid defects in 3 months), interface asset library (offline/deprecated interfaces), low-value rules (N consecutive passes, no defects, offline interface, no valid assertions).

Produce automated static quality report : auto-calculated, problem-oriented, business-value-weighted, compatible with existing diagnostics, veto items (no valid assertion, offline interface, 30-day continuous failure, severe logic error), quality gate at 70 for new cases, weekly health reports, team/module averages as KPIs.

3.1.3 Measurement Standard: Automated Health Degree Quantification

Auto-calculated via static analysis + execution data, no manual intervention.

Problem-oriented: low scores map directly to optimization priorities.

Business-value priority: weight toward assertion quality, stability, business value.

Compatible: reuse existing assertion quality and duplicate case diagnostics.

Veto items: any of {no valid assertion, offline interface, 30-day continuous failure unattended, severe logic error} → immediate fail.

Application: 70-point gate on new case submission; weekly health reports; team/module averages as quality metrics.

3.2 Coverage Governance: From "People Find Scenarios" to "Scenarios Find People"

3.2.1 AI Smart Coverage (Coverage Data Driven)

Core Pains

Traditional test-new mode accumulates blind spots: incremental coverage 80–90% but stock blind spots untreated, risk stacks.

Coverage reports visible but unactionable: manual drill-down through thousands of classes/methods/branches is slow and imprecise.

"Experience trap": scenario design varies wildly with individual architecture familiarity, LLM skill, boundary/exception expertise.

Toolchain fragmentation: coverage reports, source chain analysis, AI interaction, automation platforms scattered online/offline.

Key Capabilities

Shift from change-driven incremental coverage to blind-spot targeted governance : "panoramic blind spot location → key chain extraction → combinatorial scene recommendation".

Shift from manual experience-driven design to AI-driven blind-spot intelligent deduction : AI covers boundary/exception scenes systematically.

Shift from fragmented tools to human-machine efficient collaboration closed loop : "coverage report → blind spot location → chain extraction → scene assembly → human tuning → case precipitation" seamless, "intelligent, one-stop, what-you-see-is-what-you-get".

Solution Design

Blind spot location : multi-dimensional filter (app → pipeline → snapshot → package → class → method) with coverage opportunity view for priority.

Chain extraction : intelligent extraction of complete source chains for target coverage, feeding AI deduction.

Intelligent deduction : key chains + standardized/custom Agent interaction → deduce positive/boundary/exception scenes + effective assertions → flexible assembly into targeted case sets.

Human-machine collaboration : structured case display, instant tuning, WYSIWYG coverage result, seamless regression platform integration.

Technical Architecture: Four Layers

Data layer: collect coverage reports & same-version artifacts, parse methods, lines, branches.

Platform layer: locate blind spots, extract source code.

AI layer: Agent extracts key chains, deduces scenes & assertions, outputs structured suggestions.

Audit layer: human tuning → precipitate to case platform → runtime coverage verification → WYSIWYG.

Core Benefits (Pre-assessment)

Scenario assembly: 60 min → ≤30 min (100% efficiency gain) .

Automation conversion: 80% → 90%+ (10%+ lift) .

Code line coverage: 40% → 60%+ (20%+ lift) .

Complex boundary/fault-tolerance scene share: 35% → 50%+ (30%+ lift) .

Long-term Roadmap

Interface contract coverage: parse docs for full interfaces/params/returns, diff with case library.

Business scene coverage: LLM derives full scenes (positive, exception, boundary, idempotent, permission) from requirements + contracts, semantic match with existing cases.

Defect risk coverage: correlate defect system module defect density with case coverage density to find "high defect + low coverage" modules.

Missing case auto-generation: generate exception/boundary cases from coverage gaps + interface docs + code standards, human review then store.

3.2.2 AI Precision Cleaning (Production Traffic Driven)

Core Pains

Traffic recording blind spots: traditional replay depends on recording completeness; no visibility into production scene full picture — cannot answer "what scenes exist", "proportions", "coverage %". Result: hours of replay covering 1–2 scenes.

Test assets disconnected from business growth: regression covers only few core paths; boundary/exception/multi-platform scenes long in blind zone. Gap widens over time.

Impact assessment experience-dependent: complex architecture, tangled dependencies; senior judgment not replicable, juniors deviate more. Missed assessment → missed test → production incidents.

Risk amplification chain: frontend blind (invisible panorama → incomplete recording) → middle blind (low replay value → cases lag) → tail blind (insufficient regression coverage → no quality guarantee).

Strategy: Five-Step Closed Loop

Panoramic insight : full production traffic mirroring, auto-generate traffic panorama by business source, stage, field dimensions — fixes recording blind spots.

Automated precision cleaning : interface-level config cleaning, auto-calculate scene fingerprints, deduplicate same fingerprints — compresses scenes, solves low replay efficiency & resource hogging.

Traffic map panorama : cleaned traffic auto-generates field enum stats, compares historical case coverage gaps, precisely locks missing scenes.

One-click case assembly : parameter mapping (prod value → test value), pre-step injection, one-click executable case generation linked to pipeline — solves asset lag & manual design speed.

Continuous evolution closed loop : daily scheduled recording → auto clean → incremental compare → auto generate → self-updating case ecosystem.

Short-chain repair : panoramic insight fixes frontend blind → precision cleaning fixes middle blind → map completion guides coverage → one-click generation adapts cases → continuous evolution ensures determinism. Fundamental shift from "human experience driven" to "production data driven".

Core Benefits

Platform onboarded multiple business lines, core apps & interfaces. Full process "interface config → traffic recording → smart cleaning → traffic analysis (map) → case generation" connected. Typical interface practice: premium traffic extraction from massive raw requests, multi-dim parameter distribution insight via traffic map, one-click high-coverage case generation, effectively filling real business scene automation gaps. Incremental automation line coverage contribution ≥25% .

Comparison: Traditional vs AI Precision Cleaning + Auto Case

Scene coverage : traditional ~15% (core paths only); AI discovers large unknown business scenes from real traffic distribution.

Maintenance efficiency : traditional ~2 person-weeks; AI ~0.2 person-weeks ( 90% human savings ).

Effective scene cleaning : traditional unquantifiable; AI premium traffic <1%, significant noise/redundancy filtering.

Case generation efficiency : manual ~5 min/case; AI auto ~2 min/case ( ~15× overall efficiency ).

Critically, benefits compound as business iterates faster and traffic scenes change more frequently — the faster the iteration, the more pronounced the gains in "covering real scenes, catching production defects early".

Long-term Roadmap

Introduce AI model to auto-recommend cleaning field configs, lower human intervention cost.

Expand business line coverage breadth; achieve full-domain traffic cleaning & scene assembly via production-traffic-based pre-scene pool tagging.

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

automated testingAI-driven testingAI self-correctionassertion qualitycoverage governancedefect interceptionproduction traffic analysistest case redundancy

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion