Shaun Abram
Technology and Leadership Blog
Modern Software Testing
As a follow on from my last post about Martin Fowlers article on Testing Shapes e.g. Pyramid and Trophy), Tim Bray‘s post on modern software testing (or, “Testing in the Twenties” as he titled it) caught my eye. Bray believes that these Testing Shapes are “misshapen blobs” that are all “seriously wrong in important ways”. I do like people with opinions 🙂
Rather than focussing on what specifically he doesn’t like about them though, Bray lists a number of key points about testing, which I think all make sense.
Unit tests are essential, need to run very quickly, and that they empower code reviewers. Never allow Pull Requests without unit tests, even if there are the best of intentions to add them later (“Spoiler alert: The unit tests never come along later”) because it is neither reasonable nor fair to ask someone to do a code review if you don’t have enough tests to demonstrate your code’s basic correctness.
Integration tests are important and hard, and need to run “fast enough“.
All tests need to pass 100%, it’s not OK for there to be flakiness, or failures that are ignored.
Finally, I love his point on “No testing religions“. That is, don’t get hung up on testing ideologies. The most important thing is for your engineers to produce code with effective tests. Don’t be prescriptive beyond that, just do what works.
Tags: integrationtesting, testshapes, timbray, unittesting