Unit-Ii ST
Unit-Ii ST
SOFTWARE TESTING
TESTCASE DESIGN TECHNIQUES AND LEVELS OF TESTING
STRUCTURE BASED OR WHITE BOX
TECHNIQUE:
• The structure based or White box techniques designs test cases based
on the internal structure of the software program and code. These
techniques go into minute details of the developed code and tests
them one by one. Performed mainly by the developers, structure based
techniques require proper knowledge of software code, its internal
structure, and design and help developers in verifying the various
components of the system.
• Structure based or white box test case design technique is further
divided into five categories, which are:
1. Statement Testing & Coverage: This is the weakest criteria and least preferred metric for checking test coverage. Here, test scripts are
designed to execute code statements. The main purpose of this technique to calculate the percentage of executable statements that are
exercised by test suit.
2. Decision Testing Coverage: Also known as branch testing, decision testing coverage is where the test design techniques exercise the
percentage of the outcome of the decisions. Here, the test coverage is measured by the percentage of decision points, which are executed
out of the total decision points in the application. This technique is stronger than statement testing and coverage.
3. Condition Testing: This type of structure based techniques involves 100% coverage of the code. Here, each condition of the code coverage
is executed at least once. In coverage testing, test cases are designed in such a way that the condition outcomes are easily executed.
4. Multiple Condition Testing: Here, the main focus is on testing different combinations of condition outcomes to get 100% coverage. To
ensure this, two or more test scripts are required, which becomes a bit exhaustive and difficult to manage.
5. All Path Testing: All path testing is the strongest structure based test case design technique, which involves using the source code of a
program to find every executable path. This technique of test case designing helps determine all the faults within a particular code.
SPECIFICATION BASED TEST CASE DESIGN TECHNIQUES:
• Specification based or Black Box Test case design techniques are used
to design test cases in a systematic manner. These use external
description of the software such as technical specifications, design,
client’s requirements, and more, to derive test cases. With the
assistance of these test case design techniques, testers are able to
develop test cases that save testing time and allow full test coverage.
• Specification based or black box test case design techniques are
further divided into five categories, which are mentioned below:
1. Equivalence Partitioning: It's a method of dividing or partitioning the test input data into number of classes having equivalent
number of data, which is then used to derive and design test cases for each class or partition, at least once time. This helps in
reducing the number of test cases, significantly.
2. Boundary Value Analysis: This is the most advantageous and important specification based testing technique, which is used to
explore errors in the software product at the extreme ends of the input domain, i.e. at boundaries, and is used accordingly to derive
and design test cases.
3. Decision Tables: A technique of designing test cases, decision tables uses different combinations of inputs and their corresponding
output based on the variant types of conditions, scenarios, adhering to different business rules.
4. State Transition Diagrams/Tables: It's an approach of perceiving a software product as a system having a finite number of states
of different types, where transition from one state to another is guided by some certain rules to response or behave differently for
different input. This type of specification based technique is appropriate for systems that have implemented workflow within them.
5. Use Case Testing: This method of test case testing derives test conditions from the test the use case. Here, the test cases are
designed to execute business scenarios and user end functionalities. With the assistance of use case testing, one can easily identify
test cases that cover the entire system, on a transaction by transaction basis from the start of the testing to its end. This technique,
therefore, is used to derive test cases covering end-to-end software product evaluation.
CYCLOMATIC COMPLEXITY
• Data flow testing is a family of test strategies based on selecting paths through the
program's control flow in order to explore sequences of events related to the status of
variables or data objects. Dataflow Testing focuses on the points at which variables
receive values and the points at which these values are used.
• Advantages of Data Flow Testing:
• Data Flow testing helps us to pinpoint any of the following issues:
• A variable that is declared but never used within the program.
• A variable that is used but never declared.
• A variable that is defined multiple times before it is used.
• Deallocating a variable before it is used.
BASIS PATH TESTING
2 for i = 1 to array_size
3 if ( array[i] == value )
4 location = i;
end if;
end for;
• Path 1: 1 - 2 - 5 - 7
• Path 2: 1 - 2 - 5 - 6 - 7
• Path 3: 1 - 2 - 3 - 2 - 5 - 6 - 7
• Path 4: 1 - 2 - 3 - 4 - 2 - 5 - 6 - 7
• Basis Test Set is set of tests derived from the internal structure of a component in order to achieve 100% coverage of a
specific criterion.
• Techniques:
• Developers, who usually involve in unit testing, develop the test set for testing the internal structure. Following are the
techniques adopted to test the internal structure:
• Statement Coverage
• Branch Coverage
• Path Coverage
• When it is performed ?
• Whenever the code is ready for unit testing, the functionality is tested by the developers. Post validation of the specific
functionality, developers perform the white box testing for loop holes such as memory leaks, statement testing and path
testing to ensure each line of the code that is being written is tested.
REQUIREMENTS BASED TESTING
A program moves from state to state. In a given state, some inputs are valid, and others are ignored or rejected.
In response to a valid input, the program under test does something that it can do and does not attempt
something that it cannot do. In state-based testing, we walk the program through a large set of state
transitions and check the results carefully, every time.
• If the set of states of a system is manageable, a state model of the system can be built. A state model for a
system has four components:
• Cause Effect Graphing based technique is a technique in which a graph is used to represent the situations of
combinations of input conditions. The graph is then converted to a decision table to obtain the test cases
Steps used In deriving test cases using this technique are:
1. Division of specification:
Since it is difficult to work with cause-effect graphs of large specifications as they are complex, the specifications
are divided into small workable pieces and then converted into cause-effect graphs separately.
2. Identification of cause and effects:
This involves identifying the causes(distinct input conditions) and effects(output conditions) in the specification.
3. Transforming the specifications into a cause-effect graph:
The causes and effects are linked together using Boolean expressions to obtain a cause-effect graph. Constraints
are also added between causes and effects if possible.
4. Conversion into decision table:
The cause-effect graph is then converted into a limited entry decision table.
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. Some people seem to
be naturally good at testing and others are good testers because they have a lot of
experience either as a tester or working with a particular system and so are able to find
out its weaknesses.
• This is why an error guessing approach, used after more formal techniques have been
applied to some extent, can be very effective. It also saves a lot of time because of the
assumptions and guessing made by the experienced testers to find out the defects which
otherwise won’t be able to find.
• 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.
COMPATIBILITY TESTING
• Usability Testing
• Usability testing is often called User Experience (UX) testing, and some larger
companies have dedicated UX designers whose goal is to make their company’s
application pleasing to customers. Even if you have UX people at your company, it’s
still a good idea to test your application with the user experience in mind.
• Accessibility Testing
• Accessibility testing is important because fifteen percent of the population has some
kind of disability, and we want our applications to be used by as many people as
possible. The three main types of accessibility testing you will want to do are Visual,
Dexterity, and Auditory.
LEVELS OF TESTING IN SOFTWARE TESTING
• Tests are grouped together based on where they are added in SDLC or the by the level of
detailing they contain. In general, there are four levels of testing: unit testing, integration
testing, system testing, and acceptance testing. The purpose of Levels of testing is to make
software testing systematic and easily identify all possible test cases at a particular level.
• Levels of Testing
• There are mainly four Levels of Testing in software testing :