Re: Graphic assertions?

Phlip <[email protected]> Sun, 3 Sep 2006 12:32:15 -0700
Newsgroups gmane.comp.programming.test-driven-development,gmane.comp.programming.test-first-user-interfaces
Message-ID <[email protected]>
avinap77 wrote:

> Thanks, I'll look it up, although it looks like not quite what I need.
>
> p.s. most of my graphics TDD work so far has been mainly image
> manipulation (for instance resizing an image, cropping, etc.) and
> there was no problem TDDing this - I simply make an in-memory bitmap
> as an input, let the image processor do it's stuff and then assert on
> the output (all in memory, no file I/O required).

Can you do that "first"? Can you write a failing test that forces you
to upgrade the code to pass the test the correct way?

> I ended up with
> things like AssertPixelColorsAreSame(expectedColor, actualColor) and
> at some point even an AssertImagesLookAlike that compared an original
> bitmap and a resized bitmat to see if they, umm, look alike. But
> these assertions were only good for simplistic input cases (like
> resizing a half-red/half blue bitmat and asserting that the resized
> bitmap was also half red/half blue), and sometimes I had to add some
> flexibility to them (such as compensating for color distortions when
> converting a bitmap to JPEG).

One JB Rainsberger calls that a "Gold Master Copy" test.

-- 
  Phlip
  http://c2.com/cgi/wiki?ZeekLand  <-- NOT a blog!!


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/testdrivendevelopment/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/