Re: When to use utility/framework classes
- View SourceHullo Andy,
>In this scenario I'd most likely have done exactly the same as you have done.
> In these types of scenarios how do we know when to jump from our TDD
> implementation to the utility class or framework?
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,
- View SourceOn Thursday, May 1, 2003, at 2:29:26 AM, Andy Sipe wrote:
> Several times in the last couple of weeks I have come across a similarHard question. Usually I just go with my intuition of how hard the utility
> problem. When doing TDD, how do you know when to jump to a utility or
> framework class to solve your problem?
looks compared to how hard it is to just code what I want. Often I will do
a little spike with the utility, to increase my knowledge and reduce my
fear of it.
Logic is overrated as a system of thought.