Kavex Intelligence · Developer discipline
Testing & QA
Tests that catch the failures that matter, at the cheapest layer.
Architecture
Business rules get unit tests; integrations get contract tests; critical paths get end-to-end checks.
Agent outputs are tested with evals, not just snapshots.
Implementation flow
- Rules
One test per rule.
- Contracts
Shape checks per integration.
- Flows
Critical paths end to end.
- Evals
Scored agent cases.
Trade-offs
Unit vs end-to-end
Many fast unit tests, a few end-to-end checks on revenue paths.
Mocks vs real services
Mock at the boundary, verify against a sandbox nightly.
One test per rule
Illustrative code · ts
test("orders over the approval limit need a person", () => {
expect(needsApproval({ total: 5001, limit: 5000 })).toBe(true);
expect(needsApproval({ total: 4999, limit: 5000 })).toBe(false);
});