3. After completing
this lesson, you
will be able to
understand:
1. Static and Dynamic testing techniques
2.Test designing
4. K Levels
4)Test design techniques: (K4)
Identifying test conditions and designing test cases (K2)
Categories of test design techniques (K2)
Specification based or Black Box techniques (eg. BVA, Equivalence
Partitioning) (K3)
Structure based or white Box techniques (K4)
Experienced based techniques (Error guessing and Exploratory
guessing) (K2)
Choosing aTest techniques (K2)
5. Understand -
Test basis
The test basis is the information we need
in order to start the test analysis
and create our own test cases.
Basically it’s a documentation on which
test cases are based, such as
requirements, design specifications,
product risk analysis, architecture and
interfaces.
6. Understand -
TestCondition
and
Test Possibilities.
A test condition is simply something
that we could test.
While identifying the test conditions we
want to identify as many conditions as
we can and then we select about which
one to take forward and combine into
test cases.We could call them test
possibilities.
7. Why test design
techniques ?
Recollect – Exhaustive testing is
impossible !!!!
We need some intelligent thought
processes to guide our selection; test
techniques (i.e. test design techniques)
are such thought processes.
8. Traceability
Test conditions should be able to be linked back to their sources in
the test basis - this is called traceability.
9. Why
Traceability ?
The requirements for a given function or
feature have changed.
A set of tests that has run OK in the past has
started to have serious problems.
Before delivering a new release, we want to
know whether or not we have tested all of the
specified requirements in the requirements
specification?
11. What isStatic
testing
technique?
Static testing is the testing of the software
work products manually, or with a set of tools,
but they are not executed.
It starts early in the Life cycle and so it is done
during the verification process.
For example: reviewing, walk through,
inspection
12. What is
Dynamic
testing
technique?
This testing technique needs computer for
testing.
It is done duringValidation process.
The software is tested by executing it on
computer.
Example of this DynamicTestingTechnique:
Unit testing, integration testing, system
testing.
13. What is black-box
[Specification/Behavioral]
testing technique ?
The testers have no knowledge of how the system or component
is structured inside the box.
In black-box testing the tester is concentrating on what the
software does, not how it does it.
Perform both functional and non-functional testing.
Functional testing is concerned with what the system does its
features or functions. Non-functional testing is concerned with
examining how well the system does
There are four specification-based or black-box technique:
Equivalence partitioning
Boundary value analysis
Decision tables
State transition testing
14. Dynamic testing
technique =>
Black Box =>
Equivalence
partitioning
The idea behind this technique is to divide (i.e. to partition) a set of
test conditions into groups or sets that can be considered the
same (i.e. the system should handle them equivalently), hence
‘equivalence partitioning’.
Equivalence partitions are also known as equivalence classes –
the two terms mean exactly the same thing.
The hypothesis behind this technique is that if one
condition/value in a partition passes all others will also pass.
Likewise, if one condition in a partition fails, all other
conditions in that partition will fail.
Similarly, if one of the conditions in a partition does not work, then
we assume that none of the conditions in that partition will work
15. Dynamic testing
technique =>
Black Box =>
Equivalence
partitioning
[Example]
Scenario : Flight reservation application
Ticket values [Number of tickets a user can book in single session]
1 to 10 are considered valid & ticket is booked.
While value 11 to 99 are considered invalid for reservation and
error message will appear, "Only ten tickets may be ordered at
one time.“
Identify ?
1.test condition
2.Valid Invalid set
16. Dynamic testing
technique =>
Black Box =>
Equivalence
partitioning
[Example]
Here is the test condition
1.Any Number greater than 10 entered in the reservation column (let say
11) is considered invalid.
2.Any Number less than 1 that is 0 or below, then it is considered invalid.
3.Numbers 1 to 10 are considered valid
4.Any 3 Digit Number say -100 is invalid.
17. Dynamic testing
technique =>
Black Box =>
BoundaryValue
Analysis
[with Example]
Here we check the values at the partitions like 0, 1, 10, 11 and so on. As you may
observe, you test values at both valid and invalid boundaries. BoundaryValue
Analysis is also called range checking.
In BoundaryValue Analysis, you test boundaries between equivalence partitions.
Equivalence partitioning and boundary value analysis are closely related and can
be used together at all levels of testing.
18. Dynamic testing
technique =>
Black Box =>
BVA and EVP
Summary:
BoundaryAnalysis testing is used when practically it is
impossible to test large pool of test cases individually.
Two techniques - Equivalence Partitioning & BoundaryValue
Analysis testing techniques is used.
In Equivalence Partitioning, first you divide a set of test
condition into a partition that can be considered.
In BoundaryValue Analysis you then test boundaries between
equivalence partitions
19. Dynamic testing
technique =>
Black Box =>
Decision table
What we do if the test data got different set of input data ?
>>> Here we cannot perform BVA / EVP .
A decision table is a good way to deal with combinations of
things (e.g. inputs).This technique is sometimes also referred
to as a ‘Cause-effect’ table.
Decision tables provide a systematic way of stating complex
business rules, which is useful for developers as well as for
testers.
20. Decision table [Example]
Scenario : let's consider the behavior of Flight Button for different combinations of Fly From & FlyTo.
Rule 1: When destination for both Fly From & FlyTo are not set the Flight Icon is disabled.
Rule 2: When Fly From destination is set but Fly to is not set, Flight button is disabled.
Rule 3: When Fly from destination is not set but Fly to destination is set, Flight button is disabled
Rule 4: only when Fly to and Fly from destinations are set, Flights button is enabled
FillThe decision table
Conditions Rule 1 Rule 2 Rule 3 Rule 4
Fly From F T F T
FlyTo F F T T
Actions/Outcomes
Search Option is Enabled ?? ?? ?? ??
Error / Alert message ?? ?? ?? ??
21. Conditions Rule 1 Rule 2 Rule 3 Rule 4
Fly From F T F T
FlyTo F F T T
Actions/Outcomes
Search Option is Enabled F F F T
Error / Alert message T T T F
If you observe the outcomes for Rule 1, 2 & 3 it remains the same. So you can select any one of them
and rule 4 for your testing.
The significance of this technique becomes immediately clear as the number of inputs increases. Number of
possible Combinations is given by 2 ^ n , where n is the number of Inputs. For n = 10, which is very common in
the web based testing, having big input forms, the number of combinations will be 1024.
Obviously, you cannot test all but you will choose a rich sub-set of the possible combinations using decision
based testing technique
22. Dynamic testing
technique =>
Black Box =>
State transition
Any system where you get a different output for the same input,
depending on what has happened before, is a finite state
system.
Example : ATM cashWithdrawal.
Input :Withdraw Rs 1000
Output 1 : Check balance and output money
Output 2 : Check balance and Display message : No balance
Output 3 :ATM out of Order
A state transition model has four basic parts:
The states that the software may occupy (open/closed or funded/insufficient
funds)
The transitions from one state to another (not all transitions are allowed)
The events that cause a transition (closing a file or withdrawing money);
The actions that result from a transition (an error message or being given
your cash).
23.
24. Dynamic testing
technique =>
Black Box =>
Use case testing
A use case is a description of a particular use of the system by an
actor (a user of the system).
Each use case describes the interactions the actor has with the
system in order to achieve a specific task (or, at least, produce
something of value to the user).
Actors are generally people but they may also be other systems.
Use cases are a sequence of steps that describe the interactions
between the actor and the system.
They serve as the foundation for developing test cases mostly at
the system and acceptance testing levels
26. What isWhite- box
[Structured/Glassbox]
testing technique ?
The testers require knowledge of how the software is
implemented, how it works.
In white-box testing the tester is concentrating on how the
software does it. [Example : loops ]
Developers use structure-based techniques in component testing
and component integration testing, especially where there is good
tool support for code coverage.
27. Dynamic testing
technique =>
White Box =>
Test coverage
Test coverage measures the amount of testing performed by a set of test.
The basic coverage measure is
where the 'coverage item' is whatever we have been able to count and see whether
a test has exercised or used this item.
There is danger in using a coverage measure. 100% coverage does not mean 100%
tested!
28. Dynamic testing
technique =>
White Box =>
Test coverage
[pros / cons]
Benefit of code coverage measurement:
It creates additional test cases to increase coverage
It helps in finding areas of a program not exercised by a set of test cases
It helps in determining a quantitative measure of code coverage, which
indirectly measure the quality of the application or product.
Drawback of code coverage measurement:
One drawback of code coverage measurement is that it measures
coverage of what has been written, i.e. the code itself; it cannot say
anything about the software that has not been written.
If a specified function has not been implemented or a function was
omitted from the specification, then structure-based techniques cannot
say anything about them it only looks at a structure which is already there.
29. We can also measure coverage for each of the specification-based techniques or black-box testing:
• EVP: percentage of equivalence partitions exercised (we could measure valid and invalid partition
coverage separately)
• BVA: percentage of boundaries exercised (we could also separate valid and invalid boundaries)
• Decision tables: percentage of business rules or decision table columns tested
• State transition testing: there are a number of possible coverage measures:
— Percentage of states visited
— Percentage of (valid) transitions exercised (this is known as Chow’s 0- switch coverage)
— Percentage of pairs of valid transitions exercised (‘transition pairs’ or
Chow’s 1-switch coverage) – and longer series of transitions, such as transition triples, quadruples, etc.
— Percentage of invalid transitions exercised (from the state table).
30. Dynamic testing
technique =>
White Box =>
Test coverage
[Types]
The different types of coverage are:
1) Statement coverage
2) Decision coverage
3) Condition coverage.
31. Dynamic testing
technique =>
White Box =>
Test coverage =>
Statement
coverage
01
The statement coverage is also known as line coverage or
segment coverage.
The statement coverage covers only the true conditions.
In this process each and every line of code needs to be
checked and executed
Through statement coverage we can identify the statements
executed and where the code is not executed because of
blockage.
32. Dynamic testing
technique =>
White Box =>
Test coverage =>
Statement
coverage
Pros /Cons
Advantage of statement coverage:
It verifies what the written code is expected to do and not to
do
It measures the quality of code written
It checks the flow of different paths in the program and it also
ensure that whether those path are tested or not.
Disadvantage of statement coverage:
It cannot test the false conditions.
It does not report that whether the loop reaches its
termination condition.
It does not understand the logical operators.
33. Dynamic testing
technique =>
White Box =>
Test coverage =>
Statement
coverage
Example
1 READ X
2 READ Y
3 Z =X + 2*Y
4 IF Z> 50 THEN
5 PRINT large Z
6 ENDIF
We have two read statements, one assignment statement, and then one IF
statement on three lines, but the IF statement
contains another statement (print) as part of it.
Lets analyze the above code with theTest set.
Test 1_1: X= 2,Y = 3 ,what's the coverage ?
Test 1_2: X =0,Y = 25 , what's the coverage ?
Test 1_3: X =47,Y = 1 , what's the coverage ?
Test1_4 : X= 2,Y=25, , what's the coverage ?
34. •In Test 1_1, the value of Z will be 8, so we will cover the statements on lines 1 to 4 and line 6.
•In Test 1_2, the value of Z will be 50, so we will cover exactly the same statements as Test 1_1.
•In Test 1_3, the value of Z will be 49, so again we will cover the same statements.
•In Test 1_4, the value of Z will be 52, so we will cover the statements on lines 1 to 6.
•so now statement coverage = 100%.
35. Dynamic testing
technique =>
White Box =>
Test coverage =>
BranchCoverage or
DecisionCoverage
A branch is the outcome of a decision, so branch coverages
imply measures which decision outcomes have been tested.
It covers both the true and false conditions unlikely the
statement coverage.
Note : 100% decision coverage guarantees 100% statement
coverage, but not the other way around.
37. To calculate Branch Coverage, one
has to find out the minimum number
of paths which will ensure that all the
edges are covered.
(1) 1A-2C-3D-E-4G-5H
(2) 1A-2B-E-4F
Hence Branch Coverage is 2.
38. Dynamic testing
technique =>
White Box =>
Test coverage =>
Condition
Coverage
Condition coverage is also known as Predicate Coverage in
which each one of the Boolean expression have been
evaluated to bothTRUE and FALSE.
However, full condition coverage does not guarantee full
decision coverage.
Identify how many test set is required for 100% condition coverage.
Tip : In order to ensure complete
Condition coverage criteria for the
example,
A, B and C should be evaluated at
least once against "true" and "false".
39. So, in our example, the 3 following tests would be sufficient for
100% Condition coverage testing.
Note :
Other control-flow code-coverage measures include linear code sequence and jump (LCSAJ)
coverage, condition coverage, multiple condition coverage (also known as condition
combination coverage) and condition determination coverage (also known as multiple
condition decision coverage or modified condition decision coverage, MCDC).
40. Dynamic testing
technique =>
White Box =>
Test coverage =>
PathCoverage
Another popular, but often misunderstood, code-coverage
measure is path coverage. Sometimes any structure-based
technique is called 'path testing‘
We will detailed study with an example
42. Statement Coverage (SC):
Find out the shortest number of paths following which all the nodes will
be covered.
Path 1A-2C-3D-E-4G-5H [12345] all the nodes are covered
Statement coverage = 1
Branch Coverage (BC): The aim is to cover all possible true/false decisions.
Find out the minimum number of paths which will ensure covering of all the
edges. Paths are :
1A-2C-3D-E-4G-5H
1A-2B-E-4F.
Branch Coverage = 2.
Path Coverage (PC): Path Coverage ensures covering of all the paths from
start to end. All possible paths are-
1A-2B-E-4F
1A-2B-E-4G-5H
1A-2C-3D-E-4G-5H
1A-2C-3D-E-4F
Path coverage = 4.
43.
44. Dynamic testing
technique =>
Experienced based
testing
In experience-based techniques, people's knowledge, skills
and background are of prime importance to the test
conditions and test cases.
Experience-based techniques go together with specification-
based and structure-based techniques, and are also used
when there is no specification, or if the specification is
inadequate or out of date.
The types of Experienced based testing are
Error guessing
Exploratory testing
45. Dynamic testing
technique =>
Experienced based
testing =>
Error guessing
The Error guessing is a technique where the
experienced and good testers are encouraged to
think of situations in which the software may not be
able to cope.
The success of error guessing is very much dependent
on the skill of the tester, as good testers know where
the defects are most likely to be
Error guessing is a technique that should always be
used as a complement to other more formal
techniques.
46. Dynamic testing
technique =>
Experienced based
testing =>
Exploratory testing
Exploratory testing is a hands-on approach in which
testers are involved in minimum planning and
maximum test execution.
The test design and test execution activities are
performed in parallel typically without formally
documenting the test conditions, test cases or test
scripts.
47. How to choose
that which testing
technique is best?
Each technique is good in its own way in finding out the certain
kind of defect, and not as good for finding out the other kind of
defects.
For example, one of the benefits of structure-based
techniques is that they can find out the defects or things in the
code that aren’t supposed to be there, such as ‘Trojan horses’
or other malicious code.
However, if there are parts of the specification that are missing
from the code, only specification-based techniques will find
that, structure-based techniques can only test what is there.
If there are things missing from the specification and from the
code, then only experience based techniques would find them.
48. How to So, how to choose which testing technique is best, decision will be based on a number of factors, both
internal and external that which testing technique is best?
Internal factors
Models used in developing the system
Testers knowledge and their experience
Similar type of defects
Test objective
Documentation
Life cycle model used
External factors
Risk assessment
Customer and contractual requirements
Type of system used
Regulatory requirements
Time and budget of the project
49. TEST PLAN OUTLINE
(IEEE 829 Format)
1. Test Plan Identifier
2. References
3. Introduction
4. Test Items
5. Software Risk Issues
6. Features to be Tested
7. Features not to be Tested
8. Approach [Strategy]
9. Item Pass/Fail Criteria
10. Suspension Criteria and Resumption Requirements
11. Test Deliverables
12. Remaining Test Tasks
13. Environmental Needs
14. Staffing and Training Needs
15. Responsibilities
16. Schedule
17. Planning Risks and Contingencies
18. Approvals
19. Glossary
50. Q &A
Lets try to answer few questions based
on chapter 04
51. Question 1 In which document described in IEEE 829 would you find
instructions for the steps to be taken for a test including set-up,
logging, environment and measurement?
a.Test plan
b.Test design specification
c.Test case specification
d.Test procedure specification
52. Question 2 With a highly experienced tester with a good business
background, which approach to defining test procedures would be
effective and most efficient for a project under severe time pressure?
a. A high-level outline of the test conditions and general steps to take.
b. Every step in the test spelled out in detail.
c. A high-level outline of the test conditions with the steps to take discussed in detail
with another experienced tester.
d. Detailed documentation of all test cases and careful records of each step taken in
the testing
53. Question 3 Put the test cases that implement the following test conditions into
the best order for the test execution schedule, for a test that is checking
modifications of customers on a database.
1 Print modified customer record.
2 Change customer address: house number and street name.
3 Capture and print the on-screen error message.
4 Change customer address: postal code.
5 Confirm existing customer is on the database by opening that record.
6 Close the customer record and close the database.
7 Try to add a new customer with no details at all.
a. 5,4, 2,1, 3, 7, 6
b. 4,2,5,1,6,7,3
c. 5,4,2,1,7,3,6
d. 5,1, 2, 3,4, 7, 6
54. Question 4 Why are both specification-based and structure-based
testing techniques useful?
a. They find different types of defect.
b. Using more techniques is always better.
c. Both find the same types of defect.
d. Because specifications tend to be unstructured.
55. Question 5 What is a key characteristic of structure-based testing
techniques?
a. They are mainly used to assess the structure of a specification.
b. They are used both to measure coverage and to design tests to increase
coverage.
c. They are based on the skills and experience of the tester.
d. They use a formal or informal model of the software or component.
56. Question 6 Which of the following would be an example of decision-table testing
for a financial application applied at the system-test level?
a. A table containing rules for combinations of inputs to two fields on a screen.
b. A table containing rules for interfaces between components.
c. A table containing rules for mortgage applications.
d. A table containing rules for chess.
57. Question 7 Which of the following could be a coverage
measure for state transition testing?
V : All states have been reached.
W : The response time for each transaction is adequate.
X : Every transition has been exercised.
Y : All boundaries have been exercised.
Z : Specific sequences of transitions have been exercised.
a. X,Y and Z
b. V, X, Y and Z
c. W,X and Y
d. V, X and Z
58. Question 8 Postal rates for 'light letters' are 25p up to l0g, 35p up to 50g plus an
extra l0p for each additional 25g up to l00g. Which test inputs (in grams) would be
selected using equivalence partitioning?
a. 8,42,82,102
b. 4,15, 65, 92,159
c. 10,50,75,100
d. 5, 20, 40, 60, 80
59. Question 9 Which of the following could be used to assess the coverage achieved
for specification based (black-box) test techniques?
V Decision outcomes exercised
W Partitions exercised
X Boundaries exercised
Y State transitions exercised
Z Statements exercised
a. V,W,Y or Z
b. W,X or Y
a. V,X or Z
b. W, X, Y or Z
60. Question 10 Which of the following statements about the relationship between
statement coverage and decision coverage is correct?
a. 100% decision coverage is achieved if statement coverage is greater than 90%.
b. 100% statement coverage is achieved if decision coverage is greater than 90%.
c. 100% decision coverage always means 100% statement coverage.
d. 100% statement coverage always means 100% decision coverage.
Notes de l'éditeur
a financial application involving many calculations would benefit from boundary value analysis.