InfoQ

Interview

   Good News: We have re-worked our video infrastructure to provide more reliable service. Please email bugs at infoq.com with any problems.

Dave Astels and Steven Baker on RSpec and Behavior-Driven Development

Interview with Dave Astels and Steven Baker on Mar 30, 2007 10:11 AM

Community
Agile,
Ruby
Topics
Artifacts & Tools,
Agile Techniques
Tags
BDD,
Testing,
TDD
Summary
InfoQ interviews Dave Astels and Steven Baker, two of the authors of the successful Rspec framework about enabling Behavior-Driven Development in Ruby, and the implications of moving from a test-centric point of view to one that is more specification-driven.

Bio
Dave Astels one of the founders of the RSpec project, co-author of "A Practical Guide to eXtreme Programming" and author of "Test-driven Development: A Practical Guide" is an independent consultant in the area of Ruby and Rails. Steven Baker is a well-known Ruby on Rails developer and one of the original authors of the RSpec framework for Behavior-Driven Development.
Ok, so it's my pleasure to be here with Dave Astels and Steven Baker and they've been talking to us about TDD and RSpec and BDD (behavior-driven development). Let's talk a little bit about where you are from and why you are talking about these particular topics?
Steven?
What is TDD? In case some of out viewers are scratching their heads right now and wondering what we are talking about...
Is it not working backwards though, if you write your tests first?
Steven, you just gave a talk on TDD. Can you give us some of the main bullet points and why you are presenting this at Canada on Rails? What is the connection?
The scaffolding in Rails produces tests. In your experience, does that help people get into TDD?
Is scaffolding evil from a TDD prospective?
What are the benefits of doing TDD?
Define robust.
Definitely, you're the expert.
Why is TDD and Unit testing so important in Ruby? Versus other kind of languages?
Of particular concern for those who are evangelizing Ruby is that in the debate over static typing versus dynamic typing there's a lot of concern about runtime errors. How do you see TDD and thorough unit testing addressing the ultimate adoption and success of Ruby in the marketplace?
That's sort of a test isn't it?
It's human nature to engage in risky behavior. When you encounter people that are not testing, what do you do about it? How do you deal with it on a project basis or a corporate basis to encourage them to adopt TDD.
How do you convince someone about the benefits of TDD? How do you show them that TDD is superior?
How do you analyze the results of TDD?
That part was hit by hurricane over and over again
And you have seen results that way on your own projects?
That's a good way to turn the problem on its head. So have you had luck working with teams to transition them over to doing TDD?
How many developers do you work with?
You both mentioned the notion of specification or test specification. So, at what point do we drop the test lingo and refer to them as specifications?
Today? That's ambitious. Can you tell us a little bit about what the behavior driven design aspect of it is?
How long has this terminology changed? When did that start making sense, whose light ball was that?
So it's a relatively new development but is it a new concept? Because you can say that the way we developed along the years is specification-driven in the sense that we code to requirements, or is this different?
In the course of deciding on the vocabulary that you would use for specification, I believe you came up essentially with a DSL (domain-specific language) correct? That means a specific language for doing a specification that drop the test references right?
What did these concepts of specifications as a DSL end up looking like in Ruby?
What is Rspec?
What would the specifications for a Rails model look like?
Does this specification cross boundaries models, and controllers and different aspects of the App?
And you can use some of the syntax sugar for acceptance test?
But instead of saying "assert" by saying a property of something sould be something else makes it read more like English. Are you finding that a lot of people are doing that?
What's been the main feedback you got on Rspec?
Do you think you can get to the point where you can have some of the Rspec stubs or some amount of Rspec code generated?
You have to consider use of this thing in a greater context, right? Because if you're going to write a specification that says "account balance should be ten" that means that you already have decided that there is an account class in your system that has some sort of balance properties.
So an Rspec specification is a file and you can theoretically before you jump into the implementation of your system go through a requirements analysis phase where you generate a bunch of Rspec specifications? Or am I perverting your vision of where you want to take this?
What is FIT?
Does it replace unit tests?
Does it also replace functional tests in the Rails application?
You could say it's mocking the server?
A year ago when we found out about Rails, we started doing it, maybe longer for you Steven I'm not exactly sure, but one of the great things about Rails from an Agile perspective is that it encourage testing, TDD to some degree. I guess now we have the question: so if you have your way how would you revamp the whole Rails testing or to be more accurate the Rails specifications?
Is this BDD stuff maybe ahead of its time?
If it gets adoption outside of people who have exposure to the Agile community there are going to be issues.
Let's talk a little bit about with your specifications, if it really is like a unit test. You are using mocks and stubs then to actually define internal behavior of the class? Is it exactly the same as it would be just with a different language or are there changes that come about from the different vocabulary?
I would think that would lead to altered behavior on the part of the developers?
Let's say that we managed to get a shift in attitude so that this is no longer considered as verification. Where does testing go? Does this mean you don't test your application anymore?
Where do you see this going? We have a lot of mass behind TDD and test unit and X-unit style testing. How long does it take to get this ship going? Where do you see Rspec going in terms of provoking that?
Did you get a sense of how many people in the audience during your talk were actually familiar with the concepts you were talking about and may have actually been doing TDD? You know what they are up to, you've seen their faces right?
So what are your next stops? We talked a lot about things that maybe you're not quite there yet.
So what would the Rails plug in do? I mean you've obviously given this some thought. What will it do to your Rails development?
I guess you don't use the Rails code generation then.
So you don't even do model generation with Rails?
You mentioned being influenced by Dave quite a bit and you guys seem to spend a lot of time together. Are you going to continue working on this project together or what can we expect in the near future?
Thank you guys. We look forward to lots of good stuff from you.
show all  show all

No comments

Reply

Exclusive Content

Tapestry for Nonbelievers

A new article by I. Drobiazko and R. Zubairov introduces v. 5 of the Apache Tapestry component-oriented web framework. The tutorial shows how to create a component and covers IoC in Tapestry and Ajax.

Pete Lacey on REST and Web Services

In this interview, Burton Group consultant Pete Lacey talks to Stefan Tilkov about his disillusionment with SOAP, his opinion on REST, and addresses some of the perceived shortcomings REST vs. WS-*.

Business Natural Languages Development in Ruby

Jay Fields presents his concept of Business Natural Languages - a type of Domain Specific Languages geared towards being readable by domain experts.

Distributed Version Control Systems: A Not-So-Quick Guide Through

Adoption and interest for Distributed Version Control Systems is constantly rising. We will introduce the concept of DVCS and have a look at 3 actors in the area: git, Mercurial and Bazaar.

Segundo Velasquez and Agile as Seen Through the Customer's Eyes

Deborah Hartmann interviewed Segundo Velasquez about his experience as customer with an Agile team during the initial phase of software design of a product.

Fine Grained Versioning with ClickOnce

David Cooksey shows how to fine grained versioning to a ClickOnce deployment using an HttpHandler written with ASP.NET, making partial rollouts to a test audience much easier.

Implementing Manual Activities in Windows Workflow

Windows workflow (WF) is an excellent framework for implementing business processes, but lacks support for human activities. This article describes a completely generic approach for changing this.

Markus Voelter about Software Architecture Documentation

In this interview taken during OOPSLA 2007, Markus Voelter talks about the importance of documenting the software architecture, and gives some good and also bad examples on how it could be done.