Presentation test and design a Web API using Cucumber, NodeJS & express.
The code for this presentation can be found on Github:
https://github.com/enix/cucumber-driven-calculator
2. IT’S NOT ME, IT’SYOU
• a way to develop a
common language between
the people in your team
• a way to test software a
little bit more readable
• a way to reason about
design without the technical
clutter
3. YEAH YEAH
• to promote designing
customer value
• to ensure stuff (APIs)
keep working
• to include all team
members in the design
process
5. WHATTO DESIGN ANDTEST
Simple Calculation API that can be explored using a
HAL+JSON* like syntax
*yeah, that’s just me trying to look smart
6. QUICK BOOT INTO
NODE-JS NINJA MODE
• coffee anybody?
• Express(o) please
• promises, promises always
those promises
• anatomy of a cucumber
• I expect you to do better
next time
• HAL: I’m sorry Dave
7. COFFEE ANYBODY?
var bla = function(r){
return "hello " + r;
}
bla = (r) ->
"hello #{r}”
equals
8. EXPRESS(O) PLEASE
app.get (req, res) ->
res.send {
succes:“yes it works!”
}
app.options (req, res) ->
res.send {
succes:“yes it still works!”
}
10. ANATOMY OF A CUCUMBER
Feature: Calculator API
In order to avoid silly mistakes
As a math idiot
I want to be told the sum of two numbers
!
Scenario: calculate the sum, only nicer
When I "add" the numbers 1 and 2
Then the result should equal 3
11. ANATOMY OF A CUCUMBER
Feature: Calculator API
In order to avoid silly mistakes
As a math idiot
I want to be told the sum of two numbers
!
Scenario: calculate the sum, only nicer
When I "add" the numbers 1 and 2
Then the result should equal 3