Testing
Unit testing
Fast tests on business logic and integrations.
Layer
Testing
Used in
All services
Same layer
2 technologies
How we use Unit testing
Unit tests protect refactors on pricing, permissions, and integrations.
Where we reach for it
Pricing and calculation rules
Discounts, taxes, fees and rounding are pure logic with many edge cases, so they get thorough tests that run in milliseconds.
Permission logic
Who may see or change what is tested directly against the rules, so a refactor cannot quietly open a hole.
Integration boundaries
Code that talks to payment, email or CRM providers is tested against recorded or mocked responses, including error and timeout cases.
Safe refactoring
Before restructuring old code, we add tests that pin down current behaviour, then change the internals with a safety net in place.
When we pick something else
Tests on trivial code, or on UI details that change weekly, add maintenance without much protection. For behaviour that spans browser, server and database, end-to-end tests or integration tests against a real database are a better fit than heavily mocked unit tests.
What we watch for
Test behaviour, not internals
Tests tied to implementation details break on every refactor. We assert on inputs and outputs so tests survive restructuring.
Mocks that drift
A mock that no longer matches the real API gives false confidence. We keep mocks close to real contracts and add a few integration tests against the real thing.
Speed and CI
Unit tests are only useful if they run often. We keep them fast, run them on every push, and use tools such as Vitest or Jest that fit the stack.
Common questions
- How much test coverage do we need?
A coverage percentage is a weak target on its own. We focus on code where mistakes are costly, such as money, permissions and integrations, and measure by risk covered, not lines.
- Unit tests or integration tests?
You usually want both. Unit tests are fast and pinpoint logic errors, while integration tests confirm that parts work together with a real database or service.
- Can we add tests to an existing codebase?
Yes. Start with the riskiest or most-changed areas, add characterisation tests that record current behaviour, and grow coverage as you touch the code.
More in Testing
Next step
What is costing you time, money or customers today?
You get an honest assessment of whether and how we can help, followed by a written plan with a cost estimate and timeline.
Tell us what you're buildingWe reply within 1–3 working days, by email, call or video. Your choice.