No matter how you organize your tests, or how many you have. It
you can’t trust them enough they aren’t worth squat. In fact, the tests that
you write should have three properties that together make them “good” in my
eyes. They are:
§Trustworthy
§Maintainable
§Readable
This chapter deals with these three pillars of “Good” tests with
a series of practices you can use as a checklist when doing test reviews in
your team. Being able to trust a test will make sure your developers will
actually want to run the tests they write, and will listen to the test
results with confidence. It also means making sure the tests themselves don’t
have bugs and that they are testing the right thing.A non-maintainable test is the worst
nightmare for projects that have them, since they pose a schedule risk, or the
risk of losing the tests the minute the project goes into a more aggressive
schedule. People will simply stop maintaining and writing tests that take to
long to change. Readability is not only about being able to read a test but
also about being able to figure out where the bugs are and are not. Without
readability the other two pillars fall apart pretty quick – maintaining the tests
becomes harder, and thus you can’t trust them anymore.
Together, the three pillars make a sound investment of your time.
Drop just one of them and you run the risk of wasting everyone’s time.