From: Michael A. J. <csm...@ho...> - 2001-01-26 04:44:40
|
> > Thanks. Have you tried it out? Has anyone? > > I haven't tried it out yet either. At the moment, I don't seem to need it as > I'm doing test-first all the time now. Then again, I haven't checked it out, > so maybe I'm missing something. > > How do you use it in your daily grind? Remediating pre-existing code is pretty obvious - I generate the test stub, write the tests and then start my tinkering and refactoring. On a new unit I usually end doing the following because I am not gifted enough to do true test first. Firstly, I flesh out my class with the properties and methods etc that I am going to need. Then I usually hit control shift C to make Delphi generate the stub with no implementation. I then generate the test stub. pick a test and fill in the implementation for the test. Then I usually go an provide enough implementation to get that test working. This usually means that the constructor/destructor get implemented and a couple of helper functions get implemented in the target class to make the method I am attempting to test function and pass the first unit test. For each test method XPGen generates it provides a default implementation by making a call to fail('test not implemeted'). If you run the test off the hop, you will get 100% failure. I then work my way forward until I have 100% and I get the wonderful green bar to appear. When that happens, I'm of course done and I move on to the next bit of tests and code that I have to write. --mike |