Phil Trelford's Array
POKE 36879, 255

TickSpec: Production Ready

October 3, 2010 14:00 by phil

The TickSpec F# Behavioural Driven Development (BDD) project started on CodePlex just over a month ago, and is now in use in production for at least one commercial application. TickSpec executes plain text specifications written in the Gherkin business language against a .Net implementation using reflection and regular expressions (like Cucumber does for Ruby). All English language Gherkin keywords are supported including Background and Examples, along with Bullet Points which are TickSpec specific.

The project now includes support and samples for 3 popular .Net Unit Testing Frameworks:

Screen shot of the MbUnit’s Icarus GUI Test Runner:

TickSpecMbUnit

TickSpec gives the ability to step through plain text feature files in Visual Studio and see the current value of template placeholders of the executing Example:

WinningPositions

Debug support is achieved using Reflection.Emit which executes an IL code representation of the source files at runtime. This allows it to be used from any .Net language, and avoids the need to install a Visual Studio plug-in. Plain text specification files can easily be added to a project as an Embedded Resource.

See TickSpec in action in the following video (includes sound):

 

Yet despite all these features, the TickSpec distribution is still lightweight (<100K) comprising a single standalone assembly (TickSpec.dll). And inside there is support for both C# and F# step definitions using either instance or static methods. So that given the following specification:

Given a bullet list of:

  • 1
  • 2
  • 3

Then the following F# step definition will be passed an array of integer values:

let [<Given>] ``a bullet list of`` (xs:int[]) = ()

 

And also for C# given the regular expression is specified as an argument of the attribute:

[Given(@"a bullet list of")]
public void GivenABulletListOfNumbers(int[] xs)
{
}

 

Get started with the binary, source and examples at: http://tickspec.com and for more information on BDD check out the following free fun e-book: http://www.cuke4ninja.com/


Tags:
Categories: BDD | .Net | F# | C# | Software Craftsmanship
Actions: E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed

Comments

October 4. 2010 14:26

trackback

TickSpec a BDD framework for F#

You've been kicked (a good thing) - Trackback from DotNetKicks.com

DotNetKicks.com

January 16. 2011 14:37

trackback

Cucumber style BDD Step Definitions with F#

Cucumber style BDD Step Definitions with F#

Phil Trelford's Blog

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading