Unit Testing
|
So this time I’ll be blogging about what Unit testing is and how I applied it to both my projects(BST and L.List). Generally unit testing follows your functions you’ve created and makes sure they return the correct values or just does what they are suppose to do. The way you configure them is dependent on what your functions does. I will state here what kind of testing my class does and how it does so. As a whole this is my unit testing:
bool are_equal(T a, T b) template
I send a specific value i expect to be returned from the function I check and the returned value. I also send a small message like “TESTING DELETION(): “. So in order to lets say deletion to be checked I write the following:
//ERASE A L_LIST NODE Here I send out a message, delete the individual node by using the function then use the unit testing class.
Its seriously just this easy. The code for the unit testing class was not written specifically by me, I only altered a few variables. For more reading on unit testing: http://en.wikipedia.org/wiki/Unit_testing http://code.tutsplus.com/articles/the-beginners-guide-to-unit-testing-what-is-unit-testing–wp-25728 http://artofunittesting.com/definition-of-a-unit-test/ |