2. 2
Stories are a means for Agile teams to take large concepts and progressively break
them down into finer grained units of value
MVP
Discovery
Feature
Testing
Intake Story
Dev
Story
Spec
Story
Testing
Feature
Sketch
Ideas Celebrate!
Opportunity
Minimum Viable Product
Feature
StoryStory
Acceptance
Criteria
Story Specification Scenarios
Story Specification Test Cases
Story
Mapping
FeatureTest
Cases
Shippable
MVP
3. 3
Story Analysis
Story Engineering
Story Testing
MVP
Discovery
Feature
Sketching
Feature
Testing
Intake
MVP
Release
Weeks
Months
Stories are progressively refined through the agile feedback loop
4. 4
Story Analysis
Story Engineering
Story Testing
MVP
Discovery
Feature
Sketching
Feature
Testing
Intake
MVP
Release
Weeks
Months (weeks?)
Given some condition
And another condition
When something happens
And something else happens
Then expected result
And another expected result
Opportunity
Canvas
Story Map
Story Sketch
Story Specification
Scenario
Story Specification
Test case
Impact Map
Stories are progressively refined through the agile feedback loop
6. 6
Write (Failing) Story Specification
Days
Write (Failing) Unit
Test
Build Software
with
dependencies
mocked
Refactor
Software
Structure and
Design
Execute (Passing)
Story SpecificationCheck In and Test
All Stories In
Feature
hours
Advanced teams maximize feedback by delivering stories using a Test Driven
approach
7. 7
Story: Trading Status Alert
As a Trader
I want to be alerted when stocks are traded a specific threshold
So that I can take the right action
Scenario: Trader is not alerted below threshold
Given a stock of symbol STK1
And a threshold of 10.0
When the stock is traded at 5.0
Then the alert status should be OFF
Scenario: Trader is alerted above threshold
Given a stock of symbol STK1
And a threshold of 10.0
When the stock is traded at 11.0
Then the alert status should be ON
Write (Failing) Story
Specification Test
Write (Failing) Unit
Test
Build Software
with
dependencies
mocked
Execute (Passing) Story
Specification
Each Story is defined by creating a Scenario Specification
8. 8
Story: Trading Status Alert
As a Trader
I want to be alerted when stocks are traded a specific threshold
So that I can take the right action
Scenario: Trader is not alerted below threshold
Given a stock of symbol STK1
And a threshold of 10.0
When the stock is traded at 5.0
Then the alert status should be OFF
Scenario: Trader is alerted above threshold
Given a stock of symbol STK1
And a threshold of 10.0
When the stock is traded at 11.0
Then the alert status should be ON
Write (Failing) Story
Specification Test
Write (Failing) Unit
Test
Build Software
with
dependencies
mocked
Execute (Passing) Story
Specification
public class TraderSteps {
private Stock stock;
@Given("a stock of symbol $symbol and a threshold of $threshold")
public void aStock(String symbol, double threshold) {
stock = new Stock(symbol, threshold);
}
@When("the stock is traded at $price")
public void theStockIsTradedAt(double price) {
stock.tradeAt(price);
}
@Then("the alert status should be $status")
public void theAlertStatusShouldBe(String status) {
ensureThat(stock.getStatus().name(), equalTo(status));
}
}
http://jbehave.org/
Scenario Specifications are also created in code, often before a single line of story
code is written…
9. 9
Write (Failing)
Unit Test
Build Software with
dependencies mocked
Specification: Describe Stock Threshold
Context: When a stock is traded below alert
threshold
• Stock alert status should be OFF
• an alert message is not sent to the message
trader queue
Context: When stock is traded above alert threshold
stock
• Alert status should be ON
• An alert is sent to trader message queue
Individual classes required to
realize a story are defined
according to a suite of Software
Specifications
10. 10
Write (Failing)
Unit Test
Specification: Describe Stock Threshold
Context: When a stock is traded below alert
threshold
• Stock alert status should be OFF
• an alert message is not sent to the message
trader queue
Context: When stock is traded above alert threshold
stock
• Alert status should be ON
• An alert is sent to trader message queue
@RunWith(JDaveRunner.class)
public class StockThreshold extends Specification<Stack<?>> {
public class BelowAlertThreshold {
private Stock stock;
private const THRESHOLD =15.00
public Stock<String> create() {
stock = new Stock(new Alert(THRESHOLD));
stock.Sell(new Buyer(), THRESHOLD -1 )
return stack;
}
public void AlertStatusIsOff() {
specify(stock.Status, should.be(Status.OFF));
}
public void AlertMessageIsNotSentToTraderQueue() {
TraderMessageQueue queue = MessageQueueFactory.TraderAlertQueue();
specify(queue.Message.does.not.contain(
TraderMessageQueue.THRESHOLD_ALERT));
}
}
http://jdave.org/
Software Specs are written before the
story code, and used to guide the
design of code using an outside-in
approach (ie UI layer->domain-
>persistence/utility)
11. 11
Build Software with
dependencies mocked
Refactor Software Structure
and Design
Specification: Describe Stock Threshold
Context: When a stock is traded below alert threshold
• Stock alert status should be OFF
• an alert message is not sent to the message trader queue
Context: When stock is traded above alert threshold stock
• Alert status should be ON
• An alert is sent to trader message queue
Pass
Pass
Pass
Fail
Fail
Pass
Fail
Software Specifications
are validated
automatically as code is
updated, providing
immediate feedback on
development activity
12. 12
Build
Software with
dependencie
s mocked
Refactor
Software
Structure and
Design
Execute (Passing)
Story SpecificationCheck In and Test
All Stories In
Feature
Story: Trading Status Alert
As a Trader
I want to be alerted when stocks are traded a specific threshold
So that I can take the right action
Scenario: Trader is not alerted below threshold
Given a stock of symbol STK1
And a threshold of 10.0
When the stock is traded at 5.0
Then the alert status should be OFF
Scenario: Trader is alerted above threshold
Given a stock of symbol STK1
And a threshold of 10.0
When the stock is traded at 11.0
Then the alert status should be ON
Pass
Fail
Fail
Once all Software
Specifications for a Story
pass, the Story
Specification is run
(automatically) indicating
if user level acceptance
criteria are also passing