Skip to end of metadata
Go to start of metadata

Here is an experiment for you. (smile)

  1. Measure the time it takes to run your tests without Ashcroft. Call the time TP (seconds).
  2. Measure the time it takes to run your tests with Ashcroft. Call the time TA (seconds).
  3. Count the number of tests that were run (they should be the same for both test executions). Call this number N

Calculate N/TP. This is the number of tests you could have run per seconds if all your tests had obeyed the Ashcroft Commandments. You will probably find that N/TP is somewhere around 100 test methods per second. Or 10 milliseconds per test method if you will. (TODO: verify these numbers on a couple of OSS projects)

Calculate TP/TA. This is your Testing Pain Index (TPI). It should be as close as possible to 1. Anything over 10 is extremely painful. The Test Execution Frequency (TEF) is inversely proportional to the TPI. Examples to come hopefully - in the meanwhile take it with a grain of salt. (smile)

Does this sound intriguing to you? If it does, go ahead and enable Ashcroft and follow his advice to make your tests fast. -And your business logic decoupled from infrastructure!

  • No labels