Random BDD notes

March 27th, 2009 Leave a comment Go to comments
  • One assertion per test.  Dave Astels says it makes the examples easier to understand, drives the code to evolve in controllable steps, and keeps the code focused on behavior, grouped by context
  • Write the code you wish you had.  As you move from the outside-in, you are automatically designing APIs from the point of view of the customers – how neat is that!
  • One specification file to subject file
  • Cucumber-like test framework
    • plain text in domain language so customers can edit
    • describe outside of system
  • Design
    • User Stories e.g. starting the game, making a move; lead to…
    • Features e.g. As a _, I want to _, so I can _; are broken down into…
    • Scenarios e.g. Given _, When I _, Then _
  • RSpec file hierarchy
    • Bin – executable
    • Features – one file per
      • Step Definitions – all in one file
    • Lib
      • Folder: [App name] – files named for objects
    • Spec
      • Folder: [App name] – files named [object_spec]
  1. No comments yet.
  1. No trackbacks yet.