Refactoring issue with an "extract class"

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Refactoring issue with an "extract class"

Post by nielsene »

As discussed here, I decided to refactor my FrontDispatcher, pulling out a factory class.

The FrontDispatcher was heavily mocked, so it was heavily interaction testing. The factory methods that were pulled out were all private and thus not tested explicitly.

Following the extraction of the Factory Class and the updating of the interaction based mock tests, I'm back to a green bar. However, there is absolutely no test harness surrounding the Factory... This feels very wierd.

I guess its because I hadn't done the extra tests McGruff described with the file writing to create testable classes for the factory to produce, etc. Had I had those tests then I would have had some tests to move to the Factory test classes....
Post Reply