12
FUNCTIONAL BDD Phillip Trelford 2011 http://trelford.com/blog @ptrelford

Functional BDD at Cuke Up

Embed Size (px)

DESCRIPTION

Functional BDD talk demonstrating the TickSpec .Net framework at the Cuke Up (Cucumber) conference

Citation preview

Page 1: Functional BDD at Cuke Up

FUNCTIONAL BDDPhillip Trelford 2011

http://trelford.com/blog

@ptrelford

Page 2: Functional BDD at Cuke Up

FIRST STEPS IN BDD ON .NET

• Shell• C# & F#

StorEvil

• Visual Studio

• C#

SpecFlow

• F# & C#• VS & Shell

?

?

Visual Studio

NUnitGherkin

Page 3: Functional BDD at Cuke Up

LOOK NO HANDS

Page 4: Functional BDD at Cuke Up

LOOK NO HANDS

Page 5: Functional BDD at Cuke Up

TICKSPEC DESIGN GOALS

Platform for Innovation Lightweight Flexible Framework Extensible Parser

Support & Leverage F# Tick methods Modules Active Patterns

Support major test frameworks NUnit, xUnit, MbUnit Silverlight Unit Test

Page 6: Functional BDD at Cuke Up

INCEPTION

<200 lines of code Parser

Regular Expressions Given, When, Then And or But

Runner Reflection Attributed methods

Monday

August

302010

Page 7: Functional BDD at Cuke Up

TICKSPEC

Page 8: Functional BDD at Cuke Up

F#

Strongly Typed Functional Object Orientated Open Source .Net language In Visual Studio

Page 9: Functional BDD at Cuke Up

SYNTAX

let x = 1

let add (lhs,rhs) = lhs + rhs

[1;2;3;4] |> List.iter

(fun item -> puts item)

raise (Exception("Bang"))

x = 1

def add(lhs,rhs) lhs + rhs end

[1,2,3,4].each

{|item| puts item}

raise 'Bang'

F# Ruby

Page 10: Functional BDD at Cuke Up

CLASS

type Person(name,age) =

member person.Name = name

member person.Age = age

override person.ToString() =

sprintf "%s %d" name age

class Person

def initialize(name,age)

@name, @age = name, age

end

def name

@name

end

def age

@age

end

def to_s

"#@name (#@age)"

end

end

F# Ruby

Page 11: Functional BDD at Cuke Up

VS INTEGRATION

Page 12: Functional BDD at Cuke Up

WHAT NEXT?

MIX 11• Las Vegas • Monday April 11th

DDD Scotland• Glasgow• Saturday May 7th

F#unctional Londoners Meetup• Skills Matter, London• Every 6 weeks