I have to disagree with Andy.
I agree that appropriate testing should be carried out at the appropriate time, and that unit tests (i.e. those that do not interact with anything outside their unit) do not replace all other forms of testing.
But this does not necessarily mean that with proper separation, you cannot use the BDD framework (I also did not use Lettuce) as a runner for your tests.
I also really like the fact that Gernkin’s syntax can be thrown back to business experts, testers and sponsors as a means of capturing the process to follow, so I don’t see the reasons why one set of specifications cannot be targeted at the Unit level, but another can target system levels and regression.
Consider this (far-fetched and obviously not sufficiently granular) example
- Given that my test server is being updated with the last nights of the build
- When I run the regression TestPack1
- Then my regression results should match the known results for regressionTestPack1
I also do not say that this is appropriate in any case. You must evaluate how you will benefit from this approach by leaving all your tests in different test systems. In particular, think about the experience base of the people performing the tests.
So, if you are writing a small technical project as the only developer, and you prefer this syntax, this is not the reason. Just be very careful, you still separate your unit tests from your system tests from your regression tests.
If, however, you are part of a large team of developers, testers, business analysts, then your case will be much stronger and unlikely to be really valid.
Alski
source share