From: Panagiotis Atmatzidis Date: 2012-08-07T05:12:59+09:00 Subject: Re: Questions about test-driven development and optparse Hello, On 6 Αυγ 2012, at 20:44 , Bartosz Dziewoński wrote: > If I were you, I wouldn't use regexps for testing the output here. > That would imply that you're basically only checking that the output > format is right. > > You should probably take a simple, short log file, and package it with > the tests. Then run it once for each options combination you want to > test, save the output (which you have manually verified is correct), > and write a test that checks the the output still looks exactly the > same. > > > You could also just forget about tests here entirely. What you have > here is (when you don't count country code list and documentation) a > 100-line script that does just one thing, and you've already verified > it works. Tests are only useful in one case – when you are making > changes to your software and want to make sure they don't introduce > bugs in old code. > > Still, it might turn out later that you actually need to change stuff, > and then you'll be wishing you wrote the tests earlier :( > > -- Matma Rex > Thanks for the info. Your idea of writing tests makes sense... I'll give it a try as an exercise. Thanks! Panagiotis Atmatzidis ----------------------------- Pharmacy Student at VFU email4lists: ml@convalesco.org More info: http://about.me/atmosx The wise man said: "Never argue with an idiot, he brings you down to his level and beat you with experience."