Test Driven Development

Hale.Pane

IDONTLIFT
Oct 13, 2011
681
11
0
SeWr3A8.gif


My life has been a lie.

What are some good sources for learning tdd for ruby/RoR ?

Right now I'm just using rspec + capybara.
 


TDD is very good at ensuring you create technically sound applications, but it does nothing to ensure that the code actually accomplishes your business goals.

Take a look at Behavior Driven Development. It basically combines Agile/Scrum with TDD and lets you test business needs the same way you do standard tests.

As a .NET dev, I use SpecFlow. It's incredibly helpful because it has a "plain English" syntax readable by non-coder stakeholders. I'm not sure what the RoR equivalent is.
 
Test driven development sucks, its for catching really basic errors like types. Sure it's nice if you have all the time in the world...

Behaviour driven testing is much better
 
Testing is a deceitfully advanced topic, particularly how to not waste your time.

Check out https://github.com/sconover/wrong.

I found Rspec and Cucumber to add unnecessary complexity. `subject.should be_valid` and `subject.should_contain :apple` (Rspec) are less expressive than `assert user.valid?` and `assert fruit.contains? :apple`.