From: Jonathon McKitrick on
Suppose you have (as I do) an application that generates multi-page pdf
reports. How the heck do you write a test suite for this?

From: Pascal Costanza on
Jonathon McKitrick wrote:
> Suppose you have (as I do) an application that generates multi-page pdf
> reports. How the heck do you write a test suite for this?

Develop a version of your software that produces pdf files that you
manually check for correctness. If you're done, take a snapshot of the
generated pdf files in one folder as the expected results. The test
suite then consists of generating pdf files and performing a binary
comparison of the two folders. Thus, you will notice after changes to
your code whether the contents of the pdf files are affected or not.

Nobody promised you it's easy... ;)


Pascal

--
My website: http://p-cos.net
Closer to MOP & ContextL:
http://common-lisp.net/project/closer/
From: Nathan Baum on
Pascal Costanza wrote:
> Jonathon McKitrick wrote:
> > Suppose you have (as I do) an application that generates multi-page pdf
> > reports. How the heck do you write a test suite for this?
>
> Develop a version of your software that produces pdf files that you
> manually check for correctness. If you're done, take a snapshot of the
> generated pdf files in one folder as the expected results. The test
> suite then consists of generating pdf files and performing a binary
> comparison of the two folders. Thus, you will notice after changes to
> your code whether the contents of the pdf files are affected or not.

Additionally, in as much as test suites are an alternative to comments,
they only document what they test. Writing a test suite for an entire
program is basically writing a single comment for an entire program:
not terribly useful.

Instead, one would write tests for the components of the report
generator. Without knowing what your reports are like, it's hard to say
what those components are.

And of course, certain creative elements can't be tested automatically.
You can test the factual elements of your generated reports, but you
can't automatically test if it looks nice.

>
> Nobody promised you it's easy... ;)
>
>
> Pascal
>
> --
> My website: http://p-cos.net
> Closer to MOP & ContextL:
> http://common-lisp.net/project/closer/

From: Paul F. Dietz on
Jonathon McKitrick wrote:

> Suppose you have (as I do) an application that generates multi-page pdf
> reports. How the heck do you write a test suite for this?

Among other things, you should write unit tests for subsections of
the code. Try to achieve 100% branch coverage with these tests.
I use Waters' RT and COVER packages when I do this, although COVER
doesn't deal with CLOS all that well.

Paul

From: Nathan Baum on
Paul F. Dietz wrote:
> Jonathon McKitrick wrote:
>
> > Suppose you have (as I do) an application that generates multi-page pdf
> > reports. How the heck do you write a test suite for this?
>
> Among other things, you should write unit tests for subsections of
> the code. Try to achieve 100% branch coverage with these tests.
> I use Waters' RT and COVER packages when I do this, although COVER
> doesn't deal with CLOS all that well.

My google-fu isn't working for me. Where can I find out about these
packages?

>
> Paul