The instinct carried over from analytics pipelines is that small losses and small duplications wash out. In a funnel chart a duplicated click nudges a percentage. In a meter a duplicated event charges a customer twice, and the customer who spots a double charge is the one who churns, as the usagebox writeup on idempotent metering puts it (idempotent usage metering). The two failure modes are symmetric:
- Over-counting comes from at-least-once delivery: client retries on a timeout, queue redelivery after a consumer crash, a webhook firing twice.
- Under-counting comes from dropped events and events that arrive after the billing cutoff.
The discipline of a billing test suite is to make over-counting structurally impossible and to make under-counting detectable and recoverable. That framing comes from the same source, and it should drive your test plan: every test you write targets one of those two directions.
A useful consequence: your tests are not checking "does the code do what it says" but "is the number that reaches the invoice defensible in a dispute." A forum analysis of metered API billing makes the same point, that invoices must stand up to audit and dispute, which is why flat request counts are not enough and why events must be immutable and replayable (metered API billing).
Usage-based billing itself is now mainstream enough that metering bugs are a revenue line item, not a curiosity. Stripe cites a January 2025 survey in which 85% of SaaS companies had adopted usage-based pricing, with 78% of those adoptions happening between 2020 and 2025 (Stripe on usage-based pricing). Other sources put adoption lower, around 46% of SaaS companies per OpenView data cited by m3ter (m3ter's usage-based pricing guide), which is a good reminder to check the survey behind any adoption number before you quote it to your board.



