Svoboda | Graniru | BBC Russia | Golosameriki | Facebook
SlideShare a Scribd company logo
TEST CASE TECHNIQUES
PREPARE BY :
PINA PARMAR
TECHNIQUES
directly from a requirement
specification or black box
test design technique
• Boundary Value Analysis
(BVA)
• Equivalence Partitioning
(EP)
• Decision Table Testing
• State Transition Diagrams
• Use Case Testing
from the structure of a
component or system
• Statement Coverage
• Branch Coverage
• Path Coverage
• LCSAJ Testing
based on tester's
experience on similar
systems or testers intuition
• Error Guessing
• Exploratory Testing
BOUNDRY VALUE ANALYSIS (BVA)
• Boundary testing is the process of testing between extreme ends or
boundaries between partitions of the input values.
• So these extreme ends like Start- End, Lower- Upper, Maximum-
Minimum, Just Inside-Just Outside values are called boundary values and
the testing is called "boundary testing".
• The basic idea in boundary value testing is to select input variable values
at their:
 Minimum
 Just above the minimum
 A nominal value
 Just below the maximum
 Maximum
EQUIVALENCE PARTITIONING (EP)
• Equivalent Class Partitioning is a black box technique (code is not
visible to tester) which can be applied to all levels of testing like
unit, integration, system, etc.
• In this technique, you divide the set of test condition into a
partition that can be considered the same.
• It divides the input data of software into different equivalence
data classes.
• You can apply this technique, where there is a range in the input
field.
DECISION TABLE TESTING
• Decision table testing is a software testing technique used to test
system behavior for different input combinations.
• This is a systematic approach where the different input
combinations and their corresponding system behavior (Output)
are captured in a tabular form.
• That is why it is also called as a Cause-Effect table where Cause
and effects are captured for better test coverage.
• A Decision Table is a tabular representation of inputs versus
rules/cases/test conditions.
DECISION TABLE TESTING
• Let's create a decision table for a login screen.
• The condition is simple if the user provides correct username and
password the user will be redirected to the homepage. If any of
the input is wrong, an error message will be displayed.
Conditions Rule 1 Rule 2 Rule 3 Rule 4
Username
(T/F)
F T F T
Password
(T/F)
F F T T
Output (E/H) E E E H
T – Correct username/password
F – Wrong username/password
E – Error message is displayed
H – Home screen is displayed
STATE TRANSITION DIAGRAM
• State Transition testing is defined as the software testing
technique in which changes in input conditions cause's state
changes in the Application under Test (AUT).
• It is a black box testing technique in which the tester analyzes the
behavior of an application under test for different input conditions
in a sequence.
• In this technique, tester provides both positive and negative input
test values and record the system behavior.
• State Transition Testing Technique is helpful where you need to
test different system transitions.
STATE TRANSITION DIAGRAM
• Let's consider an ATM system function
where if the user enters the invalid
password three times the account
will be locked.
• In this system, if the user enters a
valid password in any of the first
three attempts the user will be
logged in successfully. If the user
enters the invalid password in the
first or second try, the user will be
asked to re-enter the password. And
finally, if the user enters incorrect
password 3rd time, the account will
be blocked.
USE CASE TESTING
• Use Case Testing is defined as a software testing technique, that
helps identify test cases that cover the entire system, on a
transaction by transaction basis from start to the finishing point.
• In a use-case, an actor is represented by "A" and system by "S". We
create Use for a login functionality of a Web Application as shown
below :
USE CASE TESTING
Main Success Scenario Step Description
A:Actor
S:System
1
A: Enter Agent Name &
Password
2 S: Validate Password
3
S: Allow Account
Access
Extensions
2a
Password not valid
S: Display Message and
ask for re-try 4 times
2b
Password not valid 4
times
S: Close Application
STATEMENT COVERAGE
• Statement coverage is a white box test design technique which
involves execution of all the executable statements in the source
code at least once. It is used to calculate and measure the number
of statements in the source code which can be executed given the
requirements.
• Statement coverage is used to derive scenario based upon the
structure of the code under test.
• Unused statements, dead codes and unused branches are covered
by statement coverage.
Scenario 1: If A = 3, B = 9
Number of executed statements = 5, Total
number of statements = 7 Statement
Statement Coverage: 5/7 = 71%
STATEMENT COVERAGE
Scenario 2: If A = -3, B = -9
Number of executed statements = 6
Total number of statements = 7
Statement Coverage: 6/7 = 85%
BRANCH COVERAGE
• In the branch coverage, every outcome from a code module is
tested. For example, if the outcomes are binary, you need to test
both True and False outcomes.
• It helps you to ensure that every possible branch from each
decision condition is executed at least a single time.
• By using Branch coverage method, you can also measure the
fraction of independent code segments. It also helps you to find
out which is sections of code don't have any branches.
• The formula to calculate Branch Coverage:
STATEMENT COVERAGE
Branch Coverage will consider unconditional branch as well
Test Case Value of A Output
Decision
Coverage
Branch
Coverage
1 2 2 50% 33%
2 6 18 50% 67%
PATH COVERAGE
• Path testing is a structural testing method that involves using the
source code of a program in order to find every possible
executable path.
• It helps to determine all faults lying within a piece of code. This
method is designed to execute all or selected path through a
computer program.
• Any software program includes, multiple entry and exit points.
Testing each of these points is a challenging as well as time-
consuming.
• In order to reduce the redundant tests and to achieve maximum
test coverage, basis path testing is used.
PATH COVERAGE
• Here we will take a simple example, to get a better idea what is
basis path testing include
In this example, we can see there are few
conditional statements that is executed
depending on what condition it suffice.
Here there are 3 paths or condition that
need to be tested to get the output,
• Path 1: 1,2,3,5,6, 7
• Path 2: 1,2,4,5,6, 7
• Path 3: 1, 6, 7
LCSAJ TESTING
• LCSAJ stands for Linear Code Sequence and Jump, a white box
testing technique to identify the code coverage, which begins at
the start of the program or branch and ends at the end of the
program or the branch.
• LCSAJ consists of testing and is equivalent to statement coverage.
• LCSAJ Characteristics :
 100% LCSAJ means 100% Statement Coverage
 100% LCSAJ means 100% Branch Coverage
 100% procedure or Function call Coverage
 100% Multiple condition Coverage
ERROR GUESSING TECHNIQUE
• Error guessing is a software testing technique which is based on
guessing the error which can prevail in the code.
• It is an experience-based technique where the test analyst uses
his/her or experience to guess the problematic part of the testing
application.
• The technique counts a list of possible errors or error-prone
situations.
• Then tester writes a test case to expose those errors. To design
test cases based on this software testing technique, the analyst
can use the past experiences to identify the conditions.
ERROR GUESSING TECHNIQUE
Guidelines for using Error Guessing Technique
• The test should use the previous experience of testing similar
applications
• Understanding of the system under test
• Knowledge of typical implementation errors
• Remember previously troubled areas
• Evaluate Historical data & Test results
EXPLORATORY TESTING
• Exploratory testing is all about discovery, investigation, and
learning.It emphasizes personal freedom and responsibility of the
individual tester.
• It is defined as a type of testing where Test cases are not created
in advance but testers check system on the fly.
• They may note down ideas about what to test before test
execution. The focus of exploratory testing is more on testing as a
"thinking" activity.
• Under scripted testing, you design test cases first and later
proceed with test execution. On the contrary, exploratory testing
is a simultaneous process of test design and test execution all
done at the same time.
Test case techniques

More Related Content

Test case techniques

  • 1. TEST CASE TECHNIQUES PREPARE BY : PINA PARMAR
  • 2. TECHNIQUES directly from a requirement specification or black box test design technique • Boundary Value Analysis (BVA) • Equivalence Partitioning (EP) • Decision Table Testing • State Transition Diagrams • Use Case Testing from the structure of a component or system • Statement Coverage • Branch Coverage • Path Coverage • LCSAJ Testing based on tester's experience on similar systems or testers intuition • Error Guessing • Exploratory Testing
  • 3. BOUNDRY VALUE ANALYSIS (BVA) • Boundary testing is the process of testing between extreme ends or boundaries between partitions of the input values. • So these extreme ends like Start- End, Lower- Upper, Maximum- Minimum, Just Inside-Just Outside values are called boundary values and the testing is called "boundary testing". • The basic idea in boundary value testing is to select input variable values at their:  Minimum  Just above the minimum  A nominal value  Just below the maximum  Maximum
  • 4. EQUIVALENCE PARTITIONING (EP) • Equivalent Class Partitioning is a black box technique (code is not visible to tester) which can be applied to all levels of testing like unit, integration, system, etc. • In this technique, you divide the set of test condition into a partition that can be considered the same. • It divides the input data of software into different equivalence data classes. • You can apply this technique, where there is a range in the input field.
  • 5. DECISION TABLE TESTING • Decision table testing is a software testing technique used to test system behavior for different input combinations. • This is a systematic approach where the different input combinations and their corresponding system behavior (Output) are captured in a tabular form. • That is why it is also called as a Cause-Effect table where Cause and effects are captured for better test coverage. • A Decision Table is a tabular representation of inputs versus rules/cases/test conditions.
  • 6. DECISION TABLE TESTING • Let's create a decision table for a login screen. • The condition is simple if the user provides correct username and password the user will be redirected to the homepage. If any of the input is wrong, an error message will be displayed. Conditions Rule 1 Rule 2 Rule 3 Rule 4 Username (T/F) F T F T Password (T/F) F F T T Output (E/H) E E E H T – Correct username/password F – Wrong username/password E – Error message is displayed H – Home screen is displayed
  • 7. STATE TRANSITION DIAGRAM • State Transition testing is defined as the software testing technique in which changes in input conditions cause's state changes in the Application under Test (AUT). • It is a black box testing technique in which the tester analyzes the behavior of an application under test for different input conditions in a sequence. • In this technique, tester provides both positive and negative input test values and record the system behavior. • State Transition Testing Technique is helpful where you need to test different system transitions.
  • 8. STATE TRANSITION DIAGRAM • Let's consider an ATM system function where if the user enters the invalid password three times the account will be locked. • In this system, if the user enters a valid password in any of the first three attempts the user will be logged in successfully. If the user enters the invalid password in the first or second try, the user will be asked to re-enter the password. And finally, if the user enters incorrect password 3rd time, the account will be blocked.
  • 9. USE CASE TESTING • Use Case Testing is defined as a software testing technique, that helps identify test cases that cover the entire system, on a transaction by transaction basis from start to the finishing point. • In a use-case, an actor is represented by "A" and system by "S". We create Use for a login functionality of a Web Application as shown below :
  • 10. USE CASE TESTING Main Success Scenario Step Description A:Actor S:System 1 A: Enter Agent Name & Password 2 S: Validate Password 3 S: Allow Account Access Extensions 2a Password not valid S: Display Message and ask for re-try 4 times 2b Password not valid 4 times S: Close Application
  • 11. STATEMENT COVERAGE • Statement coverage is a white box test design technique which involves execution of all the executable statements in the source code at least once. It is used to calculate and measure the number of statements in the source code which can be executed given the requirements. • Statement coverage is used to derive scenario based upon the structure of the code under test. • Unused statements, dead codes and unused branches are covered by statement coverage.
  • 12. Scenario 1: If A = 3, B = 9 Number of executed statements = 5, Total number of statements = 7 Statement Statement Coverage: 5/7 = 71% STATEMENT COVERAGE Scenario 2: If A = -3, B = -9 Number of executed statements = 6 Total number of statements = 7 Statement Coverage: 6/7 = 85%
  • 13. BRANCH COVERAGE • In the branch coverage, every outcome from a code module is tested. For example, if the outcomes are binary, you need to test both True and False outcomes. • It helps you to ensure that every possible branch from each decision condition is executed at least a single time. • By using Branch coverage method, you can also measure the fraction of independent code segments. It also helps you to find out which is sections of code don't have any branches. • The formula to calculate Branch Coverage:
  • 14. STATEMENT COVERAGE Branch Coverage will consider unconditional branch as well Test Case Value of A Output Decision Coverage Branch Coverage 1 2 2 50% 33% 2 6 18 50% 67%
  • 15. PATH COVERAGE • Path testing is a structural testing method that involves using the source code of a program in order to find every possible executable path. • It helps to determine all faults lying within a piece of code. This method is designed to execute all or selected path through a computer program. • Any software program includes, multiple entry and exit points. Testing each of these points is a challenging as well as time- consuming. • In order to reduce the redundant tests and to achieve maximum test coverage, basis path testing is used.
  • 16. PATH COVERAGE • Here we will take a simple example, to get a better idea what is basis path testing include In this example, we can see there are few conditional statements that is executed depending on what condition it suffice. Here there are 3 paths or condition that need to be tested to get the output, • Path 1: 1,2,3,5,6, 7 • Path 2: 1,2,4,5,6, 7 • Path 3: 1, 6, 7
  • 17. LCSAJ TESTING • LCSAJ stands for Linear Code Sequence and Jump, a white box testing technique to identify the code coverage, which begins at the start of the program or branch and ends at the end of the program or the branch. • LCSAJ consists of testing and is equivalent to statement coverage. • LCSAJ Characteristics :  100% LCSAJ means 100% Statement Coverage  100% LCSAJ means 100% Branch Coverage  100% procedure or Function call Coverage  100% Multiple condition Coverage
  • 18. ERROR GUESSING TECHNIQUE • Error guessing is a software testing technique which is based on guessing the error which can prevail in the code. • It is an experience-based technique where the test analyst uses his/her or experience to guess the problematic part of the testing application. • The technique counts a list of possible errors or error-prone situations. • Then tester writes a test case to expose those errors. To design test cases based on this software testing technique, the analyst can use the past experiences to identify the conditions.
  • 19. ERROR GUESSING TECHNIQUE Guidelines for using Error Guessing Technique • The test should use the previous experience of testing similar applications • Understanding of the system under test • Knowledge of typical implementation errors • Remember previously troubled areas • Evaluate Historical data & Test results
  • 20. EXPLORATORY TESTING • Exploratory testing is all about discovery, investigation, and learning.It emphasizes personal freedom and responsibility of the individual tester. • It is defined as a type of testing where Test cases are not created in advance but testers check system on the fly. • They may note down ideas about what to test before test execution. The focus of exploratory testing is more on testing as a "thinking" activity. • Under scripted testing, you design test cases first and later proceed with test execution. On the contrary, exploratory testing is a simultaneous process of test design and test execution all done at the same time.

Editor's Notes

  1. 1