Moin,

On Tuesday 28 March 2006 20:11, Fergal Daly wrote:
> On 3/28/06, David Cantrell <[EMAIL PROTECTED]> wrote:
> > Geoffrey Young wrote:
> > > David Cantrell wrote:
> > >>Try writing a test suite ahead of time for a graphing library. 
> > >> It's possible (indeed, it's trivial - just check the md5 hashes of
> > >> the images that are spat out against images that you have prepared
> > >> ahead of time in some other way) but it would be damnably
> > >> time-consuming to create those tests.  Consequently, I've not
> > >> bothered.  I throw data at it, and look at the results.  If the
> > >> results are good I then put an md5 hash of the image into a
> > >> regression test.
[snipbit]
> > Unfortunately, the draw() method is the one that's the hardest to
> > write, the one that is the most prone to error, the hardest to debug,
> > and the one where it's hardest to write tests in advance.
>
> There are things you can do though. For example you can make draw take
[snipabitmore]

Basically it revolved around testing low-level bits, and then hoping that 
when each of the features for itself is correct, that their sum will also 
be correct.

That works quite ok, but catching the remaining cases can be quite time 
consuming.

OTOH, I would _never_ _ever_ consider starting testing the output if there 
arenot unit tests for all (well,most) of the basic features. 

In addition, with raster output you can atleast ensure that the output is 
what will be displayed, in my case I also have HTML output, which adds 
the fun code-looks-different-but-renders-the-same and vice versa 
variables to the testing matrix.

Still, functional tests are a must-have. Don't accept less.

Best wishes,

Tels

-- 
 Signed on Wed Mar 29 19:03:36 2006 with key 0x93B84C15.
 Visit my photo gallery at http://bloodgate.com/photos/
 PGP key on http://bloodgate.com/tels.asc or per email.

 This email violates U.S. patent #5,546,528 and EU patent EP0689133:
 
   ________________________________________
   | Header | Body | Attachements |       |
   |--------+      +----------------------|
   |                                      |
   ~                                      ~

Attachment: pgpNM0UpF1x1P.pgp
Description: PGP signature

Reply via email to