cxxTest is a testing framework for c++. I don't know how if there was some installation behind the scenes before we started using cxxTest, but when we first used it we extracted cxxTest in a specific directory structure within our group repository. After that, cxxTest just worked. It was quite fun writing small tests and seeing it run in lab. It's the only testing framework that I know of for c++ and for our purposes, I believe it's sufficient. I don't write a lot of test cases and I don't know how to write more advanced testing techniques.
Writing code and testing each function before moving on to the next is helpful and ensures that you can be confident in your code working and this is what unit testing is for. This practice can save a lot of time in the long run. When we were programming for iterations 1 and 2, we didn't run our program until we thought we were finished. Only then, did we compare our program's output to the expected output, but before we could even do that we ran into a lot of errors that we were unsure of. We spent hours trying to figure out what was wrong. Was it our regular expressions? Or was it something we missed in our consumeWhiteSpace function? Maybe we didn't correctly output the data in our printout method? This would not have been so hard to debug if we would have wrote unit tests. It would have helped us to eliminate many factors and pin pointed us to a more exact cause of the error.
Ideally, writing unit tests through cxxTest is a very good way to program big projects, but my partner and I just don't do it. Perhaps it is just a bad habit of mine not to write small tests to make sure all the underlying methods work before I move on to the next method. Since unit testing is used for testing small parts of the whole program I don't think a lot of time will or should be spent on it. As it focuses on a small portion of the overall code it may still miss some unforeseen errors.

Recent Comments