Behavior Driven Development: As Human As Possible
secretGeek .:dot Nuts about dot Net:.
home .: about .: sign up .: sitemap .: secretGeek RSS

Behavior Driven Development: As Human As Possible

I've been intrigued with everything I've read about "Behavior Driven Development" -- which is essentially a friendlier face on Test Driven Development.

For beginners like me I think the most obvious concept is that BDD = Test Driven Development Plus "natural sentence style test naming" as JP Boodhoo calls it.

For example, David Laribee gives examples where Tests and test fixtures are simply renamed according to a strict pattern, like this:

namespace Specs_for_TransactionElection
{
[TestFixture]
public class When_an_election_is_started : Spec
{
private ITransaction _stubTransaction;
private TransactionElection _election;

[Test]
public void The_result_should_be_in_progress()
{

Assert.AreEqual(_election.Result, TransactionElectionResult.InProgress);
}
}

The upshot of this is that the tests in the code runner read like a restricted-subset of plain English:

Behavior Driven Development example from Resharper

Some people, including David Laribee and Ryan LaNeve have said that the output of these stories could be improved to present a more human-readable form.

What i'd like to see is a better looking code runner.

The treeview control itself should present a "Friendlier" form of those names -- underscores could be converted into spaces. Larger fonts could be used for sub-headings. And the larger headings should be in lower contrast colour, so you can fade them out when you want to.

Here's a dodgy mockup:

Specifications for Transaction Election passed When votes are cast: passed A single no vote should rollback the transaction.passed A no vote will leave the election with a finished and voted no status. passed Unanimous yes votes will commit the underlying transaction.

The point here is that I'm not talking about improving the output of the unit test tool -- for example the 'Dox report generated by the MbUnit GUI runner' (as Ryan LaNeve has demonstrated)-- I'm talking about changing the runner itself so that it directly cleans up the names of the tests and fixtures for presentation.

It could even report on "Convention Breakers". (Squiggly red underline perhaps).

(side note: matt calla provides a macro for doing the exact opposite of this.)

(Other side note: is this similar to Donald Knuth's idea of literate programming?)





'Ben' on Tue, 13 May 2008 16:19:41 GMT, sez:

Not another "<enter-word-here> Driven Development" scheme!!

Ok, that is cool though.... :)



'Arjan Zuidhof' on Tue, 13 May 2008 18:09:17 GMT, sez:

The idea of BDD seems nice, but it can't ever be literate programming, as everything invented by the K-nuth is impossible to understand for us mere mortals.
And by inspecting the wikipedia page http://en.wikipedia.org/wiki/Literate_programming it seems that is indeed stretched a bit further that just creating a userfriendly name for our methods



'OJ' on Tue, 13 May 2008 19:53:09 GMT, sez:

Leon, I think you've left one of your sentences hanging:

"Some people, including David and Ryan LaNeve have said that these stories"

Not sure if you intended to leave it like this ;)



'lb' on Wed, 14 May 2008 08:13:37 GMT, sez:

cheers OJ, fixed it at last.

i've also put together some lists of material on TDD, BDD, MVC, IoC (DI), and a whole lot more. So many acronyms, so little time.

lb



'Paul Kohler' on Wed, 14 May 2008 21:57:28 GMT, sez:

Leon,

Nice point about the test runner. I started doing this a while ago (more so for my "functional" tests) and it’s been quite useful. I had the GUI test results pumped into a HTML report file as the tests were executed and these format changes similar to your dodgy mock-up made for a very useful tracking mechanism of the tests - both for me and the team etc.

I do like the idea of doing it to the test runner though... hmmm!

PK :)



'Csmr' on Fri, 30 May 2008 08:17:15 GMT, sez:

Tests? Tests?!?! Specs? Specks.




name


website (optional)


enter the word:
 

comment (HTML not allowed)


All viewpoints welcome. But the right to delete any post for any reason is reserved. Don't make me do it. Comments may be republished, emailed to your loved ones or printed and used as toilet paper. Who reads this legal bit anyhow?

TimeSnapper is a life analysis system that stores and plays-back your computer use. It makes timesheet recording a breeze, helps you recover lost work and shows you how to sharpen your act.

TimeSnapper won last year's Developer Competition at Larkware.com, and is used by over 10,000 people.

Articles

Is the remote control a thing of the past? Is the remote control a thing of the past?
The Utterly Thorough Guide To Awesome Application Compatibility on Windows 7. The Utterly Thorough Guide To Awesome Application Compatibility on Windows 7.
Astounding Hyperlinked Noticeboard Astounding Hyperlinked Noticeboard
Three Questions About Each Bug You Find Three Questions About Each Bug You Find
Recursing over the Pareto Principle... Recursing over the Pareto Principle...
Sometimes, The Better You Program, The Worse You Communicate. Sometimes, The Better You Program, The Worse You Communicate.

Archives .: secretGeek :: Complete Archives
TimeSnapper -- Automated Screenshot Journal TimeSnapper.com    
Version 3.3: true productivity boost

Next Action NextAction
Managing the top of your mind

World's Simplest Code Generator (html edition) World's Simplest Code Generator
25 steps for building a Micro-ISV 25 steps for building a Micro-ISV
3 minute guides -- babysteps in new technologies: powershell, JSON, watir, F# 3 Minute Guide Series
Top 10 SecretGeek articles Top 10 SecretGeek articles
ShinyPower (help with Powershell) ShinyPower
Now at CodePlex

Gradient Maker -- a tool for making background images that blend from one colour to another. Forget photoshop, this is the bomb. Gradient Maker


[powered by Google] 


How to be depressed How to be depressed
You are not inadequate.



Recommended Reading

The Best Software Writing I
The Business Of Software (Eric Sink)

Recommended blogs

Jeff Atwood
Reginald Braithwaite
Joseph Cooney
Phil Haack
Scott Hanselman
Julia Lerman
Rhys Parry
Joel Pobar
OJ Reeves
Eric Sink
Joel Spolsky
Des Traynor

Aggregated Links

programming.reddit.com
dzone
dot net kicks

Human Link Machines

interesting finds
a continuous learner's weblog
arjan's world
n links today
new and notable
morning coffee
learning .net
weekly link post
(my del.icio.us account)

LinkedIn profile
 
home .: about .: sign up .: sitemap .: secretGeek RSS .: © Leon Bambrick 2006 .: privacy

home .: about .: sign up .: sitemap .: RSS .: © Leon Bambrick 2006 .: privacy