My #1 suggestion for legacy code: If it works, and you change it, check that it still works. If there aren't any tests, run the app already.
I replied something about writing tests, and the discussion went on with several interesting remarks that made me think. As on many others, here's one thing on which I agree with Liz: automated tests do not imply that your app is working as it should. I have seen it too many times to be so naive. It could be (almost) true if our code coverage was perfect, but let's face it, it is not. Please note that I'm not talking about having tests on getters. We should have unit tests, integration tests, end-to-end tests, there-is-no-try-yoda-tests and everything you can think of as long as it ends with "tests" for almost everything. And more often than not we don't.
And even if we did, tests are not users. Well they are, but they are not the users we're most interested in: those who receive value from our app.
Automated tests are very important, but in the end they only are our safety net (even if they also guarantee our customers), but in the end it all comes up to real users.
Automated tests never sign checks, users do. Or at least the bosses of users do. Then, if we belong to that overrated category of people that still insist on eating every day (possibly more than once), we shoud strive to have happy users more than happy tests.
Automated tests are one of our means, not our ends. Let's not forget it.
PS don't forget to follow Liz on Twitter and on her blog.
No comments:
Post a Comment