MicroTest 1.3 / MicroStub 1.1: still under 4KB
Posted by Mathew Abonyi Wed, 24 Jan 2007 06:33:07 GMT
MicroTest has had a few tweaks, making it more brief and efficient at what it does. Also, I added a setup and teardown interface which can be used. For example, I removed the use of ObjectSpace and squeezed a few percent of performance just from that. On my 1.83GHz, the 6 tests of the self test now consistently take around 500 microseconds (or 0.0005 seconds). Pretty nippy.
MicroStub had a little problem with it—it stubbed instance methods and didn’t return the class back to normal. So, it violated one of the most basic principles of testing: isolated tests. That’s all fixed now, using some Spartan back-and-forth aliasing. Obviously a double stub will fail. Maybe I’ll fix that later.
Lastly, I added a benchmarking test case, really just useful for profiling.
Of course, the library is still under 4KB—in fact, it’s 3940 bytes.
Have a look at the repository (revision 25) for the latest version.
