Using Specflow to drive outside in development on .NET MVC 3 based projects
I want to do ATDD with TDD and DDD and 开发者_JAVA百科I want to first discover behaviors (using mocks) of a domain model (ecommerce in my example). You can imagine that in DDD layering we can have application services calling domain services and repositories or other services and non business logic code, only tasks related to the application) Please use the text below that I am trying to understand:
HOW TO USE MOCKS TO DISCOVER BEHAVIOUR OF MY ECOMMERCE DOMAIN AND THEN ENTER MORE GRANULAR TDD DEVELOPMENT TO IMPLEMENT DESIRED BEHAVIOUR.
This is an excerpt from another question (as an answer).
BDD, what's a feature?
"Pick whatever task that you need to implement, open a blank text file and try to explain using simple sentences the behavior. Every sentence should start with one of three keywords: given, when and then. Using your favorite BDD framework write the code that will parse these sentences and stimulate the application to get into the start state (given), execute some commands (when) and assert the transitioned state (then). Application code may start from mere mocks. Replace gradually those mocks with gradually built code and grow your application with higher confidence and quality levels."
Can someone provide some concrete examples of starting with mocks (RhinoMock, Moq) using two approaches:
1.Driving ATDD via Controller's actions and
2.Using Watin Driver (Page Objects, WatiN MVCContrib extensions) or Selenium.If I am using no. 2. will I be able to see some example data when I visit some pages myself and do some actions ("When" I do something: navigate, post data) and validate results of these actions.
To fully understand the nature of my question please read this: http://jockeholm.wordpress.com/2010/02/14/combining-tddbdd-with-ddd/ Especially Steps 3. and 4.
I will privide the text for step 3:
3.[BDD/ATDD] For each test scenario, implement an executable example that fails, since that behaviour is not supported by the system. Then, use outside-in development, with an extensive use of mock objects, to flesh out the behavior specified in the executable example.
Thanks, Rad
This may help:
http://msdn.microsoft.com/en-us/magazine/dd882516.aspx
精彩评论