Acceptance test-driven development (ATDD)
collaboration in, 51
in friendly test automation, 162–66
gaps in, 149
support codes and, 49–50, 59–60, 70
vs. TDD, 118
Acceptance test suite, 111–12, 147
Adzic, Gojko, 121, 148, 154–55, 163, 187
Agile-friendly automation, 156, 161, 163, 177, 178, 193
Agile Software Development — Patterns, Principles, and Practices (Martin), 124
Agile Testing (Crispin and Gregory), 150
Airport Parking Lot test cases. See also individual headings
Automating Remaining Parking Lots test case, 41–46
Parking Cost Calculator Workshop test case, 3–15
Valet Parking Automation test case, 17–39
Alice’s Adventures in Wonderland (Carroll), 147
Appelo, Jurgen, 150
Arrange-Act-Assert format, 136
ArrayFixture, 135
Automating Remaining Parking Lots test case, 41–46
economy parking lot examples, 44–45
short-term parking lot examples, 41–42
step definitions after generalizing, 42
summary, 46
domain-specific test language in, 162
Behavior-driven development (BDD), 131, 132–33, 187
Business-facing tests, 150, 152
CalculateFixture, 134
Camel-casing, 137, 139, 191, 194, 199
Carroll, Lewis, 147
Clean Code (Martin), 170
Clojure, 163
Code. See also individual codes
library, 199
refactoring, 176
Code in Light States test case, developing, 66–70
deciding which one to return based on previous state, 69
final test table for car states, 69
first example passes, 68
first flow after implementing light configurations, 70
first support code class, 66
FitNesse result after creating class, 67
FitNesse test turns from yellow to red, 67
folder layout in, 66
hard-coded return value of nextState method, 68
second test expressing state transition from red and yellow to green, 69
support code class with empty method bodies, 67
Cohn, Mike, 158
in ATDD, 51
summary, 159
ColumnFixture, 134
Command/Query-Separation, 98
Concordion Framework, 163
Continuous integration (CI)
in domain discovery, 121
plug-ins for, 184
in software delivery, 51
test automation code and, 139
test failure in, 147
in Value Parking Automation test case, 18
Controller, driving. See Driving controller in First Crossing test case
Controller specifications in First Crossing test case, 93–94
happy path scenario for controller state transitions, 94
state transitions to consider, 94
Copeland, Lee, 143
production code, 189
FitNess SLiM, example of, 192
function of, 58
query tables combined with, 136, 193
in refactoring, 104
setup table preparing three different accounts, 134
support code for, 194
in test cases, 61, 65, 94, 98, 104
valet parking tests expressed as, in SLiM, 58, 134
De Florinier, Annette, 163, 187
Domain partitioning, 143
Domain-specific test language, 162
Driving controller in First Crossing test case, 94–118
body for controller glue code class that switches state, 96–97
first empty body for controller glue code class, 95–96
first invalid configuration, 99
first LightState changed in execute method, 99
first test for, 94
happy path tests for controller that
switches first light only, 96
permutated invalid configurations put into table, 102
second light state stored in field, 97–98
setting of warning configuration extracted from if body, 101
UNKNOWN light stats supported, 103
validation method extracted from if clause, 100–101
validation step added to controller before switching light states, 100
Exploratory tests, 136, 149, 150, 151, 152
Extract Superclass, 176
Feature, 17
Feature files in Cucumber, 187–88
First Crossing test case, 93–118
controller specifications, 93–94
summary, 118
Fishnet scenario, 158
FitLibrary, 134, 135, 137, 163
CalculateFixture in, 134
FitNesse and, 163
architecture, 192
in First Crossing test case, 93–118
in Light States test case, 61–91
link added to front page, 63
shell output from starting for first time, 62
SLiM tables and, 58–59, 163, 191–93
welcome screen when starting for first time, 62
Folder layout
in Light States test case, 66
in Valet Parking Automation test case, 21
behavior-driven development, 131, 132–33
glue code and support code, 139–40
Internet search, basic, 132
keywords or data-driven tests, 131, 137–39
tabulated formats, 131, 133–37
Framework for Integrated Tests (FIT), 58, 133
ActionFixture in, 137
ColumnFixture in, 134
FitLibrary and, 134, 135, 137, 163
RowFixture in, 135
Freeman, Steve, 176
Getting Started test case
refactoring of traffic lights, 56, 57
summary, 60
unit test in Java, example of, 59
Valet Parking tests expressed as decision table in SLiM, 58–59
Given-When-Then format
alternative to, 136
in First Crossing test case, 95–118
implementing for test automation, 95–118
signature of EJB2 service executor for Needle Eye pattern, 124
summary, 126
in Valet Parking Automation test case, 17–18, 20, 21
Green Pepper Framework, 163
Groovy, 163
Growing Object-oriented Software Guided by Tests (Freeman and Pryce), 176
Happy path scenario, 47, 93–94, 96, 103
Headless Selenium server, 18
Initializers in Valet Parking Automation test case, 26–31
extracted method for filling in parking durations, 28–30
final version of ParkCalcPage for
leaving date and time filled into form fields, 28–29
selecting right parking lot entry from dropdowns, 26
starting date and time filled into form fields, 27
Integrated development environments (IDEs)
in domain discovery, 121
Java, 66
in keyword-driven automation, 139
packages in, 71
in refactoring glue code, 109, 111
refactoring support and, 139, 176–78
setting up and configuring, 66
Intent-revealing tests, 123, 141
Intermodule integration tests, 150
Java, 193
in Cucumber, 163
FitNesse in, 163
in Robot Framework, 195
unit test in, example of, 59
for writing support code for SLiM tables, 193–94
JBehave Framework, 163
Just-in-time requirements trawling, 159
Jython, 195
Kaner, Cem, 143
Kerievsky, Joshua, 170
Keywords
in integrated development environments, 139
in Robot Framework, to define test cases, 193, 196
scenario tables as, 137–38, 184
in test automation code, 138
Library code, 199
Light States test case, 61–91. See also individual headings
Light States test case, first test in, 62–66
expressing state transition from red to red and yellow, 65
FitNesse result from, 66
FitNesse welcome screen when starting, 62
root suite of traffic light examples, 64
shell output from starting FitNesse, 62
TrafficLightStates suite, contents of, 65
economy parking lot automated examples, 174
setup table preparing account hierarchies with hidden tariffs and products, 175
verbose example for parking lot calculator, 173–74
Marick, Brian, 150
Martin, Robert C.
Agile Software Development — Patterns, Principles, and Practices, 124
Clean Code, 170
Simple List Invocation Method (SLiM), 133, 191
Meszaros, Gerard, 170
Nonfunctional requirements, 155
North, Dan, 132
Parallel component, 70
Parameterized tests, 59, 73–74, 112, 116
Parking Cost Calculator Workshop test case, 3–15
economy parking examples, 7, 11
long-term parking examples, 8, 9–10, 11
short-term parking, 5
short-term parking examples, 5, 12
Parking lot calculator. See also Parking Cost Calculator Workshop test case
business rules for, 3
final version for first test, 34–35
final version for initialization steps, 30–31
library for, 22
mockup of, 25
support code for, 18
test executed by, 32
business perspective, 153
mediation between perspectives, 153, 154
technical perspective, 153
Practitioner’s Guide to Software Test Design, A (Copeland), 143, 152
collaboration in, 51
in Cucumber, 189
developing, 189
TDD used for, 71
value in, vs. glue code, 124
Production code, drive, 121–22
Pryce, Nat, 176
checking existence of previously set up data, 135–36
FitNesse SLiM, example of, 193
script tables used to combined with decision tables, 136, 193
Refactoring, 103–18. See also Refactor tests
code, 176
in Light States test case, 70–90
packages, 71
traffic light calling for, 56, 57
Refactoring in First Crossing test case
adapted validation function, 116
corrected validation function, 114–15
examples, 103
final unit tests for validator, 117
function refactoring into own class, 107
new empty validator class, 108
redundant information eliminated from invalid combinations, 104–5
retrofitted unit tests for validator class, 112–13
scenario table references transparent operation, 106–7
scenario table results in collapsible section, 105
scenario table to remove redundant information from invalid combinations, 103
second validation added after light was switched, 114
tests up to failing configuration point, 115
validation function after adding check for blinking second light, 116
validation function after introducing two parameters, 108
validator after moving validation function, 109–10
validator makes parameter to validation function to move method, 109
validator method after rename, 111
validator turned into field within controller class, 110–11
Refactoring in Light States test case, 70–90
all light states covered, 75–78
changed implementation of editor class, 87
code for getAsText method in LightStateEditor, 86
code for LightState enumeration after implementing first method on editor, 85–86
conditional to rescue for red and yellow state, 80
duplication indicates the refactoring potential, 81
extracted body from LightStateEditor as valueFor on LightState class, 87
final example page after, 71
final TrafficLights implementation making use of domain concept of LightState, 90
first and second unit test expressed as data-driven test using JUnit Parameterized runner, 72–74
first code base for new traffic light enum, 72–73
first implementation for LightState transition from red to red and yellow, 73
first implementation of LightStateEditor, 79
first unit test driving domain concept of LightState, 72
iterating over all values in LightState checking for matching description, 82
LightStateEditor code after driving implementation for setAsText, 85
LightState takes String parameter for description in constructor, 81
new unit test class for valueFor method, 88–89
packages, 71
property editor in shortest form, 83
red state makes use of description field, 83
second transition captured, 75
second unit test using data driven format, 79–80
unit test for editor with defaulting behavior unit test removed, 88
unit test for getAsText function in LightStateEditor, 86
unit test for setting value to red, 79
unit tests for editor after finishing implementation for setAsText, 84
Refactoring to Patterns (Kerievsky), 170
Regression test suite, 147, 148
formats, 140
keywords section used for parking lot calculator, 197–98
keywords used to define test cases, 193, 196
library code, 199
Selenium library in, 173
settings used for parking lot calculator, 196
test case section used for parking lot calculator, 196–97
test libraries in, 137
test using keyword template for data-driven tests, 199
Variables section used for parking lot calculator, 198
RowFixture, 135
RSpec book, The (Chelimsky et al.), 187
Rule of Three Interpretations, 155, 167. See also Power of Three
Scala, 163
Scenario tables
function of, 59
Given-When-Then-format and, 193
used with script tables, 104, 193
decision tables combined with query tables, 136, 193
in FIT and FitLibrary, 137
Given-When-Then format and, 140, 193
scenario tables used with, 104, 193
support code and, 194
with whole flow through system, 136
Secret Ninja Cucumber Scrolls, The (de Florinier, Adzic, and de Florinier), 163, 187
headless, 18
SetFixture, 135
Shell output
from starting FitNesse for the first time, 62
from Valet Parking Automation test case, 19–20, 32, 36
Simple List Invocation Method (SLiM). See also individual tables
FitNesse and, 58–59, 163, 191, 192
introduction of, 133
support code for tables in, 193–94
Software specifications, 153–59
summary, 159
Specification by Example (Adzic), 154–55
Specification workshops, 48–49
Stable Dependencies Principle, 124
State Pattern, 72
State specifications in Light States test case, 61–62
all light states for cars, 62
valid light states for cars, 61
Step definitions
in BDD, 133
Short-Term Parking lot test case, 42
in Valet Parking Automation test case, 17–39
SubsetFixture, 135
collaboration in, 51
for FitNesse SLiM tables, 193–94
in Light States test case, 66–90
for setting up Selenium client, 22
in Valet Parking Automation test case, 17–18, 20, 21–22
Tab-ordering, 149
Tabulated formats, 131, 133–37
script tables with whole flow through system, 136
Tabulated tests in Valet Parking Automation test case, 36–38
examples from workshop filled into table, 37
first test converted to tabulated format, 36
ParkCalcPage class with extended durationMap for Valet Parking tests, 38
shell output with first test in tabulated format, 36–37
Technical Debt, 150
Technical tests, 150
Test, 169–81. See also Test suite
automation, developing, 170–72
code (See Code)
intermodule integration, 150
libraries in Robot Framework, 137
parameterized, 59, 73–74, 112, 116
retrofitted, 91, 112–13, 122, 173, 183
smell, 135
Test automation. See also Test automation code; Test automation tools
architecture, 17
listening to tests and, 172–76
pairing on, 164
in Valet Parking Automation test case, 17–39
Test automation code. See also Glue code; Support code
flexibility of, 171
format, 131
keywords in, 138
TDD used to implement, 119, 140, 176
testing, 170
Agile-friendly, 156, 161, 163, 177, 178, 193
Robot Framework, 193
Test-driven development (TDD). See also Test automation code
vs. ATDD, 118
collaboration in, 51
enum class implemented using, 71–78
Testing Computer Software (Kaner), 143
benefits of, 122
defined, 62
maintenance of, 136
36-hour, 148
36-hour test suite, 148
Titanic Effect, 150
Traffic Light Software System test cases. See also individual headings
First Crossing test case, 93–118
Getting Started test case, 55–60
Twist Framework, 163
in Java, example of, 59
retrofitted, 91, 112–13, 122, 173, 183
Unknown-Unknowns Fallacy, 150
Usability tests, 150, 151, 152
User acceptance tests, 150, 151
Valet Parking Automation test case, 17–39. See also Parking lot calculator
mockup for airline parking lot calculator, 25
pairing for first test, 25
summary, 39
Valet Parking Automation test case, first example, 18–25
empty implementation of parking cost calculation step, 25
empty implementations added to ParkCalcPage class, 24
first Valet Parking test, 18
folder layout, 21
initial ParkCalc class, 22
initial step definitions for, 20
initial wishful implementation of first keyword, 23, 24
shell output from first Valet Parking test, 19–20
shell output from first Valet Parking test with step definitions, 21
support code for setting up Selenium client, 22
Valet Parking Automation test case results, checking, 31–35
check after factoring out two functions for individual steps, 33
final version of ParkCalcPage class for first test, 34–35
final version of steps for first test, 34
final version of Valet Parking steps for first test, 34
initial version of check, 32
shell output from first Valet Parking test, 32
Variables
for parking lot calculator in Robot Framework, 198
Warning configuration, 101
Weinberg, Jerry
Rule of Three interpretations, 167
Titanic Effect, 150
Wiki system, 58
frequency and duration, 157
participants, 156
XUnit Test Patterns (Meszaros), 170
3.145.166.149