[rspec-users] "Why not MockEverthing" or why use fixtures for all tests?
Glenn Ford
glenn at aldenta.com
Wed Mar 19 15:34:15 EDT 2008
On Mar 19, 2008, at 3:21 PM, David Chelimsky wrote:
> On Wed, Mar 19, 2008 at 2:10 PM, Glenn Ford <glenn at aldenta.com> wrote:
>>
>> On Mar 19, 2008, at 1:03 PM, David Chelimsky wrote:
>>> Again - this is a matter of granularity. The whole point of having
>>> granular examples is to enable you to make changes to the system
>>> easily via refactoring. Sometimes refactoring requires moving
>>> examples
>>> around along with the implementation code. This is refactoring 101
>>> stuff, and an accepted part of the refactoring process in all of my
>>> experience prior to working in Ruby. It's only people in the Ruby
>>> community that I see expressing this concern. I think it's because
>>> the
>>> refactoring tools for Java and C# are superior, so they automate a
>>> lot
>>> of the granular steps you need to take when refactoring manually.
>>>
>>> The problem with decreasing the granularity is that it makes fault
>>> isolation more difficult. It means less work right now for lots more
>>> work down the road.
>>
>> Perhaps my example simplified my problem too much. The chore that I
>> was referring to unfortunately wasn't about refactoring. I wish it
>> had been that easy! Instead it was really the behavior that got
>> transfered, but the logic and code was quite different. The goal was
>> to ensure the end result was still the same, that way I would know I
>> hadn't broken anything but still had the new structure that I needed.
>> Without my specs covering the resulting state I would have had no
>> guidance to help me here.
>
>> From Fowler: "Refactoring is the process of changing a software
>> system
> in such a way that it does not alter the external behaviour of the
> code yet improves its internal structure."
>
> Sounds like what you are describing is exactly that, no?
Yes, it is, but since you spoke mostly of the simple kind of
refactoring that Eclipse might do for Java I figured that's all you
thought I was talking about. I was speaking about redesigning the
stuff under the hood. There's no ctrl+ function in Eclipse that would
do that one for me!
Glenn
> David
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
More information about the rspec-users
mailing list