InfoQ

Interview

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

Interview with Dave Astels and Steven Baker on Mar 30, 2007

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

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

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.