The Mythical Green Build
When we first started down the Automated Build and Testing scene, we became very addicted to that wonderful thing: the green build. We installed tools like Jenkins or later GoCD or even rolled our own, but we loved the power of that green build. We said: ship it! Let's get that code out in the wild! Look it passed all the tests!
Why Mythical?
So we shipped that code and something broke. People in our company didn't like us too much. Whether it was customer service or whether it was sales for us breaking stuff in the middle of their demo. But all we could say was: it was green! So, evidently, when you have 100 tests on a 200,000 line code base, there just isn't a lot of confidence that something isn't going to break. So what does a green build really mean? That is why it is mythical. We have no real "green build" if the tests are not effective and have the "area coverage".
When we write tests, we need to cover areas of the code, not code coverage. We need to make sure hat they cover what is required, not that my setter actually sets a variable. Green builds are easy: return true. Confident builds are hard. Write effective tests. Take pride in what is done. Show and prove that code is ready to be shipped and we will always have the confidence to ship our code at any time.
Comments
Post a Comment