4

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?

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

2 Answers 2

5

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.

1
  • 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. Commented Jan 23, 2011 at 18:22
0

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).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.