software testing question papers
software testing question papers
a) Define Debugging.
Debugging is the process of identifying, analyzing, and fixing bugs or issues within a software
program. It involves detecting and resolving errors in the code to ensure the software behaves as
expected.
False.
Black Box testing and Glass Box testing (also known as White Box testing) are two different
testing techniques.
Black Box testing focuses on testing the functionality of the software without knowledge
of the internal code or structure. It tests what the system does, not how it does it.
White Box testing (Glass Box testing) involves testing the internal workings of the
application, such as the code, algorithms, and architecture.
1. To identify and fix defects in the software to ensure that it meets the required
functionality.
2. To ensure that the software meets the specified requirements and performs correctly
under various conditions.
Cyclomatic Complexity is a software metric that measures the complexity of a program based on
the number of linearly independent paths through the program's source code. It helps in
determining the minimum number of test cases needed for thorough testing.
A Test Plan is a document that outlines the strategy, objectives, scope, resources, schedule, and
activities related to software testing. It provides a detailed description of the testing process and
ensures that all test activities are aligned with the project goals.
Top-down integration testing is an approach where testing starts with the highest-level modules
and progressively moves downward to lower-level modules. Initially, the top-level modules are
tested using stubs for the lower-level modules. As the testing progresses, the stubs are replaced
by actual modules, and the system is tested in parts.
Iterative and Incremental: Testing is done in short cycles or sprints with incremental
changes.
Continuous Feedback: Regular feedback is collected from stakeholders to improve the
product.
Collaboration: Testers, developers, and stakeholders collaborate throughout the process.
Adaptability: Agile testing is flexible and can adjust to changing requirements.
Focus on Customer: Ensures the product is delivered with a focus on customer
satisfaction and functionality.
The dimensions of quality refer to various aspects that determine the overall quality of a product
or service. These include:
Functionality: The capability of the product to meet its specifications and requirements.
Reliability: The product's ability to perform consistently and without failure.
Usability: How easy and intuitive the product is to use.
Efficiency: The product's ability to perform tasks with optimal use of resources.
Maintainability: The ease with which the product can be modified and improved.
Portability: The ease with which the product can be adapted to different environments.
Identifies New Bugs: Helps to identify any defects introduced by new changes or
updates.
Ensures Software Integrity: Ensures that previously working features are not broken by
changes or additions.
Enhances Reliability: Improves the stability and reliability of the software over time.
Saves Time: Automation of regression tests can speed up the testing process and reduce
manual testing effort.
The V-Model is a software development model that emphasizes verification and validation. It is
an extension of the waterfall model, where each phase of development corresponds to a testing
phase. The stages of the V-model include:
In the V-model, the development activities are linked with corresponding testing activities,
ensuring that each phase is validated.
Basic Path Testing is a technique used in White Box Testing to design test cases based on the
control flow graph of the program. It aims to ensure that all the independent paths of the program
are covered by test cases.
kotlin
Copy
if (a > b) {
return a;
} else {
return b;
}
Basic Path Testing would require two test cases to cover these paths.
c) What is system testing? How it test the system? Also list its different types.
System Testing is a type of software testing where the entire system is tested as a whole to
verify that it meets the specified requirements. It ensures that all components of the software,
both functional and non-functional, work together as expected.
Web Application: A web application is a software application that runs on a web server rather
than being installed on a local computer. It is accessed through a web browser over the internet
or an intranet. Web applications are dynamic, and their data is usually stored on a server and
accessed via the internet.
Diagrammatically:
rust
Copy
User <-----> Web Browser <-----> Web Server <-----> Database
Unit Testing: Unit testing is a software testing technique where individual units or components
of a software application are tested in isolation from the rest of the application. The goal is to
ensure that each unit (typically a function or method) behaves as expected.
How it Works:
1. A test case is written for a specific unit or function of the software.
2. The unit is tested independently, ensuring that it works correctly in isolation.
3. The output of the unit is compared with the expected output.
4. If the unit produces the expected output, the test is considered passed. Otherwise, it is
considered failed.
python
Copy
def add(a, b):
return a + b
python
Copy
def test_add():
assert add(2, 3) == 5 # Passes
assert add(-1, 1) == 0 # Passes
assert add(0, 0) == 0 # Passes
In this example, the add() function is tested with various inputs to ensure it works correctly. If
all assertions pass, the test is successful.
Test Case: A test case is a set of conditions or variables that determine whether a software
application functions correctly. It includes a set of inputs, execution conditions, and expected
results to verify the behavior of the software under test.
Agile Testing Quadrants: The Agile Testing Quadrants provide a framework for organizing
different types of testing activities in Agile projects. They are divided into four quadrants to help
clarify which types of testing should be done at different stages of development.
The Agile Testing Quadrants help teams understand the appropriate type of testing for different
stages of development and provide a balanced approach to testing across the development
lifecycle.
An error refers to a mistake made by the programmer or developer during coding or design,
which leads to incorrect results, faulty behavior, or failure in the system. Errors can be of various
types, such as syntax errors, logical errors, or runtime errors.
b) What is stub?
A stub is a piece of code used in integration testing to simulate the behavior of missing or
incomplete components of a system. It allows testing of higher-level modules while the lower-
level modules are still being developed.
The primary goal of white-box testing is to verify the internal workings of the system. It focuses
on testing the code, logic, structure, and flow of the application to ensure that all parts of the
code function as expected and there are no hidden defects or vulnerabilities.
A test plan is a document that outlines the strategy, objectives, scope, resources, schedule, and
activities required for software testing. It defines the testing approach, identifies the testing tools
to be used, and sets the criteria for testing success.
1. Equivalence Partitioning: Divides input data into equivalent partitions to reduce the
number of test cases. Each partition should ideally yield the same result.
2. Boundary Value Analysis: Focuses on testing the boundaries of input data (i.e., values
at the edges of input ranges) to identify potential defects at the limits.
The dimensions of quality include several key factors that contribute to the overall quality of a
product. These are:
Performance testing is the process of evaluating the speed, responsiveness, scalability, and
overall performance of an application or system under various conditions. It helps to identify
bottlenecks, performance degradation, and areas for optimization.
The goal of unit testing is to verify that individual units or components of the software (such as
functions or methods) perform correctly in isolation. It ensures that each part of the software
works as intended and produces the expected outputs.
Regression testing refers to the process of testing the software after changes (like enhancements,
bug fixes, or updates) have been made to ensure that these changes have not negatively affected
the existing functionality of the system.
Thorough Code Coverage: White-box testing allows for comprehensive testing of the
code, ensuring that all paths, branches, and conditions are tested. It helps identify hidden
bugs that may not be detected with black-box testing.
Early Detection of Bugs: Since white-box testing is conducted at the code level, it helps
identify bugs early in the development process, reducing the cost of fixing them later.
A web application works through a client-server model where the client (web browser) interacts
with the server over the internet:
Diagrammatic flow:
rust
Copy
User -> Browser -> Web Server -> Database (optional) -> Browser (response
rendered)
1. Alpha Testing: Conducted by the internal development team to identify bugs before
releasing the product to a selected group of external users.
2. Beta Testing: Performed by a select group of external users to identify issues from real-
world usage.
3. User Acceptance Testing (UAT): The final test by the end-users to ensure that the
product meets their needs and is ready for production.
4. Operational Acceptance Testing (OAT): Focuses on the operational aspects of the
system such as backup, recovery, and installation.
System testing verifies that the entire system works as expected. Types include:
1. Functional Testing: Ensures that the system performs the required functions correctly.
2. Performance Testing: Evaluates how well the system performs under various conditions
(e.g., load, stress).
3. Security Testing: Tests for vulnerabilities and ensures that the system is secure against
threats.
4. Usability Testing: Ensures that the system is user-friendly and meets usability standards.
5. Compatibility Testing: Checks that the system works across different platforms,
browsers, and devices.
6. Recovery Testing: Tests the system's ability to recover from failures or crashes.
7. Stress Testing: Assesses the system's stability when subjected to extreme conditions,
such as high load.
Testing Debugging
Definition: Testing is the process of evaluating a Definition: Debugging is the process of
software application to identify bugs or defects, identifying, isolating, and fixing defects
ensuring that the software meets the requirements or issues in the code of a software
and works as expected. application.
Objective: The goal of debugging is to
Objective: The goal of testing is to find defects and
locate and resolve issues or defects that
ensure that the software meets the functional and
have been identified during testing or
non-functional requirements.
reported by users.
Focus: Focuses on identifying issues (bugs), Focus: Focuses on fixing the issues or
inconsistencies, and failures in the software. bugs found during testing or use.
Tools Used: Debugging involves using
Tools Used: Testing often involves the use of test
debuggers, logging, breakpoints, and code
cases, automation tools, and testing frameworks.
analysis.
Testing Debugging
Involves analyzing the software code,
Process: Involves executing the software to detect
investigating issues, and modifying the
faults.
code to fix problems.
Cyclomatic Complexity:
Cyclomatic Complexity is a metric used to measure the complexity of a program. It is
based on the control flow graph of the program, where nodes represent code blocks and
edges represent the control flow between these blocks. It gives an indication of the
number of linearly independent paths in the code, which helps in determining the number
of test cases needed to achieve full branch coverage.
o Formula: V(G)=E−N+2PV(G) = E - N + 2PV(G)=E−N+2P Where:
V(G) = Cyclomatic Complexity
E = Number of edges in the control flow graph
N = Number of nodes in the control flow graph
P = Number of connected components (typically 1 in a single program)
kotlin
Copy
if (a > b) {
return a;
} else {
return b;
}
Graph Matrix:
A graph matrix (or adjacency matrix) is a way of representing a graph in matrix form.
Each node is assigned an index, and the matrix represents the connections between nodes
with 0s and 1s. For each pair of nodes, a 1 indicates an edge exists, and a 0 indicates no
edge.
Process:
1. Identify normal operating conditions: Establish the system's typical load, expected
traffic, and performance benchmarks.
2. Apply excessive load: Gradually increase the load beyond the system's capacity (e.g.,
high traffic, heavy data processing, etc.).
3. Monitor system performance: Track how the system behaves under stress, focusing on
CPU usage, memory consumption, response time, and other performance metrics.
4. Observe system failure: Determine at which point the system crashes, fails to meet
performance requirements, or becomes unstable.
5. Analyze results: Identify bottlenecks, weak points, and the system's capacity to recover
from stress.
Example:
A web application designed to handle 1,000 simultaneous users is tested by simulating 5,000
simultaneous users. The system is monitored for CPU usage, server load, response time, and data
integrity. Stress testing helps identify how the system behaves when it exceeds its capacity, and
where performance degradation or crashes might occur.
Navigation Testing:
Navigation testing ensures that the application’s user interface (UI) allows users to correctly and
efficiently navigate through the application, and that all links, buttons, and menus function as
expected.
o Test that all URLs, links, and buttons are working correctly.
o Ensure all links lead to the expected pages or sections.
o Verify that no dead or broken links exist.
Navigation Semantics Testing:
Semantics refers to the usability and meaning of the navigation. It ensures that the user’s
expectations are met, and the application flows logically.
How to Test Semantics:
b) Define the term test case. Explain with example test case.
Test Case:
A test case is a set of conditions, inputs, and expected results that define how a specific feature
or function of an application should behave. It is written to verify whether the software behaves
as expected under certain conditions.
Verification Validation
Definition: Verification is the process of Definition: Validation is the process of
evaluating software during development to evaluating the software at the end of the
ensure it meets the specified requirements and development cycle to ensure it meets the
design specifications. customer’s needs and expectations.
Verification Validation
Focus: Focuses on whether the software is Focus: Focuses on whether the right software
being built correctly according to the design is being built, i.e., whether it fulfills the
specifications. customer’s requirements and expectations.
Process: Involves reviews, inspections, and Process: Involves testing, user acceptance
walkthroughs. testing, and final product validation.
When Done: Performed throughout the When Done: Done at the end of the
development process. development lifecycle.
Answer to Question: “Are we building the Answer to Question: “Are we building the
product right?” right product?”
Internationalization Testing ensures that the software application can function correctly in
different languages, regions, and cultures. The phases involved are:
1. Requirement Analysis:
This phase involves understanding the internationalization requirements, such as
supporting multiple languages, regions, and date formats.
2. Design:
The software architecture is designed to support internationalization features such as
language localization, date, time, currency formats, and right-to-left text support.
3. Development:
Developers implement internationalization features, like extracting all user-facing text
into external resource files and supporting various encoding formats (e.g., UTF-8).
4. Testing:
Involves verifying that the software behaves as expected when deployed in different
regions with different locales and languages. It checks the functionality of localization
features.
5. Release:
The product is released for different regions and is localized for the target audience.
a) What is fault?
A fault (also known as a defect or bug) is an issue in the software code or design that causes the
software to behave incorrectly or produce incorrect results. Faults can arise from coding
mistakes, poor design, or incorrect assumptions made during development.
b) Define verification.
Verification is the process of evaluating software during development to ensure that it conforms
to the specifications and design documents. It checks whether the software is being built
correctly according to the defined requirements and design standards.
c) Define stub.
White-box testing involves testing the internal structures or workings of an application. Common
methods include:
A strategy for web applications refers to the approach taken to ensure the development,
deployment, and maintenance of the application is successful. Key strategies include:
Acceptance testing is the process of verifying that the software meets the requirements and
expectations of the customer or end-users. It is often the final phase of testing before the product
is released to the customer. It includes functional, usability, and performance checks.
False. Black box testing and glass box testing are different approaches:
Black box testing focuses on testing the functionality of the application without
knowledge of the internal workings (i.e., you test based on input and output).
Glass box testing, also known as white-box testing, involves testing the internal logic,
structure, and code of the application.
1. Test Manager: Responsible for overseeing the entire testing process, resource allocation,
and scheduling.
2. Test Lead: Manages the day-to-day testing activities, coordinates the testing team, and
ensures tests are executed as planned.
3. Test Analyst: Designs test cases and prepares the testing environment.
4. Tester: Executes the test cases and reports defects.
5. Automation Engineer: Develops and maintains automated test scripts.
White Box Testing: Involves testing the internal structure of the application. Testers
have knowledge of the code, and test cases are designed to verify the logic, paths,
branches, and conditions within the code.
Black Box Testing: Focuses on testing the software's functionality without any
knowledge of its internal structure. Test cases are designed based on the software's
requirements and user expectations.
Testing Debugging
Focuses on identifying defects in the
Focuses on finding and fixing defects in the code.
software.
Performed after the code is written, often by Performed by the developer, often while writing
independent testers. or after writing the code.
Performance testing evaluates how well a system performs under varying loads. This type of
testing focuses on aspects like responsiveness, stability, scalability, and resource usage under
stress. It typically includes:
A test case is a detailed set of actions used to verify that a feature or function of the software
works as expected. It includes the conditions, inputs, expected results, and steps to execute.
The V-model (Verification and Validation model) is a software development lifecycle model
that emphasizes verification and validation at each stage. It’s called the "V-model" because the
process flows down in a sequential manner, then rises back up, reflecting verification and
validation activities.
V-model Diagram:
rust
Copy
Requirements Analysis ---> System Design ---> Architecture Design
| | |
Verification Activities Verification Activities Verification
Activities
| | |
V V V
Coding (Development) <--> Unit Testing <--> Integration Testing <-->
System Testing <--> Acceptance Testing
Validation Activities Validation Activities
Validation Activities
Navigation testing verifies the correct navigation of the system, ensuring that users can move
between pages or sections as expected. It checks both the syntax (correct URLs or links) and
semantics (whether the links lead to the correct or appropriate content).
Syntax Testing: Involves testing the actual functionality of links, ensuring they direct
users to the correct destinations.
Semantics Testing: Involves testing whether the navigation structure makes sense from
the user’s perspective and whether it aligns with their expectations.
Integration testing involves testing the interfaces between modules to ensure they work together
as expected. It is done after unit testing and ensures that different parts of the system integrate
correctly.
Bottom-up Integration: In this approach, testing starts with the lowest-level modules
(leaf modules) and progresses upward to higher-level modules. Stubs are used for
modules that are not yet developed.
c) What is a web application? How it works? Explain with a diagram.
A web application is a software application that runs on a web server and can be accessed via a
web browser. It works by:
Diagram:
rust
Copy
User (Browser) <--> Web Server <--> Database
Internationalization testing ensures that the software can be adapted to different languages,
regions, and cultures without engineering changes. It involves checking that the application
handles different character sets, date formats, currencies, and other locale-specific features
correctly. This is critical when developing software for a global audience.