Feb/080
Fast And Practical Testing
I’ll be releasing this Tips & Tricks – article as free. When I four months ago started my 2D graphics engine I had problem with testing :
- How to test for regression if I don’t have the resources to setup nightly builds.
- Manually running those tests was not good enough solution.
This is really a problem in many projects, people think that there is no sense to do testing if it cannot be automated. Most of the time there is just not enough resources to setup a nightly build system. I thought about this problem for a while and I love solving problems, so I came up with an idea :
- Create fast dummy tests for the core.
- Will not test everything, but is good enough.
- Test on each build.
- This is even better than nightly build!
Now if you know that testing is the way to go you know how important it is to do as much testing as possible. This system ensures it. So, how to do it :
- Create tests in your code so that they are disabled for the release build.
- Create a RunTests – function in general or RunTestsModuleX – functions.
- Add these to your init code as early as possible.
- All tests must pass in order to continue, assert if failed!
I’ll have to say that even after years of doing shit loads of testing I’m still amazed how much it helps. I have been able to catch dozens of bugs from my code just by doing a few tests! And I’m still amazed why people don’t do it.
Note : for your information, don’t pretend to be agile developer if you are not, it makes you look -not good-.
Happy testing!
Enjoy this article?
No comments yet.
Leave a comment
No trackbacks yet.