2.1 Introduction To Testing v3.0-1
2.1 Introduction To Testing v3.0-1
1. Introduction to Testing
2. Testing Methods
• Testing is such a broad topic and have so many areas to focus on. In this module the aim
is to introduce the delegate to the concept of Testing.
• Furthermore, it explains the different SDLC models, with the different Testing Levels and
Testing Types.
5
OBJECTIVES: INTRODUCTION TO TESTING
By the end of this session you will be able to:
6
SESSION PLAN
Content
1 What is testing
➢ Typical objectives of testing
➢ Testing and debugging
2 Why is Testing necessary
3 Testing Principles
7
CLASS DISCUSSION
Class discussion….
Question 1:
What is testing?
Test planning
Static testing (reviews)
Process improvement
Test improvement
Test analysis
Test control
Design tests
Implement tests
11
WHAT IS TESTING?
• V&V
• Verification • Validation
• checking a work product • comparing behaviour to user needs
conforms to standards / & expectations
guidelines / rules relevant to • did we build the right thing?
the work product
• did we build the thing right?
Question 2:
Why do we do testing?
15
SESSION PLAN
Content
1 What is testing
➢ Typical objectives of testing
➢ Testing and debugging
2 Why is Testing necessary
3 Testing Principles
16
CLASS DISCUSSION
Class discussion….
Question 3:
What is the difference between:
• Testing
• Debugging
19
WHY IS TESTING NECESSARY?
• Because failures happen
• UK Border Agency's immigration system
▪ up to £1 billion of wasted tax payers’ money
▪ 50,000 rejected asylum seekers "lost", backlog of 29,000 applicants
• UK government tax agency
▪ 5 million incorrect tax calculations, huge cost to correct them
• New York gas utility company's internal payroll system
▪
20
WHY IS TESTING NECESSARY? (CONT)
Many Few
Defects Test Defects
Quality
Few Few
Defects Defects
You may
Be here
Low
23
SESSION PLAN
Content
1 What is testing
2 Why is Testing necessary
➢ Testing contribution to success
➢ Quality assurance and testing
➢ Errors, defects and failures
24
CLASS DISCUSSION
Class discussion….
Question 4:
What is the difference between:
• Quality Assurance
• Testing
17
SESSION PLAN
Content
1 What is testing
2 Why is Testing necessary
➢ Testing contribution to success
➢ Quality assurance and testing
➢ Errors, defects and failures
27
CLASS DISCUSSION
Class discussion….
Question 5:
Is there a difference between:
• An error
• A defect
• A failure
29
ERRORS, DEFECTS AND FAILURES
Failure is an event; defect is a state of the work product,
caused by an error
A person makes
An error ...
… That creates a
defect in the
software ...
30
ERRORS, DEFECTS AND FAILURES
• errors may occur for many reasons:
• aggressive deadlines ➔ excessive time pressure
• inexperience or lack of skills and training
• miscommunication between people in the project team
▪ e.g. about requirements and/or design,
• complexity of the problem or solution
• new and/or unfamiliar technologies
•
33
DEFECTS, ROOT CAUSES AND EFFECTS
• Root cause (a process issue)
• “The source of a defect, such that if it is removed, the occurrence of the
defect type is decreased or removed”
▪ by understanding root causes, processes can be improved,
thereby preventing future defects
• e.g.
Defect due to a Misunderstanding due to Lack of training due to
34
SESSION PLAN
Content
1 What is testing
2 Why is Testing necessary
3 Testing Principles
➢ Seven testing principles
4 Test Process
35
SEVEN TESTING PRINCIPLES
• Principle:
• fundamental truth
• rule by which conduct may be guided
• Testing principles:
• suggested over the past 40+ years
• offer general guidelines
36
CLASS DISCUSSION
Question 6:
Now that you know the definition of
a principle → what do you think is a
principle of testing?
38
PRINCIPLE 2: EXHAUSTIVE TESTING IS IMPOSSIBLE
• What is exhaustive testing -
• when all the testers are exhausted? No
• when all the planned tests have been executed? No
• exercising all combinations of inputs and preconditions? Yes
• Why is exhaustive testing impossible?
• it’s not feasible (except for trivial cases)
▪ there’d never be enough time
39
PRINCIPLE 2: WHY CAN’T WE "TEST EVERYTHING"?
41
PRINCIPLE 4: DEFECT CLUSTERING
• True or false? (Usually)
• defects are distributed evenly in the system
• a small number of modules:
False
▪ contain most of the defects discovered True
in pre-release testing
▪ show the most operational failures True
• testing should be more thorough where it is most needed True
•
42
PRINCIPLE 5: PESTICIDE PARADOX
• true or false?
• tests should find defects True
• tests should be repeatable True
• run the same test again - find a new defect? Unlikely
• how can we find a stronger pesticide (set of tests)?
• regularly review and revise tests
• write new and different tests to exercise different parts and
43
PRINCIPLE 5: PESTICIDE PARADOX
Which is the
right answer?
One that
passes
45
PRINCIPLE 7: ABSENCE-OF-ERRORS FALLACY
• Should every defect found by testing be fixed? No
• Is it ok to release software with known defects in it? Maybe
• Suppose all defects found by testing are fixed – is the system
now ok? Not necessarily
• what if performance requirements were not specified?
▪ users could find system unacceptably slow
• they may not be able to use a system even if it conforms to the
7. Absence-of-errors is a fallacy
46
SESSION PLAN
Content
1 What is testing
2 Why is Testing necessary
3 Testing Principles
4 Test Process
➢ Test process in context
➢ Test activities and tasks
47
CLASS DISCUSSION
Class discussion….
Question 6:
Is there a universal test process?
Question 7:
Are there some common activities that
48
TEST PROCESS IN CONTEXT
• A test process consists of common sets of activities
51
CLASS DISCUSSION
Class discussion….
Question 8:
Think about inviting family for a Sunday
lunch →
• Name some of the activities
52
TEST ACTIVITIES AND TASKS
• ISTQB model has these main groups of activities:
Test Planning ● Not necessarily sequential
• monitoring & control is
53
TEST PLANNING
• Test planning involves activities that define Test Planning
• the objectives of testing
54
TEST MONITORING AND CONTROL
64
TEST WORK PRODUCTS
66
TEST WORK PRODUCTS – PLANNING, MONITORING & CONTROL
• Test planning
Test Planning
•
▪ exit criteria, schedules etc. for monitoring and control Test Design
▪ more detail later in the course
Test Implementation
67
TEST WORK PRODUCTS – TEST ANALYSIS AND TEST DESIGN
• test analysis
• •
▪ must be true before test begins after the test has finished Test Design
▪ e.g., logged in with correct ▪ not directly relevant to the
Test Implementation
69
TEST WORK PRODUCTS – TEST IMPLEMENTATION
• test procedures & /or scripts Test Planning
•
•
Test Design
e.g. ready to run, pass, fail, blocked, deliberately
Test Implementation
skipped etc.
•
Test Execution
Records of what was involved in the testing Test Completion
71
TEST WORK PRODUCTS – TEST COMPLETION
• Test summary reports (see later in the course)
72
FORMATIVE ASSESSMENT PART 2
74
TRACEABILITY BETWEEN THE TEST BASIS AND TEST WORK PRODUCTS
Requirements
Specification Test Conditions Test Cases Test Procedures
not run
Req. 1 Test cond. 1 TC A1 TP 1.101 failed
passed
Test cond. 2
Req.1: all tests run,
TC B2
all passed
Test cond. 3 not run
TP 1.102 failed Req.2: all tests
Req. 2
passed run, not all
Test cond. 6
not covered by a Test Case
Req. 2 changes: look for impact on test procedures TP 1.102 and TP 1.103
78
SESSION PLAN
Content
1 What is testing
2 Why is Testing necessary
3 Testing Principles
4 Test Process
5 Testing: Sequential vs Agile approaches
➢ Testing and development activities
79
TESTING AND DEVELOPMENT ACTIVITIES
• Testing and development • Agile models differ:
activities are interconnected • how activities are integrated
• structures defined by models that • project work products
are: • names
▪ sequential, iterative and/or • test level entry/exit criteria
incremental
• use of tools
• Agile is ‘iterative incremental’
• use of independence in testing
81
COMPARING TESTING AND DEVELOPMENT ACTIVITIES 2
Agile Traditional
Agile Traditional
• Pairing • Pairing
• continuous review • not traditional
• shared ownership of quality
83
SESSION PLAN
Content
1 What is testing
2 Why is Testing necessary
3 Testing Principles
4 Test Process
5 Testing: Sequential vs Agile approaches
➢ Testing and development activities
84
PROJECT WORK PRODUCTS
Req.
Business-oriented Spec.
Describe what is needed User
and how to use software stories
User
doc.
LI G T W E G H T
Development DB H I
Describe how built, design Code
that implement, and
85
BUSINESS-ORIENTED WORK PRODUCTS IN AGILE
• User stories/epics Theme Epics Stories Tasks
• written on cards
▪ or electronic
Book using
Task
equivalent points
• Include Book
flights
Task
• acceptance criteria
Rebook
regular flight
Task
86
DEVELOPMENT WORK PRODUCTS IN AGILE
• Code
• low technical debt
▪ no known defects
Code
▪ easy to maintain
▪ testable
• Unit tests
• manual or automated Unit
•
reports
• Test result logs
• Test reports
logs
88
MODULE 2: INTRODUCTION TO TESTING
1. Introduction to Testing
2. Testing Methods