Place In The Testing Process

Sep 23, 2007 at 6:09 PM
Can I verify where you think BDD fits into the testing of a domain model, my initial thoughts were that you would do the following tests:

1) FIT style tests where the requirement suited that style instead of a story driven style.
2) BDD tests against the real domain objects. Only testing at the level of the domain interface, never breaking the encapsulation that the domain provides. Mainly state based testing (?).
3) White box interaction (unit) tests that can break encapsulation (testing against classes that may not even be visible outside the domain).
4) Integration tests running against the real domain objects and infrastructure.

Would this be an accurate representation of you see it working?
Coordinator
Sep 25, 2007 at 4:24 PM

colinjack wrote:
Can I verify where you think BDD fits into the testing of a domain model, my initial thoughts were that you would do the following tests:

1) FIT style tests where the requirement suited that style instead of a story driven style.
2) BDD tests against the real domain objects. Only testing at the level of the domain interface, never breaking the encapsulation that the domain provides. Mainly state based testing (?).
3) White box interaction (unit) tests that can break encapsulation (testing against classes that may not even be visible outside the domain).
4) Integration tests running against the real domain objects and infrastructure.

Would this be an accurate representation of you see it working?


That all makes sense. Remember, BDD doesn't impose "tests", it uses behaviors and scenarios to shape the domain/application model. This is the fundamental difference between TDD and BDD. For more info, check out http://behaviour-driven.org/
Nov 4, 2007 at 5:22 PM
One thing I'm noticing is that BDD is being used to mean several different things, and mocking is one part of this. For example my reading on BDD has left me confused whether its best suited to interaction style testing or state based domain style testing of the domain layer. Martin Fowler indicates his understanding is:

"An important offshoot of the mockist style is that of Behavior Driven Development (BDD). BDD was originally developed by my colleague Dan North as a technique to better help people learn Test Driven Development by focusing on how TDD operates as a design technique. This led to renaming tests as behaviors to better explore where TDD helps with thinking about what an object needs to do. BDD takes a mockist approach, but it expands on this, both with its naming styles, and with its desire to integrate analysis within its technique. I won't go into this more here, as the only relevance to this article is that BDD is another variation on TDD that tends to use mockist testing. I'll leave it to you to follow the link for more information."

So my question is how does BDD relate to mocking, especially in the context of a DDD domain model?