SWT1 Tim
SWT1 Tim
SWT1 Tim
Fundamentals of Testing
Chapter 1
CONTENT
•What is testing?
•Testing principles
•Psychology of testing
•Code of Ethics
What is Testing?: Background
• Most people have had an experience with software that did not
work as expected
• Software that does not work correctly can lead to many
problems, including:
o loss of money, time, or business reputation
o injury or death (can you think of an example?)
What is Testing?: Cost of Software Faults
•Huge sums
o Ariane 5 ($7billion)
The Explosion of the Ariane 5 (umn.edu)
o Mariner space probe to Venus ($250m)
Mariner 1 destroyed due to code error, July 22, 1962 – EDN
o American Airlines ($50m)
•Very little or nothing at all
o minor inconvenience
o no visible or physical detrimental impact
•Software is not “linear”:
o small input may have very large effect
What is Testing?: Safety-critical systems
Static
Testing
Software
Testing
Dynamic
Testing
What is Testing?: Misperceptions
Validation
Software
Testing
Verification
What is Testing?: Misperceptions
VERIFICATION VALIDATION
•2 sleeves? •Does it fit?
•Is it size L? •Will my crush like it?
•Is it blue? •Can I afford it?
•Are any button •Does it feel comfortable to
missing? wear?
•Does the colour match my
eyes?
Question
If you get a code from the developer and your task is to test
whether the developer added proper commenting to his code or
not, which type of testing is this?
a. Dynamic Testing
b. Static Testing
Question
Building the right product and building the product right, which
one of them is validation and which is verification?
a. Building the right product is validation and building the
product right is verification.
b. Building the right product is verification and building the
product right is validation
Question
Providing
Preventing Finding
Information to
Defects Defects
Stakeholders
Compliance Objectives
Reducing Risks
with Law may vary
Question
When test cases are designed early in the lifecycle, verifying the
test basis via the test design, which common test objective is
being achieved?
A. Gaining confidence
B. Finding defects
C. Preventing defects
D. Providing information for decision making
Question
If you are making sure that what you have built is the same as
what the client wants, which test objective is mostly met by this
activity?
A. reducing risks
B. finding defects
C. requirements fulfilment
What is Testing?: Testing & Debugging
The process of
The activity to
finding, analysing
ensure that the
& removing the
fix does resolve
causes of failures
the failure
in software
Confirmation
Testing Debugging
Testing
Tester’s job Dev’s job Tester’s job
•What is testing?
•Testing principles
•Psychology of testing
•Code of Ethics
Why is Testing Necessary?
A person makes
an error ...
… that creates a
defect in the
software ...
Failure
Error Defect
No Failure
Why do errors happen?
•Time pressure
• Human fallibility
• Lack of experience
• Miscommunication
• Complexity of work products
• System interactions
• New technologies
• Environmental conditions
What do software faults cost?
16X
8X
4X
1X
2X
•What is testing?
•Testing principles
•Psychology of testing
•Code of Ethics
Seven Testing Principles
Avr. 4 menus
3 options / menu
It depends on RISK
• Risk of missing important faults
• Risk of incurring failure costs
• Risk of releasing untested or under-tested software
• Risk of losing credibility and market share
• Risk of missing a market window
• Risk of over-testing, ineffective testing
So little time, so much to test ..
}
o what to test most i.e. where to
o how thoroughly to test each item place emphasis
o what not to test (this time)
• Use RISK to
o allocate the time available for testing by prioritising testing ...
Most important principle
•Contractual requirements
•Legal requirements
•Industry-specific requirements
o e.g. pharmaceutical industry (FDA), compiler standard tests, safety-
critical or safety-related such as railroad switching, air traffic control
3. Early testing
• Testing activities (both static & dynamic) should start as early
as possible in the software/system development life cycle and
should be focused on defined objectives.
• Early testing is sometimes referred to as "shift left". Testing
early in the SDLC helps reduce or eliminate costly changes.
Seven Testing Principles
4. Defect clustering
• A small number of modules contain most of the defects
discovered during pre-release testing, or they are responsible
for most of operational failures.
• Predicted defect clusters, and the actual observed defect
clusters in test or operation, are an important input into a risk
analysis used to focus the test effort.
Seven Testing Principles
5. Pesticide paradox
• If the same tests are repeated over and over again,
eventually these tests no longer find any new defects.
• To detect new defects, existing tests & test data are changed,
and new tests need to be written.
Seven Testing Principles
7. Absence-of-errors fallacy
• Finding and fixing defects does not help if fallacy the system
built is unusable and does not fulfill the users' needs and
expectations.
Question
A test team consistently finds between 90% and 95% of the defect present
in the the system under test. While the test manager understands that
this is a good defect detection percentage for her test team and industry,
senior management and executes remain disappointed in the test group,
saying that the test team misses too many bugs. Given that the users are
generally happy with the system and that the failures which have occurred
have generally been low impact, which of the following testing principles
is most likely to help the test manager explain to these managers and
executives why some defects are likely to be missed?
a. Pesticide paradox
b. Defect clustering
c. Exhaustive testing is impossible
d. Absence of error fallacy
Question
•What is testing
•Testing principles
•Test process
•Psychology of testing
•Code of Ethics
Test Process
• Test basis is the body of knowledge used as the basis for test
analysis and design.
o it is whatever the tests are being derived from (user requirement,
user story, design, or code)
•For example, for a mobile application, the test basis may include
a list of requirements and a list of supported mobile devices.
o Each requirement is an element of the test basis. Each supported
device is also an element of the test basis.
•The coverage criteria may require at least one test case for each
element of the test basis.
•Once executed, the results of these tests tell stakeholders
whether specified requirements are fulfilled and whether failures
were observed on supported devices.
Test Process Activities
Test
Test Test Text
Monitoring
Monitoring Design Execution
&& Control
Control
Test Process Activities
Test
Test Test Text
Monitoring
Monitoring Design Execution
&& Control
Control
Step 1. Test Planning
• Exemplary
Represents others
• Evolvable
Easy to maintain
• Economic
Cheap to use
Step 4. Test Design (cont.)
Step 5. Test Implementation
Planning Intellectual
one-off
Specification activity
activity Good to
Execute repeated automate
many times
Recording Clerical
Question
A. Test monitoring
B. Test planning
C. Test closure
D. Test control
Question
•What is testing
•Testing principles
•Psychology of testing
•Code of Ethics
Why test?
•build confidence
•find faults
•reduce costs
Low High
Software Quality
You may
be here
Low
Independence
• A destructive process
• Bring bad news (“your baby is ugly”)
• Under worst time pressure (at the end)
• Need to take a different view, a different mindset (“What if it
isn’t?”, “What could go wrong?”)
• How should fault information be communicated (to authors and
managers?)
Testers have the right to:
•What is testing
•Testing principles
•Psychology of testing
•Code of Ethics
Code of Ethics