Testing The Changes
Ok. We all have the same dilemma when we test. We all ask the same questions: what should we test? If you want the greatest confidence in your code, test your changes. When we make changes to legacy code, test those changes. When we make new code, test those changes.
The Status Quo
When we have a legacy system, we have a hard time figuring out how to change it without breaking. We are not real confident in how our code will effect the system as a whole. So we move on and hand it off to QA saying "test it all!"
How To Kill Productivity
If we want to kill our productivity in three small, short words, then by all means we should say to QA "test it all". See when QA hears that, they will test it all. They will test things we never touched. They will test it in ways we never thought possible. They will take forever to do it. So there has to be a better way. There is: test the changes.
What Do We Mean, Test the Changes
When we test the changes, we assume the product will behave the same way as it did except for what we are adding to our story. We assume that there are other things that are being tested. We don't want to effect other things. So, we take the time to understand the entry points of how our code will be integrated into the system, whether that is a single point or many points of entry, that doesn't matter. We test, from a unit perspective, not from an Integration perspective. Integration tests are bad for gainin a false sense of confidence. If we need to gain immediate results and immediate confidence in code, unit tests will make that confidence far more effective than an integration test.
As we unit test, and as we focus on testing the changes, we guarantee that we are introducing into the system of code, a specific change and we prove that we are controlling the outcome. After all, code is simply controlling the inputs and outputs.
Comments
Post a Comment