Can BDD testing with Lettuce replace all other forms of testing in a project?

I like lettuce and the feeling of testing it. Can I replace all tests (doctrines / unit tests) in a project with Lettuce functions?

+7
source share
3 answers

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.

+2
source

In short, no.

I have not used salad, but your question applies equally to other BDD frameworks such as Cucumber.

This approach is considered bad practice because integration tests are slower and work more than unit tests.

In addition, the great advantage of Gherkin's syntax is that it is read by non-technical stakeholders, and it can focus on business rules, while unit tests usually deal with detailed implementation / class-specific implementation features that are not of particular interest to business - interested parties.

Sometimes there is one coincidence between unit tests and integration / acceptance tests, but in general you should strive to find the right balance.

+8
source

It’s a bad idea to use Gerkhin / Salad for everything.

1) You should never completely eliminate manual testing. You can replace repetitive testing scripts, but you need to run the software past someone who may misunderstand or misuse it. Creative, destructive, human testing is important, but a heavy lift (90% + of all tests) must be automated.

2) Another reason lies in the distribution: it works slowly compared to unit tests. I find that the more time it takes to run a test, the less likely it is that people will run it often. You want this not to be the solution to run the tests after each change, maybe 2 or 3 times every 5 minutes (yes, it is fast!).

3) Personally, I believe that writing unittests using sniffer or autonose in another window gives me the best environment for test code. I do not know how to do this with a salad.

4) Why switch languages ​​if you do not need it? Unittest is in python, and there are no gadgets or breaks of any type to get the code you are interested in testing. It works well with bullying and fakes. Cucumber is fun, but it focuses more on plumbing. Additional plumbing is great if you don't have programmers writing tests, but otherwise it's just overhead.

+1
source

All Articles