[rspec-users] Mocks? Really?

Francis Hwang sera at fhwang.net
Tue Jan 1 13:48:04 EST 2008

On Dec 31, 2007, at 1:10 PM, Zach Dennis wrote:
> I don't think it is "designing less" either. It's designing better  
> and doing it smarter, knowing that you'll never fully comprehend  
> the domain of your problem upfront, so you discover it,  
> iteratively. As you discover more about the domain the design of  
> your program changes (during refactoring) to support a domain model  
> to which it is representing.
> This is a concept from Domain Driven Design.
> It Francis is referring to doing less upfront design to try to  
> master it all from the outset, then I agree that less of that is  
> better. But that is entirely different then just doing less design.

I'm not certain how much we're genuinely disagreeing here and how  
much we're talking past each other -- I'm certainly feeling like I'm  
not communicating my amorphous ideas very well.

One thing that seems fuzzy to me is the implied time frames here. Let  
me ask you this, Zach: Is it your aim that your released code always  
contains a set of classes whose interactions with other classes is  
well-structured and defined, through mocks, and other tools? And is  
it your belief that you can always seek to release code which  
embodies a precise understanding of the domain in question?

I suppose part of what I'm saying is that sometimes, for non- 
programmer reasons, the domain itself is too fuzzy or too quickly  
shifting to try to nail down with a well-structured design. Sometimes  
you just release code that amorphously hints at a future design --  
and in those cases, a strong test suite is what prevents you from  
shooting yourself in the foot.

Francis Hwang

More information about the rspec-users mailing list