Spunk Autos

Websites and web tools

Testing Framework Selection Checklist

A testing framework runs automated checks on your code: that a booking form rejects a past date, that a price calculation is right, that the checkout page loads. If you commission or maintain a web app for a shop or dealership, this checklist helps you judge a developer's choice of framework or make your own, without needing to know every option on the market.

Know the three layers first

LayerWhat it testsSpeedHow many you want
Unit testsOne function, such as a labour-cost calculationMilliseconds eachMany
Integration testsSeveral parts together, such as saving a booking to the databaseFractions of a second to secondsSome
End-to-end testsA real browser clicking through the siteSeconds to tens of seconds eachFew, on the critical paths

Some frameworks cover one layer; some cover two. Most projects use a unit and integration framework plus a separate browser automation tool for end-to-end tests.

The checklist

Fit

  • It is the common choice for your language and web framework, so examples and help are easy to find.
  • It works with your build tools without unusual configuration.
  • It supports the kind of code you have, such as async functions or server-rendered pages.

Developer experience

  • Failure messages show the expected and actual values clearly.
  • It can run one test file or one test on its own.
  • It has a watch mode that re-runs tests when files change.
  • Mocking time, network calls and dates is straightforward; booking logic depends on all three.

Automation

  • It runs headless in your continuous integration service.
  • It produces reports in a standard format, such as JUnit XML.
  • It can run tests in parallel.
  • It reports coverage, or works with a coverage tool.

Long-term health

  • It has regular releases and an active issue tracker.
  • Its licence suits commercial use.
  • Upgrades between major versions are documented.

Worked example: how long will the suite take?

Suppose a booking app has 400 unit tests at about 5 ms each, 40 integration tests at about 0.3 seconds each and 8 end-to-end tests at about 20 seconds each. The totals are 2 seconds, 12 seconds and 160 seconds, or 174 seconds in all.

Mistakes to avoid

  1. Choosing a framework for a feature you will never use.
  2. Writing mostly end-to-end tests because they feel more real, then living with slow, flaky runs.
  3. Testing implementation details so every refactor breaks dozens of tests.
  4. Letting failing tests stay red until everyone ignores them.
  5. Skipping tests for date and time-zone logic, a frequent source of booking bugs.