Automating Scenarios Safely

Turning Examples Into Reliable Tests — Java Edition

Art for Automating Scenarios Safely Check Out A Preview

By Bill Wake, Amr Elssamadisy, Curtis Cooley, Tim Ottinger

Automating Scenarios Safely builds on Specifying Scenarios Safely, and teaches you how to take scenarios you have collaborated on and convert them into executable tests for greenfield or legacy systems.
You will practice key automation skills of Behavior-Driven Development (BDD): writing fixtures that try a scenario on a production system, refactoring existing code to make it testable, and driving new development from scenarios.

Highlights

Scenario Testing
Scenario Testing: Create a safety-net of automated scenarios to support ongoing development. Learn more...
Expert Videos
Expert Videos: Learn tools & techniques by watching short videos from industry experts. Learn more...
Integrated Forums
Integrated Forums: Ask questions, get expert replies and read fascinating discussions. Learn more...

Includes

  • 5-8 hours of content
  • 83 pages
  • 2 videos
  • 7 exercises
  • 8 quizzes

Contents

Welcome to Scenario Automation 3
How Do Scenarios Run? 4
From Scenario to Production Code ← Click to Preview 5
What Will We Automate & How? 6
Fixtures: An Alternate 'User' Interface 7
The Automation Pyramid 8
When To Test Through The UI or API ← Click to Preview 9
Automation Strategies In Context 10
Risks in Automation 12
Safety in Automation 13
Addressing Safety 14
Java Frameworks for BDD 16
How Scenarios Run 17
The Feature File 18
The Steps Class 19
The Runner 20
Lists in Steps Are Straightforward 21
Scenario Outlines Use Tables to Reduce Duplication 22
You Can Fetch a Whole Table at a Time 23
Which File Does What? 24
Summary 25
An RPN Calculator 27
A Live Demo 28
Download the Starting Code 29
Your Mission: You Try 30
Verify Your Work ← Click to Preview 31
Instructor Solution 32
Scenarios for Wumpus 34
Download The Game 35
Your Mission: Check the Map 36
Instructor's Solution 37
Handling Random Numbers 39
Controlled Seed 40
Fake Random Number Generator 41
Randomness Bypass 42
Sample Override 43
The Best Approach 44
A Winning Scenario 46
Download The Game 47
Your Mission: Play For the Win 48
How Did It Go? ← Click to Preview 49
Instructor's Solution 50
Handling Messages 52
Download The Latest Version 53
Your Mission 54
Instructor's Solution 55
Point of Sale Terminal 60
Price Check Scenario 61
Download the Price Check Starting Code 62
Your Mission ← Click to Preview 63
Instructor's Solution: Price Check 64
Single-Item Purchase Scenario 65
Download the Single-Item Purchase Starting Code 66
Your Mission 67
Instructor's Solution: Single-Item Purchase 68
Multi-Item Purchase Scenario 69
Download the Multi-Item Purchase Starting Code 70
Your Mission 71
Instructor's Solution: Multi-Item Purchase 72
A Fat Fixture 74
What's Wrong Here? 75
The Fixture Diet 76
Why Substitute? 78
Dependencies Can Hinder Automation 79
Which Dependencies Hurt? 80
Three Ways to Inject Dependencies 81
Summary 83

Related Items

Volume Licensing

Have Any Questions?

Highlights

Scenario Testing
Scenario Testing: Create a safety-net of automated scenarios to support ongoing development. Learn more...
Expert Videos
Expert Videos: Learn tools & techniques by watching short videos from industry experts. Learn more...
Integrated Forums
Integrated Forums: Ask questions, get expert replies and read fascinating discussions. Learn more...

Includes

  • 5-8 hours of content
  • 83 pages
  • 2 videos
  • 7 exercises
  • 8 quizzes

Contents

Welcome to Scenario Automation 3
How Do Scenarios Run? 4
From Scenario to Production Code ← Click to Preview 5
What Will We Automate & How? 6
Fixtures: An Alternate 'User' Interface 7
The Automation Pyramid 8
When To Test Through The UI or API ← Click to Preview 9
Automation Strategies In Context 10
Risks in Automation 12
Safety in Automation 13
Addressing Safety 14
Java Frameworks for BDD 16
How Scenarios Run 17
The Feature File 18
The Steps Class 19
The Runner 20
Lists in Steps Are Straightforward 21
Scenario Outlines Use Tables to Reduce Duplication 22
You Can Fetch a Whole Table at a Time 23
Which File Does What? 24
Summary 25
An RPN Calculator 27
A Live Demo 28
Download the Starting Code 29
Your Mission: You Try 30
Verify Your Work ← Click to Preview 31
Instructor Solution 32
Scenarios for Wumpus 34
Download The Game 35
Your Mission: Check the Map 36
Instructor's Solution 37
Handling Random Numbers 39
Controlled Seed 40
Fake Random Number Generator 41
Randomness Bypass 42
Sample Override 43
The Best Approach 44
A Winning Scenario 46
Download The Game 47
Your Mission: Play For the Win 48
How Did It Go? ← Click to Preview 49
Instructor's Solution 50
Handling Messages 52
Download The Latest Version 53
Your Mission 54
Instructor's Solution 55
Point of Sale Terminal 60
Price Check Scenario 61
Download the Price Check Starting Code 62
Your Mission ← Click to Preview 63
Instructor's Solution: Price Check 64
Single-Item Purchase Scenario 65
Download the Single-Item Purchase Starting Code 66
Your Mission 67
Instructor's Solution: Single-Item Purchase 68
Multi-Item Purchase Scenario 69
Download the Multi-Item Purchase Starting Code 70
Your Mission 71
Instructor's Solution: Multi-Item Purchase 72
A Fat Fixture 74
What's Wrong Here? 75
The Fixture Diet 76
Why Substitute? 78
Dependencies Can Hinder Automation 79
Which Dependencies Hurt? 80
Three Ways to Inject Dependencies 81
Summary 83

Related Items