SlideShare uma empresa Scribd logo
1 de 53
Baixar para ler offline
T12
Concurrent Class
10/3/2013 11:15:00 AM

"Tests and Requirements: Like
Ham and Eggs, Sugar and Spice,
Lucy and Desi"
Presented by:
Ken Pugh
Net Objectives

Brought to you by:

340 Corporate Way, Suite 300, Orange Park, FL 32073
888-268-8770 ∙ 904-278-0524 ∙ sqeinfo@sqe.com ∙ www.sqe.com
Ken Pugh
Net Objectives
A fellow consultant with Net Objectives, Ken Pugh helps companies transform into lean-agile
organizations through training and coaching. His special interests are in communication
(particularly effectively communicating requirements), delivering business value, and using lean
principles to deliver high quality quickly. Ken trains, mentors, and testifies on technology topics
from object-oriented design to Linux/Unix.
9/19/2013

info@netobjectives.com
www.netobjectives.com

Tests and
Requirements:
You Can’t Have
One without the
Other
Ken Pugh
Fellow Consultant
Net Objectives

1

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Ken Pugh
Fellow Consultant
Photo
Size:
Height: 2.25
Position:
from top left corner
Horizontal 0.75
Vertical 1.
Picture Style: Simple Black
Frame

OOA&D, Design Patterns, Lean, Agile, Test-Driven
Development
Over 2/5 century of software development
experience
Author of seven books, including:

ken.pugh
@netobjectives.com

– Prefactoring: Extreme Abstraction, Extreme
Separation, Extreme Readability (2006 Jolt Award)
– Interface Oriented Design
– Lean Agile Acceptance Test-Driven Development:
Better Software Through Collaboration

No code goes in till the test goes on.
A journey of two thousand miles begins with a single step.
2

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

1
9/19/2013

Objectives
Show how requirements and tests are complementary
facets
How to create requirements and tests collaboratively

3

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Overall Rule
There are exceptions to every statement, except this
one

4
4

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

2
9/19/2013

Fast Car
Who wants a fast car?

5

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Requirements

6

19 September 2013

3
9/19/2013

Requirement Definition
Requirement is:
– Condition or capability needed by user to solve problem or
achieve objective
– Condition or capability met or possessed by system
component to satisfy contract, standard, specification or
regulation

7
7

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Requirements

Requirements should include
– Functions – what the software should do
– Constraints – limitations on the manifestation

Requirements should NOT include (usually)
– Ways to implement the requirements
– Specific manifestations – exactly what you want

8
8

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

4
9/19/2013

An Brownie Specification - MIL-C-44072C (1)
3.3.1 Brownie formula. The formula for the brownie shall be as
follows:
Ingredient
Sugar 1/
Flour 2/
Shortening
Nuts 3/
whole eggs 4/ 5/
Cocoa
Dextrose, anhydrous
Salt

Parts by weight
23.0
21.0
16.8
16.0
13.0
5.5
4.4
.03

3/ U.S. Standards for Shelled English Walnuts (Fresh Products Branch, Fruit and
Vegetable Division, Agricultural Marketing Service, U.S. Department of
Agriculture)
9

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

An Brownie Specification - MIL-C-44072C (2)
3.3.2 Brownie preparation.
a. Whip eggs in large bowl on high speed until light and fluffy.
b. Combine sugars, cocoa, salt, and leavening; add to beaten eggs, and whip
on high speed until thick.
c. Add shortening slowly while mixing on low speed.
d. Scrape bowl and whip on high speed until thick.
e. Mix flour, nuts, and flavors together and fold into batter; mix until
uniform.
f. Pour batter 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 until done (30 to 45 minutes).

10

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

5
9/19/2013

Characteristics of Requirements
These characteristics often applied to requirements.
Bold indicates characteristics emphasized by agility
Specific
Unambiguous
Testable/Verifiable
Singular
Design Independent
Necessary

Correct
Consistent
Complete
Documented
Prioritized
Modifiable

11
11

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Question
How do you know a requirement is testable?

12

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

6
9/19/2013

Software
Development

13

19 September 2013

The Team
Customer Unit - develops the requirements
–
–
–
–

Product Owner
Business analysts
Users
Quality Assurance

Developer / Tester Unit – develops the implementation
– Programmers
– Testers / Quality Assurance

The Triad
– Customer, developer, tester

14

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

7
9/19/2013

Value Stream Map – Classical Development

Elicit Requirements

Code

Analyze
Requirements

Test

Design

Deploy

Why go back?

15

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Why Mistakes?
Misunderstandings, missed requirements, mis-other
Feedback helps to correct misunderstandings
Quick feedback better than slow feedback
Desired

16

Actual

Copyright © 2007 Net Objectives. All Rights Reserved.

Actual

19 September 2013

8
9/19/2013

Value Stream Map – Agile Development

Elicit Requirements

Analyze
Requirements With
Tests

Code With Tests

17

Design

Deploy

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Move Testing Forward
Two types of testing
Attempting to find defects
– is WASTE
Attempting to prevent defects – is ESSENTIAL

When are defects found?
– Prevention is just early detection

18

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

9
9/19/2013

Steps
Author the tests (write)
– Customer, tester, developer together

Connect tests to system (bind)
– Developer unit

Run the tests (run)
– Developers, testers, customers
– Automated – part of build
Test

19

write

run

bind

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Usually the Case

write
Code

20

bind

run

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

10
9/19/2013

A Better Way

write

bind

Code
run

21

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Testing Strategies

Meszaros, XUNIT TEST PATTERNS: REFACTORING TEST CODE,
Fig 6.1 "Purpose of Tests" p. 51, © 2007 Pearson Education, Inc
22

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

11
9/19/2013

Another Look at Testing Strategies
Focus of the tests (not exclusive)

Customer Tests

Exploratory Testing

Expected Results

Unexpected Results

Valid Input

Specified effects

Unspecified effects

Invalid input

Specified error message

Any side effects

23

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Verification and Validation
Verification
– Have we got the requirements right?
– Focus of acceptance tests

Validation
– Have we got the right requirements?
Customer really does it this way
Environment is what we believe it to be

– How do you test this?

24

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

12
9/19/2013

Acceptance Testing

UI
Acceptance
Tests

Application /
Middle tier

Core Business Logic

Persistence

25

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Tests all the way down
Test

Test

Test

Requirement

Requirement

Customer
Acceptance
Tests

Requirement

Requires services
to implement

Test

Service
Implementation

26

Test

Service
Implementation

Copyright © 2007 Net Objectives. All Rights Reserved.

Developer
Acceptance
Tests

19 September 2013

13
9/19/2013

Definitions
Acceptance criteria
– A statement of how something will be tested

Acceptance test outline
– Steps in an acceptance test

Acceptance test
– A test with all information for clear pass/fail repeatability

27

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Requirements and Tests
Requirements and tests are inter-related
– You can’t have one without the other

Failing test is a requirement
– Passing test denotes specification on how system works

28

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

14
9/19/2013

ATDD as a Prism

Requirements

29

ATDD

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Acceptance Test
Examples

30

19 September 2013

15
9/19/2013

A First Example

31

19 September 2013

First Example
As a user, I want to convert a temperature in Fahrenheit to a
temperature in Celsius.
What is an acceptance criteria for this?
What’s your estimate?

32

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

16
9/19/2013

Acceptance Test Outline
Given:
– A temperature in Fahrenheit

When
– The user converts it

Then
– The result should be the corresponding temperature in
Celsius

Exercise: What specific tests should there be?

33

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Acceptance Tests

Fahrenheit (Input)
32

0

212

100

-459.7

-273.15

Precision

Error

-273.151

Below 0 Kelvin

1000

34

Celsius
(Output)

Notes

550

Maximum – Needed?

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

17
9/19/2013

Stories

35

19 September 2013

Context
Sam’s Lawn Mower Repair and CD Rental Store
– A custom software package for CD rentals.

36

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

18
9/19/2013

User Story Examples

As the clerk, I want to check out a CD for a
customer.
As the clerk, I want to check in a CD for a
customer.
As the inventory maintainer, I want to know
where every CD is—in the store or rented.
As the finance manager, I want to submit a
credit card charge every time a CD is rented so
that the store does not have to handle cash.
37
37

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Story Acceptance Criteria
Check Out CD
– Check out a CD. Check to see that it is recorded as rented.

Check In CD
– Check in a CD. Check to see that it is recorded as returned.
– Check in a CD that is late. Check to see that it is noted as late.

Report Inventory
– Check out a few CDs. See if the report shows them as rented.
– Check in a few CDs. See if the report shows them as in the store.

Charge Rental
– Check in a CD. See if the rental charge is correct. See if the credit
charge matches the rental charge. See if the charge is made to the
credit card company. Check that the bank account receives money
from the charge.
38

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

19
9/19/2013

Developable Stories
To become developable, stories require
– More detailed requirements
Workflow or use cases
Possibly mock-up user interfaces

– Acceptance test outline against those details

39
39

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Detailing Stories
Use Cases
Event / Response Tables (if there’s time)

40

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

20
9/19/2013

Use Case Template – Part One
Name—Identifier to easily reference it by
Description—Brief note
Actor—Who initiates the use case
Pre-conditions—What must be true before the use
case is initiated
Post-conditions—What is true if the use case
successfully executes
Main course—Steps that show the sequence of
interactions
41
41

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Use Case Example – Part One
Name—Check Out CD.
Description—Check out a CD for a customer.
Actor—Clerk.
Pre-conditions—The customer has an identification. The CD
has an identity.
Post-conditions—The CD is recorded as rented. The rental
contract is printed.
Main Course:
1. The clerk enters the customer identification and CD identifier into
the system.
2. The system records the information.
3. The system prints a contract that the customer signs.

42
42

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

21
9/19/2013

Use Case Template – Part Two

Alternatives: flow that allows the use case to be
successful even if some condition occurs
Exceptions: conditions can occur that may not
allow it to reach its post-conditions.
Business Rules: rules that must be followed
regardless of technology
Note: Alternatives and Exceptions could become
separate story(ies) if requires significant effort
Exceptions and Alternatives numbered with
reference to Main Course steps
43
43

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Use Case Example – Part Two
Exceptions:
1a. Customer identification is not recognized.
Clerk repeats step 1.
1b. The customer violates the CD Rental Limit business rule.
The clerk notifies the customer of the violation.
The use case is abandoned.

Business Rule:
CD Rental Limit
A customer can rent only three CDs at any one time.

Alternatives
3a. The printer jams.
The clerk fills out the contract by hand.
The use case exits.

44
44

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

22
9/19/2013

Acceptance Tests

List of Acceptance Tests
– Rent a CD—This is the main course.
– Bad Customer ID—Enter the customer ID wrong.
– CD Rental Limit—A customer has three CDs and rents
another one.
– Printer Jam—Simulate a printer jam (maybe out of paper).

45
45

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Acceptance Test
Outline

46

19 September 2013

23
9/19/2013

Test Flow
Test

Setup
(Given))

Trigger
(When)

Assert
(Then)
Expected
System
State and
Output

Initial

Action or Event

System
State

47

Final
System
State and
Output

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Given / When / Then Outline
Given (Setup)
Customer has ID (initial system state)
CD has ID (initial system state)
CD is not currently rented (initial system state)
When (Trigger)
Clerk checks out CD (action)
Then (Verify)
CD recorded as rented (final system state)
Rental contract printed (output)

48

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

24
9/19/2013

Acceptance Test
Using Tables

49

19 September 2013

Table Types
Calculation Table
Action Table
Data Table

50

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

25
9/19/2013

Calculation Table

Title
Input Name 1

Input Name 2

Result Name?

Notes

Anything that
Value for input 1 Value for input 2 Expected output describes
scenario
Another value
for input 1

Another value
for input 2

51

Another
expected output

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Calculation Table Example

Discount Calculation

Item Total

Customer Rating

Discount Percentage?

$10.00

Good

When

0%

Then

Given

52

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

26
9/19/2013

Data Table
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

53

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Data Table Example
Customer Data
Name
James

007

Maxwell

54

ID
86

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

27
9/19/2013

Action Table
Enter enters data into an entry field
Press initiates a process, such as a Submit button on a
dialog box
Check sees if a result is equal to an expected value.
Action Name
Enter

Value Name 1

Value for 1

Enter

Value Name 2

Value for 2

Press

Submit

Check

Value Name 3

55

Expected value for 3

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

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

When

Press

Rent

Then

Check

Rented

Given

56

True

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

28
9/19/2013

Full
Requirements
and Tests

57

19 September 2013

Given / When / Then Example Outline
Given (Setup)
Customer has ID (initial system state)
CD has ID (initial system state)
CD is not currently rented (initial system state)
When (Trigger)
Clerk checks out CD (action)
Then (Verify)
CD recorded as rented (final system state)
Rental contract printed (output)

58

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

29
9/19/2013

Full Test
Check Out 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

59

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Full Test (2)
When a clerk checks out a CD:
Check Out CD
Enter

007

Enter

CD ID

CD2

Press

60

Customer ID

Rent

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

30
9/19/2013

Full Test (3)
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

61

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

The Action
Can drive a GUI

Or a method
Rent(CustomerID aCustomer, CDID, aCD);

62

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

31
9/19/2013

Full Test - Exception
Check Out CD with CD Rental Limit
Given Customer has ID and CD has ID
and the Customer has three rentals already
Customer Data
Name

ID

James

007

CD Data
ID

Rented

Customer ID

CD2

Yes

007

CD3

Yes

007

CD4

Yes

007

CD5

No

63

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Full Test Exception (2)
When a clerk checks out a CD
Then CD Rental Limit occurs
Check Out CD
Enter

007

Enter

CD ID

CD5

Press

Rent

Check

64

Customer ID

Status

CD_Rental_Limit_Exceeded

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

32
9/19/2013

The Other Tests
To be developable
– All tests should be complete
You are going to need them all anyway
The tests detail the requirement

Pragmatically
– Sufficient tests need to be complete
– Defining “sufficient” is the hard part

65

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

When To Write
Story Tests

66

19 September 2013

33
9/19/2013

Iteration Based
Make Developable

Iteration
Backlog

Product
Backlog

Acceptance
Tests (or
Outline)

Acceptance
Criteria

67

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Make Developable
Within iteration
write

bind

Code
run

Previous iteration
write

bind

Code
run

68

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

34
9/19/2013

Iteration-less (Kanban)

Idea
Queue

Idea

69

Prioritize

Ready to Analyze
Analyze

Ready to Create
Detail
acceptance
tests

Ready to Develop
Develop

Ready
for
“Release
Set”
testing

Story

Story

Story

Done

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Not An Ending,
But A Beginning

70

19 September 2013

35
9/19/2013

Outlines
Objectives were:
– Show how requirements and tests are complementary facets
– How to create requirements and tests collaboratively

71

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Other Things Tests Are Good For
Acceptance tests can also be used as:
– Estimation aid
To break stories down if they are too big

– Degree of doneness
Percentage of passing acceptance tests is “rough” indication of story
completion

– Regression test suite
particularly if automated

72

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

36
9/19/2013

Why Acceptance Tests?
Rework Down from 60% to 20%
Workflows Working First Time
Little Room for Miscommunication
Saving Time
Getting Business Rules Right
Game Changing
Tighter Cross-Functional Team Integration
Crisp Visible Story Completion Criteria
Automation Yields Reduced Testing Time
73

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Now, if there’s time, an exercise
If not:

74

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

37
9/19/2013

Thank you.
Please fill out the evaluations

75

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

An Exercise

76

19 September 2013

38
9/19/2013

The Story
As a computer user, I want to copy a file from one
directory to another.
What’s your estimate?

77

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

The Interface
GUI

Command line
CopyFile <SourceDirectory>
<TargetDirectory> <Filename>

78

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

39
9/19/2013

Exercise
Write tests for:
“copying a file from one directory to another”
Describe in terms of:
– Given: some state
– When: copy (file, source_directory, destination_directory)
– Then: expected state
When

Given
Source
Directory
Contents

Destination
Directory
Contents

Then (Expected)

Copy
File
X

X

Destination
Directory
Contents?
X

79

Anything else?

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Copying Table Example
Given

Then (Expected)

When

Source
Directory
Contents

Destination
Directory
Contents

Copy
File

Destination
Directory
Contents?

Source
Directory
Contents?

Content
Comparison?

Notes

X, Y, Z

D,E,f

X

D,E,F,X

X,Y,Z

(Destination.X
== Source.X)

Standard
copy

X, Y, Z

D,E,F,X

X

D,E,F,X

X,Y,Z

(Destination.X
== Source.X)

X
overwritte
n

X, Y, Z

D,E,F,X

X

D,E,F,X

X,Y,Z

(Destination.X
==
Destination.X)

X not
overwritte
n

What about modification date and other attributes?
Make more columns

80

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

40
9/19/2013

Copy File Example
Copy a file (happy path)
Given a source
and target directory

File system
Directory Name

Directory Contents

A

X, Y, Z
D,E,F

B
Copy File
Enter

Source Directory

A

Enter

Target Directory

B

Enter

File name

X

Press

When copy request is
made

Copy

File system

Then file is copied

Directory Name

Directory Contents

A

X, Y, Z
D,E,F,X

B
81

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Copy File Example
Non-existent file Given a source and target directory
File system
Directory Name

Directory Contents

A

X, Y, Z
D,E,F

B

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?
82

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

41
9/19/2013

Implementing
Acceptance Tests

83

19 September 2013

A Business Rule Example
If Customer Rating is Good and the Order Total is less
than or equal $10.00,
Then do not give a 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%.

84

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

42
9/19/2013

Business Rule Table = Test

Discount
Order total

Customer rating

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%

85

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Ways To Implement Test
Testing script
Program interface
Xunit framework
ATDD framework

86

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

43
9/19/2013

Testing script
Tester creates script (usually GUI based).
Example:
–
–
–
–
–

Logon as Customer who is rated Good
Start order
Put items in the order until the total is exactly $10.01
Complete order
Check it shows a $.10 discount

Repeat for other five cases

87

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Program interface
Create a command line or graphic user interface
Discount Percentage Screen

Screen

Customer Type: Good
Order Total:
10.01
Percentage:

Discount
Method

1 %

C:>DiscountPercentage Good 10.01
Percentage: 1%
88

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

44
9/19/2013

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));
}

}

89

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Fit (Table = Test)

Discount
Order total

Discount percentage?

10.00

Good

0

10.01

Good

1

50.01

Good

1

.01

Excellent

1

50.00

Excellent

1

50.01

90

Customer rating

Excellent

5

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

45
9/19/2013

Example
Contributions
With States

91

19 September 2013

Retirement Contribution Example
Requirement
The system shall match incoming retirement contribution files
with bank deposits. If the total on the contribution files
matches the bank deposit, the corresponding funds shall be
purchased.

Exceptions ?
Retirement Plan
Contribution
File

92

Bank Deposit

Process

Funding

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

46
9/19/2013

Given (Setup)
PlanID = XYZ
Name

Fund

George

WildEyedStocks

Sam

GovernmentBonds

Bill

UnderTheMattress

PlanID

Bank Routing
Number

Account Number

XYZ

111-11-11111

12345678

93

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

When (Trigger) File Received

401K Contributions

PlanID=XYZ

Name

Amount

George

5000

Sam

1000

Bill

500

Bank Deposit
Routing Number

Amount

111-11-11111

94

Account Number
12345678

6500

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

47
9/19/2013

Then (Expected)

Expected Output
Funding

PlanID = XYZ

Name

Fund

Amount

George
Sam

WildEyedStocks
GovernmentBonds

5000
1000

Bill

UnderTheMattress

500

95

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Contribution States

Contribution State
Received
Awaiting Match
Purchase Funds
Begin Exception Processing
Edit Processing

96

Meaning
Contribution File received
Waiting for Bank Deposit
Matched Bank Deposit, buy
funds
Bank Deposit received, but
incorrect
Contribution File bad
format

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

48
9/19/2013

State Transitions
Contribution State Event
Initial
Received
data
Received
Data check is
bad
Received
Data check is
good
Awaiting Match
Matched
exactly
Awaiting Match
Discrepancy
in match
AwaitingMatch
Matching
time
exceeded
Purchase Funds
One minute
prior to
market close
97

New State
Received

Notes

EditProcessing
Awaiting Match
Purchase Funds

Matching on entry and ½
hour before close

BeginExceptionProcessing
BeginExceptionProcessing

Awaiting Confirmation

Enter order for funds

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Deposit States

Deposit State
Initial
Received
Received

New State
Received
Edit Processing
Awaiting Match

Awaiting Match

98

Event
Data received
Data check is bad
Data check is good
MatchedExactly

Matched

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

49
9/19/2013

info@netobjectives.com
www.netobjectives.com

A Few Problems

99

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

A Hotel Display

100

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

50
9/19/2013

Another Hotel Display (1)

101

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

Another Hotel Display (2)

102

Copyright © 2007 Net Objectives. All Rights Reserved.

19 September 2013

51

Mais conteúdo relacionado

Destaque

Governing Agile Teams: Disciplined Strategies to Increase Agile Effectiveness
Governing Agile Teams: Disciplined Strategies to Increase Agile EffectivenessGoverning Agile Teams: Disciplined Strategies to Increase Agile Effectiveness
Governing Agile Teams: Disciplined Strategies to Increase Agile EffectivenessTechWell
 
Protection Poker: An Agile Security Game
Protection Poker: An Agile Security GameProtection Poker: An Agile Security Game
Protection Poker: An Agile Security GameTechWell
 
Influence Strategies for Software Professionals
Influence Strategies for Software ProfessionalsInfluence Strategies for Software Professionals
Influence Strategies for Software ProfessionalsTechWell
 
Agile Redefines Global Economics: What Recent Data Reveals
Agile Redefines Global Economics: What Recent Data RevealsAgile Redefines Global Economics: What Recent Data Reveals
Agile Redefines Global Economics: What Recent Data RevealsTechWell
 
Agile Program Management: Networks, Not Hierarchies
Agile Program Management: Networks, Not HierarchiesAgile Program Management: Networks, Not Hierarchies
Agile Program Management: Networks, Not HierarchiesTechWell
 
Agile and CMMI: Yes, They Can Work Together
Agile and CMMI: Yes, They Can Work TogetherAgile and CMMI: Yes, They Can Work Together
Agile and CMMI: Yes, They Can Work TogetherTechWell
 
Agile Testing: It’s a Team Sport
Agile Testing: It’s a Team SportAgile Testing: It’s a Team Sport
Agile Testing: It’s a Team SportTechWell
 
Agile Success with Scrum: It’s All about the People
Agile Success with Scrum: It’s All about the PeopleAgile Success with Scrum: It’s All about the People
Agile Success with Scrum: It’s All about the PeopleTechWell
 
Design for Testability: A Tutorial for Devs and Testers
Design for Testability: A Tutorial for Devs and TestersDesign for Testability: A Tutorial for Devs and Testers
Design for Testability: A Tutorial for Devs and TestersTechWell
 
Seven Keys to Navigating Your Agile Testing Transition
Seven Keys to Navigating Your Agile Testing TransitionSeven Keys to Navigating Your Agile Testing Transition
Seven Keys to Navigating Your Agile Testing TransitionTechWell
 
The Google Hacking Database: A Key Resource to Exposing Vulnerabilities
The Google Hacking Database: A Key Resource to Exposing VulnerabilitiesThe Google Hacking Database: A Key Resource to Exposing Vulnerabilities
The Google Hacking Database: A Key Resource to Exposing VulnerabilitiesTechWell
 
Designing Your Team and Organization for Innovation
Designing Your Team and Organization for InnovationDesigning Your Team and Organization for Innovation
Designing Your Team and Organization for InnovationTechWell
 
Software Metrics: Taking the Guesswork Out of Software Projects
Software Metrics: Taking the Guesswork Out of Software ProjectsSoftware Metrics: Taking the Guesswork Out of Software Projects
Software Metrics: Taking the Guesswork Out of Software ProjectsTechWell
 
Test Managers: How You Can Really Make a Difference
Test Managers: How You Can Really Make a DifferenceTest Managers: How You Can Really Make a Difference
Test Managers: How You Can Really Make a DifferenceTechWell
 
Data Warehouse Testing: It’s All about the Planning
Data Warehouse Testing: It’s All about the PlanningData Warehouse Testing: It’s All about the Planning
Data Warehouse Testing: It’s All about the PlanningTechWell
 

Destaque (15)

Governing Agile Teams: Disciplined Strategies to Increase Agile Effectiveness
Governing Agile Teams: Disciplined Strategies to Increase Agile EffectivenessGoverning Agile Teams: Disciplined Strategies to Increase Agile Effectiveness
Governing Agile Teams: Disciplined Strategies to Increase Agile Effectiveness
 
Protection Poker: An Agile Security Game
Protection Poker: An Agile Security GameProtection Poker: An Agile Security Game
Protection Poker: An Agile Security Game
 
Influence Strategies for Software Professionals
Influence Strategies for Software ProfessionalsInfluence Strategies for Software Professionals
Influence Strategies for Software Professionals
 
Agile Redefines Global Economics: What Recent Data Reveals
Agile Redefines Global Economics: What Recent Data RevealsAgile Redefines Global Economics: What Recent Data Reveals
Agile Redefines Global Economics: What Recent Data Reveals
 
Agile Program Management: Networks, Not Hierarchies
Agile Program Management: Networks, Not HierarchiesAgile Program Management: Networks, Not Hierarchies
Agile Program Management: Networks, Not Hierarchies
 
Agile and CMMI: Yes, They Can Work Together
Agile and CMMI: Yes, They Can Work TogetherAgile and CMMI: Yes, They Can Work Together
Agile and CMMI: Yes, They Can Work Together
 
Agile Testing: It’s a Team Sport
Agile Testing: It’s a Team SportAgile Testing: It’s a Team Sport
Agile Testing: It’s a Team Sport
 
Agile Success with Scrum: It’s All about the People
Agile Success with Scrum: It’s All about the PeopleAgile Success with Scrum: It’s All about the People
Agile Success with Scrum: It’s All about the People
 
Design for Testability: A Tutorial for Devs and Testers
Design for Testability: A Tutorial for Devs and TestersDesign for Testability: A Tutorial for Devs and Testers
Design for Testability: A Tutorial for Devs and Testers
 
Seven Keys to Navigating Your Agile Testing Transition
Seven Keys to Navigating Your Agile Testing TransitionSeven Keys to Navigating Your Agile Testing Transition
Seven Keys to Navigating Your Agile Testing Transition
 
The Google Hacking Database: A Key Resource to Exposing Vulnerabilities
The Google Hacking Database: A Key Resource to Exposing VulnerabilitiesThe Google Hacking Database: A Key Resource to Exposing Vulnerabilities
The Google Hacking Database: A Key Resource to Exposing Vulnerabilities
 
Designing Your Team and Organization for Innovation
Designing Your Team and Organization for InnovationDesigning Your Team and Organization for Innovation
Designing Your Team and Organization for Innovation
 
Software Metrics: Taking the Guesswork Out of Software Projects
Software Metrics: Taking the Guesswork Out of Software ProjectsSoftware Metrics: Taking the Guesswork Out of Software Projects
Software Metrics: Taking the Guesswork Out of Software Projects
 
Test Managers: How You Can Really Make a Difference
Test Managers: How You Can Really Make a DifferenceTest Managers: How You Can Really Make a Difference
Test Managers: How You Can Really Make a Difference
 
Data Warehouse Testing: It’s All about the Planning
Data Warehouse Testing: It’s All about the PlanningData Warehouse Testing: It’s All about the Planning
Data Warehouse Testing: It’s All about the Planning
 

Semelhante a Tests and Requirements Go Hand in Hand

User Acceptance Testing: Make the User a Part of the Team
User Acceptance Testing: Make the User a Part of the TeamUser Acceptance Testing: Make the User a Part of the Team
User Acceptance Testing: Make the User a Part of the TeamTechWell
 
Cause-Effect Graphing: Rigorous Test Case Design
Cause-Effect Graphing: Rigorous Test Case DesignCause-Effect Graphing: Rigorous Test Case Design
Cause-Effect Graphing: Rigorous Test Case DesignTechWell
 
Strategies for Implementing Aras Innovator
Strategies for Implementing Aras InnovatorStrategies for Implementing Aras Innovator
Strategies for Implementing Aras InnovatorAras
 
From Manual To Automated Software Testing - A Webinar Presentation
From Manual To Automated Software Testing - A Webinar PresentationFrom Manual To Automated Software Testing - A Webinar Presentation
From Manual To Automated Software Testing - A Webinar PresentationInflectra
 
Model Drivers: The testing profile and its opportunity 2013-09-01
Model Drivers: The testing profile and its opportunity 2013-09-01Model Drivers: The testing profile and its opportunity 2013-09-01
Model Drivers: The testing profile and its opportunity 2013-09-01Greg Soulsby
 
Improving the User Story Agile Technique Using the INVEST Criteria
Improving the User Story Agile Technique Using the  INVEST CriteriaImproving the User Story Agile Technique Using the  INVEST Criteria
Improving the User Story Agile Technique Using the INVEST CriteriaLuigi Buglione
 
Optimizely Product Vision: The Future of Experimentation
Optimizely Product Vision: The Future of ExperimentationOptimizely Product Vision: The Future of Experimentation
Optimizely Product Vision: The Future of ExperimentationOptimizely
 
SbE - Requirements in an agile process
SbE - Requirements in an agile processSbE - Requirements in an agile process
SbE - Requirements in an agile processChris Schotanus
 
The Survey Says: Testers Spend Their Time Doing...
The Survey Says: Testers Spend Their Time Doing...The Survey Says: Testers Spend Their Time Doing...
The Survey Says: Testers Spend Their Time Doing...TechWell
 
Monitoring in the DevOps Era
Monitoring in the DevOps EraMonitoring in the DevOps Era
Monitoring in the DevOps EraMike Kavis
 
Augmenting Coded UI
Augmenting Coded UIAugmenting Coded UI
Augmenting Coded UItravisk
 
IBM Social Business Toolkit SDK - Playground and Scenarios
IBM Social Business Toolkit SDK - Playground and ScenariosIBM Social Business Toolkit SDK - Playground and Scenarios
IBM Social Business Toolkit SDK - Playground and ScenariosNiklas Heidloff
 
How BiggerPockets runs experiments faster with performance edge
How BiggerPockets runs experiments faster with performance edgeHow BiggerPockets runs experiments faster with performance edge
How BiggerPockets runs experiments faster with performance edgeOptimizely
 
How to sell OpenERP out of-the-box vs implementation. Francois Pietquin, OpenERP
How to sell OpenERP out of-the-box vs implementation. Francois Pietquin, OpenERPHow to sell OpenERP out of-the-box vs implementation. Francois Pietquin, OpenERP
How to sell OpenERP out of-the-box vs implementation. Francois Pietquin, OpenERPOdoo
 
Sprinkle on Just Enough Process
Sprinkle on Just Enough ProcessSprinkle on Just Enough Process
Sprinkle on Just Enough ProcessTechWell
 
Changing the world with compelling ideas (Solar Event)
Changing the world with compelling ideas (Solar Event)Changing the world with compelling ideas (Solar Event)
Changing the world with compelling ideas (Solar Event)VNUExhibitions
 

Semelhante a Tests and Requirements Go Hand in Hand (20)

User Acceptance Testing: Make the User a Part of the Team
User Acceptance Testing: Make the User a Part of the TeamUser Acceptance Testing: Make the User a Part of the Team
User Acceptance Testing: Make the User a Part of the Team
 
Cause-Effect Graphing: Rigorous Test Case Design
Cause-Effect Graphing: Rigorous Test Case DesignCause-Effect Graphing: Rigorous Test Case Design
Cause-Effect Graphing: Rigorous Test Case Design
 
Strategies for Implementing Aras Innovator
Strategies for Implementing Aras InnovatorStrategies for Implementing Aras Innovator
Strategies for Implementing Aras Innovator
 
Mac Klingler: 2013 Sandia National Laboratoies Wind Plant Reliability Workshop
Mac Klingler: 2013 Sandia National Laboratoies Wind Plant Reliability WorkshopMac Klingler: 2013 Sandia National Laboratoies Wind Plant Reliability Workshop
Mac Klingler: 2013 Sandia National Laboratoies Wind Plant Reliability Workshop
 
From Manual To Automated Software Testing - A Webinar Presentation
From Manual To Automated Software Testing - A Webinar PresentationFrom Manual To Automated Software Testing - A Webinar Presentation
From Manual To Automated Software Testing - A Webinar Presentation
 
Model Drivers: The testing profile and its opportunity 2013-09-01
Model Drivers: The testing profile and its opportunity 2013-09-01Model Drivers: The testing profile and its opportunity 2013-09-01
Model Drivers: The testing profile and its opportunity 2013-09-01
 
Improving the User Story Agile Technique Using the INVEST Criteria
Improving the User Story Agile Technique Using the  INVEST CriteriaImproving the User Story Agile Technique Using the  INVEST Criteria
Improving the User Story Agile Technique Using the INVEST Criteria
 
Optimizely Product Vision: The Future of Experimentation
Optimizely Product Vision: The Future of ExperimentationOptimizely Product Vision: The Future of Experimentation
Optimizely Product Vision: The Future of Experimentation
 
SbE - Requirements in an agile process
SbE - Requirements in an agile processSbE - Requirements in an agile process
SbE - Requirements in an agile process
 
The Survey Says: Testers Spend Their Time Doing...
The Survey Says: Testers Spend Their Time Doing...The Survey Says: Testers Spend Their Time Doing...
The Survey Says: Testers Spend Their Time Doing...
 
SSE SE Practices Introduction
SSE SE Practices IntroductionSSE SE Practices Introduction
SSE SE Practices Introduction
 
Monitoring in the DevOps Era
Monitoring in the DevOps EraMonitoring in the DevOps Era
Monitoring in the DevOps Era
 
Model based testing
Model based testingModel based testing
Model based testing
 
Augmenting Coded UI
Augmenting Coded UIAugmenting Coded UI
Augmenting Coded UI
 
IBM Social Business Toolkit SDK - Playground and Scenarios
IBM Social Business Toolkit SDK - Playground and ScenariosIBM Social Business Toolkit SDK - Playground and Scenarios
IBM Social Business Toolkit SDK - Playground and Scenarios
 
How BiggerPockets runs experiments faster with performance edge
How BiggerPockets runs experiments faster with performance edgeHow BiggerPockets runs experiments faster with performance edge
How BiggerPockets runs experiments faster with performance edge
 
How to sell OpenERP out of-the-box vs implementation. Francois Pietquin, OpenERP
How to sell OpenERP out of-the-box vs implementation. Francois Pietquin, OpenERPHow to sell OpenERP out of-the-box vs implementation. Francois Pietquin, OpenERP
How to sell OpenERP out of-the-box vs implementation. Francois Pietquin, OpenERP
 
Sprinkle on Just Enough Process
Sprinkle on Just Enough ProcessSprinkle on Just Enough Process
Sprinkle on Just Enough Process
 
Cost estimating and risk in complex projects
Cost estimating and risk in complex projectsCost estimating and risk in complex projects
Cost estimating and risk in complex projects
 
Changing the world with compelling ideas (Solar Event)
Changing the world with compelling ideas (Solar Event)Changing the world with compelling ideas (Solar Event)
Changing the world with compelling ideas (Solar Event)
 

Mais de TechWell

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and RecoveringTechWell
 
Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization TechWell
 
Test Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTest Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTechWell
 
System-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartSystem-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartTechWell
 
Build Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyBuild Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyTechWell
 
Testing Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTesting Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTechWell
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowTechWell
 
Develop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityDevelop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityTechWell
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyTechWell
 
Transform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTransform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTechWell
 
The Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipThe Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipTechWell
 
Resolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsResolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsTechWell
 
Pin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GamePin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GameTechWell
 
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsAgile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsTechWell
 
A Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationA Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationTechWell
 
Databases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessDatabases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessTechWell
 
Mobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateMobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateTechWell
 
Cultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessCultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessTechWell
 
Turn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTurn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTechWell
 

Mais de TechWell (20)

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and Recovering
 
Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization
 
Test Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTest Design for Fully Automated Build Architecture
Test Design for Fully Automated Build Architecture
 
System-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartSystem-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good Start
 
Build Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyBuild Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test Strategy
 
Testing Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTesting Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for Success
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlow
 
Develop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityDevelop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your Sanity
 
Ma 15
Ma 15Ma 15
Ma 15
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps Strategy
 
Transform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTransform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOps
 
The Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipThe Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—Leadership
 
Resolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsResolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile Teams
 
Pin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GamePin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile Game
 
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsAgile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
 
A Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationA Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps Implementation
 
Databases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessDatabases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery Process
 
Mobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateMobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to Automate
 
Cultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessCultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for Success
 
Turn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTurn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile Transformation
 

Último

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 

Último (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

Tests and Requirements Go Hand in Hand

  • 1. T12 Concurrent Class 10/3/2013 11:15:00 AM "Tests and Requirements: Like Ham and Eggs, Sugar and Spice, Lucy and Desi" Presented by: Ken Pugh Net Objectives Brought to you by: 340 Corporate Way, Suite 300, Orange Park, FL 32073 888-268-8770 ∙ 904-278-0524 ∙ sqeinfo@sqe.com ∙ www.sqe.com
  • 2. Ken Pugh Net Objectives A fellow consultant with Net Objectives, Ken Pugh helps companies transform into lean-agile organizations through training and coaching. His special interests are in communication (particularly effectively communicating requirements), delivering business value, and using lean principles to deliver high quality quickly. Ken trains, mentors, and testifies on technology topics from object-oriented design to Linux/Unix.
  • 3. 9/19/2013 info@netobjectives.com www.netobjectives.com Tests and Requirements: You Can’t Have One without the Other Ken Pugh Fellow Consultant Net Objectives 1 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Ken Pugh Fellow Consultant Photo Size: Height: 2.25 Position: from top left corner Horizontal 0.75 Vertical 1. Picture Style: Simple Black Frame OOA&D, Design Patterns, Lean, Agile, Test-Driven Development Over 2/5 century of software development experience Author of seven books, including: ken.pugh @netobjectives.com – Prefactoring: Extreme Abstraction, Extreme Separation, Extreme Readability (2006 Jolt Award) – Interface Oriented Design – Lean Agile Acceptance Test-Driven Development: Better Software Through Collaboration No code goes in till the test goes on. A journey of two thousand miles begins with a single step. 2 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 1
  • 4. 9/19/2013 Objectives Show how requirements and tests are complementary facets How to create requirements and tests collaboratively 3 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Overall Rule There are exceptions to every statement, except this one 4 4 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 2
  • 5. 9/19/2013 Fast Car Who wants a fast car? 5 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Requirements 6 19 September 2013 3
  • 6. 9/19/2013 Requirement Definition Requirement is: – Condition or capability needed by user to solve problem or achieve objective – Condition or capability met or possessed by system component to satisfy contract, standard, specification or regulation 7 7 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Requirements Requirements should include – Functions – what the software should do – Constraints – limitations on the manifestation Requirements should NOT include (usually) – Ways to implement the requirements – Specific manifestations – exactly what you want 8 8 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 4
  • 7. 9/19/2013 An Brownie Specification - MIL-C-44072C (1) 3.3.1 Brownie formula. The formula for the brownie shall be as follows: Ingredient Sugar 1/ Flour 2/ Shortening Nuts 3/ whole eggs 4/ 5/ Cocoa Dextrose, anhydrous Salt Parts by weight 23.0 21.0 16.8 16.0 13.0 5.5 4.4 .03 3/ U.S. Standards for Shelled English Walnuts (Fresh Products Branch, Fruit and Vegetable Division, Agricultural Marketing Service, U.S. Department of Agriculture) 9 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 An Brownie Specification - MIL-C-44072C (2) 3.3.2 Brownie preparation. a. Whip eggs in large bowl on high speed until light and fluffy. b. Combine sugars, cocoa, salt, and leavening; add to beaten eggs, and whip on high speed until thick. c. Add shortening slowly while mixing on low speed. d. Scrape bowl and whip on high speed until thick. e. Mix flour, nuts, and flavors together and fold into batter; mix until uniform. f. Pour batter 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 until done (30 to 45 minutes). 10 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 5
  • 8. 9/19/2013 Characteristics of Requirements These characteristics often applied to requirements. Bold indicates characteristics emphasized by agility Specific Unambiguous Testable/Verifiable Singular Design Independent Necessary Correct Consistent Complete Documented Prioritized Modifiable 11 11 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Question How do you know a requirement is testable? 12 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 6
  • 9. 9/19/2013 Software Development 13 19 September 2013 The Team Customer Unit - develops the requirements – – – – Product Owner Business analysts Users Quality Assurance Developer / Tester Unit – develops the implementation – Programmers – Testers / Quality Assurance The Triad – Customer, developer, tester 14 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 7
  • 10. 9/19/2013 Value Stream Map – Classical Development Elicit Requirements Code Analyze Requirements Test Design Deploy Why go back? 15 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Why Mistakes? Misunderstandings, missed requirements, mis-other Feedback helps to correct misunderstandings Quick feedback better than slow feedback Desired 16 Actual Copyright © 2007 Net Objectives. All Rights Reserved. Actual 19 September 2013 8
  • 11. 9/19/2013 Value Stream Map – Agile Development Elicit Requirements Analyze Requirements With Tests Code With Tests 17 Design Deploy Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Move Testing Forward Two types of testing Attempting to find defects – is WASTE Attempting to prevent defects – is ESSENTIAL When are defects found? – Prevention is just early detection 18 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 9
  • 12. 9/19/2013 Steps Author the tests (write) – Customer, tester, developer together Connect tests to system (bind) – Developer unit Run the tests (run) – Developers, testers, customers – Automated – part of build Test 19 write run bind Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Usually the Case write Code 20 bind run Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 10
  • 13. 9/19/2013 A Better Way write bind Code run 21 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Testing Strategies Meszaros, XUNIT TEST PATTERNS: REFACTORING TEST CODE, Fig 6.1 "Purpose of Tests" p. 51, © 2007 Pearson Education, Inc 22 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 11
  • 14. 9/19/2013 Another Look at Testing Strategies Focus of the tests (not exclusive) Customer Tests Exploratory Testing Expected Results Unexpected Results Valid Input Specified effects Unspecified effects Invalid input Specified error message Any side effects 23 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Verification and Validation Verification – Have we got the requirements right? – Focus of acceptance tests Validation – Have we got the right requirements? Customer really does it this way Environment is what we believe it to be – How do you test this? 24 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 12
  • 15. 9/19/2013 Acceptance Testing UI Acceptance Tests Application / Middle tier Core Business Logic Persistence 25 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Tests all the way down Test Test Test Requirement Requirement Customer Acceptance Tests Requirement Requires services to implement Test Service Implementation 26 Test Service Implementation Copyright © 2007 Net Objectives. All Rights Reserved. Developer Acceptance Tests 19 September 2013 13
  • 16. 9/19/2013 Definitions Acceptance criteria – A statement of how something will be tested Acceptance test outline – Steps in an acceptance test Acceptance test – A test with all information for clear pass/fail repeatability 27 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Requirements and Tests Requirements and tests are inter-related – You can’t have one without the other Failing test is a requirement – Passing test denotes specification on how system works 28 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 14
  • 17. 9/19/2013 ATDD as a Prism Requirements 29 ATDD Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Acceptance Test Examples 30 19 September 2013 15
  • 18. 9/19/2013 A First Example 31 19 September 2013 First Example As a user, I want to convert a temperature in Fahrenheit to a temperature in Celsius. What is an acceptance criteria for this? What’s your estimate? 32 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 16
  • 19. 9/19/2013 Acceptance Test Outline Given: – A temperature in Fahrenheit When – The user converts it Then – The result should be the corresponding temperature in Celsius Exercise: What specific tests should there be? 33 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Acceptance Tests Fahrenheit (Input) 32 0 212 100 -459.7 -273.15 Precision Error -273.151 Below 0 Kelvin 1000 34 Celsius (Output) Notes 550 Maximum – Needed? Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 17
  • 20. 9/19/2013 Stories 35 19 September 2013 Context Sam’s Lawn Mower Repair and CD Rental Store – A custom software package for CD rentals. 36 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 18
  • 21. 9/19/2013 User Story Examples As the clerk, I want to check out a CD for a customer. As the clerk, I want to check in a CD for a customer. As the inventory maintainer, I want to know where every CD is—in the store or rented. As the finance manager, I want to submit a credit card charge every time a CD is rented so that the store does not have to handle cash. 37 37 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Story Acceptance Criteria Check Out CD – Check out a CD. Check to see that it is recorded as rented. Check In CD – Check in a CD. Check to see that it is recorded as returned. – Check in a CD that is late. Check to see that it is noted as late. Report Inventory – Check out a few CDs. See if the report shows them as rented. – Check in a few CDs. See if the report shows them as in the store. Charge Rental – Check in a CD. See if the rental charge is correct. See if the credit charge matches the rental charge. See if the charge is made to the credit card company. Check that the bank account receives money from the charge. 38 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 19
  • 22. 9/19/2013 Developable Stories To become developable, stories require – More detailed requirements Workflow or use cases Possibly mock-up user interfaces – Acceptance test outline against those details 39 39 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Detailing Stories Use Cases Event / Response Tables (if there’s time) 40 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 20
  • 23. 9/19/2013 Use Case Template – Part One Name—Identifier to easily reference it by Description—Brief note Actor—Who initiates the use case Pre-conditions—What must be true before the use case is initiated Post-conditions—What is true if the use case successfully executes Main course—Steps that show the sequence of interactions 41 41 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Use Case Example – Part One Name—Check Out CD. Description—Check out a CD for a customer. Actor—Clerk. Pre-conditions—The customer has an identification. The CD has an identity. Post-conditions—The CD is recorded as rented. The rental contract is printed. Main Course: 1. The clerk enters the customer identification and CD identifier into the system. 2. The system records the information. 3. The system prints a contract that the customer signs. 42 42 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 21
  • 24. 9/19/2013 Use Case Template – Part Two Alternatives: flow that allows the use case to be successful even if some condition occurs Exceptions: conditions can occur that may not allow it to reach its post-conditions. Business Rules: rules that must be followed regardless of technology Note: Alternatives and Exceptions could become separate story(ies) if requires significant effort Exceptions and Alternatives numbered with reference to Main Course steps 43 43 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Use Case Example – Part Two Exceptions: 1a. Customer identification is not recognized. Clerk repeats step 1. 1b. The customer violates the CD Rental Limit business rule. The clerk notifies the customer of the violation. The use case is abandoned. Business Rule: CD Rental Limit A customer can rent only three CDs at any one time. Alternatives 3a. The printer jams. The clerk fills out the contract by hand. The use case exits. 44 44 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 22
  • 25. 9/19/2013 Acceptance Tests List of Acceptance Tests – Rent a CD—This is the main course. – Bad Customer ID—Enter the customer ID wrong. – CD Rental Limit—A customer has three CDs and rents another one. – Printer Jam—Simulate a printer jam (maybe out of paper). 45 45 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Acceptance Test Outline 46 19 September 2013 23
  • 26. 9/19/2013 Test Flow Test Setup (Given)) Trigger (When) Assert (Then) Expected System State and Output Initial Action or Event System State 47 Final System State and Output Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Given / When / Then Outline Given (Setup) Customer has ID (initial system state) CD has ID (initial system state) CD is not currently rented (initial system state) When (Trigger) Clerk checks out CD (action) Then (Verify) CD recorded as rented (final system state) Rental contract printed (output) 48 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 24
  • 27. 9/19/2013 Acceptance Test Using Tables 49 19 September 2013 Table Types Calculation Table Action Table Data Table 50 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 25
  • 28. 9/19/2013 Calculation Table Title Input Name 1 Input Name 2 Result Name? Notes Anything that Value for input 1 Value for input 2 Expected output describes scenario Another value for input 1 Another value for input 2 51 Another expected output Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Calculation Table Example Discount Calculation Item Total Customer Rating Discount Percentage? $10.00 Good When 0% Then Given 52 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 26
  • 29. 9/19/2013 Data Table 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 53 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Data Table Example Customer Data Name James 007 Maxwell 54 ID 86 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 27
  • 30. 9/19/2013 Action Table Enter enters data into an entry field Press initiates a process, such as a Submit button on a dialog box Check sees if a result is equal to an expected value. Action Name Enter Value Name 1 Value for 1 Enter Value Name 2 Value for 2 Press Submit Check Value Name 3 55 Expected value for 3 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 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 When Press Rent Then Check Rented Given 56 True Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 28
  • 31. 9/19/2013 Full Requirements and Tests 57 19 September 2013 Given / When / Then Example Outline Given (Setup) Customer has ID (initial system state) CD has ID (initial system state) CD is not currently rented (initial system state) When (Trigger) Clerk checks out CD (action) Then (Verify) CD recorded as rented (final system state) Rental contract printed (output) 58 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 29
  • 32. 9/19/2013 Full Test Check Out 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 59 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Full Test (2) When a clerk checks out a CD: Check Out CD Enter 007 Enter CD ID CD2 Press 60 Customer ID Rent Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 30
  • 33. 9/19/2013 Full Test (3) 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 61 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 The Action Can drive a GUI Or a method Rent(CustomerID aCustomer, CDID, aCD); 62 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 31
  • 34. 9/19/2013 Full Test - Exception Check Out CD with CD Rental Limit Given Customer has ID and CD has ID and the Customer has three rentals already Customer Data Name ID James 007 CD Data ID Rented Customer ID CD2 Yes 007 CD3 Yes 007 CD4 Yes 007 CD5 No 63 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Full Test Exception (2) When a clerk checks out a CD Then CD Rental Limit occurs Check Out CD Enter 007 Enter CD ID CD5 Press Rent Check 64 Customer ID Status CD_Rental_Limit_Exceeded Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 32
  • 35. 9/19/2013 The Other Tests To be developable – All tests should be complete You are going to need them all anyway The tests detail the requirement Pragmatically – Sufficient tests need to be complete – Defining “sufficient” is the hard part 65 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 When To Write Story Tests 66 19 September 2013 33
  • 36. 9/19/2013 Iteration Based Make Developable Iteration Backlog Product Backlog Acceptance Tests (or Outline) Acceptance Criteria 67 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Make Developable Within iteration write bind Code run Previous iteration write bind Code run 68 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 34
  • 37. 9/19/2013 Iteration-less (Kanban) Idea Queue Idea 69 Prioritize Ready to Analyze Analyze Ready to Create Detail acceptance tests Ready to Develop Develop Ready for “Release Set” testing Story Story Story Done Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Not An Ending, But A Beginning 70 19 September 2013 35
  • 38. 9/19/2013 Outlines Objectives were: – Show how requirements and tests are complementary facets – How to create requirements and tests collaboratively 71 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Other Things Tests Are Good For Acceptance tests can also be used as: – Estimation aid To break stories down if they are too big – Degree of doneness Percentage of passing acceptance tests is “rough” indication of story completion – Regression test suite particularly if automated 72 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 36
  • 39. 9/19/2013 Why Acceptance Tests? Rework Down from 60% to 20% Workflows Working First Time Little Room for Miscommunication Saving Time Getting Business Rules Right Game Changing Tighter Cross-Functional Team Integration Crisp Visible Story Completion Criteria Automation Yields Reduced Testing Time 73 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Now, if there’s time, an exercise If not: 74 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 37
  • 40. 9/19/2013 Thank you. Please fill out the evaluations 75 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 An Exercise 76 19 September 2013 38
  • 41. 9/19/2013 The Story As a computer user, I want to copy a file from one directory to another. What’s your estimate? 77 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 The Interface GUI Command line CopyFile <SourceDirectory> <TargetDirectory> <Filename> 78 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 39
  • 42. 9/19/2013 Exercise Write tests for: “copying a file from one directory to another” Describe in terms of: – Given: some state – When: copy (file, source_directory, destination_directory) – Then: expected state When Given Source Directory Contents Destination Directory Contents Then (Expected) Copy File X X Destination Directory Contents? X 79 Anything else? Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Copying Table Example Given Then (Expected) When Source Directory Contents Destination Directory Contents Copy File Destination Directory Contents? Source Directory Contents? Content Comparison? Notes X, Y, Z D,E,f X D,E,F,X X,Y,Z (Destination.X == Source.X) Standard copy X, Y, Z D,E,F,X X D,E,F,X X,Y,Z (Destination.X == Source.X) X overwritte n X, Y, Z D,E,F,X X D,E,F,X X,Y,Z (Destination.X == Destination.X) X not overwritte n What about modification date and other attributes? Make more columns 80 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 40
  • 43. 9/19/2013 Copy File Example Copy a file (happy path) Given a source and target directory File system Directory Name Directory Contents A X, Y, Z D,E,F B Copy File Enter Source Directory A Enter Target Directory B Enter File name X Press When copy request is made Copy File system Then file is copied Directory Name Directory Contents A X, Y, Z D,E,F,X B 81 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Copy File Example Non-existent file Given a source and target directory File system Directory Name Directory Contents A X, Y, Z D,E,F B 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? 82 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 41
  • 44. 9/19/2013 Implementing Acceptance Tests 83 19 September 2013 A Business Rule Example If Customer Rating is Good and the Order Total is less than or equal $10.00, Then do not give a 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%. 84 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 42
  • 45. 9/19/2013 Business Rule Table = Test Discount Order total Customer rating 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% 85 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Ways To Implement Test Testing script Program interface Xunit framework ATDD framework 86 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 43
  • 46. 9/19/2013 Testing script Tester creates script (usually GUI based). Example: – – – – – Logon as Customer who is rated Good Start order Put items in the order until the total is exactly $10.01 Complete order Check it shows a $.10 discount Repeat for other five cases 87 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Program interface Create a command line or graphic user interface Discount Percentage Screen Screen Customer Type: Good Order Total: 10.01 Percentage: Discount Method 1 % C:>DiscountPercentage Good 10.01 Percentage: 1% 88 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 44
  • 47. 9/19/2013 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)); } } 89 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Fit (Table = Test) Discount Order total Discount percentage? 10.00 Good 0 10.01 Good 1 50.01 Good 1 .01 Excellent 1 50.00 Excellent 1 50.01 90 Customer rating Excellent 5 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 45
  • 48. 9/19/2013 Example Contributions With States 91 19 September 2013 Retirement Contribution Example Requirement The system shall match incoming retirement contribution files with bank deposits. If the total on the contribution files matches the bank deposit, the corresponding funds shall be purchased. Exceptions ? Retirement Plan Contribution File 92 Bank Deposit Process Funding Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 46
  • 49. 9/19/2013 Given (Setup) PlanID = XYZ Name Fund George WildEyedStocks Sam GovernmentBonds Bill UnderTheMattress PlanID Bank Routing Number Account Number XYZ 111-11-11111 12345678 93 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 When (Trigger) File Received 401K Contributions PlanID=XYZ Name Amount George 5000 Sam 1000 Bill 500 Bank Deposit Routing Number Amount 111-11-11111 94 Account Number 12345678 6500 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 47
  • 50. 9/19/2013 Then (Expected) Expected Output Funding PlanID = XYZ Name Fund Amount George Sam WildEyedStocks GovernmentBonds 5000 1000 Bill UnderTheMattress 500 95 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Contribution States Contribution State Received Awaiting Match Purchase Funds Begin Exception Processing Edit Processing 96 Meaning Contribution File received Waiting for Bank Deposit Matched Bank Deposit, buy funds Bank Deposit received, but incorrect Contribution File bad format Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 48
  • 51. 9/19/2013 State Transitions Contribution State Event Initial Received data Received Data check is bad Received Data check is good Awaiting Match Matched exactly Awaiting Match Discrepancy in match AwaitingMatch Matching time exceeded Purchase Funds One minute prior to market close 97 New State Received Notes EditProcessing Awaiting Match Purchase Funds Matching on entry and ½ hour before close BeginExceptionProcessing BeginExceptionProcessing Awaiting Confirmation Enter order for funds Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Deposit States Deposit State Initial Received Received New State Received Edit Processing Awaiting Match Awaiting Match 98 Event Data received Data check is bad Data check is good MatchedExactly Matched Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 49
  • 52. 9/19/2013 info@netobjectives.com www.netobjectives.com A Few Problems 99 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 A Hotel Display 100 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 50
  • 53. 9/19/2013 Another Hotel Display (1) 101 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 Another Hotel Display (2) 102 Copyright © 2007 Net Objectives. All Rights Reserved. 19 September 2013 51