I have in the last year gotten quite fond of using SpecFlow (which is a .NET port of Cucumber)

I have used it both to test a ASP.NET MVC application at the web layer, i.e. using browser automation, but also at the controller layer. The first gives me a higher confidence in the correctness of the application, because JavaScript is tested, and improper controller configuration is also caught.

But those tests are slower to execute, and more complex to implement, than those just testing on the controller layer.

My tests are full functional tests, i.e. they exercise all layers of the application, all the way down to the database. So the first thing before any scenario is that the database is cleared of data, allowing the test to assume that only data specified in the "Given" block exists.

Then I see example on how to use it, where they test just exercise the model layer.

So what are your experiences with these tools? Which layer of the application do you test?

  • 2
    There's a good question in here somewhere, but I'm not quite sure what it is. – Robert Harvey Jan 23 '11 at 0:18

It is important to keep the testing triangle in mind when creating tests:

alt text

This means you should create many more tests at the lower levels of the triangle, and spend less time higher up. It is more costly to maintain end-to-end tests than unit tests.

| improve this answer | |
  • 1
    +1 for the triangle, but I haven't seen much information about BDD specifically. Given that BDD is Behavior driven development, I would expect such tests to be higher up on the triangle. – Robert Harvey Jan 23 '11 at 18:22

Our company is embarking on implementing BDD with our .NET application. Our application is structured with:

  • .NET UI + Middleware
  • OpenEdge AppServer+Database

Our thinking is to replace the UI with the BDD scenarios, and the scenarios interact directly with the middleware.

We are leaving any UI testing as manual (for the moment).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.