« Return to Thread: How to TDD a Reporting Application?

Re: How to TDD a Reporting Application?

by Carl Manaster-2 :: Rate this Message:

Reply to Author | View in Thread

Hi, Mike,

Think about it this way:

If your program was already written and running, what test could you
write that demonstrated it was working?

If that's too big a step, pick a little piece - say, "combining the
data in one of the various ways" - and write a test for that.  Say one
of your various ways was concatenation.  assertEquals("",
ConcatenationCombiner.combine("", ""));

Make that pass.

assertEquals("a", ConcatenationCombiner.combine("a", ""));

Make that pass.

assertEquals("a", ConcatenationCombiner.combine("", "a"));

Make that pass.

assertEquals("ab", ConcatenationCombiner.combine("a", "b"));

Make that pass.  OK, ConcatenationCombiner is done.  Any opportunities
yet for refactoring?  No?  Ready for a bigger step?  No?  Test-drive
your next Combiner.  Or Formatter.  Or DataRetriever, etc., etc.

Repeat until done.  Alternate red and green to move forward.

Peace,
--Carl


On 3/1/08, fsharpmike <fsharpmike@...> wrote:
> Hi,
>
>     Could anyone provide any pointers on how to go about developing a
>  reporting application using TDD?  That is, an application that is
>  focused on reading from different tables in the database, combining
>  the data in various ways, then formatting and outputting it?
--
http://undisclosed-recipients.blogspot.com
http://www.flickr.com/photos/carlmanaster/sets/228603/

 « Return to Thread: How to TDD a Reporting Application?