Friday, 17 February 2012

Testing is back up to scratch

The marathon that is 'better.testing' is over!

The old testing was based mainly around using the frontend to exercise the backend. This was a logical approach, but was flawed in a few ways.

  • First, it left little room for edge case testing - 'happy path' testing does not find issues.
  • Second, using the frontend and a valgrind run backend was painfully slow.
So, I've updating things a bit. First the current tests have been split into 'service starting/stopping scenarios', and the 'current frontend tests' (with valgrind checking removed).

A new set of tests have been created, that fire HTTP request at the services just as an AJAX request would do. The responses are checked for what is expected and the database compared to ensure the action have been performed correctly. These tests are also checked under valgrind, to give confidence with regard to memory violations. 

This changes not only cover a greater range, but also allows greater control for the tests we have and flexibility for new testing in the future. 

Will be available in the 0.8 releases.