When MailReader - an example application bundled with the Struts Action
framework - was created six years ago, most Java developers had yet to
discover unit testing. Consequently neither the Struts framework nor the
MailReader were created test-first. Since then, we've bolted a few unit tests
onto the Action framework, but the MailReader for Struts 1.2 still has no
developer tests at all.
Over the last 10 years, testing has become more popular with developers. Much
of this popularity can be attributed to the JUnit framework: a simple
effective tool for many teams. But JUnit isn't enough. It makes writing tests
easier, but we still have to write the tests. Many of us despair at the
notion of writing even more code to test the application code we're already
writing. What... (more)
Unit tests give us the confidence to change applications, even legacy
applications that we didn't write ourselves. To avoid the drudgery of writing
a test case for every edge and boundary, we can let JUnit Factory generate a
large set of characterization tests for us. If we need to explore an existing
code base, characterization tests can act as a learning guide by documenting
what the c... (more)