From: Avdi Grimm Date: 2008-11-20T03:44:51+09:00 Subject: Re: I don't like specs, should I change my point of view ? On Tue, Nov 18, 2008 at 9:06 PM, Ken Bloom wrote: > I've read that before. Can anyone defend rspec against that attack? What > does rspec do better? I want to get a better idea of why they invented > this quasi-English framework. There's information about the "why" here: http://behaviour-driven.org/BehaviourDrivenDevelopment BDD is, as you've identified, just testing with a slightly different vocabulary. But vocabulary is important: it influences how you think about the problem. I've seen a lot of TDD code fall into the rut of "let's test method A, now let's test method B, now let's test method C". BDD encourages a different focus and a different organization: "let's talk about how this object should behave in situation A. Now let's talk about how the object should behave in situation B." The granularity is based on contextual behavior, rather than on methods. The very best TDD unit tests I've seen have provided a well-organized breakdown of the expected inputs and outputs of each method in a class, and were usable as documentation by a programmer. Documentation, not a document. By contrast, the very best BDD specs I've seen have read almost like a prose document describing the system's behavior, one you could read aloud to a client and have them understand and either agree or disagree. -- Avdi