Software Testing and Quality Assurance
Software Testing and Quality Assurance
Complete testing, also known as exhaustive testing, refers to the idea of testing a software application in
such a way that every possible input, combination of inputs, and execution path is covered.
The goal is to ensure that the software is free from defects and that all aspects of its functionality have
been thoroughly tested.
In theory, complete testing would involve testing every possible state and transition of the system,
leaving no room for undiscovered bugs.
However, achieving truly complete testing is practically impossible for several reasons
Infinite Input Space: For non-trivial software, the number of possible inputs and combinations is
often infinite, making it impractical to test every combination comprehensively.
Infinite Paths: The number of execution paths through a program can also be infinite, especially
in complex applications. It's not feasible to test every path exhaustively.
Time and Resources: Complete testing would require an enormous amount of time and
resources. The cost and time required to test every possible scenario could be prohibitive,
especially for large and complex systems.
Changing Requirements: Software requirements are often subject to change, and new features
may be added. Achieving complete testing becomes a moving target as the software evolves.
While complete testing might be an ideal concept, in practice, testing efforts are usually focused on
achieving effective coverage through a combination of techniques, including:
Requirements-Based Testing: Ensuring that the software meets the specified requirements.
Risk-Based Testing: Identifying and prioritizing high-risk areas for testing.
Code Coverage: Measuring the percentage of code that has been executed by tests.
Equivalence Partitioning: Testing representative values from different equivalence classes.
Boundary Value Analysis: Testing values at the boundaries of input ranges.
Use Case Testing: Testing the software based on typical use cases.
Random Testing: Using random inputs to explore different scenarios.
The production of a quality software product by identifying defects, their root causes and taking
corrective and preventive measures to avoid their recurrence can be termed as the goal of defect
prevention process.
1
some key reasons why defect prevention is important in testing:
Cost Savings: Fixing issues early is cheaper than later in the software process, reducing the need
for extensive rework and debugging.
Time Efficiency: Catching and preventing defects early avoids backtracking, making
development smoother and faster.
Enhanced Product Quality: Addressing issues early leads to a higher-quality product, meeting
user expectations and ensuring customer satisfaction.
Improved Productivity: Developers can focus on creating instead of fixing, boosting
productivity and creating a positive work environment.
Customer Satisfaction: A high-quality, low-defect product enhances customer satisfaction,
building trust and potential for repeat business.
Risk Mitigation: Identifying and dealing with risks early reduces overall risks associated with
software development.
3. Clearly discuss about Mutation Testing?
Mutation testing is a software testing technique that assesses the quality of a test suite by introducing
small, intentional changes (mutations) to the source code and checking if the tests can detect these
changes.
The primary goal of mutation testing is to evaluate the effectiveness of a test suite in terms of its ability to
identify faults or bugs in the code.
Mutation Generation: Make small controlled changes to the source code, mimicking common
programming errors like altering operators, variables, or conditions.
Test Suite Execution: Run the modified code with mutations through the existing test suite. The
goal is to see if the tests can identify these artificial faults.
Mutation Analysis: Analyze the test results to find out how many mutations were detected. If a
mutation goes unnoticed by any test case, it's considered a "surviving" mutation.
Metrics and Reporting: Calculate metrics, like the mutation score, which is the ratio of detected
mutations to the total mutations introduced. A higher mutation score indicates a more effective
test suite.
Key Concepts:
Mutants: Mutants are altered versions of the source code, each representing a potential bug
2
Killing Mutants: If a test case finds and fails for a mutant, it's "killed." Killing mutants is the
main goal of mutation testing.
Surviving Mutants: Mutants not caught by any test are "surviving mutants." They reveal
potential gaps in the test suite, highlighting areas where your tests might need improvement.
Effectiveness Evaluation: Mutation testing gauges test suite strength. A high score is good; a
low one signals areas for improvement.
Identifying Gaps in Testing: Surviving mutants show where tests fall short, guiding
improvements in test coverage.
Improving Test Quality: Feedback from mutation testing enhances test cases, making them
more reliable in catching potential defects.
Computational Cost: Mutation testing can be computationally expensive, especially for large
codebases, as it runs multiple versions of the code.
False Positives: Surviving mutants may not always indicate real defects; some might be due to
method limitations or lack practical significance.
Complexity: Interpreting mutation test results and choosing the right mutation operators can be
complex, requiring careful consideration.
PIT
Stryker
4. What are the strength and weaknesses of automated and manual testing?
Automated testing is the process in which testers utilize tools and scripts to automate testing efforts.
3
Initial setup cost: Developing scripts and infrastructure can be time-consuming and expensive
initially.
Not suitable for exploratory testing: Less effective than manual testing for exploring
applications and identifying new issues.
UI Changes: Can be brittle with frequent UI changes, requiring frequent script updates.
Manual testing is the process in which QA analysts execute tests one-by-one in an individual manner.
The purpose of manual testing is to catch bugs and feature issues before a software application goes live.
Exploratory Testing: Excellent for exploratory testing, leveraging human intuition and
creativity.
Usability and User Experience: Well-suited for assessing UI, usability, and overall user
experience.
Adaptability: Adaptable to changing requirements or interfaces.
Initial setup cost: Developing scripts and infrastructure can be time-consuming and expensive
initially.
UI Changes: Can be brittle with frequent UI changes, requiring frequent script updates.
Complex scenarios: Challenging for subjective evaluations or scenarios involving user
experience.
5. The use of debugging in software testing by considering its three approaches (Backtracking, Brute
force and Cause elimination); write clearly about these three approaches
Debugging is a crucial aspect of software testing that involves identifying, isolating, and fixing defects or
bugs in a program.
There are various approaches to debugging, and three common strategies are backtracking, brute force,
and cause elimination.
1. Backtracking:
Backtracking is an approach in debugging where the programmer starts from the point of failure and
traces backward through the code to identify the root cause of the issue. The process involves
systematically undoing recent changes or operations to determine where the error originated.
Pros
4
Effective for identifying the specific change that caused the failure.
Can quickly pinpoint the root cause when the defect is related to recent modifications.
Cons:
Brute force debugging involves systematically trying different inputs, conditions, or scenarios to identify
the conditions under which the failure occurs. It is a more exploratory approach that aims to discover the
specific circumstances leading to the defect.
Pros:
Cons:
Cause elimination involves systematically ruling out potential causes of a defect by isolating different
parts of the code or components. The goal is to narrow down the possible sources of the issue.
Pros:
Cons:
Requires a good understanding of the codebase to identify relevant sections for elimination.
May be time-consuming, especially if the defect is in a complex interaction of components.
Each debugging approach has its strengths and weaknesses, and the choice of method often depends on
the nature of the defect, the complexity of the codebase, and the available information about the failure.
Skilled programmers often use a combination of these approaches to efficiently identify and resolve
defects during the software testing and debugging process.
5
6. By using software metrics techniques write the formula used to calculate the Portability, Reliability
and Availability of software product and give an example for these three quality factors by
measuring them
1. Portability: Portability measures how easily software can be transferred from one platform to
another. A lower percentage indicates lower portability.
Formula:
Example:
2. Reliability: Reliability assesses the ability of the software to perform without failure. A higher
percentage indicates higher reliability.
Formula:
Example:
Formula:
Example:
6
f a software system is available for 900 hours out of a total of 1000 hours, the
900
availability would be ×100 = 90%
1000