InfoQ

Interview

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
Agile Techniques ,
Artifacts & Tools
Tags
BDD ,
TDD ,
Testing
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

Related Sponsor

VersionOne is recognized by Agile practitioners as the leader in Agile project management tools. Companies such as Adobe, BBC, CNN, Dow, HP, IBM, Sony and 3M have turned to VersionOne to help deliver greater value to their customers.

No comments

Watch Thread Reply

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.