Phil Trelford at CukeUp 2013@ptrelford
Specification                            By Example              Behaviour              Driven              DevelopmentAcc...
You want to do X,            and you think Y is the best way of doing so.Instead of asking about X,                   you ...
You want to do deliver the right software,   and you think SpecFlow is the best way of doing so.Instead of asking about Sp...
 How can we stop these scenarios being so brittle? How do we use our BDD tool to do <this kind of testing>? We’re using...
1.1 - Two firm orders in the market, existing implied calendar orderh4. *Given** the following orders already exist:| ID |...
h4. *Examples*|| contract 1 || order 1 || contract A || order A || observed contract || implied order ||| API2 - Jul 2010 ...
Scenario: [2.B] First leg is generated when orders already exist on the second leg and the spread.   Given the following o...
 Feature Background Scenario Scenario Outline Examples
 Background Scenario Scenario Outline Examples Scenario Outline Examples Examples
 Background Scenario Scenario Outline Scenario Outline Shared Examples Shared Examples of @tag
Scenario: Change propagates from a value cell to a reference via 3 referencesGiven a sheet with data:| Row |     A   |   B...
Scenario: Sum from 3 horizontal cellsGiven a sheet with data:| Row | A      | B       | C   | D     ||   1    | 1   | 10 |...
Twitter: @ptrelfordBlog: http://trelford.com/blogJoule: http://trayport.com/JouleTsunami IDE: http://tsunami.ioTickSpec: h...
Examples, Examples, Examples!
Examples, Examples, Examples!
Examples, Examples, Examples!
Examples, Examples, Examples!
Examples, Examples, Examples!
Examples, Examples, Examples!
Examples, Examples, Examples!
Examples, Examples, Examples!
Examples, Examples, Examples!
Examples, Examples, Examples!
Upcoming SlideShare
Loading in …5
×

Examples, Examples, Examples!

3,849 views

Published on

Specification by Example talk at CukeUp 2013 in London.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,849
On SlideShare
0
From Embeds
0
Number of Embeds
2,801
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Examples, Examples, Examples!

  1. 1. Phil Trelford at CukeUp 2013@ptrelford
  2. 2. Specification By Example Behaviour Driven DevelopmentAcceptanceTest DrivenDevelopment
  3. 3. You want to do X, and you think Y is the best way of doing so.Instead of asking about X, you ask about Y.
  4. 4. You want to do deliver the right software, and you think SpecFlow is the best way of doing so.Instead of asking about Specification By Example, you ask about SpecFlow.
  5. 5.  How can we stop these scenarios being so brittle? How do we use our BDD tool to do <this kind of testing>? We’re using a BDD tool. How do we get our analysts to help us? How can we avoid all this duplication in our scenarios? What do we do if the business aren’t interested in BDD?
  6. 6. 1.1 - Two firm orders in the market, existing implied calendar orderh4. *Given** the following orders already exist:| ID | Contract | Existing Order || 1 | <contract 1> | <order 1> || 2 | <contract 2> | <order 2> |h4. *When** I subscribe to implied orders for <observed contract>* The following orders are added:|| ID || Contract || Added Order ||| A | <contract A> | <order A> |h4. *Then** I should observe the following implied orders:|| Contract || Implied Order ||| <observed contract> | <implied order> |
  7. 7. h4. *Examples*|| contract 1 || order 1 || contract A || order A || observed contract || implied order ||| API2 - Jul 2010 | Bid 5@10 | API2 - Aug 2010 | Ask 5@10 | API2 - Jul 2010 x Aug 2010 | Bid 5@0 || API2 - Jul 2010 | Bid 5@20 | API2 - Aug 2010 | Ask 5@10 | API2 - Jul 2010 x Aug 2010 | Bid 5@10 || API2 - Jul 2010 | Bid 5@20 | API2 - Aug 2010 | Ask 5@30 | API2 - Jul 2010 x Aug 2010 | Bid@-10 || API2 - Jul 2010 | Ask 5@10 | API2 - Aug 2010 | Bid 5@10 | API2 - Jul 2010 x Aug 2010 | Ask 5@0 || API2 - Jul 2010 | Ask 5@20 | API2 - Aug 2010 | Bid 5@10 | API2 - Jul 2010 x Aug 2010 | Ask 5@10 || API2 - Jul 2010 | Ask 5@20 | API2 - Aug 2010 | Bid 5@30 | API2 - Jul 2010 x Aug 2010 | Ask 5@-10 || API2 - Jul 2010 x Aug 2010 | Bid 5@0 | API2 - Aug 2010 | Bid 5@5 | API2 - Jul 2010 | Bid 5@5 || API2 - Jul 2010 x Aug 2010 | Ask 5@0 | API2 - Aug 2010 | Ask@5 | API2 - Jul 2010 | Ask 5@5 || API2 - Jul 2010 x Aug 2010 | Bid 5@5 | API2 - Aug 2010 | Bid 5@5 | API2 - Jul 2010 | Bid 5@10 || API2 - Jul 2010 x Aug 2010 | Ask 5@5 | API2 - Aug 2010 | Ask@5 | API2 - Jul 2010 | Ask 5@10 || API2 - Jul 2010 x Aug 2010 | Bid 5@-5 | API2 - Aug 2010 | Bid 5@5 | API2 - Jul 2010 | Bid 5@0 || API2 - Jul 2010 x Aug 2010 | Ask 5@-5 | API2 - Aug 2010 | Ask@5 | API2 - Jul 2010 | Ask 5@0 |
  8. 8. Scenario: [2.B] First leg is generated when orders already exist on the second leg and the spread. Given the following orders already exist: | ID | Contract | Existing Order | | AB | <contract A> - <contract B> | <order AB> | | B | <contract B> | <order B> | Then I should observe these implied orders: | Source | Contract | Implied Order | | AB+B | <contract A> | <implied order> | Examples: | order AB | order B | implied order | | Bid (0,5]@0 | Bid (0,5.5]@10 | Bid (0,5]@10 | | Ask (0,5]@0 | Ask (0,5]@5 | Ask (0,5]@5 | Examples: | contract A | contract B | | "API 2" "Nov 2010" | "API 2" "Dec 2010" | | "API 2" "Nov 2010" | "API 4" "Nov 2010" | | ("API 2" "Nov 2010" - "API 4" "Nov 2010") | ("API 2" "Dec 2010" - "API 4" "Dec 2010") |
  9. 9.  Feature Background Scenario Scenario Outline Examples
  10. 10.  Background Scenario Scenario Outline Examples Scenario Outline Examples Examples
  11. 11.  Background Scenario Scenario Outline Scenario Outline Shared Examples Shared Examples of @tag
  12. 12. Scenario: Change propagates from a value cell to a reference via 3 referencesGiven a sheet with data:| Row | A | B | C | D | E || 1 | 1 | =A1 | =B1 | =C1 | =D1 |When the values are changed:| Cell | Value || A1 | 2 |Then the values should equal:| Cell | Value || E1 | 2 |
  13. 13. Scenario: Sum from 3 horizontal cellsGiven a sheet with data:| Row | A | B | C | D || 1 | 1 | 10 | 100 | =<formula> |When the cell values are computedThen the values should equal:| Cell | Value || D1 | 111 |Examples:| formula || A1+B1+C1 || SUM(A1,B1,C1) || SUM(A1:C1) || SUM(C1:A1) |
  14. 14. Twitter: @ptrelfordBlog: http://trelford.com/blogJoule: http://trayport.com/JouleTsunami IDE: http://tsunami.ioTickSpec: http://tickspec.codeplex.comCellz: http://cellz.codeplex.com

×