0% found this document useful (0 votes)
15 views32 pages

Comprehensive Guide to Software Testing

Software testing is a process aimed at identifying errors in programs to ensure they meet customer requirements and perform optimally. It encompasses various types of testing, including verification and validation, as well as techniques like black box, white box, and gray box testing, each with distinct methodologies and advantages. Key principles include thorough planning, focusing on high-risk areas, and utilizing both manual and automated testing approaches.

Uploaded by

neetukumari4155
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)
15 views32 pages

Comprehensive Guide to Software Testing

Software testing is a process aimed at identifying errors in programs to ensure they meet customer requirements and perform optimally. It encompasses various types of testing, including verification and validation, as well as techniques like black box, white box, and gray box testing, each with distinct methodologies and advantages. Key principles include thorough planning, focusing on high-risk areas, and utilizing both manual and automated testing approaches.

Uploaded by

neetukumari4155
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

Software Testing

▪ Testing is the process of executing a program to find errors.


▪ To make software perform well it should be error-free.

➢ Principles of Testing:-

▪ All the tests should meet the customer requirements.


▪ To make our software testing should be performed by a third party.
▪ Exhaustive testing(testing for absolutely everything just to make sure that the
product cannot be destroyed or crashed by some random happenstance) is not
possible. As we need the optimal amount of testing based on the risk
assessment of the application.
▪ All the tests to be conducted should be planned before implementing it .
▪ It follows the Pareto rule(80/20 rule) which states that 80% of errors come
from 20% of program components.
▪ Start testing with small parts and extend it to large parts.
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.

Verification: “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.

Validation: “Are we building the right


product?”
Levels of Testing:-

Done by Done by Done by Done by


Developer Tester Tester User
Unit Testing:
Testing • A level of the software testing process where individual units/components of a software/system are tested.
• Purpose: To validate that each unit of the software performs as designed.

Integration Testing:
Testing • A level of the software testing process where individual units are combined and tested as a group.
• Purpose: To expose faults in the interaction between integrated units.

System Testing:
Testing • A level of the software testing process where a complete, integrated system/software is tested.
• Purpose: To evaluate the system’s compliance with the specified requirements.

Acceptance Testing:
Testing • A level of the software testing process where a system is tested for acceptability.
• Purpose: To evaluate the system’s compliance with business requirements and assess whether it is acceptable for delivery.
Parameters Manual Testing Automation Testing

In manual testing, the test cases are In automated testing, the test cases are
Definition
executed by the human tester. executed by the software tools.

Automation testing is faster than manual


Processing Time Manual testing is time-consuming.
testing.

Manual testing takes up human Automation testing takes up automation


Resources requirement
resources. tools and trained employees.

Exploratory testing is possible in manual Exploratory testing is not possible in


Exploratory testing
testing. automation testing.

Automation testing uses frameworks like


Framework requirement Manual testing doesn’t use frameworks.
Data Drive, Keyword, etc.
Black Box Testing
• Definition:
• A software testing technique where the tester does not require internal knowledge of the software.
• Focuses on validating functionality based on provided specifications or requirements.
• Advantages of Black Box Testing:
• No Need for Programming Knowledge: Testers do not need deep functional or programming skills.
• Efficient for Large Systems: Suitable for testing large and complex systems.
• User-Centric Approach: Tests are executed from the user’s or client’s perspective.
• Reproducible Test Cases: Test cases can be easily repeated for verification.
• Identifies Specification Issues: Helps detect ambiguities and contradictions in functional specifications.
Types of Black Box testing Verifies that each function of the
software works as per
requirements and specifications.
Functional Testing Definition:
Not concerned with source code
but focuses on expected vs. actual
Tests user interface, APIs, output.
database, security, and
client/server applications.

Key Aspects: Can be manual or automated.

Ensures the software meets its


functional requirements.
Tests modified parts of the code
and areas that might be affected
by modifications.
Definition:
Ensures no new errors are
introduced after changes.

Types of Black Box testing Regression Testing


Prevents return of bugs due
to new updates.

Ensures newly added code


Key Aspects: is compatible with existing
code.

Performed after system


maintenance and
upgrades.
Non-Functional Testing

• Definition:
• Evaluates non-functional attributes of the
system.
• Tests the readiness of a system based on
parameters not covered by functional testing.
• Key Aspects:
• Focuses on performance, usability, and
scalability.
• Ensures the system meets quality standards
beyond functionality.
• Also known as NFT (Non-Functional Testing).
• Equally important as functional testing.
Ways of Black Box Testing Done
➢ Equivalence partitioning
▪ In this, input data divided into partitions of valid and invalid values, and it is mandatory that all
partitions must exhibit the same behavior.

➢ Boundary Value Technique


▪ It is used to test boundary values, boundary values are those that contain the upper and lower limit of
a variable.
▪ It tests, while entering boundary value whether the software is producing correct output or not.

➢ Acceptance testing
▪ It is formal testing based on user requirements and function processing.
▪ It determines whether the software is conforming specified requirements and user requirements
or not.
Alpha Testing
to determine the product in the development testing environment by a specialized testers team
usually called alpha testers.
Beta Testing:
▪ to assess the product by exposing it to the real end-users, usually called beta testers in
their environment.
▪ Feedback is collected from the users and the defects are fixed.
▪ Also, this helps in enhancing the product to give a rich user experience.

➢ State Based Technique


▪ It is used to capture the behavior of the software application when different input values are
given to the same function.
▪ This applies to those types of applications that provide the specific number of attempts to access
the application.

➢ Cause effect Graphing


▪ This technique establishes a relationship between logical input called causes with
corresponding actions called the effect.

➢ Pair- wise testing


▪ It is used to test all the possible discrete combinations of values.
▪ This combinational method is used for testing the application that uses checkbox input, radio
button input, list box, text box, etc.
Tools Used for Black Box Testing
• Appium
• Selenium
• QTP (QuickTest Professional)
• LoadRunner
• JMeter
• TestComplete
• Ranorex
• Katalon Studio
• Postman
• SoapUI
• Cucumber
• HP QTP .
• Applitools
• Microsoft Coded UI
White Box Testing
•Definition:
•Analyzes internal structures, data structures, internal design, code structure, and workings of the
software rather than just its functionality.
•Also known as glass box testing, clear box testing, structural testing, transparent testing, or
open box testing.
•Key Characteristics:
•Involves testing the internal structure and workings of a software application.
•The tester has access to the source code and uses it to design test cases at the code level.
Advantages of White Box Testing:
• Thorough Testing: Ensures complete testing as the entire code and structures are examined.
• Code Optimization: Helps in optimizing the code by removing errors and redundant lines.
• Early Detection of Defects: Can start early in the Software Development Life Cycle (SDLC) as it
doesn’t require an interface like black box testing.
• Integration with SDLC: Can be seamlessly incorporated into the development process.
• Detection of Complex Defects: Identifies defects that are not easily detected through other testing
techniques.
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.


• Conducted after unit testing to ensure components function well
both individually and together.

Regression Testing:

• Verifies that changes or updates do not break existing


functionality.
• Ensures the application still passes all previous tests after
modifications.
White Box Testing Process
1. Input: The process starts by gathering all related documents, including:

•Requirements: Define what the application should do and its expected behavior.
•Functional Specifications: Describe how the software should perform under specific conditions.
•Design Documents: Provide detailed insights into the architecture, components, and flow of the system.
•Source Code: The actual code written for the application, where logic and functionality are defined. This is
the primary focus during white box testing.
2. Processing: After gathering inputs, the next step includes:
•Risk Analysis:
•Identifies potential risks in the code.
•Analyzes functionality and dependencies to prioritize high-risk areas.

•Test Planning:
•Designs detailed test cases covering all paths, conditions, loops, and functions.
•Ensures every part of the application is tested.
2. Processing: After gathering inputs, the next step includes:
•Risk Analysis:
•Identifies potential risks in the code.
•Analyzes functionality and dependencies to prioritize high-risk areas.

•Test Planning:
•Designs detailed test cases covering all paths, conditions, loops, and
functions.
•Ensures every part of the application is tested.
White Box Testing Techniques
➢ Control flow testing

▪ This type of testing method is often used by developers to test their own code and own
implementation as the design, code and the implementation is better known to the
developers.
▪ This testing method is implemented with the intention to test the logic of the code so
that the user requirements can be fulfilled.

➢ Data flow Testing

▪ It is a method that is used to find the test paths of a program according to the locations
of definitions and uses of variables in the program. It has nothing to do with data
flow diagrams.
▪ It is concerned with:
• Statements where variables receive values,
• Statements where these values are used or referenced.
➢ Basis Path Testing

▪ It 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.
▪ To design test cases using this technique, four steps are followed :
• Construct the Control Flow Graph
• Compute the Cyclomatic Complexity of the Graph
• Identify the Independent Paths
• Design Test cases from Independent Paths

➢ Statement Coverage

▪ This technique involves execution of all statements of the source code at


least once.
▪ It is used to calculate the total number of executed statements in the source
code out of total statements present in the source code.
➢ Branch coverage

▪ It is used to cover all branches of the control flow graph.


▪ It covers all the possible outcomes (true and false) of each condition of decision point at
least once.

➢ Path Coverage

▪ It is a structured testing technique for designing test cases with intention 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 of Statement,
Branch and Path coverage :

Statement : We can cover all the statements in the


flowchart by writing 1 Test Case that follows the
following route : 1A-2C-3D-E-4G-5H.

Branch : We can cover all the branches in the


flowchart by writing 2 Test Cases that follow the
following two routes: 1A-2C-3D-E-4G-5H and 1A-2B-
E-4F.

Path : We can cover all the paths in the flowchart by


writing 4 Test Cases that follow the following four
routes: 1A-2B-E-4F, 1A-2B-E-4G-5H, 1A-2C-3D-E-
4G-5H and 1A-2C-3D-E-4F.
Gray Box Testing

•Definition:
• A hybrid software testing technique combining elements of Black Box Testing and White Box
Testing.
• The tester has partial knowledge of the internal structure.
• Involves access to internal data structures and algorithms for test case design.

•Advantages of Gray Box Testing:


• Clarity of Goals: Users and developers have well-defined testing objectives.
• User Perspective Testing: Conducted primarily from the user’s viewpoint.
• No Need for Advanced Programming Skills: Testers do not require high-level coding expertise.
• Non-Intrusive Approach: Does not interfere with the internal workings of the system.
• Improved Product Quality: Enhances the overall quality of the software.
Cyclomatic Complexity
➢ It is a software metric that measures the logical complexity of the program code.
➢ It is the maximum number of independent paths through the program code.
➢ It depends only on the number of decisions in the program code.
➢ Insertion or deletion of functional statements from the code does not affect its cyclomatic complexity.
➢ It is always greater than or equal to 1.
➢ There are 3 commonly used methods for calculating the cyclomatic complexity-
▪ Cyclomatic Complexity = Total number of closed regions in the control flow graph + 1
▪ Cyclomatic Complexity = E – N + 2
Here, E = Total number of edges in the control flow graph, N = Total number of nodes in the
control flow graph
▪ Cyclomatic Complexity = P + 1
Here, P = Total number of predicate nodes contained in the control flow graph
Aspect Black Box Testing White Box Testing Gray Box Testing

Tester has no knowledge of the internal workings


Available Tester has full knowledge of internal workings, Tester has partial knowledge, such as access to design
including source code and architecture. Focuses on
Information including source code and architecture. documents but not the source code.
inputs and outputs.

Limited coverage, based on expected behavior and Full coverage, as tester has access to source code Moderate coverage, with focus on areas where some
Test Coverage
requirements without internal knowledge. and can test all code paths. knowledge is available.

Performed after some parts of the application are


Performed after the application is built, during later Can be performed early in the SDLC, integrating into
Time of Analysis built but allows for earlier analysis than black box
stages of the SDLC. the development process.
testing.

Uses dynamic analysis tools for testing during Uses static analysis tools (like code analyzers) to Uses both dynamic and limited static analysis tools
Tool Usage
runtime, focusing on user behavior. inspect source code. depending on available knowledge.

Acts as an end user, focusing on functionality Acts like a developer, focusing on internal logic, Partially a developer and user, focusing on the
Tester Mindset
without knowledge of internal workings. structure, and code. expected behavior with some internal knowledge.

Largest, as it needs to cover broad user interactions Smaller compared to black box, as it focuses on Smaller than both black and white box, focused on
Test Case Input Size
and scenarios. specific code paths. available knowledge areas.

Finding Hidden Challenging, may find some hidden errors that are
Difficult to detect, as it focuses only on outputs. Easier due to full access to internal code and logic.
Errors visible at the user level.

Not suitable, as it lacks the internal access to Not suitable, as it lacks full access to algorithms and
Algorithm Testing Well-suited for testing internal algorithms and logic.
algorithms. internal code.

Functional testing, data-driven testing, closed box Structural testing, clear box testing, code-based
Other Names Translucent testing.
testing. testing, transparent testing.
Other Types of Testing
1. Smoke Testing

• Ensures that the software is stable and ready for further testing.
• Called a "smoke test" because it checks for major failures at an early stage.
• Example: If a project has two modules, module 1 must work properly before testing
module

2. Advantages:

• Easy to perform.
• Identifies defects in early stages.
• Improves system quality.
• Reduces the risk of failure.
• Makes progress easier to assess.
2. Sanity Testing
• A subset of regression testing to check whether code changes work properly.
• Determines whether testing for the build can proceed or not.
• Performed on urgent builds like critical bug fixes.

Advantages:
• Quickly identifies defects in core functionality.
• Saves time since no documentation is required.
• Avoids unnecessary regression tests if defects are found.
• Less expensive than other testing types.
• Helps identify missing dependent objects.
3. Regression Testing
•Ensures that new code changes do not break existing functionality.
•Can be performed in different ways:
• Retesting – Checks affected features after changes.
• Re-execution – Runs previous test cases again.
• Comparison – Compares new and old software versions.

Advantages:
•Prevents new bugs from appearing after updates.
•Maintains software reliability.
•Improves stability and performance.

Example:
•In school management software, integrating staff, students, and finance
modules and ensuring they function correctly.
4. User Acceptance Testing (UAT)
• End-users test the product to ensure it meets their expectations.
• Conducted at either the client's site or the developer's site.
• Industries like medicine and aerospace require regulatory compliance testing.
• UAT plans are created based on specific requirements.

5. Exploratory Testing
• Unscripted testing where testers explore the software freely.
• Testers use their skills, knowledge, and experience to find defects.

Advantages:
• Requires little to no preparation.
• Quickly identifies critical defects.
• Enhances tester creativity and productivity.
6. Adhoc Testing
• Random, unstructured testing performed after formal testing.
• Also known as Monkey Testing.

Advantages:
• Finds errors that structured tests may miss.
• Requires minimal time to execute.
• Helps create unique test cases.
• Strengthens product quality.
• Can be performed at any stage of the SDLC.

7. Security Testing
• Identifies vulnerabilities and ensures data protection.
• Prevents unauthorized access and security threats.

Advantages:
• Detects weak passwords, misconfigurations, and unpatched software.
• Strengthens system security.
• Ensures compliance with regulations like HIPAA, PCI DSS, and SOC2.
8. Globalization Testing
• Ensures software functions across different regions, languages,
and cultures.

Benefits:
• Makes software more scalable and adaptable.
• Saves time and effort in localization.
• Reduces the cost of localization testing.

You might also like