cfSpec now includes "stub" objects (with true "mock" objects coming soon) so that you can specify the behavior of components independent from each other (so you don't have to write multiple objects just to get one object's expectations satisfied).
As far as I can see both are very 'agile' and can be used in a similar way. ie rather than writing a Test First mxunit test - red, green, refactor - we're doing the same with BDD - purple - green - refactor.
The benefits I see are a more descriptive language in the specs/tests and the possibility we can easily generate cfSpec's from use cases etc
But both seem 'botton-up' to me in the sense that we don't need to do a BIG design up-front. We just write a spec, watch it fail then write JUST ENOUGH code to make it pass.
BDD focuses more on higher level behavior and allows multiple implementations for a single expectation and is also deals with "should" rather than "is" (which may be a subtle semantic difference but when you're designing a system, "should" is a better reflection of how you *expect* a system to behave rather than a series of detailed tests on specific values).
Does that make sense?
The way you describe it its almost as if as developers we can use both approaches but I always thought of it as BDD versus TDD as a choice otherwise you'll violate DRY ie a BDD cart.shouldBeEmpty() and a TDD ensureCartIsEmptyWhenCreated() do generally the same thing.
Next question would be: if there was a decent Eclipse plugin for cfSpec and good mocking options would you switch from mxunit for your tests, sorry specs? :-)
My rule of thumb would be to think about how much detail you normally put in a specification document. You specify expected behaviors of entities within the system but you don't necessarily go into mind-numbing detail.
I would use BDD for the same level of detail as I would write a spec and then use TDD for lower-level implementation stuff. I think I would be more likely to use TDD for maintenance and bug fixes, than BDD (create a test that fails to highlight the bug and then fix the bug and make sure the test passes).
Of course, right now I tend to use TDD for "everything" but it doesn't always feel very natural for the higher-level stuff because it requires you to be very explicit in your test code.
Bottom line, I suspect I will use both cfSpec and MXUnit going forward.
Another consideration is that BDD allows for regular human-readable "tests" whereas TDD requires a computer programmer to read the tests (which, of course, was part of the motivation for the folks who created BDD in the first place).
Final question before I disappear :-)
So if BDD is used for higher level stuff would you run the 'specs' as part of CI in the same way you would run your suite of unit tests or would you leave BDD out of this and keep it as only a higher level tool for designing your software?
I'm guessing the BDD specs would not form part of your CI process
I guess if the BDD tools expand to support programmatic output, suitable for use with ant and, say, JUnit Reports then I would move closer to using BDD for everything.
Of course, there's also a school of thought that views BDD as merely TDD using different terminology (this comes up on the testdrivendevelopment Yahoo! group from time to time)...


