Production data may be used in many ways but is it actually a testing silver bullet? And if you will use it in testing purposes you are sure to locate bugs thus you will create just the right amount of high quality tests, right? Well, this statement does have some ground underneath it. Hard to argue with that, but if such an approach is the only thing used the quality of your software will be still under question as there are such weaknesses of this approach like:
- You are risking of terrible user experience as well as data corruption as many bugs may appear right in production yielding
- Your business logic is not tested with unit tests (or is not tested enough at the best)
- What about integration tests that are to make sure all goes well with large pieces of code interactions? Hardly you could have considered enough of those
- I’m not even mentioning load test checks as your software load testing wont probably be more than a breeze
- How about validating UI is doing fine and is acceptably bug-free? What about functional tests that are to make sure on that?
- And the last but not least. Test data that is written around your production data becomes dependent of it. Where does this take us? As soon as production code changes (the event that always happens) all the test data is frankly useless
What is a tester to do in that case? Any tester has to be proactive. It’s like a chess game. Why wait for your opponent to win just to analyze your defeat if you are able of winning within three or four turns if you have just did the same opponent analysis, you just did it before you began playing?
Beat them before the game even began!
But how does one do so in testing? By creating Synthetic data! Meaning data generated with the goal of meeting requirements of your tests you are about to run in order of validating the code base. That is a nice way of being proactive which is a much safer way of testing. What are the benefits of such an approach?
- Unit tests will validate your data piece by piece
- The will be many complex scenarios that are sure to test most of possible integrations-related challenges
- Large amount of data will be built for better performance as well as load tests
- Accurate functional testing may be done if you did a great job of producing proper Synthetic data
This sounds more difficult than testing in production? This leaves you no time you used to waste while the code was in production? Well, nobody said testing will be easy.
And I will just leave the next meme here for no reason (it makes me laugh way to hard).
Image via Matt Groening