Engineering Team Lead · Internal Developer Platform · CabbageApps (Dec 2021–Feb 2022)

Constraint-Driven Test Case Generation Platform
Eliminating 90% of manual test authoring with algorithmic test case generation

CabbageApps operated 100+ business-critical forms, each requiring comprehensive test coverage across hundreds of constraint combinations. QA engineers were spending 60-70% of their capacity writing test cases rather than executing them - a single complex form took 4-6 hours to document, and manual authoring guaranteed coverage gaps. I designed a constraint algebra engine and led a 9-engineer team to build it in 3 months. The engine computes the cartesian product of all constraint violations across a form's input fields, generating 20-30+ comprehensive test cases per form in minutes from a JSON schema definition - with mathematical guarantee of 100% constraint coverage. Includes isolated focus mode for field-level testing, multi-mode generation strategies, a test suite composition layer, and a real-time collaborative tracking dashboard.

qa.testcase.engineActive
90%
Writing cut
30+
Test cases
3mo
Built in
Schema
Driven
testcase generation · per form ↑
The Challenge

Test case authoring consuming 60–70% of QA capacity with no coverage guarantee

CabbageApps operated 100+ business-critical forms: registration, transactions, account settings, data entry interfaces. Each required comprehensive testing against hundreds of constraint combinations. A form with 5 input fields and 10 constraints could produce 100+ valid and invalid permutations - and manually selecting which 20-30 to write and document took 4-6 hours per form. With dozens of active forms and continuous schema changes, the QA team was spending nearly 70% of their capacity authoring test cases instead of executing them. Beyond the time cost, manual authoring meant coverage was author-dependent. Edge cases got missed. Constraint interactions between fields were frequently overlooked.

  • 60–70% of QA engineering time spent authoring test cases instead of executing them
  • Complex forms with multiple constraint interactions required 4–6 hours to fully document
  • Manual authoring created inevitable coverage gaps - edge cases missed, constraint interactions overlooked
  • No mathematical guarantee that all constraint permutations were being tested
  • Inconsistent test descriptions and expected outcomes across different QA engineers
  • 100+ active forms requiring ongoing manual test case maintenance on every schema change

qa_velocity.beforeDegraded
60-70% capacity
Testcase authoring
4-6 hours
Per complex form
manual selection
Coverage approach
Testcase consistencyAuthor-dependent
Active forms100+
Constraint coverageEstimated gaps
The Solution

A constraint algebra engine with multi-mode generation and collaborative tracking

1
Formal constraint definition language - JSON schema for expressing form constraints:
  • Supported required, length (exact/min/max), char classes
  • Max-lines for textareas, read-only field definitions
  • QA engineers define schema once
  • Schema changes auto-regenerate full test suite
2
Cartesian product constraint generation algorithm - Core engine computing all constraint violations:
  • Generates (N+1)^M test cases for N constraints, M fields
  • Every valid & invalid input permutation covered
  • Produces 20-30+ comprehensive test cases
  • 100% algorithmic coverage by construction
3
Isolated Focus Mode and intelligent filtering - Field-level testing & coverage management:
  • Focus Mode tests each field independently
  • Other fields remain in pristine valid state
  • SINGLE_VIOLATION filter manages test explosion
  • Auto-generates context-appropriate descriptions
4
Test suite composition and execution engine - QA engineers compose without authoring content:
  • Compose auto-generated test cases into structured suites
  • Parallel execution & real-time result aggregation
  • Per-cycle pass/fail metrics & heatmaps
  • Pattern identification from constraint violation data
5
Real-time collaborative dashboard - Single source of truth replacing siloed spreadsheets:
  • Live test execution visibility & per-cycle metrics
  • Historical trend analysis & release readiness
  • Full audit trail of runs, results, modifications
  • Eliminated email-based result sharing
Constraint Algebra Engine
CONSTRAINT DEFINITION · INPUTForm Definition (JSON)fields · constraints · typesschema-driven · versionedConstraint Parsertokenise · build ASTvalidate · build constraint graphCARTESIAN PRODUCT ENGINEfield_a["v1","v2"]2 valuesCartesian Product Enginefield_a × field_b × … × field_nO(Πi |Vi|) combos · deterministicfield_n["a","b","c"]3 valuesConstraint Filterremove invalid combos · apply exclusion rulesTEST CASE OUTPUT · 100% COMBINATORIAL COVERAGETest Case Set{ id, field: value, expected }100% constraint coverageTest Suitegrouped by form · versionedexported · composableCartesian product algebra · 90% manual authoring eliminated · 100% coverage
Execution Modes + Real-Time Dashboard
MULTI-MODE TEST GENERATIONFocus Modeisolated field testssmart filter activetargeted coverageFull Modeall combinationsCartesian product100% coverageBatch Modeparameterised suiteform group exportcross-team sharingEXECUTION ENGINETest Execution EngineNestJS · run + validate + record resultPostgreSQLresults · pass/fail · timestampsRedislive state · session contextREAL-TIME COLLABORATIVE DASHBOARDWebSocket Serverreal-time push · rooms per formQA Leaddashboard overviewQA Eng 1form A trackingQA Eng 2form B trackingQA Eng Nreal-time updates9 engineers · 100+ forms · real-time collab · 3-month delivery · 90% manual work eliminated
The Results

From fragile to enterprise-grade

90%
Test case writing eliminated

Forms that took 4-6 hours to write testcases for now generate 20-30+ comprehensive testcases in minutes via schema definition. QA engineers shifted from writing testcases to executing them.

100%
Constraint coverage

Every constraint permutation is covered algorithmically. Boundary cases, valid inputs, and all constraint violations are generated systematically. No human error in coverage gaps.

3mo
Delivery time

Full engine including generation algorithm, testcase filters, isolated focus mode, dashboard UI, and API backend delivered in 3 months. Led team of 9 engineers through MVP to production.

30+
Testcases per form

Average complex form schema generates 20-30 comprehensive testcases covering all constraints and combinations. Ensures no edge cases are missed by QA execution.

Engineering Decisions

Architectural choices, tradeoffs, and what nearly broke production

Cartesian product for mathematical completeness

Why generate all constraint permutations instead of intelligent sampling?

Sampling leaves coverage gaps. With form validation, a single missed edge case becomes a production bug affecting customers.

Cartesian product generates all (N+1)^M permutations mathematically proving complete coverage of distinct constraint violations across fields.

The result: provable 100% constraint coverage vs estimated 60-75% with manual selection.

Constraint algebra over property-based testing

Why not use QuickCheck-style property-based testing instead?

Property-based testing generates random values trying to find violations. For form validation, you need deterministic, repeatable testcases. Every generated testcase has a deterministic reason for existing.

When a testcase fails, you know exactly which constraints interacted. The description generator explains the violation combination. With random generation, you often cannot replicate or understand failures.

Deterministic generation also allows caching: same schema produces same testcases across runs.

Isolated Focus Mode for multi-field interaction testing

Couldn't you just test all fields together in a single operation?

Complex forms have interdependent constraints. If field A is required, field B has length >= 5, and field C has max-lines = 3, testing field A's constraints becomes confusing when B and C are also being violated.

IFM tests field A independently: field B and C remain pristine (no violations). This reveals field-level bugs that full-form testing would hide.

After field isolation testing proves each field correct independently, then you test field-interaction scenarios: both A and B violated, both B and C, etc.

Trade-off: additional testcases for each field isolate but much higher confidence in bug detection.

Machine-generated descriptions over manual documentation

Wouldn't one-line descriptions be faster?

When a testcase fails, QA needs complete context: which constraint combination, what values were tested, what the expected outcome is.

The description generator creates natural-language explanations.

Multi-field combinations produce verbose descriptions with full context.

This information density optimization guides QA debugging and catches constraint interaction bugs faster than generic one-line descriptions.

THE TRADEOFFS

Cost · Risk · Tradeoffs

Estimated values based on production metrics and monitoring data

Cost Impact
1-2 hours per engineer
Constraint schema learning curve
QA engineers need to understand constraint types and schema format. One complex form written together, then the next forms are self-service. ROI positive after the first 2 forms.
9-engineer team investment
Production platform maintenance
Building a constraint algebra engine, generation algorithm, and real-time platform requires domain expertise. Ongoing: bug fixes, new constraint types, performance optimization.
Risk Reduction
mitigated via filters
Testcase explosion with large forms
Forms with N constraints and M fields can generate exponential testcases (N+1)^M. SINGLE_VIOLATION filter reduces explosion intelligently while maintaining coverage completeness through algorithmic guarantee.
Technical Tradeoff
90% reduction
Test authoring time savings
Manual authoring: 4-6 hours per form. Schema generation: 5-10 minutes per form. 24-30+ hours saved per complex form per year in an active codebase.
consistency wins
Testcase consistency vs manual flexibility
Trade manual ad-hoc variations (which introduce bugs) for deterministic machine-generated testcases with algorithmic coverage. One schema, provable coverage, zero variance.
eliminated spreadsheets
Real-time collaboration overhead
Dashboard replaces email-based test result sharing and spreadsheets. Single source of truth for all test cycles, results, and release metrics. Better data quality, faster decision making.
Before vs After

Transformative Results: Before vs After

✕Before
  • Manual test case writing per form4-6 hours each
  • Incomplete constraint coverageDepends on author
  • No systematic validationGaps inevitable
  • Form changes require rewritingHigh rework cost
  • No shared platformSiloed spreadsheets
→
✓After
  • Schema-driven test generationMinutes per form
  • 100% constraint coverageAlgorithmic guarantee
  • Cartesian product validationAll permutations tested
  • Dynamic regeneration on schema changeZero rework
  • Shared test suites and resultsFull trackability
⇪Business Impact
90% writing time eliminated
30+ testcases per form auto-generated
100% constraint coverage achieved
Tech Stack

What was used

Constraint AlgebraCartesian product computation
Generation EngineTypeScript with field interaction analysis
FiltersSINGLE_VIOLATION_MAX_OR_ALL_EMPTY and Isolated Focus Mode
Description GenerationContext-aware natural language templates
FrontendReact with real-time dashboard
Backend APINestJS REST with constraint service
StoragePostgreSQL (schemas, test results, cycles)
InfrastructureDocker containers on AWS
Team Size9 engineers, 3 months to production

Need engineering team leadership?

I've led teams of up to 9 engineers to design and build SaaS platforms. Let's talk about your engineering challenges and how I can help lead your team to scalable, maintainable solutions.