Anyway, what I need is a simple test framework for cross-platform c++ projects. And I put my hands up to say I am a crappy tester and programmer. So this is really just an attempt to clear my own threads. So do not be surprised if you saw some terms you never heard before - it has to be my invention. Candidates on the short list finally come down to:
There was a good summary from Snappy Touch about using unit test framework in game and iPhone development. My list is much simpler:
- Licensce free (I am sorry, but this has to be on top of my list. It is not about price; it is the principle :-))
- Passed my 30 mins HW test. (30 minutes for me to run a Hello World program successfully, officially in this case is Hello Test World.)
- Robust. I REALLY do not want to spend a second in debugging the framework itself!
- Most of test framework is about predefined macros, fixtures etc. To me, it has to be just as easy as using a probe. Minimum code snippets required for invoking the actually test and output test results.
- Support good test template for input of expected results (whether it is a value, condition check, status machine transition, whatever). This is actually the most tricky one, in my opinion.
- Test code itself MUST be easy to port. In addition to the no-dependencies on non-standard libraries contraint, I found it is extremely important to leave those compiler-dependent features out, otherwise, we will spend awful a lot of time in figuring out what the heck has went wrong when test failed miserably after you come out from Microsoft illusion to the reality, on target device, not mention after tools such as Lint is applied to assure the code quality itself.
- Handles exceptions well. Remember my days in Symbian, one thing I really loved is the replacement concept to exception as in Panic!
- It would be very nice if it comes with some scripts available to kick off the automated build and run process.
Maybe I should cook out my own test framework someday, just for fun...
No comments:
Post a Comment