SlideShare a Scribd company logo
1 of 150
Download to read offline
ATDD 
Acceptance 
Test Driven 
Development 
J a r e d R i c h a r d s o n 
A g i l e A r t i s a n s
Who are you?
Jared Richardson 
Author Ship It! and Career 2.0 
Screencast editor PragProg.com 
2nd public signatory of the Agile Manifesto 
Started AgileRTP in 2007! 
Agile coach 
AgileArtisans.com
Who are you?
What would you say you 
do here? 
Roles? 
Responsibilities? 
Why are you here? 
What are your tests for this session?
Objectives 
Understand ATDD in context of SDLC 
Learn how to turn requirements into tests 
What is a good acceptance test? 
ATDD as a communication vehicle
Outline 
Terms and definitions 
Requirements and tests 
Software development 
ATDD examples 
Anatomy of a test 
Tables 
System boundary
Breaks 
Halfway (90 minutes)
One Rule 
There are exceptions to every statement 
Except this one
What is an Acceptance 
test? 
External view of the system 
Examines visible effects 
Inputs 
Outputs 
State changes 
External interfaces
Definitions 
Acceptance criteria -> General idea 
Acceptance test -> specific. Pass/fail. 
Implementation independent 
Triad -> Customer, developer, tester
Fast Car 
Who wants one? 
Criteria 
Closed course. Measure acceleration. 
Test 
Accelerate 0 to 60 in X seconds
Fast Car 
0 to 60 in 30 seconds 
0 to 60 in 5 seconds. Top speed is 61. 
0 to 60 in 5. Top speed is 120. 60 to 120 in 5 min 
0 to 60 in 5. 60 to 120 in 20 sec. Range of 1/4 mile. 
Range of 200 miles. Cost of 7 billion.
Why? 
Rework down from 60% to 20% 
Workflows work 1st time 
Little room miscommunication 
Saves time 
Getting business rules RIGHT 
Game changing 
Tighter cross functional team integration 
Crisp visible story completion criteria 
Automation yields reduced testing time
Requirements and Tests
Requirement 
Needed by a user to solve a problem 
Needed by a system to satisfy contract, 
standard, spec, regulation...
Requirements Include 
Functions (what software does) 
Constraints (limits)
Requirements 
Should not 
Include 
Implementation details 
Specific manifestation
A Brownie Spec 
Ingredient 
Parts 
by 
weight 
Sugar 
23.0 
Flour 
21.0 
Shortening 
16.8 
Nuts 
16.0 
whole 
eggs 
13.0 
Cocoa 
5.5 
Dextrose, 
anhydrous 
4.4 
Salt
Brownie Spec 
a. 
Whip 
eggs 
in 
large 
bowl 
on 
high 
speed 
un3l 
light 
and 
fluffy. 
b. 
Combine 
sugars, 
cocoa, 
salt, 
and 
leavening; 
add 
to 
beaten 
eggs, 
and 
whip 
on 
high 
speed 
un3l 
thick. 
c. 
Add 
shortening 
slowly 
while 
mixing 
on 
low 
speed. 
d. 
Scrape 
bowl 
and 
whip 
on 
high 
speed 
un3l 
thick. 
e. 
Mix 
flour, 
nuts, 
and 
flavors 
together 
and 
fold 
into 
baDer; 
mix 
un3l 
uniform. 
f. 
Pour 
baDer 
into 
pan 
at 
a 
rate 
that 
will 
yield 
uncoated 
brownies 
which, 
when 
cut 
such 
as 
to 
meet 
the 
dimension 
requirements 
specified 
in 
3.4f, 
will 
weigh 
approximately 
35 
grams 
each. 
g. 
Bake 
at 
3500F 
un3l 
done 
(30 
to 
45 
minutes).
Requirements 
and tests 
Inter-related 
Can't have one w/o the other 
Failing test... 
... is a requirement 
Passing test... 
... valid system spec
ATDD as a Prism 
Requirements 
Tests 
ATDD
Software Development
Exercise 
What Issues? 
Current software dev process 
Write down your own 
Groups of 3 to 8 
Pass to front
The Team 
Developers Testers 
Customers
Customer Unit 
Product owner 
Business analysts 
Users 
QA
Developer/Tester Unit 
Programmers 
Testers 
QA
The Triad 
Developers Testers 
Customers
Traditional Value Stream 
Elicit& 
Requirements& 
Analyze& 
Requirements& Design&& 
Code& Test& 
Deploy& 
Why go back?
Mistakes? 
Misunderstandings 
Missed requirements 
Mis other
Mistakes 
Feedback corrects misunderstandings 
Quick feedback better than slow feedback
Slow Feedback 
Desired Actual 
Fast Feedback 
Actual
Agile Value Stream 
Elicit& 
Requirements& 
Analyze& 
Requirements& 
With&Tests& 
Design&& 
Code&With& 
Tests& Deploy&
Move Testing Forward
Two Types of Testing 
To find defects 
To prevent defects
Finding 
Defects 
Waste 
Identifying mistakes 
flickr.com/photos/mag3737/444557606
preventing Defects 
Saves development time 
Saves QA time 
Saves money
Steps 
Author tests (write) 
customer, tester, developer together 
Connect to the system (automate) 
developer 
Run the tests (execute) 
developer, testers, customers, CI system 
Test% write% bind% run%
Two Ways 
Code% 
write% bind% run% 
Code% 
write% 
run% 
bind%
Test First 
Write the test first 
Write the code after 
One molds the other 
First in wins
Testing Strategies 
Meszaros, XUNIT TEST PATTERNS: REFACTORING TEST CODE, 
Fig 6.1 "Purpose of Tests" p. 51, © 2007 Pearson Education, Inc
Testing Focus
Verification 
vs 
Validation 
Verification 
Are the requirements right 
Focus of acceptance tests 
Validation 
Have we got the right requirements? 
Customer really do it this way? 
How do you test this?
Acceptance Testing 
UI* 
Applica'on*/* 
*Middle*'er* 
Core*Business*Logic** 
Persistence* 
Acceptance 
Tests
Tests all the way down 
Test* Test* 
Requirement* Requirement** 
Test* 
Requirement* 
Test* 
Service* 
Implementa4on* 
Test* 
Customer 
Acceptance 
Tests 
Developer 
Acceptance 
Tests 
Service* 
Implementa4on* 
Requires services 
to implement
Acceptance Test 
Examples
Temperature 
Input in Celsius 
Output in Fahrenheit 
What tests?
Temperature
Test Binning 
Formula Tests 
Celsius' Fahrenheit' Notes' 
0" 32" 
100" 212" Needed?" 
Precision Tests 
Celsius' Fahrenheit' Notes' 
*273.15" *459.67" Precision" 
Limit Tests 
Celsius' Fahrenheit' Notes' 
*273.15" *459.67" 0"Kelvin"" 
*273.151" Error" Below"0"Kelvin"" 
500" 932" Maximum"–"Needed?"
Is This A Good Spec?
Business Rules 
If a Customer Rating is Good and the Order Total is 
less than or equal $10.00, 
Then give no discount 
Otherwise give a 1% discount 
If Customer Rating is Excellent, 
Then give a discount of 1% for any order 
If the Order Total is greater than $50.00, 
Then give a discount of 5%
Rule Table => Test
Another Business Rule 
Email coupon codes 
If a customer enters the code, 
provide a 20% discount 
Discount an item or the order?
Implementation 
Testing script 
Program interface 
Xunit framework 
ATDD framework
Testing Script 
Tools for testers 
(Usually) GUI based
Testing Script 
Log in as a Customer who is rated Good 
Start an Order 
Add items totally $10.01 
Complete order 
Verify $0.10 discount 
Repeat for 10 other similar cases
Program Interface 
Code something (CLI or GUI) 
Screen 
Discount 
Method 
Discount Percentage Screen 
Customer Type: Good 
Order Total: 10.01 
Percentage: 1 % 
C:>DiscountPercentage Good 10.01 
Percentage: 1%
Xunit Test 
class TestCase { 
testDiscountPercentageForCustomer() { 
SomeClass o = new SomeClass() 
assertEquals(0, o.computeDiscount(10.0, Good)); 
assertEquals(1, o.computeDiscount(10.01, Good)); 
assertEquals(1, o.computeDiscount(50.01, Good)); 
assertEquals(1, o.computeDiscount(.01, Excellent)); 
assertEquals(1, o.computeDiscount(50.0, 
Excellent)); 
assertEquals(5, o.computeDiscount(50.01, 
Excellent)); 
} 
}
Fit Test
Tables as Requirements 
and Tests 
Discount Rule 
Customer Rating Order Total Discount Percentage 
Good 
<= $10.00 0% 
Otherwise 1% 
Excellent 
Any 1% 
> $50.00 5% 
Discount))Test) 
Order)total) Customer)ra3ng) Discount)percentage?) 
$10.00% Good% 0%% 
$10.01% Good% 1%% 
$50.01% Good% 1%% 
$.01% Excellent% 1%% 
$50.00% Excellent% 1%% 
$50.01% Excellent% 5%% 
Requirement 
Test
Context
Context Diagram 
Process' 
User 
Reports 
Commands 
Views
Another Context Diagram 
Process' 
User 
Another System 
Shared Database 
Commands 
Views 
Requests 
Responses 
Stores 
Retrievals
Engine Controller 
Engine& 
Controller& 
Engine Rotation Speed 
Spark Timing 
Gasoline Flow Control 
Acceleration / De-acceleration 
Air Flow Control
Embedded Contexts 
Input Output 
Internal I/O 
System One 
Sub$ System Two
Car Context 
Acceleration 
De-acceleration Movement 
Engine& 
& Wheels& 
Drive& 
sha*& 
& 
Trans-mission& 
&
Software Context 
Developer 
Acceptance 
Core 
or API 
Test 
Customer 
Acceptance 
Test 
Middle-tier 
GUI
Use Cases and Tests
Use Case Template 
Name—Iden3fier 
to 
easily 
reference 
it 
by 
DescripGon—Brief 
note 
Actor—Who 
ini3ates 
the 
use 
case 
Pre-­‐condiGons—What 
must 
be 
true 
before 
the 
use 
case 
is 
ini3ated 
Post-­‐condiGons—What 
is 
true 
if 
the 
use 
case 
successfully 
executes 
Main 
course—Steps 
that 
show 
the 
sequence 
of 
interac3ons
Example: Part One 
Name—Check 
Out 
CD. 
DescripGon—Check 
out 
a 
CD 
for 
a 
customer. 
Actor—Clerk. 
Pre-­‐condiGons—The 
customer 
has 
an 
iden3fica3on. 
The 
CD 
has 
an 
iden3ty. 
Post-­‐condiGons—The 
CD 
is 
recorded 
as 
rented. 
The 
rental 
contract 
is 
printed. 
Main 
Course: 
1. 
The 
clerk 
enters 
the 
customer 
iden3fica3on 
and 
CD 
iden3fier 
into 
the 
system. 
2. 
The 
system 
records 
the 
informa3on. 
3. 
The 
system 
prints 
a 
contract 
that 
the 
customer 
signs.
Example: Part Two 
Alterna3ves: 
flow 
that 
allows 
the 
use 
case 
to 
be 
successful 
even 
if 
some 
condi3on 
occurs 
Excep3ons: 
condi3ons 
can 
occur 
that 
may 
not 
allow 
it 
to 
reach 
its 
post-­‐condi3ons. 
Business 
Rules: 
rules 
that 
must 
be 
followed 
regardless 
of 
technology 
Note: 
Alterna3ves 
and 
Excep3ons 
could 
become 
separate 
story(ies) 
if 
requires 
significant 
effort 
Excep3ons 
and 
Alterna3ves 
numbered 
with 
reference 
to 
Main 
Course 
steps
Example: Part Three 
ExcepGons: 
1a. 
Customer 
iden3fica3on 
is 
not 
recognized. 
Clerk 
repeats 
step 
1. 
1b. 
The 
customer 
violates 
the 
CD 
Rental 
Limit 
business 
rule. 
The 
clerk 
no3fies 
the 
customer 
of 
the 
viola3on. 
The 
use 
case 
is 
abandoned. 
Business 
Rule: 
CD 
Rental 
Limit 
A 
customer 
can 
rent 
only 
three 
CDs 
at 
any 
one 
3me. 
AlternaGves 
3a. 
The 
printer 
jams. 
The 
clerk 
fills 
out 
the 
contract 
by 
hand. 
The 
use 
case 
exits.
Acceptance Testing 
The Triad create acceptance tests for stories 
Tests from general (expected path) ... 
... to specific (exceptions)
Examples 
Rent a CD (expected path) 
Bad Customer ID (Enter it wrong) 
CD Rental Limit (already has 3. Try 4.) 
Print jam (simulate by removing paper)
Test Anatomy
Test Flow 
Setup 
Use 
Verify
Test Flow 
Ini$al' 
System' 
State' 
Test' 
Setup' 
(Given))' 
Trigger' 
(When)' 
Assert' 
(Then)' 
Final' 
System' 
State'and' 
Output' 
Action or Event 
Expected 
System' 
State'and' 
Output'
Given/When/Then 
Given 
= 
Use 
case 
pre-­‐condi3ons 
When 
= 
Main 
course 
(or 
excep3onal 
course) 
Then 
= 
Use 
case 
post-­‐condi3ons
Given/when/Then 
Given 
(Setup) 
Customer 
has 
ID 
(ini3al 
system 
state) 
CD 
has 
ID 
(ini3al 
system 
state) 
CD 
is 
not 
currently 
rented 
(ini3al 
system 
state) 
When 
(Trigger) 
Clerk 
checks 
out 
CD 
(ac3on) 
Then 
(Verify) 
CD 
recorded 
as 
rented 
(final 
system 
state) 
Rental 
contract 
printed 
(output)
Context Diagram
Internal or External 
Persistence 
Change address Send mail 
Input for 
send mail 
Output is 
response to 
change address 
External 
repository 
for address
Internal or External 
Persistence 
How 
to 
test 
internal 
persistence? 
Through 
another 
ac3on 
Through 
a 
“see-­‐through” 
method 
Change address 
Internal 
persistence of 
address (state) 
Send mail 
Addressed mail
Exercise 
Write 
ques3ons 
(tests) 
for: 
“copying 
a 
file 
from 
one 
directory 
to 
another” 
Describe 
in 
terms 
of: 
Given: 
some 
state 
When: 
copy 
(file, 
source_directory, 
des3na3on_directory) 
Then: 
expected 
state 
Given When Then (Expected) 
Source' 
Directory' 
Contents' 
Des/na/on' 
Directory' 
Contents' 
Copy' 
File'' 
Des/na/on' 
Directory' 
Contents?' 
Anything'else?'' 
X' X' X'
Scenario 
A 
B 
X 
Copy% 
B 
X 
A 
X
Example 
Given When Then (Expected) 
Source' 
Directory' 
Contents' 
Des/na/on' 
Directory' 
Contents' 
Copy' 
File'' 
Des/na/on' 
Directory'' 
Contents?' 
Source' 
Directory' 
Contents?' 
Content' 
Comparison?' 
Notes' 
X,#Y,#Z# D,E,f# X# D,E,F,X# X,Y,Z# (Des-na-on.X# 
==#Source.X)# 
Standard# 
copy## 
X,#Y,#Z# D,E,F,X# X# D,E,F,X# X,Y,Z# (Des-na-on.X# 
==#Source.X)# 
X# 
overwri?e 
n# 
X,#Y,#Z# D,E,F,X# X# D,E,F,X# X,Y,Z# (Des-na-on.X# 
==# 
Des-na-on.X)# 
# 
X#not# 
overwri?e 
n# 
What about modification date and other attributes? 
Make more columns
Tables
Tables 
Table-­‐driven 
requirements 
can 
reduce 
ambiguity 
over 
free 
text 
Tables 
can 
be 
the 
tests 
Discovery 
Filling 
out 
tables 
may 
bring 
to 
light 
suppressed 
premises 
Unstated 
requirements 
or 
assump7ons
Table Types 
Calculation 
Action 
Data
Calculation Table
Calc Table Example 
Discount Calculation 
Item Total Customer Rating Discount Percentage? 
$10.00 Good 0% 
Given 
When 
Then
Data 
! Exists&(or&should&exist)&–&for&Given&and&Then& 
Title Data 
Value Name 1 Value Name 2 
Value for 1 Value for 2 
Another value for 1 Another value for 2
Data Table Example 
Customer Data 
Name ID 
James 007 
Maxwell 86 
Customer Data Name Begins with="’J" 
Name ID 
James 007
Action Table 
Enter 
enters 
data 
into 
an 
entry 
field 
Press 
ini3ates 
a 
process, 
such 
as 
a 
Submit 
buDon 
Check 
sees 
if 
a 
result 
is 
equal 
to 
an 
expected 
value
Action Table Example 
Can be just “When” or a stand-alone Given-When-Then 
Check Out CD 
Enter Customer ID 007 
Enter CD ID CD2 
Press Rent 
Check Rented True 
Given 
When 
Then
Copy File Example 
Copy%a%file%(happy%path)%% 
! Given&a&source&& 
! and&target&directory& 
&&&&&& 
File system 
Directory Name Directory Contents 
A X,&Y,&Z& 
B D,E,F 
Copy File 
Enter Source Directory A 
Enter Target Directory B 
Enter File name X 
Press Copy 
! When&copy&request&is& 
made& 
&&&&&& 
! Then&file&is&copied& 
&&&&&& 
File system 
Directory Name Directory Contents 
A X,&Y,&Z& 
B D,E,F,X
The Action 
! Can$drive$a$GUI$ 
! Or$a$method$$ 
CopyFile(Directory source, 
Directory target, Filename file)
Copy File Example 
Non$existent*file***Given&a&source&and&target&directory& 
File system 
Directory Name Directory Contents 
A X,&Y,&Z& 
B D,E,F 
! When&copy&request&is&made&for&a&non;existent&file&,&an&error&is&generated& 
&&&& 
Copy File 
Enter Source Directory A 
Enter Target Directory B 
Enter File name Q 
Press Copy Error_file_does_not_exist 
! Anything&else?& 
&&&&
Given/When/Then 
revsited 
Given 
(Setup) 
Customer 
has 
ID 
(ini3al 
system 
state) 
CD 
has 
ID 
(ini3al 
system 
state) 
CD 
is 
not 
currently 
rented 
(ini3al 
system 
state) 
When 
(Trigger) 
Clerk 
checks 
out 
CD 
(ac3on) 
Then 
(Verify) 
CD 
recorded 
as 
rented 
(final 
system 
state) 
Rental 
contract 
printed 
(output)
Check Out A CD 
! Given&Customer&has&ID&& 
&&&&&and&CD&has&ID&& 
&&&&&and&CD&is&not&currently&rented&& 
Customer Data 
Name ID 
James 007 
CD Data 
ID Title Rented 
CD2 Beatles Greatest Hits No
CHECKING OUT 
CONTINUED 
! When%a%clerk%checks%out%a%CD:% 
Check Out CD 
Enter Customer ID 007 
Enter CD ID CD2 
Press Rent
CONTINUED 
FURTHER... 
! Then%the%CD%is%recorded%as%rented%and%a%rental%contract% 
is%printed:%% 
CD Data 
ID Title Rented Customer ID 
CD2 Beatles Greatest Hits Yes 007 
Rental Contract 
Customer ID Customer Name CD ID CD Title 
007 James CD2 Beatles Greatest Hits
THE ACTION 
! Can$drive$a$GUI$ 
! Or$a$method$$ 
Rent(CustomerID aCustomer, CDID aCD);
ASSUMPTIONS 
Assume... 
- No other data changes 
- Can select customers (or CDs) from a list 
Could have tests for these assumptions...
Test Example 
Check&that&no&other&elements&changed&on&check1out& 
! Given&Customers&and&CDs&& 
&&&&&& Customer Data 
Name ID 
James 007 
Maxwell 86 
CD Data 
ID Title Rented Customer ID 
CD2 Beatles Greatest Hits No 
CD3 Lucy&Michelle&Hits No 
CD4 Janet&Jackson&Hits Yes 86
Test Example 1 
Check&that&no&other&elements&changed&on&check1out& 
! Given&Customers&and&CDs&& 
&&&&&& Customer Data 
Name ID 
James 007 
Maxwell 86 
CD Data 
ID Title Rented Customer ID 
CD2 Beatles Greatest Hits No 
CD3 Lucy&Michelle&Hits No 
CD4 Janet&Jackson&Hits Yes 86
Test Example 2 
! When%a%clerk%checks%out%a%CD:% 
Check Out CD 
Enter Customer ID 007 
Enter CD ID CD2 
Press Rent
Test Example 3 
! Then%only%the%rented%CD%is%affected%% 
Customer Data 
Name ID 
James 007 
Maxwell 86 
CD Data 
ID Title Rented Customer ID 
CD2 Beatles Greatest Hits Yes 007 
CD3 Lucy%Michelle%Hits No 
CD4 Janet%Jackson%Hits Yes 86
Selection Example 
Check&that&a&customer&can&be&selected&& 
! Given&Customers& 
&&&&&& 
Customer Data 
Name ID 
James 007 
Maxwell 86 
Check Out CD 
Enter Customer ID 86 
Press Select 
! When&a&Customer&is&selected&& 
&&&&&& 
! Then&the&correct&customer&is&selected& 
&&&&&& 
Selected Customer 
Name ID 
Maxwell 86
Business Rules Test 
Usually many 
One test per rule
Example 
CD(Rental(Rates( 
Regular(($2(/(2(days(plus($1(/(day(( 
Golden(Oldie($1(/(2(days(plus($(.50(/(day( 
Hot(Stuff(($4(/(2(days(plus($2(/(day( 
Rates& 
Type& Days& Cost?& 
Regular( 2( $2( 
Golden(Oldie( 3( $1.50( 
Hot(Stuff( 6( $12( 
Hot(Stuff( 50(( IGBTYOT((
UI & Business Rules 
Email 
Ajax call to middle-tier 
Submit, 
Middle-tier test 
Email&Valida)on&(Middle/Tier)& 
Value&& Valid?&& 
manager@sam.com, yes, 
someone@@somewhere.com, no, 
!#$%&*+7/=?^_,{|}~@sam.com, yes,
Alternatives 
Can use "script" in tables or separately
Copy A File 
(Happy Path) 
Given directory A with files X, Y, & Z 
And directory B with files D, E, F 
When file X is copied from A to B 
Then directory A has files X, Y, & Z 
and directory B has files D, E, F, & X
CD Rental 
(happy Path) 
Given customer James with ID 007 
And CD ID CD2 w/title "Beatle's Greatest Hits" is not rented 
When customer 007 rents CD2 
And a rental contract is printed with: 
name James, 
customer ID 007, 
CD ID CD2, and 
CD title "Beatle's Greatest Hits"
Business Rule Script Test 
When(a(CD(of(type(Regular(is(rented(for(2(days( 
Then(the(cost(is($2( 
When(a(CD(of(type(Golden(Oldie(is(rented(for(3(days(( 
Then(the(cost(is($1.50(( 
When(a(CD(of(type(Hot(Stuff(is(rented(for(6(days( 
Then(the(cost(is($12( 
( 
Rates& 
Type& Days& Cost?& 
Regular( 2( $2( 
Golden(Oldie( 3( $1.50( 
Hot(Stuff( 6( $12( 
Hot(Stuff( 50(( IGBTYOT((
System Boundaries
External Interfaces 
! Connec&ons(to(external(systems(need(to(have(test(doubles( 
(mocks)( 
! Random(events(may(need(to(be(simulated(( 
! Test(doubles(give(repeatability(and(speed(( 
External system, 
device, service 
Random 
events 
Time
External Interface 
Example 
CD 
Rental 
System 
Charge Transfer To 
Credit Card 
Processor 
Sam’s 
Bank 
Confirmation 
or Denial Bank 
Statement
Example of a Credit Card 
Test Double 
CD 
Rental 
System 
Credit Card 
Processor 
Test Double 
Charge 
Confirmation 
or Denial
Example of a Email 
Test Double 
CD 
Rental 
System 
Email Server 
Test Double 
Email 
Confirmation 
or Denial 
Test verifies that email sent to proper address with 
proper contents
Complex Business Rule 
and 
Separation
Complex Business Rule 
A business rule determines whether a user is allowed to 
perform a certain operation 
Fields may contain values or be blank 
Field&One& Field&Two& Field&Three& Field&Four& Result&?& 
>&20& <&50&or&blank& >=100& Y& Allow& 
Otherwise&or& 
blank& 
DNC& DNC& DNC& Disallow& 
DNC& Otherwise& DNC& DNC& Disallow& 
DNC& DNC& Otherwise&or& 
blank& 
DNC& Disallow& 
DNC& DNC& DNC& N&or&blank& Disallow&
Complex Business Rule 
Field&One& Result?& 
>&20& Allow& 
Blank& Disallow& 
Otherwise& Disallow& 
Field&Two& Result?& 
<&50& Allow& 
Blank& Allow& 
Otherwise& Disallow& 
Field&Three& Result&?& 
>=100& Allow& 
Blank& Disallow& 
Otherwise& Disallow& 
Field&Four& Result?&& 
Y& Allow& 
N& Disallow& 
Blank& Disallow& 
Otherwise& ??&
Complex Business Rule 
Field&One& Field&Two& Field&Three& Field&Four& Result&?& 
Allow& Allow& Allow& Allow& Allow& 
Disallow& DNC& DNC& DNC& Disallow& 
DNC& Disallow& DNC& DNC& Disallow& 
DNC& DNC& Disallow& DNC& Disallow& 
DNC& DNC& DNC& Disallow& Disallow&
Business Rule & UI 
Two 
business 
rule 
results 
Allow 
Disallow 
Alternate 
UI 
manifesta3ons 
of 
the 
business 
rule 
Disable 
the 
buDon 
if 
disallowed 
Hide 
the 
buDon 
if 
disallowed. 
Display 
dialog 
box 
if 
disallowed 
and 
they 
push 
the 
buDon 
To 
cut 
down 
tes3ng, 
expose 
business 
rule 
test 
5 
+ 
2 
tests, 
rather 
than 
5 
* 
2 
tests
Separate UI from 
Business Rule 
Business'Rule'Display'Requirement'' 
Business'Rule'Result' UI'Display?' Notes'' 
Disallow' Disable'Bu9on' 
Allow' Enable'Bu9on'' Take'to'some'entry' 
screen' 
End@to@end'Business'Rule'Test' 
Sample'user'ID' Business'Rule'Result' UI'Display?' 
10345' Allow' Enable'Bu9on' 
5555' Disallow'' Disable'Bu9on' 
Third'column'will'change'if'Business'Rule' 
Display'Requirement'changes''
Separate the Model from 
the View 
Rental Contract 
Customer ID Customer Name CD ID CD Title Rental Due 
007 James CD2 Beatles Greatest Hits 1/23/2011 
Rental Contract Template 
The customer named <Customer Name> with the ID <Customer ID>, hereafter 
referred to as the Renter, has rented the CD identified by <CD ID> with the title "<CD 
Title>," hereafter referred to as the Rented CD, from Sam's Lawn Mower Repair and 
CD Rental Store, hereafter referred to as the Rentee. The Renter promises to return the 
Rented CD to the Rentee by <Rental Due>. If said Renter exceeds .. blah…blah…blah 
Rental Contract Printout 
The customer named James with the ID 007, hereafter referred to as the Renter, has 
rented the CD identified by CD2 with the title "Beatle's Greatest Hits," hereafter 
referred to as the Rented CD, from Sam's Lawn Mower Repair and CD Rental Store, 
hereafter referred to as the Rentee. The Renter promises to return the Rented CD to the 
Rentee by 1/23/2011. If said Renter exceeds .. blah…blah…blah
Separate the Event from 
the Response 
Logon%Sequence%% 
Username% Password% Result?% Notes% 
Sam$ 123$ Bad_password$ 1st$bad$ 
George$ 1123$ No_user$ 2nd$bad$ 
Sam$ 1234$ Bad_password$ 3rd$bad$ 
Same$$ 12345$ Security_viola?on$ 4th$bad$ 
Logon%Ac9ons%% 
Result% Ac9on% 
Bad_password$ Display$“password$bad”$ 
No_user$$ Display$“no$user”$ 
Security_viola?on$ Send$enforcement$team$
Google Maps 
What can you test w/o a UI?
Google Maps 
No UI? 
Search phrase => List of places 
Place => Position 
Zoom Level => List of maps 
Position => List what's there
Test Evaluation
WARNING!! 
Acceptances tests do NOT replace interactive 
communication! 
They provide focus for the communication
Test Evaluation 
Remove 
redundant 
redundancy 
Business 
domain 
terms 
Shared 
between 
customer 
unit 
and 
developer/tester 
units 
Avoid 
lots 
of 
input 
and 
output 
columns 
Break 
into 
smaller 
tables 
(example 
follows)
Big Table to Smaller One 
Big$Data$Test$ 
F1$ F2$ F3$ F4$ …$ Valid?$$ Reason$ 
1$ 2$ 3$ 6$ Y$ 
1$ 3$ 3$ 6$ N$ F2$+$F3$>$5$ 
1$ 3$ 1$ 6$ N$ F2$+$F3$<$5$$ 
…$Lots$more$$ 
for$other$rules$ 
If can apply default values to F1, F4 etc., then could be: 
Big$Data$Test$for$F2EF3$$ 
F2$ F3$ Valid?$$ Reason$ 
2$ 3$ Y$ 
3$ 3$ N$ F2$+$F3$>$5$ 
3$ 1$ N$ F2$+$F3$<$5$$
Guidelines 
Develop tests & automation separately 
First, understand 
Second, automate (if appropriate) 
Automate tests for regression 
Run in continuous integration 
Cover 100% of function (if practical)
Separation of Concerns 
Separate 
business 
rules 
from 
how 
results 
of 
business 
rules 
are 
displayed 
Separate 
calcula3on 
of 
a 
business 
rule 
(such 
as 
a 
customer 
ra3ng) 
from 
the 
use 
of 
that 
business 
rule 
(such 
as 
to 
give 
a 
discount) 
Separate 
each 
use 
case 
or 
step 
in 
a 
workflow 
Separate 
out 
valida3on 
of 
an 
en3ty 
from 
use 
of 
en3ty
Separation and 
Abstraction 
One 
story 
together: 
When 
the 
build 
fails, 
send 
an 
email 
to 
the 
administrator 
Separate 
and 
abstracted: 
When 
the 
build 
fails, 
generate 
an 
alert 
When 
an 
alert 
is 
generated, 
no3fy 
the 
responsible 
individual 
When 
the 
responsible 
individual 
is 
no3fied, 
use 
that 
individual’s 
no3fica3on 
preference 
(email) 
Test 
the 
no3fica3on 
itself 
works 
(e.g. 
email 
works)
What is a Good Test? 
Fails reliably (for a known reason) 
No false positives 
No other test covers the same area 
NOTE: Tests at the "top" often forced to 
assume business rules... aim for 1 failure at 
each level
Use Alternate Tables 
Create tables in alternative forms, if standard not appropriate 
Sudoku Puzzle 
1 4 7 
2 5 8 
3 6 9 
4 7 1 
5 8 2 
6 9 3 
7 1 4 
8 2 5 
9 3 6 
Sudoku Solution 
1 6 5 4 9 8 7 3 2 
9 2 4 3 5 7 6 8 1 
8 7 3 2 1 6 5 4 9 
4 9 8 7 3 2 1 6 5 
3 5 7 6 8 1 9 2 4 
2 1 6 5 4 9 8 7 3 
7 3 2 1 6 5 4 9 8 
6 8 1 9 2 4 3 5 7 
5 4 9 8 7 3 2 1 6 
Required(Performance(( 
Puzzle(Type( Time(to(Solve?( Notes( 
Easy% .1%seconds%% See%easy%determina2on% 
Impossible% 1%second% No%solu2on%%
Story Tests Not Enough 
Disk%Monitor% 
Report'Error'If'Disk' 
Does'Not'Respond' 
Within'1'Second 
Power%Saver%% 
Spin'Down'Disk'If'Not' 
Accessed'In'Past'Minute
Other uses for Tests 
Estimation Aids 
Degree of Doneness
Process note 
Requirement Testable 
Requirement 
Developable 
Requirement 
Not schedulable Preferably all 
At least one 
example for 
each test 
examples for 
all tests
process Note 
Write within iteration 
Code% 
write% 
run% 
bind% 
Code% 
write% 
run% 
bind% 
Write previous iteration
Not the End.... 
The Beginning!
Objective Review 
Understand ATDD in context of SDLC 
Learn how to turn requirements into tests 
What is a good acceptance test? 
ATDD as a communication vehicle
Our Outline 
Terms and definitions 
Requirements and tests 
Software development 
ATDD examples 
Anatomy of a test 
Tables 
System boundary
Recap 
Primary 
goals 
Discover 
ambiguous 
requirements 
and 
gaps 
in 
requirements 
early 
on. 
Create 
a 
record 
of 
business/development 
understanding. 
Give 
feedback 
on 
quality 
. 
Secondary 
goals 
Use 
acceptance 
tests 
as 
an 
executable 
regression 
test. 
Measure 
your 
progress 
towards 
"done” 
completeness. 
Measure 
the 
complexity 
of 
requirements. 
Use 
the 
tests 
as 
a 
basis 
for 
user 
documenta3on.
Exercise 
You listed your development issues... 
Would ATDD help, hurt, or be neutral 
Why? 
Write down your answer and pass it up
Agility 
Responding to Change 
You're my customers 
You provided your requirements 
Now play the user/tester 
Were your requirements met? 
What else needs to be done?
Acceptance Test Driven Development at StarWest 2014

More Related Content

What's hot

Stop! you're testing too much
Stop!  you're testing too muchStop!  you're testing too much
Stop! you're testing too muchShawn Wallace
 
Maelscrum / Business Story Manager Overview
Maelscrum / Business Story Manager OverviewMaelscrum / Business Story Manager Overview
Maelscrum / Business Story Manager OverviewPaul Gerrard
 
Software Quality Assurance (QA) Testing Interview Questions & Answers
Software Quality Assurance (QA) Testing Interview Questions & AnswersSoftware Quality Assurance (QA) Testing Interview Questions & Answers
Software Quality Assurance (QA) Testing Interview Questions & AnswersJanBask Training
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinQA or the Highway
 
Istqb intro with question answer for exam preparation
Istqb intro with question answer for exam preparationIstqb intro with question answer for exam preparation
Istqb intro with question answer for exam preparationKevalkumar Shah
 
General technical interview questions
General technical interview questionsGeneral technical interview questions
General technical interview questionsKevalkumar Shah
 
software testing for beginners
software testing for beginnerssoftware testing for beginners
software testing for beginnersBharathi Ashok
 
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
Hey You Got Your TDD in my SQL DB by Jeff McKenzieHey You Got Your TDD in my SQL DB by Jeff McKenzie
Hey You Got Your TDD in my SQL DB by Jeff McKenzieQA or the Highway
 
Tutorial of web application load testing in selinium
Tutorial of web application load testing in seliniumTutorial of web application load testing in selinium
Tutorial of web application load testing in seliniumKevalkumar Shah
 
Large-Scale Agile Test Automation Strategies in Practice
Large-Scale Agile Test Automation Strategies in PracticeLarge-Scale Agile Test Automation Strategies in Practice
Large-Scale Agile Test Automation Strategies in PracticeTechWell
 
Testing Sap: Modern Methodology
Testing Sap: Modern MethodologyTesting Sap: Modern Methodology
Testing Sap: Modern MethodologyEthan Jewett
 
Inverting Test Pyramid - A First Hand Experience Report
Inverting Test Pyramid - A First Hand Experience ReportInverting Test Pyramid - A First Hand Experience Report
Inverting Test Pyramid - A First Hand Experience ReportNaresh Jain
 
How to get Automated Testing "Done"
How to get Automated Testing "Done"How to get Automated Testing "Done"
How to get Automated Testing "Done"TEST Huddle
 
Software testing interview Q&A – Part 2
Software testing interview Q&A – Part 2Software testing interview Q&A – Part 2
Software testing interview Q&A – Part 2Khoa Bui
 
Using Stories to Test Requirements and Systems
Using Stories to Test Requirements and SystemsUsing Stories to Test Requirements and Systems
Using Stories to Test Requirements and SystemsPaul Gerrard
 
SAP Testing Training
SAP Testing TrainingSAP Testing Training
SAP Testing TrainingVGlobal Govi
 

What's hot (20)

Leadership
LeadershipLeadership
Leadership
 
Stop! you're testing too much
Stop!  you're testing too muchStop!  you're testing too much
Stop! you're testing too much
 
Maelscrum / Business Story Manager Overview
Maelscrum / Business Story Manager OverviewMaelscrum / Business Story Manager Overview
Maelscrum / Business Story Manager Overview
 
Software Quality Assurance (QA) Testing Interview Questions & Answers
Software Quality Assurance (QA) Testing Interview Questions & AnswersSoftware Quality Assurance (QA) Testing Interview Questions & Answers
Software Quality Assurance (QA) Testing Interview Questions & Answers
 
The Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt EakinThe Art of Gherkin Scripting - Matt Eakin
The Art of Gherkin Scripting - Matt Eakin
 
Istqb intro with question answer for exam preparation
Istqb intro with question answer for exam preparationIstqb intro with question answer for exam preparation
Istqb intro with question answer for exam preparation
 
General technical interview questions
General technical interview questionsGeneral technical interview questions
General technical interview questions
 
software testing for beginners
software testing for beginnerssoftware testing for beginners
software testing for beginners
 
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
Hey You Got Your TDD in my SQL DB by Jeff McKenzieHey You Got Your TDD in my SQL DB by Jeff McKenzie
Hey You Got Your TDD in my SQL DB by Jeff McKenzie
 
Tutorial of web application load testing in selinium
Tutorial of web application load testing in seliniumTutorial of web application load testing in selinium
Tutorial of web application load testing in selinium
 
The Test Pyramid
The Test PyramidThe Test Pyramid
The Test Pyramid
 
Large-Scale Agile Test Automation Strategies in Practice
Large-Scale Agile Test Automation Strategies in PracticeLarge-Scale Agile Test Automation Strategies in Practice
Large-Scale Agile Test Automation Strategies in Practice
 
Testing Sap: Modern Methodology
Testing Sap: Modern MethodologyTesting Sap: Modern Methodology
Testing Sap: Modern Methodology
 
Inverting Test Pyramid - A First Hand Experience Report
Inverting Test Pyramid - A First Hand Experience ReportInverting Test Pyramid - A First Hand Experience Report
Inverting Test Pyramid - A First Hand Experience Report
 
How to get Automated Testing "Done"
How to get Automated Testing "Done"How to get Automated Testing "Done"
How to get Automated Testing "Done"
 
Software testing interview Q&A – Part 2
Software testing interview Q&A – Part 2Software testing interview Q&A – Part 2
Software testing interview Q&A – Part 2
 
Using Stories to Test Requirements and Systems
Using Stories to Test Requirements and SystemsUsing Stories to Test Requirements and Systems
Using Stories to Test Requirements and Systems
 
Black box
Black boxBlack box
Black box
 
SAP Testing Training
SAP Testing TrainingSAP Testing Training
SAP Testing Training
 
Top 10 Qualities of a QA Tester
Top 10 Qualities of a QA TesterTop 10 Qualities of a QA Tester
Top 10 Qualities of a QA Tester
 

Viewers also liked

ATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven DevelopmentATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven DevelopmentNaresh Jain
 
Effective and pragmatic test driven development by Andrew Rendell, Principal ...
Effective and pragmatic test driven development by Andrew Rendell, Principal ...Effective and pragmatic test driven development by Andrew Rendell, Principal ...
Effective and pragmatic test driven development by Andrew Rendell, Principal ...Valtech UK
 
Acceptance test driven development (attd) cycle
Acceptance test driven development (attd) cycleAcceptance test driven development (attd) cycle
Acceptance test driven development (attd) cycleGiuseppe Torchia
 
Acceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And FriendsAcceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And FriendsChristopher Bartling
 
Test driven developement
Test driven developementTest driven developement
Test driven developementBhavik Panchal
 
Agile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseAgile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseClareMcLennan
 
Writing Acceptance Tests Using Fitnesse
Writing Acceptance Tests Using FitnesseWriting Acceptance Tests Using Fitnesse
Writing Acceptance Tests Using FitnesseFacundo Farias
 
How To Fit Testing Into The Iteration
How To Fit Testing Into The IterationHow To Fit Testing Into The Iteration
How To Fit Testing Into The IterationRally Software
 
ATDD in Practice
ATDD in PracticeATDD in Practice
ATDD in PracticeSteven Mak
 
TDD: Test Driven Development 첫번째 이야기
TDD: Test Driven Development 첫번째 이야기TDD: Test Driven Development 첫번째 이야기
TDD: Test Driven Development 첫번째 이야기Ji Heon Kim
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationJohn Ferguson Smart Limited
 
BDD presentation
BDD presentationBDD presentation
BDD presentationtemebele
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot FrameworkPekka Klärck
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testingdversaci
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Zohirul Alam Tiemoon
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentLiz Keogh
 
Introduction to Acceptance Test Driven Development
Introduction to Acceptance Test Driven DevelopmentIntroduction to Acceptance Test Driven Development
Introduction to Acceptance Test Driven DevelopmentElisabeth Hendrickson
 

Viewers also liked (20)

ATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven DevelopmentATDD - Acceptance Test Driven Development
ATDD - Acceptance Test Driven Development
 
Effective and pragmatic test driven development by Andrew Rendell, Principal ...
Effective and pragmatic test driven development by Andrew Rendell, Principal ...Effective and pragmatic test driven development by Andrew Rendell, Principal ...
Effective and pragmatic test driven development by Andrew Rendell, Principal ...
 
Acceptance test driven development (attd) cycle
Acceptance test driven development (attd) cycleAcceptance test driven development (attd) cycle
Acceptance test driven development (attd) cycle
 
Specflow - Criando uma ponte entre desenvolvedores.
Specflow - Criando uma ponte entre desenvolvedores.Specflow - Criando uma ponte entre desenvolvedores.
Specflow - Criando uma ponte entre desenvolvedores.
 
Acceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And FriendsAcceptance Test Driven Development With Spec Flow And Friends
Acceptance Test Driven Development With Spec Flow And Friends
 
Test driven developement
Test driven developementTest driven developement
Test driven developement
 
Agile Acceptance testing with Fitnesse
Agile Acceptance testing with FitnesseAgile Acceptance testing with Fitnesse
Agile Acceptance testing with Fitnesse
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Writing Acceptance Tests Using Fitnesse
Writing Acceptance Tests Using FitnesseWriting Acceptance Tests Using Fitnesse
Writing Acceptance Tests Using Fitnesse
 
How To Fit Testing Into The Iteration
How To Fit Testing Into The IterationHow To Fit Testing Into The Iteration
How To Fit Testing Into The Iteration
 
ATDD in Practice
ATDD in PracticeATDD in Practice
ATDD in Practice
 
TDD: Test Driven Development 첫번째 이야기
TDD: Test Driven Development 첫번째 이야기TDD: Test Driven Development 첫번째 이야기
TDD: Test Driven Development 첫번째 이야기
 
BDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world applicationBDD in Action – principles, practices and real-world application
BDD in Action – principles, practices and real-world application
 
BDD presentation
BDD presentationBDD presentation
BDD presentation
 
ATDD Using Robot Framework
ATDD Using Robot FrameworkATDD Using Robot Framework
ATDD Using Robot Framework
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testing
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Introduction to Acceptance Test Driven Development
Introduction to Acceptance Test Driven DevelopmentIntroduction to Acceptance Test Driven Development
Introduction to Acceptance Test Driven Development
 

Similar to Acceptance Test Driven Development at StarWest 2014

Quality Assurance & Testing in a glimpse
Quality Assurance & Testing in a glimpseQuality Assurance & Testing in a glimpse
Quality Assurance & Testing in a glimpseTahmid Munaz
 
Enhancing Software Quality
Enhancing Software QualityEnhancing Software Quality
Enhancing Software QualityAnand Prabhala
 
Making the Move to Behavior Driven Development
Making the Move to Behavior Driven DevelopmentMaking the Move to Behavior Driven Development
Making the Move to Behavior Driven DevelopmentQASymphony
 
Effective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentEffective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentRaj Indugula
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQASymphony
 
Specification-by-Example: A Cucumber Implementation
Specification-by-Example: A Cucumber ImplementationSpecification-by-Example: A Cucumber Implementation
Specification-by-Example: A Cucumber ImplementationTechWell
 
Workshop: Behavior Driven Development - Deliver value by Naveen Kumar Singh
Workshop: Behavior Driven Development - Deliver value by Naveen Kumar SinghWorkshop: Behavior Driven Development - Deliver value by Naveen Kumar Singh
Workshop: Behavior Driven Development - Deliver value by Naveen Kumar SinghAgile ME
 
QAustral Testing
QAustral   TestingQAustral   Testing
QAustral Testingcusmaim
 
Test Smart, not hard
Test Smart, not hardTest Smart, not hard
Test Smart, not hardDiUS
 
Zero touch QA automation platform for DevOps
Zero touch QA automation platform for DevOpsZero touch QA automation platform for DevOps
Zero touch QA automation platform for DevOpsTaUB Solutions
 
What are Software Testing Methodologies | Software Testing Techniques | Edureka
What are Software Testing Methodologies | Software Testing Techniques | EdurekaWhat are Software Testing Methodologies | Software Testing Techniques | Edureka
What are Software Testing Methodologies | Software Testing Techniques | EdurekaEdureka!
 
Elements of a Test Framework
Elements of a Test FrameworkElements of a Test Framework
Elements of a Test FrameworkSmartBear
 
Quality control and quality managment philosophies by Prof.Saurabh S. Bhange
Quality control and quality managment philosophies by Prof.Saurabh S. BhangeQuality control and quality managment philosophies by Prof.Saurabh S. Bhange
Quality control and quality managment philosophies by Prof.Saurabh S. BhangeSaurabh Bhange
 

Similar to Acceptance Test Driven Development at StarWest 2014 (20)

Atdd half day_new_1_up
Atdd half day_new_1_upAtdd half day_new_1_up
Atdd half day_new_1_up
 
Quality Assurance & Testing in a glimpse
Quality Assurance & Testing in a glimpseQuality Assurance & Testing in a glimpse
Quality Assurance & Testing in a glimpse
 
Enhancing Software Quality
Enhancing Software QualityEnhancing Software Quality
Enhancing Software Quality
 
Making the Move to Behavior Driven Development
Making the Move to Behavior Driven DevelopmentMaking the Move to Behavior Driven Development
Making the Move to Behavior Driven Development
 
1st module.....
1st module.....1st module.....
1st module.....
 
Effective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile EnvironmentEffective Testing Practices in an Agile Environment
Effective Testing Practices in an Agile Environment
 
Software Testing Presentation
Software Testing PresentationSoftware Testing Presentation
Software Testing Presentation
 
Quality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the EnterpriseQuality Jam: BDD, TDD and ATDD for the Enterprise
Quality Jam: BDD, TDD and ATDD for the Enterprise
 
Agile testing
Agile testingAgile testing
Agile testing
 
Future of QA
Future of QAFuture of QA
Future of QA
 
Futureofqa
FutureofqaFutureofqa
Futureofqa
 
Journey of atdd
Journey of atddJourney of atdd
Journey of atdd
 
Specification-by-Example: A Cucumber Implementation
Specification-by-Example: A Cucumber ImplementationSpecification-by-Example: A Cucumber Implementation
Specification-by-Example: A Cucumber Implementation
 
Workshop: Behavior Driven Development - Deliver value by Naveen Kumar Singh
Workshop: Behavior Driven Development - Deliver value by Naveen Kumar SinghWorkshop: Behavior Driven Development - Deliver value by Naveen Kumar Singh
Workshop: Behavior Driven Development - Deliver value by Naveen Kumar Singh
 
QAustral Testing
QAustral   TestingQAustral   Testing
QAustral Testing
 
Test Smart, not hard
Test Smart, not hardTest Smart, not hard
Test Smart, not hard
 
Zero touch QA automation platform for DevOps
Zero touch QA automation platform for DevOpsZero touch QA automation platform for DevOps
Zero touch QA automation platform for DevOps
 
What are Software Testing Methodologies | Software Testing Techniques | Edureka
What are Software Testing Methodologies | Software Testing Techniques | EdurekaWhat are Software Testing Methodologies | Software Testing Techniques | Edureka
What are Software Testing Methodologies | Software Testing Techniques | Edureka
 
Elements of a Test Framework
Elements of a Test FrameworkElements of a Test Framework
Elements of a Test Framework
 
Quality control and quality managment philosophies by Prof.Saurabh S. Bhange
Quality control and quality managment philosophies by Prof.Saurabh S. BhangeQuality control and quality managment philosophies by Prof.Saurabh S. Bhange
Quality control and quality managment philosophies by Prof.Saurabh S. Bhange
 

More from jaredrrichardson

Continuous Testing in Vegas
Continuous Testing in VegasContinuous Testing in Vegas
Continuous Testing in Vegasjaredrrichardson
 
First Things: A Quick Guide to Starting a Team on the Path to Agility
First Things: A Quick Guide to Starting a Team on the Path to AgilityFirst Things: A Quick Guide to Starting a Team on the Path to Agility
First Things: A Quick Guide to Starting a Team on the Path to Agilityjaredrrichardson
 
GROWS at Southern Fried Agile 2015 in Charlotte
GROWS at Southern Fried Agile 2015 in CharlotteGROWS at Southern Fried Agile 2015 in Charlotte
GROWS at Southern Fried Agile 2015 in Charlottejaredrrichardson
 
Introduction to Agile (10/8/2014 at RedHat Agile Day)
Introduction to Agile (10/8/2014 at RedHat Agile Day)Introduction to Agile (10/8/2014 at RedHat Agile Day)
Introduction to Agile (10/8/2014 at RedHat Agile Day)jaredrrichardson
 
SAFe: An Introduction to the Scaled Agile Framework
SAFe: An Introduction to the Scaled Agile FrameworkSAFe: An Introduction to the Scaled Agile Framework
SAFe: An Introduction to the Scaled Agile Frameworkjaredrrichardson
 

More from jaredrrichardson (9)

Continuous Testing in Vegas
Continuous Testing in VegasContinuous Testing in Vegas
Continuous Testing in Vegas
 
First Things: A Quick Guide to Starting a Team on the Path to Agility
First Things: A Quick Guide to Starting a Team on the Path to AgilityFirst Things: A Quick Guide to Starting a Team on the Path to Agility
First Things: A Quick Guide to Starting a Team on the Path to Agility
 
GROWS at Southern Fried Agile 2015 in Charlotte
GROWS at Southern Fried Agile 2015 in CharlotteGROWS at Southern Fried Agile 2015 in Charlotte
GROWS at Southern Fried Agile 2015 in Charlotte
 
Grows for Executives
Grows for ExecutivesGrows for Executives
Grows for Executives
 
Continuous Testing
Continuous TestingContinuous Testing
Continuous Testing
 
Introduction to Agile (10/8/2014 at RedHat Agile Day)
Introduction to Agile (10/8/2014 at RedHat Agile Day)Introduction to Agile (10/8/2014 at RedHat Agile Day)
Introduction to Agile (10/8/2014 at RedHat Agile Day)
 
SAFe: An Introduction to the Scaled Agile Framework
SAFe: An Introduction to the Scaled Agile FrameworkSAFe: An Introduction to the Scaled Agile Framework
SAFe: An Introduction to the Scaled Agile Framework
 
Continuous Testing
Continuous TestingContinuous Testing
Continuous Testing
 
Introduction to agile
Introduction to agileIntroduction to agile
Introduction to agile
 

Recently uploaded

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 

Recently uploaded (20)

5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 

Acceptance Test Driven Development at StarWest 2014

  • 1. ATDD Acceptance Test Driven Development J a r e d R i c h a r d s o n A g i l e A r t i s a n s
  • 3. Jared Richardson Author Ship It! and Career 2.0 Screencast editor PragProg.com 2nd public signatory of the Agile Manifesto Started AgileRTP in 2007! Agile coach AgileArtisans.com
  • 5. What would you say you do here? Roles? Responsibilities? Why are you here? What are your tests for this session?
  • 6. Objectives Understand ATDD in context of SDLC Learn how to turn requirements into tests What is a good acceptance test? ATDD as a communication vehicle
  • 7. Outline Terms and definitions Requirements and tests Software development ATDD examples Anatomy of a test Tables System boundary
  • 9. One Rule There are exceptions to every statement Except this one
  • 10. What is an Acceptance test? External view of the system Examines visible effects Inputs Outputs State changes External interfaces
  • 11. Definitions Acceptance criteria -> General idea Acceptance test -> specific. Pass/fail. Implementation independent Triad -> Customer, developer, tester
  • 12. Fast Car Who wants one? Criteria Closed course. Measure acceleration. Test Accelerate 0 to 60 in X seconds
  • 13. Fast Car 0 to 60 in 30 seconds 0 to 60 in 5 seconds. Top speed is 61. 0 to 60 in 5. Top speed is 120. 60 to 120 in 5 min 0 to 60 in 5. 60 to 120 in 20 sec. Range of 1/4 mile. Range of 200 miles. Cost of 7 billion.
  • 14. Why? Rework down from 60% to 20% Workflows work 1st time Little room miscommunication Saves time Getting business rules RIGHT Game changing Tighter cross functional team integration Crisp visible story completion criteria Automation yields reduced testing time
  • 16. Requirement Needed by a user to solve a problem Needed by a system to satisfy contract, standard, spec, regulation...
  • 17. Requirements Include Functions (what software does) Constraints (limits)
  • 18. Requirements Should not Include Implementation details Specific manifestation
  • 19. A Brownie Spec Ingredient Parts by weight Sugar 23.0 Flour 21.0 Shortening 16.8 Nuts 16.0 whole eggs 13.0 Cocoa 5.5 Dextrose, anhydrous 4.4 Salt
  • 20. Brownie Spec a. Whip eggs in large bowl on high speed un3l light and fluffy. b. Combine sugars, cocoa, salt, and leavening; add to beaten eggs, and whip on high speed un3l thick. c. Add shortening slowly while mixing on low speed. d. Scrape bowl and whip on high speed un3l thick. e. Mix flour, nuts, and flavors together and fold into baDer; mix un3l uniform. f. Pour baDer into pan at a rate that will yield uncoated brownies which, when cut such as to meet the dimension requirements specified in 3.4f, will weigh approximately 35 grams each. g. Bake at 3500F un3l done (30 to 45 minutes).
  • 21. Requirements and tests Inter-related Can't have one w/o the other Failing test... ... is a requirement Passing test... ... valid system spec
  • 22. ATDD as a Prism Requirements Tests ATDD
  • 24. Exercise What Issues? Current software dev process Write down your own Groups of 3 to 8 Pass to front
  • 25. The Team Developers Testers Customers
  • 26. Customer Unit Product owner Business analysts Users QA
  • 28. The Triad Developers Testers Customers
  • 29. Traditional Value Stream Elicit& Requirements& Analyze& Requirements& Design&& Code& Test& Deploy& Why go back?
  • 30. Mistakes? Misunderstandings Missed requirements Mis other
  • 31. Mistakes Feedback corrects misunderstandings Quick feedback better than slow feedback
  • 32. Slow Feedback Desired Actual Fast Feedback Actual
  • 33. Agile Value Stream Elicit& Requirements& Analyze& Requirements& With&Tests& Design&& Code&With& Tests& Deploy&
  • 35. Two Types of Testing To find defects To prevent defects
  • 36. Finding Defects Waste Identifying mistakes flickr.com/photos/mag3737/444557606
  • 37. preventing Defects Saves development time Saves QA time Saves money
  • 38. Steps Author tests (write) customer, tester, developer together Connect to the system (automate) developer Run the tests (execute) developer, testers, customers, CI system Test% write% bind% run%
  • 39. Two Ways Code% write% bind% run% Code% write% run% bind%
  • 40. Test First Write the test first Write the code after One molds the other First in wins
  • 41. Testing Strategies Meszaros, XUNIT TEST PATTERNS: REFACTORING TEST CODE, Fig 6.1 "Purpose of Tests" p. 51, © 2007 Pearson Education, Inc
  • 43. Verification vs Validation Verification Are the requirements right Focus of acceptance tests Validation Have we got the right requirements? Customer really do it this way? How do you test this?
  • 44. Acceptance Testing UI* Applica'on*/* *Middle*'er* Core*Business*Logic** Persistence* Acceptance Tests
  • 45. Tests all the way down Test* Test* Requirement* Requirement** Test* Requirement* Test* Service* Implementa4on* Test* Customer Acceptance Tests Developer Acceptance Tests Service* Implementa4on* Requires services to implement
  • 47. Temperature Input in Celsius Output in Fahrenheit What tests?
  • 49. Test Binning Formula Tests Celsius' Fahrenheit' Notes' 0" 32" 100" 212" Needed?" Precision Tests Celsius' Fahrenheit' Notes' *273.15" *459.67" Precision" Limit Tests Celsius' Fahrenheit' Notes' *273.15" *459.67" 0"Kelvin"" *273.151" Error" Below"0"Kelvin"" 500" 932" Maximum"–"Needed?"
  • 50. Is This A Good Spec?
  • 51. Business Rules If a Customer Rating is Good and the Order Total is less than or equal $10.00, Then give no discount Otherwise give a 1% discount If Customer Rating is Excellent, Then give a discount of 1% for any order If the Order Total is greater than $50.00, Then give a discount of 5%
  • 53. Another Business Rule Email coupon codes If a customer enters the code, provide a 20% discount Discount an item or the order?
  • 54. Implementation Testing script Program interface Xunit framework ATDD framework
  • 55. Testing Script Tools for testers (Usually) GUI based
  • 56. Testing Script Log in as a Customer who is rated Good Start an Order Add items totally $10.01 Complete order Verify $0.10 discount Repeat for 10 other similar cases
  • 57. Program Interface Code something (CLI or GUI) Screen Discount Method Discount Percentage Screen Customer Type: Good Order Total: 10.01 Percentage: 1 % C:>DiscountPercentage Good 10.01 Percentage: 1%
  • 58. Xunit Test class TestCase { testDiscountPercentageForCustomer() { SomeClass o = new SomeClass() assertEquals(0, o.computeDiscount(10.0, Good)); assertEquals(1, o.computeDiscount(10.01, Good)); assertEquals(1, o.computeDiscount(50.01, Good)); assertEquals(1, o.computeDiscount(.01, Excellent)); assertEquals(1, o.computeDiscount(50.0, Excellent)); assertEquals(5, o.computeDiscount(50.01, Excellent)); } }
  • 60. Tables as Requirements and Tests Discount Rule Customer Rating Order Total Discount Percentage Good <= $10.00 0% Otherwise 1% Excellent Any 1% > $50.00 5% Discount))Test) Order)total) Customer)ra3ng) Discount)percentage?) $10.00% Good% 0%% $10.01% Good% 1%% $50.01% Good% 1%% $.01% Excellent% 1%% $50.00% Excellent% 1%% $50.01% Excellent% 5%% Requirement Test
  • 62. Context Diagram Process' User Reports Commands Views
  • 63. Another Context Diagram Process' User Another System Shared Database Commands Views Requests Responses Stores Retrievals
  • 64. Engine Controller Engine& Controller& Engine Rotation Speed Spark Timing Gasoline Flow Control Acceleration / De-acceleration Air Flow Control
  • 65. Embedded Contexts Input Output Internal I/O System One Sub$ System Two
  • 66. Car Context Acceleration De-acceleration Movement Engine& & Wheels& Drive& sha*& & Trans-mission& &
  • 67. Software Context Developer Acceptance Core or API Test Customer Acceptance Test Middle-tier GUI
  • 68. Use Cases and Tests
  • 69. Use Case Template Name—Iden3fier to easily reference it by DescripGon—Brief note Actor—Who ini3ates the use case Pre-­‐condiGons—What must be true before the use case is ini3ated Post-­‐condiGons—What is true if the use case successfully executes Main course—Steps that show the sequence of interac3ons
  • 70. Example: Part One Name—Check Out CD. DescripGon—Check out a CD for a customer. Actor—Clerk. Pre-­‐condiGons—The customer has an iden3fica3on. The CD has an iden3ty. Post-­‐condiGons—The CD is recorded as rented. The rental contract is printed. Main Course: 1. The clerk enters the customer iden3fica3on and CD iden3fier into the system. 2. The system records the informa3on. 3. The system prints a contract that the customer signs.
  • 71. Example: Part Two Alterna3ves: flow that allows the use case to be successful even if some condi3on occurs Excep3ons: condi3ons can occur that may not allow it to reach its post-­‐condi3ons. Business Rules: rules that must be followed regardless of technology Note: Alterna3ves and Excep3ons could become separate story(ies) if requires significant effort Excep3ons and Alterna3ves numbered with reference to Main Course steps
  • 72. Example: Part Three ExcepGons: 1a. Customer iden3fica3on is not recognized. Clerk repeats step 1. 1b. The customer violates the CD Rental Limit business rule. The clerk no3fies the customer of the viola3on. The use case is abandoned. Business Rule: CD Rental Limit A customer can rent only three CDs at any one 3me. AlternaGves 3a. The printer jams. The clerk fills out the contract by hand. The use case exits.
  • 73. Acceptance Testing The Triad create acceptance tests for stories Tests from general (expected path) ... ... to specific (exceptions)
  • 74. Examples Rent a CD (expected path) Bad Customer ID (Enter it wrong) CD Rental Limit (already has 3. Try 4.) Print jam (simulate by removing paper)
  • 76. Test Flow Setup Use Verify
  • 77. Test Flow Ini$al' System' State' Test' Setup' (Given))' Trigger' (When)' Assert' (Then)' Final' System' State'and' Output' Action or Event Expected System' State'and' Output'
  • 78. Given/When/Then Given = Use case pre-­‐condi3ons When = Main course (or excep3onal course) Then = Use case post-­‐condi3ons
  • 79. Given/when/Then Given (Setup) Customer has ID (ini3al system state) CD has ID (ini3al system state) CD is not currently rented (ini3al system state) When (Trigger) Clerk checks out CD (ac3on) Then (Verify) CD recorded as rented (final system state) Rental contract printed (output)
  • 81. Internal or External Persistence Change address Send mail Input for send mail Output is response to change address External repository for address
  • 82. Internal or External Persistence How to test internal persistence? Through another ac3on Through a “see-­‐through” method Change address Internal persistence of address (state) Send mail Addressed mail
  • 83. Exercise Write ques3ons (tests) for: “copying a file from one directory to another” Describe in terms of: Given: some state When: copy (file, source_directory, des3na3on_directory) Then: expected state Given When Then (Expected) Source' Directory' Contents' Des/na/on' Directory' Contents' Copy' File'' Des/na/on' Directory' Contents?' Anything'else?'' X' X' X'
  • 84. Scenario A B X Copy% B X A X
  • 85. Example Given When Then (Expected) Source' Directory' Contents' Des/na/on' Directory' Contents' Copy' File'' Des/na/on' Directory'' Contents?' Source' Directory' Contents?' Content' Comparison?' Notes' X,#Y,#Z# D,E,f# X# D,E,F,X# X,Y,Z# (Des-na-on.X# ==#Source.X)# Standard# copy## X,#Y,#Z# D,E,F,X# X# D,E,F,X# X,Y,Z# (Des-na-on.X# ==#Source.X)# X# overwri?e n# X,#Y,#Z# D,E,F,X# X# D,E,F,X# X,Y,Z# (Des-na-on.X# ==# Des-na-on.X)# # X#not# overwri?e n# What about modification date and other attributes? Make more columns
  • 87. Tables Table-­‐driven requirements can reduce ambiguity over free text Tables can be the tests Discovery Filling out tables may bring to light suppressed premises Unstated requirements or assump7ons
  • 88. Table Types Calculation Action Data
  • 90. Calc Table Example Discount Calculation Item Total Customer Rating Discount Percentage? $10.00 Good 0% Given When Then
  • 91. Data ! Exists&(or&should&exist)&–&for&Given&and&Then& Title Data Value Name 1 Value Name 2 Value for 1 Value for 2 Another value for 1 Another value for 2
  • 92. Data Table Example Customer Data Name ID James 007 Maxwell 86 Customer Data Name Begins with="’J" Name ID James 007
  • 93. Action Table Enter enters data into an entry field Press ini3ates a process, such as a Submit buDon Check sees if a result is equal to an expected value
  • 94. Action Table Example Can be just “When” or a stand-alone Given-When-Then Check Out CD Enter Customer ID 007 Enter CD ID CD2 Press Rent Check Rented True Given When Then
  • 95. Copy File Example Copy%a%file%(happy%path)%% ! Given&a&source&& ! and&target&directory& &&&&&& File system Directory Name Directory Contents A X,&Y,&Z& B D,E,F Copy File Enter Source Directory A Enter Target Directory B Enter File name X Press Copy ! When&copy&request&is& made& &&&&&& ! Then&file&is&copied& &&&&&& File system Directory Name Directory Contents A X,&Y,&Z& B D,E,F,X
  • 96. The Action ! Can$drive$a$GUI$ ! Or$a$method$$ CopyFile(Directory source, Directory target, Filename file)
  • 97. Copy File Example Non$existent*file***Given&a&source&and&target&directory& File system Directory Name Directory Contents A X,&Y,&Z& B D,E,F ! When&copy&request&is&made&for&a&non;existent&file&,&an&error&is&generated& &&&& Copy File Enter Source Directory A Enter Target Directory B Enter File name Q Press Copy Error_file_does_not_exist ! Anything&else?& &&&&
  • 98. Given/When/Then revsited Given (Setup) Customer has ID (ini3al system state) CD has ID (ini3al system state) CD is not currently rented (ini3al system state) When (Trigger) Clerk checks out CD (ac3on) Then (Verify) CD recorded as rented (final system state) Rental contract printed (output)
  • 99. Check Out A CD ! Given&Customer&has&ID&& &&&&&and&CD&has&ID&& &&&&&and&CD&is&not&currently&rented&& Customer Data Name ID James 007 CD Data ID Title Rented CD2 Beatles Greatest Hits No
  • 100. CHECKING OUT CONTINUED ! When%a%clerk%checks%out%a%CD:% Check Out CD Enter Customer ID 007 Enter CD ID CD2 Press Rent
  • 101. CONTINUED FURTHER... ! Then%the%CD%is%recorded%as%rented%and%a%rental%contract% is%printed:%% CD Data ID Title Rented Customer ID CD2 Beatles Greatest Hits Yes 007 Rental Contract Customer ID Customer Name CD ID CD Title 007 James CD2 Beatles Greatest Hits
  • 102. THE ACTION ! Can$drive$a$GUI$ ! Or$a$method$$ Rent(CustomerID aCustomer, CDID aCD);
  • 103. ASSUMPTIONS Assume... - No other data changes - Can select customers (or CDs) from a list Could have tests for these assumptions...
  • 104. Test Example Check&that&no&other&elements&changed&on&check1out& ! Given&Customers&and&CDs&& &&&&&& Customer Data Name ID James 007 Maxwell 86 CD Data ID Title Rented Customer ID CD2 Beatles Greatest Hits No CD3 Lucy&Michelle&Hits No CD4 Janet&Jackson&Hits Yes 86
  • 105. Test Example 1 Check&that&no&other&elements&changed&on&check1out& ! Given&Customers&and&CDs&& &&&&&& Customer Data Name ID James 007 Maxwell 86 CD Data ID Title Rented Customer ID CD2 Beatles Greatest Hits No CD3 Lucy&Michelle&Hits No CD4 Janet&Jackson&Hits Yes 86
  • 106. Test Example 2 ! When%a%clerk%checks%out%a%CD:% Check Out CD Enter Customer ID 007 Enter CD ID CD2 Press Rent
  • 107. Test Example 3 ! Then%only%the%rented%CD%is%affected%% Customer Data Name ID James 007 Maxwell 86 CD Data ID Title Rented Customer ID CD2 Beatles Greatest Hits Yes 007 CD3 Lucy%Michelle%Hits No CD4 Janet%Jackson%Hits Yes 86
  • 108. Selection Example Check&that&a&customer&can&be&selected&& ! Given&Customers& &&&&&& Customer Data Name ID James 007 Maxwell 86 Check Out CD Enter Customer ID 86 Press Select ! When&a&Customer&is&selected&& &&&&&& ! Then&the&correct&customer&is&selected& &&&&&& Selected Customer Name ID Maxwell 86
  • 109. Business Rules Test Usually many One test per rule
  • 110. Example CD(Rental(Rates( Regular(($2(/(2(days(plus($1(/(day(( Golden(Oldie($1(/(2(days(plus($(.50(/(day( Hot(Stuff(($4(/(2(days(plus($2(/(day( Rates& Type& Days& Cost?& Regular( 2( $2( Golden(Oldie( 3( $1.50( Hot(Stuff( 6( $12( Hot(Stuff( 50(( IGBTYOT((
  • 111. UI & Business Rules Email Ajax call to middle-tier Submit, Middle-tier test Email&Valida)on&(Middle/Tier)& Value&& Valid?&& manager@sam.com, yes, someone@@somewhere.com, no, !#$%&*+7/=?^_,{|}~@sam.com, yes,
  • 112. Alternatives Can use "script" in tables or separately
  • 113. Copy A File (Happy Path) Given directory A with files X, Y, & Z And directory B with files D, E, F When file X is copied from A to B Then directory A has files X, Y, & Z and directory B has files D, E, F, & X
  • 114. CD Rental (happy Path) Given customer James with ID 007 And CD ID CD2 w/title "Beatle's Greatest Hits" is not rented When customer 007 rents CD2 And a rental contract is printed with: name James, customer ID 007, CD ID CD2, and CD title "Beatle's Greatest Hits"
  • 115. Business Rule Script Test When(a(CD(of(type(Regular(is(rented(for(2(days( Then(the(cost(is($2( When(a(CD(of(type(Golden(Oldie(is(rented(for(3(days(( Then(the(cost(is($1.50(( When(a(CD(of(type(Hot(Stuff(is(rented(for(6(days( Then(the(cost(is($12( ( Rates& Type& Days& Cost?& Regular( 2( $2( Golden(Oldie( 3( $1.50( Hot(Stuff( 6( $12( Hot(Stuff( 50(( IGBTYOT((
  • 117. External Interfaces ! Connec&ons(to(external(systems(need(to(have(test(doubles( (mocks)( ! Random(events(may(need(to(be(simulated(( ! Test(doubles(give(repeatability(and(speed(( External system, device, service Random events Time
  • 118. External Interface Example CD Rental System Charge Transfer To Credit Card Processor Sam’s Bank Confirmation or Denial Bank Statement
  • 119. Example of a Credit Card Test Double CD Rental System Credit Card Processor Test Double Charge Confirmation or Denial
  • 120. Example of a Email Test Double CD Rental System Email Server Test Double Email Confirmation or Denial Test verifies that email sent to proper address with proper contents
  • 121. Complex Business Rule and Separation
  • 122. Complex Business Rule A business rule determines whether a user is allowed to perform a certain operation Fields may contain values or be blank Field&One& Field&Two& Field&Three& Field&Four& Result&?& >&20& <&50&or&blank& >=100& Y& Allow& Otherwise&or& blank& DNC& DNC& DNC& Disallow& DNC& Otherwise& DNC& DNC& Disallow& DNC& DNC& Otherwise&or& blank& DNC& Disallow& DNC& DNC& DNC& N&or&blank& Disallow&
  • 123. Complex Business Rule Field&One& Result?& >&20& Allow& Blank& Disallow& Otherwise& Disallow& Field&Two& Result?& <&50& Allow& Blank& Allow& Otherwise& Disallow& Field&Three& Result&?& >=100& Allow& Blank& Disallow& Otherwise& Disallow& Field&Four& Result?&& Y& Allow& N& Disallow& Blank& Disallow& Otherwise& ??&
  • 124. Complex Business Rule Field&One& Field&Two& Field&Three& Field&Four& Result&?& Allow& Allow& Allow& Allow& Allow& Disallow& DNC& DNC& DNC& Disallow& DNC& Disallow& DNC& DNC& Disallow& DNC& DNC& Disallow& DNC& Disallow& DNC& DNC& DNC& Disallow& Disallow&
  • 125. Business Rule & UI Two business rule results Allow Disallow Alternate UI manifesta3ons of the business rule Disable the buDon if disallowed Hide the buDon if disallowed. Display dialog box if disallowed and they push the buDon To cut down tes3ng, expose business rule test 5 + 2 tests, rather than 5 * 2 tests
  • 126. Separate UI from Business Rule Business'Rule'Display'Requirement'' Business'Rule'Result' UI'Display?' Notes'' Disallow' Disable'Bu9on' Allow' Enable'Bu9on'' Take'to'some'entry' screen' End@to@end'Business'Rule'Test' Sample'user'ID' Business'Rule'Result' UI'Display?' 10345' Allow' Enable'Bu9on' 5555' Disallow'' Disable'Bu9on' Third'column'will'change'if'Business'Rule' Display'Requirement'changes''
  • 127. Separate the Model from the View Rental Contract Customer ID Customer Name CD ID CD Title Rental Due 007 James CD2 Beatles Greatest Hits 1/23/2011 Rental Contract Template The customer named <Customer Name> with the ID <Customer ID>, hereafter referred to as the Renter, has rented the CD identified by <CD ID> with the title "<CD Title>," hereafter referred to as the Rented CD, from Sam's Lawn Mower Repair and CD Rental Store, hereafter referred to as the Rentee. The Renter promises to return the Rented CD to the Rentee by <Rental Due>. If said Renter exceeds .. blah…blah…blah Rental Contract Printout The customer named James with the ID 007, hereafter referred to as the Renter, has rented the CD identified by CD2 with the title "Beatle's Greatest Hits," hereafter referred to as the Rented CD, from Sam's Lawn Mower Repair and CD Rental Store, hereafter referred to as the Rentee. The Renter promises to return the Rented CD to the Rentee by 1/23/2011. If said Renter exceeds .. blah…blah…blah
  • 128. Separate the Event from the Response Logon%Sequence%% Username% Password% Result?% Notes% Sam$ 123$ Bad_password$ 1st$bad$ George$ 1123$ No_user$ 2nd$bad$ Sam$ 1234$ Bad_password$ 3rd$bad$ Same$$ 12345$ Security_viola?on$ 4th$bad$ Logon%Ac9ons%% Result% Ac9on% Bad_password$ Display$“password$bad”$ No_user$$ Display$“no$user”$ Security_viola?on$ Send$enforcement$team$
  • 129. Google Maps What can you test w/o a UI?
  • 130. Google Maps No UI? Search phrase => List of places Place => Position Zoom Level => List of maps Position => List what's there
  • 132. WARNING!! Acceptances tests do NOT replace interactive communication! They provide focus for the communication
  • 133. Test Evaluation Remove redundant redundancy Business domain terms Shared between customer unit and developer/tester units Avoid lots of input and output columns Break into smaller tables (example follows)
  • 134. Big Table to Smaller One Big$Data$Test$ F1$ F2$ F3$ F4$ …$ Valid?$$ Reason$ 1$ 2$ 3$ 6$ Y$ 1$ 3$ 3$ 6$ N$ F2$+$F3$>$5$ 1$ 3$ 1$ 6$ N$ F2$+$F3$<$5$$ …$Lots$more$$ for$other$rules$ If can apply default values to F1, F4 etc., then could be: Big$Data$Test$for$F2EF3$$ F2$ F3$ Valid?$$ Reason$ 2$ 3$ Y$ 3$ 3$ N$ F2$+$F3$>$5$ 3$ 1$ N$ F2$+$F3$<$5$$
  • 135. Guidelines Develop tests & automation separately First, understand Second, automate (if appropriate) Automate tests for regression Run in continuous integration Cover 100% of function (if practical)
  • 136. Separation of Concerns Separate business rules from how results of business rules are displayed Separate calcula3on of a business rule (such as a customer ra3ng) from the use of that business rule (such as to give a discount) Separate each use case or step in a workflow Separate out valida3on of an en3ty from use of en3ty
  • 137. Separation and Abstraction One story together: When the build fails, send an email to the administrator Separate and abstracted: When the build fails, generate an alert When an alert is generated, no3fy the responsible individual When the responsible individual is no3fied, use that individual’s no3fica3on preference (email) Test the no3fica3on itself works (e.g. email works)
  • 138. What is a Good Test? Fails reliably (for a known reason) No false positives No other test covers the same area NOTE: Tests at the "top" often forced to assume business rules... aim for 1 failure at each level
  • 139. Use Alternate Tables Create tables in alternative forms, if standard not appropriate Sudoku Puzzle 1 4 7 2 5 8 3 6 9 4 7 1 5 8 2 6 9 3 7 1 4 8 2 5 9 3 6 Sudoku Solution 1 6 5 4 9 8 7 3 2 9 2 4 3 5 7 6 8 1 8 7 3 2 1 6 5 4 9 4 9 8 7 3 2 1 6 5 3 5 7 6 8 1 9 2 4 2 1 6 5 4 9 8 7 3 7 3 2 1 6 5 4 9 8 6 8 1 9 2 4 3 5 7 5 4 9 8 7 3 2 1 6 Required(Performance(( Puzzle(Type( Time(to(Solve?( Notes( Easy% .1%seconds%% See%easy%determina2on% Impossible% 1%second% No%solu2on%%
  • 140. Story Tests Not Enough Disk%Monitor% Report'Error'If'Disk' Does'Not'Respond' Within'1'Second Power%Saver%% Spin'Down'Disk'If'Not' Accessed'In'Past'Minute
  • 141. Other uses for Tests Estimation Aids Degree of Doneness
  • 142. Process note Requirement Testable Requirement Developable Requirement Not schedulable Preferably all At least one example for each test examples for all tests
  • 143. process Note Write within iteration Code% write% run% bind% Code% write% run% bind% Write previous iteration
  • 144. Not the End.... The Beginning!
  • 145. Objective Review Understand ATDD in context of SDLC Learn how to turn requirements into tests What is a good acceptance test? ATDD as a communication vehicle
  • 146. Our Outline Terms and definitions Requirements and tests Software development ATDD examples Anatomy of a test Tables System boundary
  • 147. Recap Primary goals Discover ambiguous requirements and gaps in requirements early on. Create a record of business/development understanding. Give feedback on quality . Secondary goals Use acceptance tests as an executable regression test. Measure your progress towards "done” completeness. Measure the complexity of requirements. Use the tests as a basis for user documenta3on.
  • 148. Exercise You listed your development issues... Would ATDD help, hurt, or be neutral Why? Write down your answer and pass it up
  • 149. Agility Responding to Change You're my customers You provided your requirements Now play the user/tester Were your requirements met? What else needs to be done?