Testing, testing, 1-2-3… 25 Jul, 2003
Lately, I've been thinking about testing a lot. Thomas Duff has had some interesting things to say about the XP approach, which is (amongst other things) test-driven.
Naturally, there's been some pondering about how one can practically apply this to Notes & Domino programming — in fact, I feel an article coming on soon (it's about bloody time!) Essentially, test-driven development is all about writing the tests first, rather than diving straight in with the code. Sounds odd at first, but bear with me. Suppose you have a new application or problem to sort out. It could be complex, and you don't really know where to begin in terms of structuring your code (whether that's organising a load of procedural routines or designing an object model). Designing applications is an art, so anything that helps structure one's thoughts can't be bad eh? This is where your tests come in: write those first, and this will help lend a semblance of structure to your solution. In addition, knowing that each component comes from a test scenario means that it gets tested during coding rather than after. Ideally you're then in a position to combine your components into the finished solution with confidence: all your routines / classes / whatever have been through the testing process multiple times.
I'd also add that this approach means that you have more of a chance at avoiding those really stupid design errors, made when you're just too close to your code (or is that just me? :-o)
Does anyone else have thoughts on this?
Thanks for bringing it up, BENThomas Duff#
Looking forward to the e-Pro article Tom!Ben Poole#
(snork) ;-Pjonvon#
With version 3 (more insight, new requirements, more OO experience), I'm trying to think of ways to do more low-level componentised testing, but it's not easy.
I think there are 2 big issues:
1) writing good tests -- some things are 'general' and easy to build unit tests… others, you run the risk of simply writing alternative 'wrappers' which do the same thing as the original client code.
2) DISCIPLINE… I've always written small 'test' routines & agents to test bits of bigger systems (nothing on the level XP seems to suggest, though), but as the code morphs, a lot of these fall by the wayside. Making sure that the 'test' code doesn't get left behind, and committing to test-first, test-at-each-change needs a serious commitment.
Thanks for the post, you guys are getting me to think a lot more seriously about this testing. I see serious benefits but I'm still not 100% sure how to get there… but I'll be doing a lot more reading.Colin Pretorius#
-richRichard Schwartz#
What's different in XP, of course, is the idea of a couple of folks sitting together and cranking on the coding and test cases. I've done the XP-style of coding at times, although we didn't call it that, and it wasn't for more than short spurts. However it is very quickly apparent that there are benefits to be had.
As for HOW to do automated testing…There at least USED to be some tools that would help this type of thing. Years back I coded some routines using a tool called AUTOMATORmi (I think). There was also a tool from them or someone else with the word GHOST in it. These were basically macro record/playback tools with logging. You would manually do whatever you needed to with an app, recording a macro (just like recording a macro in Word or Excel). That macro could be saved as your test module, and run when needed, recording whether or not the results met the expected results. OK, that was limited to Windows systems and things like mouse movements raise all kinds of problems, but the point is that I'm certain there are tools available. It would make a GREAT article for one of us to research automated testing tools for Notes/Domino and publish the findings.Joe Litton#