codeactual / hashmark

MySQL time-series database and PHP library for data point insertion and analytic queries
MIT License
12 stars 3 forks source link

Lazy/shallow tests #9

Open codeactual opened 15 years ago

codeactual commented 15 years ago

Some Pádraic Brady blog posts articulated some problems which are definitely prevalent in the test suites. Most tests contain more than one assertion, and some have perhaps hundreds as they loop over test data (ex. Test/Analyst/BasicDecimal.php).

It was clear during dev. that it slowed identification of failures. Using --stop-on-failure and adding details to assertion messages did help, but those alone probably aren't clean enough for long-term use.

References:

http://blog.astrumfutura.com/archives/387-Unit-Testing-Multiple-Assertions-And-LazyShallow-Testing-Are-Evil.html http://blog.astrumfutura.com/archives/388-Unit-Testing-One-Test,-One-Assertion-Why-It-Works.html