Facet Coverage isn't a type of testing—it's a requirements traceability layer that sits on top of your existing tests. It spans testing phases rather than belonging to one.
This is the sweet spot. Facets are stakeholder requirements, and acceptance tests verify those requirements. The mapping is natural.
// This test directly maps to business requirements
test('guest user can complete a purchase', () => {
facet(Facets.BUSINESS_GUEST_CHECKOUT);
facet(Facets.COMPLIANCE_PCI_DSS);
// ...
});Tests that exercise user flows and system behavior map well to business requirements like "user can checkout with saved payment method" or "PII is encrypted in transit."
When an auditor asks "prove HIPAA requirement X is tested," you can point to specific tests linked to that facet. The coverage report provides audit-ready traceability.
Before release, you can see which stakeholder requirements have no test coverage at all—across business, compliance, UX, and technical perspectives simultaneously.
Most unit tests verify implementation details (doesThisFunctionSortCorrectly) not business requirements. You could link some unit tests to facets, but it's often too granular to be meaningful.
Exploratory testing is unscripted by nature and doesn't map well to predefined requirements.
These tests verify system characteristics, not feature requirements. However, you could have a "performance budget" facet for specific thresholds if performance is a documented requirement.
Think of Facet as a layer that answers a different question:
| Approach | Question Answered |
|---|---|
| Code coverage | "What % of code did tests execute?" |
| Facet coverage | "What % of business requirements do tests verify?" |
Facet is most valuable when:
- Multiple stakeholders have requirements (product, compliance, security, UX)
- Traceability matters (regulated industries, audits)
- You need to prove specific requirements are tested
- Gap detection is important before releases
Facet adds the most value at the acceptance/integration level where tests naturally align with stakeholder requirements.