» tagged pages
» logout

sorted by: recent | see : popular
Content Tagged with unit-testing + unit-test

Unit Testing C and C++

A couple of years ago, while writing some C++ code, I was compelled to look around for a unit testing framework, in the spirit of JUnit, which I’d been using profitably for a couple of years, that I could use with C++ code.

I expected things to be less nice than they were with Java and JUnit. After all, early binding, the type systems of C and C++, the fashion in which physical dependencies are managed, and the frequently static nature of things should all be expected to contribute to making things less nice, fast, flexible and friendly than they are in Java.

Add to that the ever shifting and historically abominable “standard libraries” that C++ has been blessed with, and the gardens of supernatural pleasure from which flow such springs of joy as C++’s exception handling system, templates, other gratuitous preprocessor abuse, RTTI, and so on, and my expectations weren’t high…

...and they weren’t met. The first thing I tried, whose name was the most obvious pattern match for a JUnit-esque thing ported to C/C++ was a bit of a horror show. The framework and the included examples were tangled together like the probable genealogies of the C.H.U.D. The documentation sucked dead bunnies through a kinked krazy straw packed with gravel. On Windows, things were unnecessarily riddled with gobs of MFC crap that should have been stranded years ago on a remote island, bereft of any materials out of which a boat could be fashioned, in the very middle of a doldrumy sea of poisonous yet somehow shark-infested water. I can’t imagine what menagerie of horrors beyond hororrs, and nuclei of undreamable hideousness, must have infested the framework in MFC’s place under Unix.

Now, I need to revisit the problem. I’ve heard stories that CxxTest addresses, or at least refuses to inflame, the sorts of things that gnawed my craw about the other ones I looked at… I’m hoping that this is true and looking forward to giving it a try.

User:jerryk: Software I Use

More on Rails Testing Changes

Mike Clark has written an interesting blog post on the changes to Rails unit testing in Rails 1.0. He includes some justification and performance measurements.

If you’ve been reading Agile Development In Rails, then this will save you a little bit of confusion by making some sections of chapter 12 work properly.

User:jerryk: Ruby, Rails and Related

simpletest

SimpleTest is a unit tester, Web tester, and dynamic mock objects framework for PHP.