o-ni

o-ni

Monday, November 7, 2011

imagine you just finished writing 2000 lines of code. now to see if it works... nope, not working. now what? this kind of hopeless situation is exactly what unit testing and cxxtest are used to prevent!

unit testing is the practice of testing if each tiny component of the program works correctly as soon as it's built/linked together with other parts into a bigger unit. this is a practice recommended exponentially more with the size of the program. Why? Because YOU WILL NOT GET EVERYTHING RIGHT THE FIRST TIME AROUND! Then the butterfly effect multiplies it many times over depending how deep in your program it is. these tend to be horrible and hard to find errors that unit testing saves you from.

unit testing is very useful, but constantly testing every single piece of code is a pain. this is where cxxtest comes in. cxxtest is a tool that helps automate testing. this allows you to test more and easily, thereby making unit testing more doable.

in conclusion, unit testing is necessary and cxxtest makes it workable. this can save you a great deal of work, headache and time. i know it did me.