Scale and contention
How are order value and assumed processing rate calculated?
The requirements are tested at a concrete, fictional scale of 12,000 orders per day. Average load, peak load and contention are considered separately.
Starting point Check credit reservations atomically against the remaining limit.
Assumptions for the example case
A fictional example design with one customer, one currency and one warehouse; a binding price offer; complete local stock and credit reservations; and one complete delivery. Figures and quality goals are illustrative test assumptions. Multiple currencies, tax calculation, partial delivery and credit insurance are outside the scope.
Throughput and the contended resource
Daily rate and contention for two scarce resources
The baseline rate is low; a hotspot locks item stock and customer credit together.
Reproducible test profile calculations
- 01
Average load
12,000 orders/day12,000 ÷ 36,000 s = 0.333 orders/s over 10 hours
For the designThe rate describes the assumed total volume; response time still requires measurement.
- 02
Peak test
30 orders/s for 600 s = 18,000 orders10 boxes × 2,000 cents/box = 20,000 cents order value
For the designThe additional quantity calculation defines a separate check of resource or retention needs.
Test concurrency separately
- Test oracle
- Two orders each request 10 boxes and 20,000 cents against 15 boxes and 30,000 cents available. In either commit order, one wins; 5 boxes and 10,000 cents remain. No order may reserve only stock or only credit.
Make the amount traceable
Calculate order totals as integer cents.
Ten boxes cost 2,000 cents each.
20,000 cents correspond exactly to the offer.
- Alternative considered
- Floating-point rounding can make reservation and invoice amounts differ.
- Trade-off
- Discounts need their own rounding rules.
- Reassess
- Tiered prices are introduced.
Terms in this step
- Make the amount traceable
- 20,000 cents correspond exactly to the offer.
Try it yourself
Calculate the value of ten boxes and the average order rate.
A hint for your attempt
Use the specific entities and conditions from this step. The two solution parts distinguish the decision from its evidenced outcome.
Compare with a possible solution
- First part of the solution
- Ten times 2,000 cents is 20,000 cents.
- Second part of the solution
- 12,000 orders divided by 36,000 seconds gives 0.333/s. The peak test at 30/s requires separate evidence.
Apply to your project
Which corresponding assumption would you test first in your project? Consider this trigger: Tiered prices are introduced.