Peter Bell wrote in post #978204:
[...]
> I would say that Marnen's position is very consistent from what I see
> from Kent Beck and others on the XP/TDD lists.

The XP crowd have been a major influence on my testing philosophy, even 
though I've never done XP as such.

> It took me a while to get
> used to the approach, and I think it's important to clarify that Marnen
> isn't saying not to test complex private methods.

Well, I guess I sort of *am* saying that, but only in the sense that you 
probably shouldn't *have* complex private methods that need their own 
tests -- that is, if your private methods are that complex, they should 
be made public and/or decomposed.

> He's just saying that
> if they are complex, maybe you've discovered another composed object's
> public method.

Or the same object's public method, or a method that is too long...


> SRP and all that . . .

I suppose.  Basically, I think if you have a private method that is 
complex enough that wants to be tested in isolation, then that is a 
symptom of an underlying design problem: your methods are insufficiently 
accessible, or insufficiently atomic, or your code is otherwise 
insufficiently modular (say, by virtue of needing a new class 
introduced).  Fix the underlying problem and the need for 
"so-big-it-needs-its-own-tests" private methods will go away.

>
> Best Wishes,
> Peter

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to