Module 1
Software Testing Fundamentals - Software Testing Definition,
Importance, objectives, why is it too hard? Errors, faults and failure.
Testing process, STLC, QA and QC, Verification and Validation,
Inspections and walkthroughs, Test Plan, test cases, drivers,
stubs, Validation checks.
Fundamentals Of Testing Why Is Testing Necessary?, What Is
Testing?
“Software testing is the act of examining the artifacts and the behaviour of the
software under test by validation and verification.”
In simpler terms, think of software testing as a quality check for software.
It’s all about ensuring the software does what it should and provides users with a seamless
experience. By testing, we ensure potential issues are spotted and fixed before the software
reaches your hands
Why software Testing?
Quality Check: It’s not just about ensuring the software works; it’s about ensuring it
works perfectly every time you use it.
Happy Users: Remember the last time an app crashed on you? Annoying, right?
Testing aims to prevent such frustrations.
Saving Money: Think of it this way: it’s cheaper to spot a leak and fix it than to mop
up the water later. Similarly, finding and fixing software issues early on is more cost-
effective
Staying Safe: Just as you wouldn’t want a toy with sharp edges, you wouldn’t want
software with security risks. Testing helps keep things safe and secure.
Good Reputation: When things work smoothly, it builds trust. And trust is everything
in the digital world.
Staying Updated: The world of software testing is ever-evolving. To understand its
current landscape and anticipate future challenges, staying updated with the latest
trends is essential.
software testing fundamentals revolve around ensuring the software’s
reliability, efficiency, and usability.
Objectives of software Testing
Ensure Reliability: Just as you’d want your dish to be consistently delicious every
time you prepare it, we test to ensure the software is dependable and won’t
disappoint you when needed.
Verify Functionality: It’s like ensuring all the ingredients in a recipe come together
ideally. In software, we verify that every feature functions as intended.
Identify Defects: Before serving a dish, you’d want to ensure it tastes right and has
no unwanted elements. Similarly, testing helps spot and fix any issues or bugs in the
software.
Assess User Experience: Just as the presentation and taste of a dish enhance your
dining experience, a user-friendly software interface ensures a delightful digital
journey.
Maintain Quality Standards: Just as dishes must meet specific culinary standards,
the software has quality benchmarks it needs to meet.
Software testing can be perceived as difficult due to a combination of
factors, including the complexity of modern software, the need for diverse
skills, tight deadlines, and the potential for communication breakdowns. It's
not inherently impossible, but requires a multifaceted approach and
continuous learning to excel.
Here's a more detailed look at why it's often considered challenging:
1. Complexity of Software:
Modern software systems are intricate, involving numerous components,
dependencies, and potential interactions, making comprehensive testing a
monumental task.
2. Need for Diverse Skills:
Effective testing demands a broad skillset, including technical
expertise in coding, understanding of formal languages and
algorithms, and strong analytical and problem-solving abilities.
3. Time Constraints and Deadlines:
Software releases often have tight deadlines, leaving limited time for thorough
testing.
4. Communication and Collaboration:
Effective communication between testers, developers, and other stakeholders
is crucial for identifying and resolving issues.
5. Constant Evolution:
Software is constantly evolving, with new features, updates, and changes
being introduced regularly.
6. The Illusion of Complete Testing:
While testers strive for error-free software, it's often impossible to achieve
complete coverage due to the infinite number of potential inputs and
scenarios.
Error- > Fault/ Bug /Defect- > Failure
Bug, Defect, Errors, faults and failure.
What is a Bug?
A bug refers to defects which means that the software product or
the application is not working as per the adhered requirements
set. When we have any type of logical error, it causes our code
to break, which results in a bug. It is now that the Automation/
Manual Test Engineers describe this situation as a bug.
What is a Defect?
A defect refers to a situation when the application is not working
as per the requirement and the actual and expected result of the
application or software are not in sync with each other.
What is an Error?
Error is a situation that happens when the Development team or
the developer fails to understand a requirement definition and
hence that misunderstanding gets translated into buggy code.
This situation is referred to as an Error and is mainly a term
coined by the developers.
Errors are generated due to wrong logic, syntax, or loop
that can impact the end-user experience.
It raises due to several reasons like design issues, coding
issues, or system specification issues and leads to issues
in the application.
What is a Fault?
Sometimes due to certain factors such as Lack of resources or
not following proper steps Fault occurs in software which means
that the logic was not incorporated to handle the errors in the
application. This is an undesirable situation, but it mainly
happens due to invalid documented steps or a lack of data
definitions.
It is an unintended behavior by an application program.
What is a Failure?
Failure is the accumulation of several defects that ultimately
lead to Software failure and results in the loss of information in
critical modules thereby making the system unresponsive.
Failure can happen due to human errors or can also be
caused intentionally in the system by an individual.
It is a term that comes after the production stage of the
software.
It can be identified in the application when the defective
part is executed.
A simple diagram depicting Bug vs Defect vs Fault vs Failure:
Bug Defect Fault Error Failure
Failure is the
A bug refers to
A Fault is a accumulation of
defects which A Defect
state that An Error is a several defects
means that the is a
causes the mistake that ultimately
software deviation
software to made in the lead to Software
product or the between
fail and code due to failure and
application is the
therefore it which results in the loss
not working as actual
does not compilation of information in
per the and
achieve its or execution critical modules
adhered expected
necessary fails, thereby making
requirements output
function. the system
set
unresponsive.
Testing Process (STLC)
The different phases of the Software Testing Life Cycle are:
1. Requirement Analysis
2. Test Planning
3. Test Design
4. Test Environment Setup
5. Test Execution
6. Test Closure
Verification and Validation
The primary difference between verification and validation is that Verification
checks if the product is built right, while Validation checks if the right product
is built. Apart from this, Verification is Static Testing, but Validation is Dynamic
Testing.
Aspect Verification Validation
Static process of checking documents, Dynamic process of testing and
Definition design, code, and program to see if software validating the actual product to meet
is built according to requirements. the exact needs of the customer.
Type of
Static (does not involve code execution). Dynamic (involves code execution).
Testing
Reviews, walkthroughs, inspections, desk- Black Box Testing, White Box
Methods
checking. Testing, Non-functional testing.
Meeting customer requirements and
Focus Conformity to specifications.
expectations.
Bug Finds bugs not caught by
Finds bugs early in development.
Detection verification.
Application and software architecture,
Target Actual software product.
specification, design, database.
Execution
Quality assurance team. Testing team with QA involvement.
Team
Sequence in
Performed before validation. Follows verification.
Development
Nature of
Checking of documents/files by humans. Execution of program by computer.
Checks
Ensures software is traceable to
Purpose Ensures correct implementation of functions.
customer requirements.
Aligning with customer and business Functioning across different
Key Concern
requirements at each stage. conditions and environments.
Defect
Detection Finds about 50-60% of defects. Finds about 20-30% of defects.
Rate
Emphasis Process, standards, guidelines. Product itself.
Execution Does not require devices, platforms, Best executed using real browsers,
Requirements browsers, OS. devices, OS.
Question
Are we building the product right? Are we building the right product?
Addressed
In software testing, inspections and walkthroughs are two different
types of reviews that aim to find defects early in the development
process. Inspections are formal, structured reviews with defined roles and
processes, while walkthroughs are more informal and flexible, often led by
the author of the work product.
Inspections:
Formal and structured:
Inspections follow a predefined process with specific roles like moderator,
author, and inspectors.
Detailed and thorough:
They involve a meticulous examination of the software artifact using checklists
and predefined criteria.
Focus on defect detection:
The primary goal is to identify and document defects, not to fix them during the
inspection meeting.
Includes planning, preparation, and follow-up:
A structured approach ensures thoroughness and accountability.
Walkthroughs:
Informal and flexible:
Walkthroughs are less structured and can be adapted to the specific needs of
the project.
Led by the author:
The author presents the work product and guides the discussion, often focusing
on achieving a shared understanding.
Feedback-oriented:
Walkthroughs encourage feedback and discussion among participants.
Can be less thorough than inspections:
While they can be effective for finding defects, they may not be as
comprehensive as inspections.
Can be used for various purposes:
Walkthroughs are useful for high-level documents like requirements
specifications as well as code.
Key Differences Summarized:
Feature Inspection Walkthrough
Formality Formal, structured Informal, flexible
Process Defined roles, phases, checklists Author-led, discussion-based
Defect Focus Defect detection and documentation Defect detection, shared understanding, feedback
Moderator Trained moderator Author
Thoroughness Highly thorough Can vary
Use Cases Detailed design, code, unit test results Requirements, high-level designs, code
Both inspections and walkthroughs are valuable tools in software
development for improving quality and finding defects early in the
lifecycle. They can be used independently or in combination, depending on
the specific context and project needs.
Stubs and Drivers in software Testing
What are Stubs?
Stubs are dummy implementations of modules or functions that are called by
the component being tested. They simulate the behavior of the dependent
modules that are not yet developed or available for testing. Stubs are
typically used when testing higher?level components that depend on lower?
level components.
The main purpose of stubs is to provide a simplified or mock version of the
missing or unavailable modules. Stubs are designed to return predetermined
values, thereby allowing the testing of the higher?level component in
isolation. By using stubs, the developer or tester can focus on testing the
logic and functionality of the component without being dependent on the
actual implementation of the dependent modules.
Purpose: Stubs are used when a module being tested relies on the
functionality of another module, which may not be available or fully
implemented at the time of testing.
Testing Focus: Stubs are primarily used in top?down testing
approaches, where higher?level modules are tested before lower?level
modules.
What are Drivers?
Drivers are also dummy implementations, but they are used to simulate the
behavior of higher?level modules or components that invoke the component
being tested. Drivers are employed when testing lower?level components
that are dependent on higher?level components.
The primary purpose of drivers is to create a controlled environment for
testing lower?level components by providing the necessary input parameters
or data that the component expects from the higher?level modules. Drivers
facilitate the execution of the component being tested by mimicking the
behavior of the missing or unavailable higher?level modules. This allows
developers or testers to assess the functionality and performance of the
lower?level component without the need for the actual higher?level modules.
Here are some of the key features of drivers:
Definition: Drivers are software components that enable the testing of
a module in isolation by simulating the behavior and functionality of
the higher?level modules that interact with it.
Testing Focus: Drivers are commonly used in bottom?up testing
approaches, where lower?level modules are tested before higher?level
modules.
Validation checks in software testing ensure the developed product meets
user needs and expectations. It focuses on whether the right product is
being built, confirming it aligns with the intended use and solves the correct
problem. This involves dynamic testing, where the software is executed to
verify functionality, usability, and performance in real-world scenarios.
Key Aspects of Validation Checks:
Meeting User Needs:
Validation testing verifies that the software satisfies the users' requirements and
expectations.
Dynamic Testing:
It involves executing the software to assess its functionality, usability, and
performance.