Professional Documents
Culture Documents
Development
Naresh Jain
naresh@agilefaqs.com
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
1
Tutorial Schedule
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
2
Welcome
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
3
Welcome
• Continuum
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
3
Welcome
• Continuum
• Hopes and Concerns
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
3
Getting Started Exercise
Warmup Scenarios
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
4
Getting Started Exercise
Warmup Scenarios
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
4
Getting Started Exercise
Warmup Scenarios
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
4
Getting Started Exercise
Warmup Scenarios
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
4
Getting Started Exercise
Warmup Scenarios
4
What are
Acceptance Tests?
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
5
What are Acceptance Tests?
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
6
What are Acceptance Tests?
Communication
• Forces customers, testers, and developers to
work together
• creation
• implementation
• execution
• maintenance
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
7
What are Acceptance Tests?
Feedback
• A source of data
• A tool for project management
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
8
Data From Acceptance Tests
Total ATs Failing ATs Passing ATs
90
72
54
36
18
0
1 2 3 4 5 6 7 8 9 10
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
9
Acceptance Tests:
A Critical Piece of Agile
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
10
Acceptance Tests: A Critical Piece of Agile
Traditional Approach
1 May 1 Jul 1 Sep 1 Nov
Analysis
Design
Implementation
ERD
DFD
DD
ST
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
11
Acceptance Tests: A Critical Piece of Agile
Analysis
Test
Implementation
Design
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
12
Acceptance Tests: A Critical Piece of Agile
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
13
Acceptance Tests: A Critical Piece of Agile
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
13
Acceptance Tests: A Critical Piece of Agile
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
13
Acceptance Tests: A Critical Piece of Agile
Acceptance
Criteria
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
13
Acceptance Tests: A Critical Piece of Agile
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
13
Acceptance Tests: A Critical Piece of Agile
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
13
Acceptance Tests: A Critical Piece of Agile
Automated
Acceptance
Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
13
Acceptance Tests: A Critical Piece of Agile
Automated
Acceptance
Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
13
Acceptance Tests: A Critical Piece of Agile
Automated Acceptance
Acceptance Criteria
Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
13
Acceptance Tests: A Critical Piece of Agile
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
14
Acceptance Tests: A Critical Piece of Agile
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
15
Acceptance Tests: A Critical Piece of Agile
Manual
Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
15
Acceptance Tests: A Critical Piece of Agile
Manual
Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
15
Acceptance Tests Are
Automated
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
16
Acceptance Tests: A Critical Piece of Agile
The Button
• How often would
you press it?
• When would you
press it?
• Who would press
it?
• Testers, Developers,
Managers, Customers,
Spectators, etc.
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
17
Acceptance Tests: A Critical Piece of Agile
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
18
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
19
Criteria for DONE
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
19
Criteria for DONE
+
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
19
Criteria for DONE
+ Automated
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
19
Criteria for DONE
+ Automated
Executable Specification
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
19
Acceptance Tests: A Critical Piece of Agile
Executable Specification
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
20
Who Writes Acceptance
Tests?
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
21
Who Writes Acceptance Tests?
The Customer
• Yeah right! Then who?
• The Customer Role
• Stake holder
• Business Analyst
• Quality Assurance
• Product Owner
• Developercopyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
22
Who Writes Acceptance Tests?
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
23
Who Writes Acceptance Tests?
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
24
Who Writes Acceptance Tests?
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
25
Exercise #1
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
26
Exercise #1
27
Writing Good
Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
28
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
29
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
29
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
29
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
29
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
29
Writing Good Acceptance Tests
BOC
Build
Operate
Check
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
30
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
31
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
31
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
31
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
31
Writing Good Acceptance Tests
Be Specific
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
31
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
32
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
33
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
33
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
33
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
33
Writing Good Acceptance Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
33
Writing Good Acceptance Tests
Tests UI
System
Database
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
34
Writing Good Acceptance Tests
35
Tools
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
36
Tools
Commercial Tools
• WinRunner TestPartner EggPlant
• Silk QTP TestComplete
• RFT Squish WindowTester
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
37
Tools
38
Tools
FIT
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
39
Tools
FitNesse
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
40
FIT FitNesse
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
41
Thinking in Tables
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
42
Thinking in Tables
Ignored
Executed
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
43
Thinking in Tables
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
44
Thinking in Tables
3 Foundation Fixtures
• Column Fixture
• Row Fixture
• Action Fixture
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
45
Thinking in Tables
Column Fixture
package eg;
// Copyright (c) 2002 Cunningham & Cunningham
// Released under the terms of the GNU Genera
Public …
import fit.ColumnFixture;
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
46
Thinking in Tables
Row Fixture
Analogous to comparing
against rows in a
database table
package fitnesse.fixtures;
import fit.RowFixture;
public class EmployeePayRecord {
public int id;
public class EmployeePayRecordsRowFixture extends private double salary;
RowFixture { public EmployeePayRecord(int id,
public Object[] query() throws Exception { double salary){
EmployeePayRecord[] records = new this.id = id;
EmployeePayRecord[2]; this.salary = salary;
records[0] = new EmployeePayRecord(1, 1000); }
records[1] = new EmployeePayRecord(2,2000); public double pay() {
return records; return salary;
} }
public Class getTargetClass() { }
return EmployeePayRecord.class;
}
}
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
47
Thinking in Tables
Action Fixture
• Think GUI window Counter Window
Counter:
public class CountFixture extends Fixture {
private int counter = 0; Counter: 6
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
48
Exercise #2
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
49
Exercise #2
50
Exercise #2
Possible Solution
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
51
FitLibrary
• Extension to FIT
• Written by Rick Mugridge
• Adds some handy Fixtures
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
52
FitLibrary
FitLibrary Fixtures
• ArrayFixture for ordered lists
• SetFixture for unordered lists
• SetUpFixture
• Supports
• Graphics
• Tree structures
• Nested Tables
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
53
FitLibrary
DoFixture
• Highly readable
• Flexibility
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
54
Wiki
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
55
Wiki
What is it?
• A collaborative web site
• Editable by any
• Created by Ward Cunningham
• Every project should have one
• http://c2.com/wiki
• http://en.wikipedia.com
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
56
Wiki
Creating Tests
• Use Wiki syntax to create a page with test tables
• Label the page as a Test Page
• Use a page name of the form Test…
• Turn on the Test property
• Make sure your Fixtures are in the classpath
• Use !path widget
• Mechanics
• !path values are concatenated
• Java command to start FitServer is executed
• Testable HTML is passed to FitServer
• FitServer runs the tests
• Results are passed back to FitNesse
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
57
Wiki
Creating Suites
There are 2 ways to make Suites
• Set the Suite property
• Create a page with the Suite property
• Created test pages inside this page
• When the suite is executed, all child test pages will
be included in the suite execution
• Use the !see widget
• !see <name of test page>
• All “included” tests pages will be included in the
suite execution
Run a Suite by clicking the Suite button
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
58
Hands-on Session
• Conference Proposal Submission Portal
• Some sample Stories
• Should be able to submit new proposal
• Should be able to list all submitted proposal
• Submitting proposal with same title should display appropriate error
message
• Should be able to delete submitted proposal based on the title
• Should be able to delete submitted proposal based on the title
• Should be able to search proposals by title
• Should be able to search proposals by ID
• Should be able to find all proposal by an author's name
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
59
Break
http://www.fitnesse.org
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
60
Patterns
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
61
Patterns
Organizing Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
62
Patterns
Version Control
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
63
Patterns
Cross-Functional Pairing
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
64
Patterns
ATDD
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
65
Patterns
CSTT
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
66
Patterns
Independent Tests
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
67
Patterns
Dynamic Stubbing
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
68
Non-Production
Patterns
Setup/Teardown
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
69
Patterns
Suite Levels
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
70
Patterns
DRY
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
71
Patterns
Make it Real
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
72
Patterns
Fixture Evolution
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
73
Patterns
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
74
Anti-Patterns
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
75
Anti-Patterns
Developer ATs
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
76
Anti-Patterns
Unit Testing
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
77
Anti-Patterns
QA Testing Tool
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
78
Anti-Patterns
Silver Bullet
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
79
Anti-Patterns
Test After
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
80
Anti-Patterns
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
81
Implementation
Anti-Patterns
Dependant ATs
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
82
Anti-Patterns
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
83
The End
http://www.fitnesse.org
copyright (c) 2007 by Micah Martin & Naresh Jain. All rights reserved.
84