> In these types of scenarios how do we know when to jump from our TDD
> implementation to the utility class or framework?
In this scenario I'd most likely have done exactly the same as you have done.
You started with:
* A FileScanner with a full set of tests
* Your in progress class with a developing set of tests.
You noticed a smell, some potential duplication, or observed a similiarity
which could be exploited. I might also have extracted a superclass /
superinterface from the original FileScanner if that made sense given the
context within which I was developing...
When do you know when to jump?
* If you're not confident but have a feeling that this is the right thing to do then
spike out and satisfy your curiosity.
* If your curiosity proves your feelings were right then go with it.
* If you feel, after spiking, that your original path was more appropriate, then
go with that... It might be time to consider other options that popped into your
mind as you spiked out...
So it sounds like you navigated the possibilities and made sensible step by
step improvements which allowed your current solution to emerge as it is
today. That's TDD in a nutshell. You've got passing tests that codify the intent
of your endeavours which also document the extent to which the solution is
applicable and demonstrate how to use the classes to developers consuming
your code, be they team mates or other customers.
Is mise le meas,