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. Incivility is not tolerated, such comments are deleted.

 

I'm the co-author of TimeSnapper, 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.

 

NimbleText - FREE text manipulation and data extraction

NimbleText is a Powerful FREE Tool

I wrote this, and use it every day for:

  • extracting data from text
  • manipulating text
  • generating code

It makes you look awesome. You should use NimbleText, you handsome devil!

 

Articles

The Canine Pyramid The Canine Pyramid
Humans: A Tragedy. Humans: A Tragedy.
ACK! ACK!
OfficeQuest... Gamification for the Office Suite OfficeQuest... Gamification for the Office Suite
New product launch: NimbleSET New product launch: NimbleSET
Programming The Robot from Diary of a Wimpy Kid Programming The Robot from Diary of a Wimpy Kid
Happy new year 2014 Happy new year 2014
Downtime as a service Downtime as a service
The Shape of Your Irrationality The Shape of Your Irrationality
This is why I don't go to nice restaurants any more. This is why I don't go to nice restaurants any more.
A flowchart of what programmers do at work all day A flowchart of what programmers do at work all day
The Telepresent Man. The Telepresent Man.
Interview with an Ex-Microsoftie. Interview with an Ex-Microsoftie.
CRUMBS! Commandline navigation tool for Powershell CRUMBS! Commandline navigation tool for Powershell
Little tool for making Amazon affiliate links Little tool for making Amazon affiliate links
Extracting a Trello board as markdown Extracting a Trello board as markdown
hgs: Manage Lots of Mercurial Projects Simultaneously hgs: Manage Lots of Mercurial Projects Simultaneously
You Must Get It! You Must Get It!
AddDays: A Very Simple Date Calculator AddDays: A Very Simple Date Calculator
Google caught in a lie. Google caught in a lie.
NimbleText 2.0: More Than Twice The Price! NimbleText 2.0: More Than Twice The Price!
A Computer Simulation of Creative Work, or 'How To Get Nothing Done' A Computer Simulation of Creative Work, or 'How To Get Nothing Done'
NimbleText 1.9 -- BoomTown! NimbleText 1.9 -- BoomTown!
Line Endings. Line Endings.
**This** is how you pivot **This** is how you pivot
Art of the command-line helper Art of the command-line helper
Go and read a book. Go and read a book.
Slurp up mega-traffic by writing scalable, timeless search-bait Slurp up mega-traffic by writing scalable, timeless search-bait
Do *NOT* try this Hacking Script at home Do *NOT* try this Hacking Script at home
The 'Should I automate it?' Calculator The 'Should I automate it?' Calculator

Archives Complete secretGeek Archives

TimeSnapper -- Automated Screenshot Journal TimeSnapper: automatic screenshot journal

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
Universal Troubleshooting checklist Universal Troubleshooting Checklist
Top 10 SecretGeek articles Top 10 SecretGeek articles
ShinyPower (help with Powershell) ShinyPower
Now at CodePlex

Realtime CSS Editor, in a browser RealTime Online CSS Editor
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 little schemer


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

Recommended blogs

Jeff Atwood
Joseph Cooney
Phil Haack
Scott Hanselman
Julia Lerman
Rhys Parry
Joel Pobar
OJ Reeves
Eric Sink

InfoText - amazing search for SharePoint
LogEnvy - event logs made sexy
Computer, Unlocked. A rapid computer customization resource
Aussie Bushwalking
BrisParks :: best parks for kids in brisbane
PhysioTec, Brisbane Specialist Physiotherapy & Pilates
 
home .: about .: sign up .: sitemap .: secretGeek RSS .: © Leon Bambrick 2006 .: privacy

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