0% found this document useful (0 votes)
4 views31 pages

Spm Notes III Unit

The document outlines various software testing techniques, including manual and automated testing, as well as functional and non-functional testing methods. It emphasizes the importance of software testing in identifying defects, improving software quality, and ensuring customer satisfaction. Additionally, it details principles of testing, types of testing techniques, and the significance of both static and dynamic testing approaches.

Uploaded by

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

Spm Notes III Unit

The document outlines various software testing techniques, including manual and automated testing, as well as functional and non-functional testing methods. It emphasizes the importance of software testing in identifying defects, improving software quality, and ensuring customer satisfaction. Additionally, it details principles of testing, types of testing techniques, and the significance of both static and dynamic testing approaches.

Uploaded by

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

Software Testing Techniques


Software testing techniques are methods used to design and execute tests to
evaluate software applications. The following are common testing techniques:
1. Manual testing – Involves manual inspection and testing of the software by a
human tester.
2. Automated testing – Involves using software tools to automate the testing
process.
3. Functional testing – Tests the functional requirements of the software to
ensure they are met.
4. Non-functional testing – Tests non-functional requirements such as
performance, security, and usability.
5. Unit testing – Tests individual units or components of the software to ensure
they are functioning as intended.
6. Integration testing – Tests the integration of different components of the
software to ensure they work together as a system.
7. System testing – Tests the complete software system to ensure it meets the
specified requirements.
8. Acceptance testing – Tests the software to ensure it meets the customer’s or
end-user’s expectations.
9. Regression testing – Tests the software after changes or modifications have
been made to ensure the changes have not introduced new defects.
10. Performance testing – Tests the software to determine its performance
characteristics such as speed, scalability, and stability.
11. Security testing – Tests the software to identify vulnerabilities and ensure it
meets security requirements.
12. Exploratory testing – A type of testing where the tester actively explores
the software to find defects, without following a specific test plan.
13. Boundary value testing – Tests the software at the boundaries of input
values to identify any defects.
14. Usability testing – Tests the software to evaluate its user-friendliness and
ease of use.
15. User acceptance testing (UAT) – Tests the software to determine if it meets
the end-user’s needs and expectations.
Software testing techniques are the ways employed to test the application under
test against the functional or non-functional requirements gathered from business.
Each testing technique helps to find a specific type of defect .

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 1


Principles Of Testing
Below are the principles of software testing:
1. All the tests should meet the customer’s requirements.
2. To make our software testing should be performed by a third party.
3. Exhaustive testing is not possible. As we need the optimal amount of testing
based on the risk assessment of the application.
4. All the tests to be conducted should be planned before implementing it.
5. It follows the Pareto rule (80/20 rule) which states that 80% of errors come
from 20% of program components.
6. Start testing with small parts and extend it to large parts.
Types Of Software Testing Techniques
There are two main categories of software testing techniques:
1. Static Testing Techniques are testing techniques that are used to find defects
in an application under test without executing the code. Static Testing is done
to avoid errors at an early stage of the development cycle thus reducing the cost
of fixing them.
2. Dynamic Testing Techniques are testing techniques that are used to test the
dynamic behaviour of the application under test, that is by the execution of the
code base. The main purpose of dynamic testing is to test the application with
dynamic inputs- some of which may be allowed as per requirement (Positive
testing) and some are not allowed (Negative Testing).
Each testing technique has further types as showcased in the below diagram. Each
one of them will be explained in detail with examples below.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 2


Static Testing Techniques
As explained earlier, Static Testing techniques are testing techniques that do not
require the execution of a code base. Static Testing Techniques are divided into
two major categories:
1. Reviews : They can range from purely informal peer reviews between two
developers/testers on the artifacts (code/test cases/test data) to
formal Inspections which are led by moderators who can be internal/external
to the organization.
1. Peer Reviews : Informal reviews are generally conducted without any
formal setup. It is between peers. For Example- Two developers/Testers
review each other’s artifacts like code/test cases.
2. Walkthroughs : Walkthrough is a category where the author of work (code
or test case or document under review) walks through what he/she has done
and the logic behind it to the stakeholders to achieve a common
understanding or for the intent of feedback.
3. Technical review : It is a review meeting that focuses solely on the
technical aspects of the document under review to achieve a consensus. It
has less or no focus on the identification of defects based on reference
documentation. Technical experts like architects/chief designers are
required to do the review. It can vary from Informal to fully formal.
4. Inspection : Inspection is the most formal category of reviews. Before the
inspection, the document under review is thoroughly prepared before going
for an inspection. Defects that are identified in the Inspection meeting are
logged in the defect management tool and followed up until closure. The
discussion on defects is avoided and a separate discussion phase is used for
discussions, which makes Inspections a very effective form of review.
2. Static Analysis : Static Analysis is an examination of requirement/code or
design to identify defects that may or may not cause failures. For Example-
Review the code for the following standards. Not following a standard is a
defect that may or may not cause a failure. Many tools for Static Analysis are
mainly used by developers before or during Component or Integration
Testing. Even Compiler is a Static Analysis tool as it points out incorrect
usage of syntax, and it does not execute the code per se. There are several
aspects to the code structure – Namely Data flow, Control flow, and Data
Structure.
1. Data Flow : It means how the data trail is followed in a given program –
How data gets accessed and modified as per the instructions in the program.
By Data flow analysis, you can identify defects like a variable definition
that never got used.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 3


2. Control flow : It is the structure of how program instructions get executed
i.e. conditions, iterations, or loops. Control flow analysis helps to identify
defects such as Dead code i.e. a code that never gets used under any
condition.
3. Data Structure : It refers to the organization of data irrespective of code.
The complexity of data structures adds to the complexity of code. Thus, it
provides information on how to test the control flow and data flow in a
given code.
Dynamic Testing Techniques
Dynamic techniques are subdivided into three categories:
1. Structure-based Testing:
These are also called White box techniques . Structure-based testing techniques are
focused on how the code structure works and test accordingly. To understand
Structure-based techniques, we first need to understand the concept of code
coverage.
Code Coverage is normally done in Component and Integration Testing . It
establishes what code is covered by structural testing techniques out of the total
code written. One drawback of code coverage is that- it does not talk about code
that has not been written at all (Missed requirement), There are tools in the market
that can help measure code coverage.
There are multiple ways to test code coverage:
1. Statement coverage: Number of Statements of code exercised/Total number of
statements. For Example, if a code segment has 10 lines and the test designed by
you covers only 5 of them then we can say that statement coverage given by the
test is 50%.
2. Decision coverage: Number of decision outcomes exercised/Total number of
Decisions. For Example, If a code segment has 4 decisions (If conditions) and your
test executes just 1, then decision coverage is 25%
3. Conditional/Multiple condition coverage: It has the aim to identify that each
outcome of every logical condition in a program has been exercised.
2. Experience-Based Techniques:
These are techniques for executing testing activities with the help of experience
gained over the years. Domain skill and background are major contributors to this
type of testing. These techniques are used majorly for UAT/business user testing .
1. Error guessing : It is used by a tester who has either very good experience in
testing or with the application under test and hence they may know where a system
might have a weakness. It cannot be an effective technique when used stand-alone
but is helpful when used along with structured techniques.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 4


2. Exploratory testing : It is hands-on testing where the aim is to have maximum
execution coverage with minimal planning. The test design and execution are
carried out in parallel without documenting the test design steps. The key aspect of
this type of testing is the tester’s learning about the strengths and weaknesses of an
application under test. Similar to error guessing, it is used along with other formal
techniques to be useful.
3. Specification-based Techniques:
This includes both functional and non-functional techniques (i.e. quality
characteristics). It means creating and executing tests based on functional or non-
functional specifications from the business. Its focus is on identifying defects
corresponding to given specifications. Here are the types of specification-based
techniques:
1. Equivalence partitioning : It is generally used together and can be applied to
any level of testing. The idea is to partition the input range of data into valid and
non-valid sections such that one partition is considered “equivalent”. Once we
have the partitions identified, it only requires us to test with any value in a given
partition assuming that all values in the partition will behave the same. For
example, if the input field takes the value between 1-999, then values between 1-
999 will yield similar results, and we need NOT test with each value to call the
testing complete.
2. Boundary Value Analysis (BVA) : This analysis tests the boundaries of the
range- both valid and invalid. In the example above, 0,1,999, and 1000 are
boundaries that can be tested. The reasoning behind this kind of testing is that
more often than not, boundaries are not handled gracefully in the code.
3. Decision Tables : These are a good way to test the combination of inputs. It is
also called a Cause-Effect table. In layman’s language, one can structure the
conditions applicable for the application segment under test as a table and identify
the outcomes against each one of them to reach an effective test.
1. It should be taken into consideration that there are not too many combinations
so the table becomes too big to be effective.
2. Take an example of a Credit Card that is issued if both credit score and salary
limit are met. This can be illustrated in below decision table below:

Decision Table

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 5


4. Use case-based Testing : This technique helps us to identify test cases that
execute the system as a whole- like an actual user (Actor) , transaction by
transaction. Use cases are a sequence of steps that describe the interaction between
the Actor and the system. They are always defined in the language of the Actor,
not the system. This testing is most effective in identifying integration defects. Use
case also defines any preconditions and postconditions of the process flow. ATM
example can be tested via use case:

Use case-based Testing

5. State Transition Testing : It is used where an application under test or a part of


it can be treated as FSM or finite state machine. Continuing the simplified ATM
example above, We can say that ATM flow has finite states and hence can be
tested with the State transition technique. There are 4 basic things to consider –
1. States a system can achieve
2. Events that cause the change of state
3. The transition from one state to another
4. Outcomes of change of state
A state event pair table can be created to derive test conditions – both positive and
negative.

State Transition

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 6


What is Software Testing?

Software testing is an important process in the software development lifecycle .
It involves verifying and validating that a software application is free of bugs,
meets the technical requirements set by its design and development , and satisfies
user requirements efficiently and effectively.

Software Testing is a method to assess the functionality of the software program.


The process checks whether the actual software matches the expected
requirements and ensures the software is bug-free. The purpose of software testing
is to identify the errors, faults, or missing requirements in contrast to actual
requirements. It mainly aims at measuring the specification, functionality, and
performance of a software program or application.
Software testing can be divided into two steps
1. Verification: It refers to the set of tasks that ensure that the software correctly
implements a specific function. It means “Are we building the product right?”.
2. Validation: It refers to a different set of tasks that ensure that the software that
has been built is traceable to customer requirements. It means “Are we building
the right product?”.
Importance of Software Testing
 Defects can be identified early: Software testing is important because if there
are any bugs they can be identified early and can be fixed before the delivery of
the software.
 Improves quality of software: Software Testing uncovers the defects in the
software, and fixing them improves the quality of the software.
 Increased customer satisfaction: Software testing ensures reliability, security,
and high performance which results in saving time, costs, and customer
satisfaction.
 Helps with scalability: Software testing type non-functional testing helps to
identify the scalability issues and the point where an application might stop
working.
 Saves time and money: After the application is launched it will be very
difficult to trace and resolve the issues, as performing this activity will incur
more costs and time. Thus, it is better to conduct software testing at regular
intervals during software development.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 7


Different Types Of Software Testing
Explore diverse software testing methods including manual and automated testing
for improved quality assurance . Enhance software reliability and performance
through functional and non-functional testing, ensuring user satisfaction. Learn
about the significance of various testing approaches for robust software
development.

Types Of Software Testing

Software Testing can be broadly classified into 3 types:


1. Functional testing : It is a type of software testing that validates the software
systems against the functional requirements. It is performed to check whether
the application is working as per the software’s functional requirements or not.
Various types of functional testing are Unit testing, Integration testing, System
testing, Smoke testing, and so on.
2. Non-functional testing : It is a type of software testing that checks the
application for non-functional requirements like performance, scalability,
portability, stress, etc. Various types of non-functional testing are Performance
testing, Stress testing, Usability Testing, and so on.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 8


3. Maintenance testing : It is the process of changing, modifying, and updating
the software to keep up with the customer’s needs. It involves regression
testing that verifies that recent changes to the code have not adversely affected
other previously working parts of the software.
Apart from the above classification software testing can be further divided into 2
more ways of testing:
1. Manual testing : It includes testing software manually, i.e., without using any
automation tool or script. In this type, the tester takes over the role of an end-
user and tests the software to identify any unexpected behavior or bug. There
are different stages for manual testing such as unit testing, integration testing,
system testing, and user acceptance testing. Testers use test plans, test cases, or
test scenarios to test software to ensure the completeness of testing. Manual
testing also includes exploratory testing, as testers explore the software to
identify errors in it.
2. Automation testing : It is also known as Test Automation, is when the tester
writes scripts and uses another software to test the product. This process
involves the automation of a manual process. Automation Testing is used to re-
run the test scenarios quickly and repeatedly, that were performed manually in
manual testing.
Apart from Regression testing , Automation testing is also used to test the
application from a load, performance, and stress point of view. It increases the test
coverage, improves accuracy, and saves time and money when compared to
manual testing.
Different Types of Software Testing Techniques
Software testing techniques can be majorly classified into two categories:
1. Black box Testing : Testing in which the tester doesn’t have access to the
source code of the software and is conducted at the software interface without
any concern with the internal logical structure of the software known as black-
box testing.
2. White box Testing : Testing in which the tester is aware of the internal
workings of the product, has access to its source code, and is conducted by
making sure that all internal operations are performed according to the
specifications is known as white box testing.
3. Grey Box Testing : Testing in which the testers should have knowledge of
implementation, however, they need not be experts.
Different Levels of Software Testing
Software level testing can be majorly classified into 4 levels:
1. Unit testing : It a level of the software testing process where individual
units/components of a software/system are tested. The purpose is to validate
that each unit of the software performs as designed.
J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 9
2. Integration testing : It is a level of the software testing process where
individual units are combined and tested as a group. The purpose of this level
of testing is to expose faults in the interaction between integrated units.
3. System testing : It is a level of the software testing process where a complete,
integrated system/software is tested. The purpose of this test is to evaluate the
system’s compliance with the specified requirements.
4. Acceptance testing : It is a level of the software testing process where a
system is tested for acceptability. The purpose of this test is to evaluate the
system’s compliance with the business requirements and assess whether it is
acceptable for delivery.
Benefits of Software Testing
 Product quality: Testing ensures the delivery of a high-quality product as the
errors are discovered and fixed early in the development cycle.
 Customer satisfaction: Software testing aims to detect the errors or
vulnerabilities in the software early in the development phase so that the
detected bugs can be fixed before the delivery of the product. Usability testing
is a type of software testing that checks the application for how easily usable it
is for the users to use the application.
 Cost-effective: Testing any project on time helps to save money and time for
the long term. If the bugs are caught in the early phases of software testing, it
costs less to fix those errors.
 Security: Security testing is a type of software testing that is focused on testing
the application for security vulnerabilities from internal or external sources.

White box Testing



White box testing techniques analyze the internal structures the used
data structures, internal design, code structure, and the working of the
software rather than just the functionality as in black box testing. It is also
called glass box testing clear box testing or structural testing. White Box
Testing is also known as transparent testing or open box testing.

White box testing is a software testing technique that involves testing the
internal structure and workings of a software application . The tester has
access to the source code and uses this knowledge to design test cases
that can verify the correctness of the software at the code level.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 10


White box testing is also known as structural testing or code-based
testing, and it is used to test the software’s internal logic, flow, and
structure. The tester creates test cases to examine the code paths and
logic flows to ensure they meet the specified requirements.
Before we move in depth of the white box testing do you known that their
are many different type of testing used in industry and some automation
testing tools are there which automate the most of testing so if you wish
to learn the latest industry level tools then you check-out our manual to
automation testing course in which you will learn all these concept and
tools
What Does White Box Testing Focus On?
White box testing uses detailed knowledge of a software’s inner workings
to create very specific test cases.
 Path Checking: Examines the different routes the program can take
when it runs. Ensures that all decisions made by the program are
correct, necessary, and efficient.
 Output Validation: Tests different inputs to see if the function gives
the right output each time.
 Security Testing: Uses techniques like static code analysis to find
and fix potential security issues in the software. Ensures the software
is developed using secure practices.
 Loop Testing: Checks the loops in the program to make sure they
work correctly and efficiently. Ensures that loops handle variables
properly within their scope.
 Data Flow Testing: Follows the path of variables through the program
to ensure they are declared, initialized, used, and manipulated
correctly.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 11


Types Of White Box Testing
White box testing can be done for different purposes. The three main
types are:
1. Unit Testing
2. Integration Testing
3. Regression Testing

Types Of White Box Testing

Unit Testing
 Checks if each part or function of the application works correctly.
 Ensures the application meets design requirements during
development.
Integration Testing
 Examines how different parts of the application work together.
 Done after unit testing to make sure components work well both alone
and together.
Regression Testing
 Verifies that changes or updates don’t break existing functionality.
 Ensures the application still passes all existing tests after updates.
White Box Testing Techniques
One of the main benefits of white box testing is that it allows for testing
every part of an application. To achieve complete code coverage, white
box testing uses the following techniques:
1. Statement Coverage
In this technique, the aim is to traverse all statements at least once.
Hence, each line of code is tested. In the case of a flowchart, every node
must be traversed at least once. Since all lines of code are covered, it
helps in pointing out faulty code.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 12


Statement Coverage Example

2. Branch Coverage
In this technique, test cases are designed so that each branch from all
decision points is traversed at least once. In a flowchart, all edges must
be traversed at least once.

4 test cases are required such that all branches of all decisions are covered, i.e, all edges of the flowchart

are covered

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 13


3. Condition Coverage
In this technique, all individual conditions must be covered as shown in
the following example:
 READ X, Y
 IF(X == 0 || Y == 0)
 PRINT ‘0’
 #TC1 – X = 0, Y = 55
 #TC2 – X = 5, Y = 0
4. Multiple Condition Coverage
In this technique, all the possible combinations of the possible outcomes
of conditions are tested at least once. Let’s consider the following
example:
 READ X, Y
 IF(X == 0 || Y == 0)
 PRINT ‘0’
 #TC1: X = 0, Y = 0
 #TC2: X = 0, Y = 5
 #TC3: X = 55, Y = 0
 #TC4: X = 55, Y = 5
5. Basis Path Testing
In this technique, control flow graphs are made from code or flowchart
and then Cyclomatic complexity is calculated which defines the number
of independent paths so that the minimal number of test cases can be
designed for each independent path. Steps:
 Make the corresponding control flow graph
 Calculate the cyclomatic complexity
 Find the independent paths
 Design test cases corresponding to each independent path
 V(G) = P + 1, where P is the number of predicate nodes in the flow
graph
 V(G) = E – N + 2, where E is the number of edges and N is the total
number of nodes
 V(G) = Number of non-overlapping regions in the graph
 #P1: 1 – 2 – 4 – 7 – 8
 #P2: 1 – 2 – 3 – 5 – 7 – 8
 #P3: 1 – 2 – 3 – 6 – 7 – 8
 #P4: 1 – 2 – 4 – 7 – 1 – . . . – 7 – 8

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 14


6. Loop Testing
Loops are widely used and these are fundamental to many algorithms
hence, their testing is very important. Errors often occur at the beginnings
and ends of loops.
 Simple loops: For simple loops of size n, test cases are designed
that:
1. Skip the loop entirely
2. Only one pass through the loop
3. 2 passes
4. m passes, where m < n
5. n-1 ans n+1 passes
 Nested loops: For nested loops, all the loops are set to their minimum
count, and we start from the innermost loop. Simple loop tests are
conducted for the innermost loop and this is worked outwards till all
the loops have been tested.
 Concatenated loops: Independent loops, one after another. Simple
loop tests are applied for each. If they’re not independent, treat them
like nesting.
Process of White Box Testing
1. Input: Requirements, Functional specifications, design documents,
source code.
2. Processing: Performing risk analysis to guide through the entire
process.
3. Proper test planning: Designing test cases to cover the entire code.
Execute rinse-repeat until error-free software is reached. Also, the
results are communicated.
4. Output: Preparing the final report of the entire testing process.
Features of White box Testing
1. Code coverage analysis: White box testing helps to analyze the
code coverage of an application, which helps to identify the areas of
the code that are not being tested.
2. Access to the source code: White box testing requires access to the
application’s source code, which makes it possible to test individual
functions, methods, and modules.
3. Knowledge of programming languages: Testers performing white
box testing must have knowledge of programming languages like
Java, C++, Python, and PHP to understand the code structure and
write tests.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 15


4. Identifying logical errors: White box testing helps to identify logical
errors in the code, such as infinite loops or incorrect conditional
statements.
5. Integration testing: White box testing is useful for integration testing,
as it allows testers to verify that the different components of an
application are working together as expected.
6. Unit testing: White box testing is also used for unit testing, which
involves testing individual units of code to ensure that they are
working correctly.
7. Optimization of code: White box testing can help to optimize the
code by identifying any performance issues, redundant code, or other
areas that can be improved.
8. Security testing: White box testing can also be used for security
testing, as it allows testers to identify any vulnerabilities in the
application’s code.
9. Verification of Design: It verifies that the software’s internal design is
implemented in accordance with the designated design documents.
10. Check for Accurate Code: It verifies that the code operates in
accordance with the guidelines and specifications.
11. Identifying Coding Mistakes: It finds and fix programming flaws in
your code, including syntactic and logical errors.
12. Path Examination: It ensures that each possible path of code
execution is explored and test various iterations of the code.
13. Determining the Dead Code: It finds and remove any code that
isn’t used when the programme is running normally (dead code).
Advantages of White Box Testing
1. Thorough Testing : White box testing is thorough as the entire code
and structures are tested.
2. Code Optimization: It results in the optimization of code removing
errors and helps in removing extra lines of code.
3. Early Detection of Defects: It can start at an earlier stage as it
doesn’t require any interface as in the case of black box testing.
4. Integration with SDLC: White box testing can be easily started in
Software Development Life Cycle.
5. Detection of Complex Defects: Testers can identify defects that
cannot be detected through other testing techniques.
6. Comprehensive Test Cases: Testers can create more
comprehensive and effective test cases that cover all code paths.
7. Testers can ensure that the code meets coding standards and is
optimized for performance.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 16


Disadvantages of White Box Testing
1. Programming Knowledge and Source Code Access: Testers need
to have programming knowledge and access to the source code to
perform tests.
2. Overemphasis on Internal Workings: Testers may focus too much
on the internal workings of the software and may miss external issues.
3. Bias in Testing: Testers may have a biased view of the software
since they are familiar with its internal workings.
4. Test Case Overhead: Redesigning code and rewriting code needs
test cases to be written again.
5. Dependency on Tester Expertise: Testers are required to have in-
depth knowledge of the code and programming language as opposed
to black-box testing.
6. Inability to Detect Missing Functionalities: Missing functionalities
cannot be detected as the code that exists is tested.
7. Increased Production Errors: High chances of errors in production.

Basis Path Testing in Software Testing


Last Updated : 15 Dec, 2022


Prerequisite – Path Testing Basis Path Testing is a white-box testing technique
based on the control structure of a program or a module. Using this structure, a
control flow graph is prepared and the various possible paths present in the graph
are executed as a part of testing. Therefore, by definition, Basis path testing is a
technique of selecting the paths in the control flow graph, that provide a basis set
of execution paths through the program or module. Since this testing is based on
the control structure of the program, it requires complete knowledge of the
program’s structure. To design test cases using this technique, four steps are
followed :
1. Construct the Control Flow Graph
2. Compute the Cyclomatic Complexity of the Graph
3. Identify the Independent Paths
4. Design Test cases from Independent Paths
Let’s understand each step one by one. 1. Control Flow Graph – A control flow
graph (or simply, flow graph) is a directed graph which represents the control
structure of a program or module. A control flow graph (V, E) has V number of
nodes/vertices and E number of edges in it. A control graph can also have :
J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 17
 Junction Node – a node with more than one arrow entering it.
 Decision Node – a node with more than one arrow leaving it.
 Region – area bounded by edges and nodes (area outside the graph is also
counted as a region.)

Below are the notations used while constructing a flow graph :


 Sequential Statements

If – Then – Else

 Do – While

 While – Do –

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 18


Switch – Case

Cyclomatic Complexity – The cyclomatic complexity V(G) is said to be a


measure of the logical complexity of a program. It can be calculated using three
different formulae :
1. Formula based on edges and nodes :
V(G) = e - n + 2*P

1. Where, e is number of edges, n is number of vertices, P is number of connected


components. For example, consider first graph given above,
where, e = 4, n = 4 and p = 1

So,
Cyclomatic complexity V(G)
= 4 - 4 + 2 * 1
= 2

1. Formula based on Decision Nodes :


V(G) = d + P

1. where, d is number of decision nodes, P is number of connected nodes. For


example, consider first graph given above,
where, d = 1 and p = 1

So,
Cyclomatic Complexity V(G)
= 1 + 1
= 2

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 19


1. Formula based on Regions :
V(G) = number of regions in the graph

1. For example, consider first graph given above,


Cyclomatic complexity V(G)
= 1 (for Region 1) + 1 (for Region 2)
= 2

Hence, using all the three above formulae, the cyclomatic complexity obtained
remains same. All these three formulae can be used to compute and verify the
cyclomatic complexity of the flow graph. Note –
1. For one function [e.g. Main( ) or Factorial( ) ], only one flow graph is
constructed. If in a program, there are multiple functions, then a separate flow
graph is constructed for each one of them. Also, in the cyclomatic complexity
formula, the value of ‘p’ is set depending of the number of graphs present in
total.
2. If a decision node has exactly two arrows leaving it, then it is counted as one
decision node. However, if there are more than 2 arrows leaving a decision
node, it is computed using this formula :
d = k - 1

1. Here, k is number of arrows leaving the decision node.


Independent Paths : An independent path in the control flow graph is the one
which introduces at least one new edge that has not been traversed before the path
is defined. The cyclomatic complexity gives the number of independent paths
present in a flow graph. This is because the cyclomatic complexity is used as an
upper-bound for the number of tests that should be executed in order to make sure
that all the statements in the program have been executed at least once. Consider
first graph given above here the independent paths would be 2 because number of
independent paths is equal to the cyclomatic complexity. So, the independent paths
in above first given graph :
 Path 1:
A -> B

 Path 2:
C -> D

Note – Independent paths are not unique. In other words, if for a graph the
cyclomatic complexity comes out be N, then there is a possibility of obtaining two
different sets of paths which are independent in nature. Design Test Cases
: Finally, after obtaining the independent paths, test cases can be designed where
each test case represents one or more independent paths. Advantages : Basis Path
Testing can be applicable in the following cases:

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 20


1. More Coverage – Basis path testing provides the best code coverage as it aims
to achieve maximum logic coverage instead of maximum path coverage. This
results in an overall thorough testing of the code.
2. Maintenance Testing – When a software is modified, it is still necessary to
test the changes made in the software which as a result, requires path testing.
3. Unit Testing – When a developer writes the code, he or she tests the structure
of the program or module themselves first. This is why basis path testing
requires enough knowledge about the structure of the code.
4. Integration Testing – When one module calls other modules, there are high
chances of Interface errors. In order to avoid the case of such errors, path
testing is performed to test all the paths on the interfaces of the modules.
5. Testing Effort – Since the basis path testing technique takes into account the
complexity of the software (i.e., program or module) while computing the
cyclomatic complexity, therefore it is intuitive to note that testing effort in case
of basis path testing is directly proportional to the complexity of the software
or program

Control Structure Testing



Control structure testing is used to increase the coverage area by testing
various control structures present in the program. The different types of
testing performed under control structure testing are as follows-
1. Condition Testing
2. Data Flow Testing
3. Loop Testing

1. Condition Testing : Condition testing is a test cased design method,


which ensures that the logical condition and decision statements are free
from errors. The errors present in logical conditions can be incorrect
boolean operators, missing parenthesis in a booleans expression, error in
relational operators, arithmetic expressions, and so on. The common
types of logical conditions that are tested using condition testing are-
1. A relation expression, like E1 op E2 where ‘E1’ and ‘E2’ are arithmetic
expressions and ‘OP’ is an operator.
2. A simple condition like any relational expression preceded by a NOT
(~) operator. For example, (~E1) where ‘E1’ is an arithmetic
expression and ‘a’ denotes NOT operator.
3. A compound condition consists of two or more simple conditions,
Boolean operator, and parenthesis. For example, (E1 & E2)|(E2 & E3)
J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 21
where E1, E2, E3 denote arithmetic expression and ‘&’ and ‘|’ denote
AND or OR operators.
4. A Boolean expression consists of operands and a Boolean operator
like ‘AND’, OR, NOT. For example, ‘A|B’ is a Boolean expression
where ‘A’ and ‘B’ denote operands and | denotes OR operator.
2. Data Flow Testing : The data flow test method chooses the test path
of a program based on the locations of the definitions and uses all the
variables in the program. The data flow test approach is depicted as
follows suppose each statement in a program is assigned a unique
statement number and that theme function cannot modify its parameters
or global variables. For example, with S as its statement number.
DEF (S) = {X | Statement S has a definition of X}
USE (S) = {X | Statement S has a use of X}

3. Loop Testing : Loop testing is actually a white box testing technique.


It specifically focuses on the validity of loop construction. Following are
the types of loops.
1. Simple Loop – The following set of test can be applied to simple
loops, where the maximum allowable number through the loop is n.
1. Skip the entire loop.
2. Traverse the loop only once.
3. Traverse the loop two times.
4. Make p passes through the loop where p<n.
5. Traverse the loop n-1, n, n+1 times.
2. Concatenated Loops – If loops are not dependent on each other,
contact loops can be tested using the approach used in simple loops.
if the loops are interdependent, the steps are followed in nested loops.

3. Nested Loops – Loops within loops are called as nested loops. when
testing nested loops, the number of tested increases as level nesting
increases. The following steps for testing nested loops are as follows-

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 22


1. Start with inner loop. set all other loops to minimum values.
2. Conduct simple loop testing on inner loop.
3. Work outwards.
4. Continue until all loops tested.
4. Unstructured loops – This type of loops should be redesigned,
whenever possible, to reflect the use of unstructured the structured
programming constructs.

BLOCK BOX TESTING:


Black-box testing is a type of software testing in which the tester is not
concerned with the software’s internal knowledge or implementation
details but rather focuses on validating the functionality based on the
provided specifications or requirements.

Black Box Testing

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 23


Types Of Black Box Testing
The following are the various categories of black box testing:
1. Functional Testing
2. Regression Testing
3. Nonfunctional Testing (NFT)
Functional Testing
 Functional testing is defined as a type of testing that verifies that each
function of the software application works in conformance with the
requirement and specification.
 This testing is not concerned with the source code of the application.
Each functionality of the software application is tested by providing
appropriate test input, expecting the output, and comparing the actual
output with the expected output.
 This testing focuses on checking the user interface, APIs, database,
security, client or server application, and functionality of the
Application Under Test. Functional testing can be manual or
automated. It determines the system’s software functional
requirements.
Regression Testing
 Regression Testing is the process of testing the modified parts of the
code and the parts that might get affected due to the modifications to
ensure that no new errors have been introduced in the software after
the modifications have been made.
 Regression means the return of something and in the software field, it
refers to the return of a bug. It ensures that the newly added code is
compatible with the existing code.
 In other words, a new software update has no impact on the
functionality of the software. This is carried out after a system
maintenance operation and upgrades.
Nonfunctional Testing
 Non-functional testing is a software testing technique that checks the
non-functional attributes of the system.
 It is defined as a type of software testing to check non-functional
aspects of a software application.
 It is designed to test the readiness of a system as per nonfunctional
parameters which are never addressed by functional testing.
 It is as important as functional testing.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 24


 It is also known as NFT. This testing is not functional testing of
software. It focuses on the software’s performance, usability, and
scalability.
Advantages of Black Box Testing
 The tester does not need to have more functional knowledge or
programming skills to implement the Black Box Testing.
 It is efficient for implementing the tests in the larger system.
 Tests are executed from the user’s or client’s point of view.
 Test cases are easily reproducible.
 It is used to find the ambiguity and contradictions in the functional
specifications.
Disadvantages of Black Box Testing
 There is a possibility of repeating the same tests while implementing
the testing process.
 Without clear functional specifications, test cases are difficult to
implement.
 It is difficult to execute the test cases because of complex inputs at
different stages of testing.
 Sometimes, the reason for the test failure cannot be detected.
 Some programs in the application are not tested.
 It does not reveal the errors in the control structure.
 Working with a large sample space of inputs can be exhaustive and
consumes a lot of time.

Software Testing Strategies


Software testing is the process of evaluating a software application to identify if it
meets specified requirements and to identify any defects. The following are
common testing strategies:
1. Black box testing – Tests the functionality of the software without looking at
the internal code structure.
2. White box testing – Tests the internal code structure and logic of the software.
3. Unit testing – Tests individual units or components of the software to ensure
they are functioning as intended.
4. Integration testing – Tests the integration of different components of the
software to ensure they work together as a system.
5. Functional testing – Tests the functional requirements of the software to
ensure they are met.
6. System testing – Tests the complete software system to ensure it meets the
specified requirements.
J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 25
7. Acceptance testing – Tests the software to ensure it meets the customer’s or
end-user’s expectations.
8. Regression testing – Tests the software after changes or modifications have
been made to ensure the changes have not introduced new defects.
9. Performance testing – Tests the software to determine its performance
characteristics such as speed, scalability, and stability.
10. Security testing – Tests the software to identify vulnerabilities and ensure it
meets security requirements.
The main objective of software testing is to design the tests in such a way that it
systematically finds different types of errors without taking much time and effort
so that less time is required for the development of the software. The overall
strategy for testing software includes:

Validation testing
Validation testing is testing where tester performed functional and non-functional testing.
Here functional testing includes Unit Testing (UT), Integration Testing (IT) and System
Testing (ST), and non-functional testing includes User acceptance testing (UAT).

Validation testing is also known as dynamic testing, where we are ensuring that "we have
developed the product right." And it also checks that the software meets the business
needs of the client.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 26


Validation testing is a crucial phase in the software development lifecycle that ensures the
developed product meets the specified business requirements and fulfills its intended use. It is
also known as dynamic testing because it involves executing the code to validate the software's
functionality and performance.
Key Principles

Validation testing answers the question, "Are we building the right product?" It ensures that
the software product is up to the mark and meets the high-level requirements of the client12. This
type of testing is performed after verification testing and focuses on the final product rather than
the intermediate work-products.
Activities Involved

Validation testing includes various types of functional and non-functional testing:


 Unit Testing (UT): Testing individual components or modules of the software to ensure they
work as expected.
 Integration Testing (IT): Testing the interaction between integrated modules to ensure they
work together correctly.
 System Testing (ST): Testing the complete system to verify that it meets the specified
requirements.
 User Acceptance Testing (UAT): Testing the software in a real-world environment to ensure it
meets the user's needs and expectations13.

What is System Testing ?


System Testing is a type of software testing that is performed on a completely
integrated system to evaluate the compliance of the system with the corresponding
requirements. In system testing, integration testing passed components are taken as
input.
 System Testing is carried out on the whole system in the context of either
system requirement specifications or functional requirement specifications or the
context of both. System testing tests the design and behavior of the system and
also the expectations of the customer.
 It has both functional and non-functional testing. System Testing is a black-box
testing . System Testing is performed after the integration testing and before the
acceptance testing.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 27


System Testing Process
System Testing is performed in the following steps:
 Test Environment Setup: Create testing environment for the better quality
testing.
 Create Test Case: Generate test case for the testing process.
 Create Test Data: Generate the data that is to be tested.
 Execute Test Case: After the generation of the test case and the test data, test
cases are executed.
 Defect Reporting: Defects in the system are detected.
 Regression Testing: It is carried out to test the side effects of the testing
process.
 Log Defects: Defects are fixed in this step.
 Retest: If the test is not successful then again test is performed.

System Testing Process

Types of System Testing


 Performance Testing: Performance Testing is a type of software testing that is
carried out to test the speed, scalability, stability and reliability of the software
product or application.
 Load Testing: Load Testing is a type of software Testing which is carried out to
determine the behavior of a system or software product under extreme load.
 Stress Testing: Stress Testing is a type of software testing performed to check
the robustness of the system under the varying loads.
 Scalability Testing: Scalability Testing is a type of software testing which is
carried out to check the performance of a software application or system in terms
of its capability to scale up or scale down the number of user request load.
Tools used for System Testing
1. JMeter
2. Gallen Framework
3. HP Quality Center/ALM
4. IBM Rational Quality Manager
5. Microsoft Test Manager
6. Selenium
7. Appium
8. LoadRunner
9. Gatling
10. JMeter

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 28


11. Apache JServ
12. SoapUI
Note: The choice of tool depends on various factors like the technology used, the
size of the project, the budget, and the testing requirements.
Advantages of System Testing
 The testers do not require more knowledge of programming to carry out this
testing.
 It will test the entire product or software so that we will easily detect the errors or
defects which cannot be identified during the unit testing and integration testing.
 The testing environment is similar to that of the real time production or business
environment.
 It checks the entire functionality of the system with different test scripts and also
it covers the technical and business requirements of clients.
 After this testing, the product will almost cover all the possible bugs or errors and
hence the development team will confidently go ahead with acceptance testing
 Verifies the overall functionality of the system.
 Detects and identifies system-level problems early in the development cycle.
 Helps to validate the requirements and ensure the system meets the user needs.
 Improves system reliability and quality.
 Facilitates collaboration and communication between development and testing
teams.
 Enhances the overall performance of the system.
 Increases user confidence and reduces risks.
 Facilitates early detection and resolution of bugs and defects.
 Supports the identification of system-level dependencies and inter-module
interactions.
 Improves the system’s maintainability and scalability.
Disadvantages of System Testing
 This testing is time consuming process than another testing techniques since it
checks the entire product or software.
 The cost for the testing will be high since it covers the testing of entire software.
 It needs good debugging tool otherwise the hidden errors will not be found.
 Can be time-consuming and expensive.
 Requires adequate resources and infrastructure.
 Can be complex and challenging, especially for large and complex systems.
 Dependent on the quality of requirements and design documents.
 Limited visibility into the internal workings of the system.
 Can be impacted by external factors like hardware and network configurations.
 Requires proper planning, coordination, and execution.
 Can be impacted by changes made during development.
 Requires specialized skills and expertise.
 May require multiple test cycles to achieve desired results.

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 29


The Art of debugging
Debugging is an essential skill for any developer, involving the process of identifying, isolating,
and fixing issues in your code. It ensures the quality, performance, and user satisfaction of
software products. Despite being time-consuming, mastering debugging can make you a more
effective and efficient developer.
Debugging Strategies

Logging
Logging is a developer's best friend when it comes to debugging. Insert log statements in your
code to track the flow of execution and the values of variables. Tools like console.log in
JavaScript, print in Python, or more advanced logging libraries can help you trace the code's
behavior2.
Divide and Conquer
Break down the problem into smaller parts. If you're dealing with a complex issue, isolate specific
sections of code to identify the root cause. Test each part independently and gradually narrow
down the problem's location2.
Code Review
Another set of eyes can often spot issues you've missed. Collaborate with your team or seek help
from forums and online communities. Explaining the problem and your thought process can lead
you to the solution2.
Version Control
If the bug appeared after making changes to your code, version control systems like Git can be
your savior. Use git diff to see what you've changed and check your commit history to
understand what might have introduced the bug2.
Debugging Tools
There are a plethora of debugging tools available for different programming languages and
environments. Some popular ones include:
 IDEs: Visual Studio Code, PyCharm, and Xcode come with built-in debugging tools.
 Browser Developer Tools: For web developers, browser developer tools are indispensable.
 Language-Specific Debuggers: For Python, there's pdb and ipdb ; for JavaScript,
there's debugger .
 Profiling Tools: Tools like cProfile for Python or built-in browser profilers can help identify
performance bottlenecks2.
Rubber Duck Debugging
Explaining the problem to an inanimate object, like a rubber duck, can help you uncover the issue.
This process forces you to articulate the problem and often leads to a solution 2.
Google and Stack Overflow

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 30


Don't hesitate to search for your error message or issue on Google and developer forums like
Stack Overflow. Many developers have likely encountered similar problems and shared their
solutions2.
Stay Calm and Patient
Debugging can be frustrating, but it's essential to stay calm and patient. Rushing can lead to more
errors and increased frustration. Take breaks, step away from the computer, and come back with
a fresh perspective2.
Document Your Solution
Once you've identified and fixed the bug, document the solution. This is helpful for future
reference and for your fellow developers who may encounter a similar problem 2.
Conclusion

Debugging is an indispensable skill for developers. While it can be challenging, it's also highly
rewarding when you successfully pinpoint and resolve an issue. By following these strategies and
utilizing the right tools, you can become a proficient debugger and enhance your problem-solving
skills as a developer12. Remember, debugging is not just about fixing code; it's about sharpening
your analytical thinking and troubleshooting abilities. Happy debugging!

J.KALPANA., MCA., ASSISTANT PROFESSOR, DEPARTMENT OF CA., Page 31

You might also like