Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TDD? BDD? I'm confused! What should I use for testing and why?

So yeah, I'm gettin' into this testing thing!
But I don't know what to use =/

Rspec + Shoulda?
Rspec + Steak?
Minitest?
Cucumber?
Capybara?
Coulda? (Cucumber with Shoulda mixup)
Mini_shoulda? (Minitest with Shoulda mixup)

Argh, so many choices! I'm confused <.< I do know I want something small and simple to test my future gems and sinatra & rails apps. What do you people use and why?

like image 804
Icid Avatar asked Jan 28 '11 16:01

Icid


People also ask

How do you choose between TDD and BDD?

The key difference is the scope. TDD is a development practice while BDD is a team methodology. In TDD, the developers write the tests while in BDD the automated specifications are created by users or testers (with developers wiring them to the code under test.)

How are both BDD and TDD used together for testing?

BDD and TDD may seem very similar since they are both testing strategies for a software application. In both cases, the developer writes the test before writing the code to make the test pass. And in both cases, the tests can be used as part of an automated testing framework to prevent bugs.

What is BDD and TDD in testing?

Behavior Driven Development is a development technique which focuses more on a software application's behavior. Test Driven Development is a development technique which focuses more on the implementation of a feature of a software application/product. 02. In BDD the participants are Developers, Customer, QAs.

Which is more suitable for integration and functional testing TDD or BDD?

Starting with the highest level of functionality and letting that drive how you test and develop your application makes your code more flexible and resilient. For optimal development practice, BDD can and should be paired with TDD.


1 Answers

If you are just starting out, you should go with the defaults and follow the official guides. The important thing is that you practice testing. It's less important which testing library/framework you use - that's a stylistic choice that's secondary to actually practicing testing in the first place - and the easiest way to get starting testing your Rails app is to follow the "Golden Path" that the official guides lay out.

Once you get more comfortable with testing your Rails app, you will be in a much better position to evaluate the options out there. I personally like rspec and cucumber (at the moment - I may decide to change my preference), but I was only able to come up with this preference after already being somewhat familiar with testing and after already being somewhat familiar with Rails.

like image 191
yfeldblum Avatar answered Oct 11 '22 14:10

yfeldblum