0% found this document useful (0 votes)
30 views24 pages

Unit-Ii ST

Uploaded by

Nidhi Bhatia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views24 pages

Unit-Ii ST

Uploaded by

Nidhi Bhatia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

UNIT-II

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

• Cyclomatic complexity is a source code complexity measurement that is being correlated to


a number of coding errors. It is calculated by developing a Control Flow Graph of the code
that measures the number of linearly-independent paths through a program module.
• Lower the Program's cyclomatic complexity, lower the risk to modify and easier to
understand. It can be represented using the below formula:
• Cyclomatic complexity = E - N + 2*P
• where,
• E = number of edges in the flow graph.
• N = number of nodes in the flow graph.
• P = number of nodes that have exit points
DATA FLOW TESTING

• 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

• Basis path testing, a structured testing or white box testing technique


used for designing test cases intended to examine all possible paths of
execution at least once. Creating and executing tests for all possible
paths results in 100% statement coverage and 100% branch coverage.
Example:
Function fn_delete_element (int value, int array_size, int array[])
{
1 int i;
location = array_size + 1;

2 for i = 1 to array_size
3 if ( array[i] == value )
4 location = i;
end if;
end for;

5 for i = location to array_size


6 array[i] = array[i+1];
end for;
7 array_size --;
}
STEPS TO CALCULATE THE INDEPENDENT
PATHS
• Step 1 : Draw the Flow Graph of the Function/Program under consideration
as shown below:
• Step 2 : Determine the independent paths.

• 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

• The process of requirements based testing deals with validating


whether the requirements are complete, consistent , unambiguous,
complete and logically connected. With such requirements, we can
proceed to develop test cases to ensure that the test cases full fill all
the requirements. Testing in this technique revolves around
requirements. The strategy of Requirement based testing is to
integrate testing throughout the life cycle of the software development
process, to assure quality of the Requirement Specification. The aim is
defect prevention than defect detection.
• Taking Requirement Based testing into account, testing is divided into the following types of activity :
• Define Test Completion Criteria :Testing should be defined in quantifiable terms. The goal is
considered to be achieved only when test coverage is 100%.
• Design Test Cases :Test cases must be in accordance with requirements specification.
• Build Test Cases :Join the logical parts together to form/build test cases .
• Execute Test Cases :Execute the test cases to evaluate the results.
• Verify Test Results :Check whether actual results deviate from the expected ones.
• Verify Test Coverage :Check for functional test coverage.
• Manage Test Library :Test manager is responsible for monitoring the test case executions, that is,
the tests passed or failed, or to ascertain whether all tests have been successfully performed.
STATE BASED TESTING
• State-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:

– States. Represent the impact of the past inputs to the system.


– Transitions. Represent how the state of the system changes from one state to another in response to some
events.
– Events. Inputs to the system.
– Actions. The outputs for the events.
DECISION TABLES

• A Decision Table is a tabular representation of inputs versus rules/cases/test conditions. It is a


very effective tool used for both complex software testing and requirements management.
Decision table helps to check all possible combinations of conditions for testing and testers
can also identify missed conditions easily. The conditions are indicated as True(T) and False(F)
values.
• 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.
CAUSE EFFECT GRAPHING

• 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

• Compatibility Testing is a type of Software testing to check whether your software is


capable of running on different hardware, operating systems, applications, network
environments or Mobile devices.
• Compatibility Testing is a type of Non-functional testing
• Types of Compatibility Tests
• Hardware: It checks software to be compatible with different hardware configurations.
• Operating Systems: It checks your software to be compatible with different Operating Systems like Windows, Unix, Mac OS etc.
• Software: It checks your developed software to be compatible with other software. For example, MS Word application should be compatible
with other software like MS Outlook, MS Excel, VBA etc.
• Network: Evaluation of performance of a system in a network with varying parameters such as Bandwidth, Operating speed, Capacity. It also
checks application in different networks with all parameters mentioned earlier.
• Browser: It checks the compatibility of your website with different browsers like Firefox, Google Chrome, Internet Explorer etc.
• Devices: It checks compatibility of your software with different devices like USB port Devices, Printers and Scanners, Other media devices and
Blue tooth.
• Mobile: Checking your software is compatible with mobile platforms like Android, iOS etc.
• Versions of the software: It is verifying your software application to be compatible with different versions of the software. For instance
checking your Microsoft Word to be compatible with Windows 7, Windows 7 SP1, Windows 7 SP2, Windows 7 SP3.
USABILITY & ACESSIBILTY 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 :

1. Unit Testing : checks if software components are fulfilling functionalities or not.


2. Integration Testing : checks the data flow from one module to other modules.
3. System Testing : evaluates both functional and non-functional needs for the testing.
4. Acceptance Testing : checks the requirements of a specification or contract are met as per its delivery.
1) Unit testing:
A Unit is a smallest testable portion of system or application which can be compiled, liked, loaded, and executed. This kind of testing helps to test each module
separately. The aim is to test each part of the software by separating it. It checks that component are fulfilling functionalities or not. This kind of testing is
performed by developers.
2) Integration testing:
Integration means combining. For Example, In this testing phase, different software modules are combined and tested as a group to make sure that integrated
system is ready for system testing.
Integrating testing checks the data flow from one module to other modules. This kind of testing is performed by testers.
3) System testing:
System testing is performed on a complete, integrated system. It allows checking system’s compliance as per the requirements. It tests the overall interaction
of components. It involves load, performance, reliability and security testing.
System testing most often the final test to verify that the system meets the specification. It evaluates both functional and non-functional need for the testing.
4) Acceptance testing:
Acceptance testing is a test conducted to find if the requirements of a specification or contract are met as per its delivery. Acceptance testing is basically done
by the user or customer. However, other stockholders can be involved in this process.
THANK YOU

You might also like