Phillip Trelford's Array

POKE 36879,255

TickSpec: One Year On

It’s coming up to the first anniversary for TickSpec, a library and framework designed to support Behaviour Driven Development (BDD).

The first check-in was on the 30th August 2010:

Barebones BDD framework that supports a subset of the Gherkin language (Given,When,Then).

Since then the original aims of the project have been met, i.e create a lightweight parser library and invocation framework with first class support for F#, C# and integration with the major unit testing frameworks.

At the start of the project the focus was on core features, e.g.:

Added dynamic code generation so that you can step through feature files with the debugger

Added table support

Added Tags support

After the core features came a set of project examples for major unit testing frameworks including NUnit, xUnit, MbUnit and the Silverlight Unit Testing Framework.

TickSpecSLUT

Then with a number of projects using TickSpec in production, it was time to get out and about to talk with people about BDD and demonstrate how Acceptance Tests can be automated with TickSpec. Most recently a Live Meeting in June for the F# Community:


 

Over the last year I’ve been fortunate to attend and speak at quite a few related conferences and community events:

And there’s more on the horizon:

    OSJCukeyFSharp

And there are plenty more related articles here on this blog:

Thanks to recent user feedback on TickSpec there is also now a New Release with:

  • 100x Performance Increase (thanks Jon Harrop)
  • Improved error messages (thanks Martin Trojer)
  • A better C# debug experience (thanks James Banton)

In summary, a year on TickSpec has become a mature open source library and framework for automating acceptance tests on the .Net framework.


Disclaimer

Please bare in mind that a BDD framework is a means to an end and not the end in itself.

In the words of Gojko Adzic from his excellent new book Specification By Example (chapter 4, pages 46-47):

Don’t make test automation the end goal

this approach often leads to tests that are too technical

Don’t focus on a tool

this approach often ends up with programmers using a non-technical tool, intended for executable specifications, to manage technical, developer-orientated tests. This is a waste of time.

And Liz Keogh’s wise words in the article Step Away from the Tools:

BDD isn’t about the tools.

You don’t need BDD tools to do BDD.

Start by having conversations, engaging both testers and business stakeholders

If you can’t have those conversations, stop. You can’t do BDD

BuyerUser Beware!

Progressive F# Tutorials November 2011

At first glance it sounds a little like a set of rock music tutorials, based on a genre from the late 60s and early 70s performed and in a specific key. However on closer inspection the Progressive F# Tutorials seem to have a lot more to do with learning F#, an exciting new multi-paradigm programming language that’s part of Visual Studio 2010.

progfsharpbanner

Could there still be a tenuous link with Progressive Rock?

Jon Covach, once described in Contemporary Music Review, Progressive Rock as:

"a mostly British attempt to elevate rock music to new levels of artistic credibility."

Phil Trelford described in this very article, the Progressive F# Tutorials as:

“a mostly British attempt to elevate F# to new levels of developer understanding.”

Here’s How!

First, assemble of some of the big names in the F# world:

Second, mix in 2 tracks of F# goodness:

  • Track 1: Practical F# from the beginning
    suitable for programmers with C# or VB.Net experience
  • Track 2: F# in the Enterprise
    suitable those with F# experience or advanced C# and VB.Net developers
  • Each tutorial will be approximately 3 hours long and will have a very practical focus (i.e. bring your laptop or netbook). The aim of the conference is to have you programming F# confidently by the time you leave.

Third, help you shift into a Functional mind set with a Programming with the Stars session, where developers explain how they solve problems, featuring:

Finally, kick the whole event of with a look at what’s new in F# vNext!

Hope to see you on November 3rd..4th.

Tetris

Playable Silverlight mini-game implemented with a couple of hundred lines of F#!

Keys: Left Arrow = Left, Right Arrow = Right, Up Arrow = Rotate, Down Arrow = Drop

 

Can also be run as an editable script inside TryFSharp.org.

The main game loop:

let rec gameLoop () =  async {
    do! prompt "Click To Start" awaitingClick                                    
    do! inGameLoop ()         
    do! prompt "Game Over" paused        
    well.Clear()
    return! gameLoop ()
    }

The game makes use of F#’s Asynchronous Workflows to simplify the asynchronous flow. The game loop above looks as if it is run synchronously. But by simply wrapping the code in an async block it can be run asynchronously!

Resources