0% found this document useful (0 votes)
28 views46 pages

Lecture 15 - Introduction To Software Testing-1721286822153

Uploaded by

Chirag sharma
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)
28 views46 pages

Lecture 15 - Introduction To Software Testing-1721286822153

Uploaded by

Chirag sharma
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/ 46

Software Project

Management
Lecture 15
Introduction to Software Testing
Can you recall Design Patterns and
1
their categories

Can you explain Reusability and


2
Maintainability

Can you explain UML (Unified


3
Modeling Language)
Session Objective
By the end of this class, you will be able to:

▪ Explore fundamentals of software


testing.
▪ Comprehend the Test-Driven
Development (TDD) cycle and its
step-by-step iterative process.
▪ Recognize the importance of TDD.
▪ Learn how TDD contributes to enhanced
software maintainability, scalability, and
overall development efficiency.
Learn about Software Testing ,
purpose and its types

Learn about Software Testing


Principles

Learn about Test-Driven


Development (TDD)
What is
Software Testing ?
Software testing is a crucial process in the development of
software applications and systems. It involves evaluating and
verifying whether the software meets its intended
requirements, functions correctly, and performs as expected.
Purpose of Software Testing

Identifying Defects: Software testing aims to find and report defects or


errors in the software, which could be logical mistakes, coding errors.

Ensuring Quality: Testing helps ensure that the software meets the
desired quality standards and performs its functions correctly.

Validating Requirements: Testing validates that the software fulfills the


specified requirements and business needs.

Reducing Maintenance Costs: By finding and fixing defects early in the


development process, software testing can reduce the cost and effort
required for post-release maintenance and support.
Building Confidence: Thorough testing instills confidence in the
stakeholders (developers, testers, managers, customers) that the
software is reliable and performs as intended.
Importance of Software Testing

Error Customer Continuous


Detection Satisfaction Improvement

01 02 03 04 05

Quality Risk
Assurance Mitigation
Types of Software
Testing
Types of Software Testing

Manual testing Automation testing

The process of checking the Automation testing is a process of


functionality of an application as per converting any manual test cases into
1 the customer needs without taking any 2 the test scripts with the help of
help of automation tools is known as automation tools, or any programming
manual testing. language is known as automation
testing.
Types of Manual testing

White box testing Black box testing Gray box testing

White Box testing is a Black Box is a software Gray Box Testing Technique
software testing type in testing type that has uses effective combination
which the detailed nothing to do with the of both Black Box testing
investigation of the internal internal structure or techniques and White Box
structure and logic of the workings of the codes. The testing techniques. Grey
application is conducted. software tester doesn’t Box testing techniques
need to know the system increase testing coverage
architecture or source code. by focusing on all the layers
of a complex system.
Types of Automation Testing

Unit System Regression


Testing Testing Testing

01 02 03 04 05

Integration Acceptance
Testing Testing
Learn about Software Testing ,
purpose and its types

Learn about Software Testing


Principles

Learn about Test-Driven Development


(TDD)
Software Testing
Principles
Software testing is a procedure of implementing software or
the application to identify the defects or bugs. For testing an
application or software, we need to follow some principles to
make our product defects free, and that also helps the test
engineers to test the software with their effort and time.

There are seven essential principles of software testing.


1. Testing shows the presence of defect

▪ The test engineer will test the application to


make sure that the application is bug or
defects free. While doing testing, we can only
identify that the application or software has
any errors.
▪ The primary purpose of doing testing is to
identify the numbers of unknown bugs with
the help of various methods and testing
techniques because the entire test should be
traceable to the customer requirement, which
means that to find any defects that might
cause the product failure to meet the client's
needs.
2. Exhaustive Testing is not possible

▪ Sometimes it seems to be very hard to test all


the modules and their features with effective
and non- effective combinations of the inputs
data throughout the actual testing process.
3. Early Testing

▪ Here early testing means that all the testing


activities should start in the early stages of the
software development life cycle's requirement
analysis stage to identify the defects because
if we find the bugs at an early stage, it will be
fixed in the initial stage itself, which may cost
us very less as compared to those which are
identified in the future phase of the testing
process.
4. Defect clustering

▪ The defect clustering defined that throughout


the testing process, we can detect the
numbers of bugs which are correlated to a
small number of modules.
▪ We have various reasons for this, such as the
modules could be complicated; the coding part
may be complex, and so on.
5. Pesticide paradox

▪ This principle defined that if we are executing


the same set of test cases again and again
over a particular time, then these kinds of the
test will not be able to find the new bugs in the
software or the application.
▪ To get over these pesticide paradoxes, it is
very significant to review all the test cases
frequently. And the new and different tests are
necessary to be written for the
implementation of multiple parts of the
application or the software, which helps us to
find more bugs.
6. Testing is context-dependent

▪ Testing is a context-dependent principle


states that we have multiple fields such as
e-commerce websites, commercial websites,
and so on are available in the market. There is
a definite way to test the commercial site as
well as the e-commerce websites because
every application has its own needs, features,
and functionality.
▪ To check this type of application, we will take
the help of various kinds of testing, different
technique, approaches, and multiple methods.
7. Absence of errors fallacy

▪ Once the application is completely tested and


there are no bugs identified before the
release, so we can say that the application is
99 percent bug-free.
▪ But there is the chance when the application is
tested beside the incorrect requirements,
identified the flaws, and fixed them on a given
period would not help as testing is done on the
wrong specification, which does not apply to
the client's requirements.
Learn about Software Testing ,
purpose and its types

Learn about Software Testing


Principles

Learn about Test-Driven Development


(TDD)
Testing Levels
The levels of software testing involve the different
methodologies, which can be used while we are performing
the software testing.

There are 4 levels of testing


Levels of Testing

1. Unit Testing

▪ Unit testing is the lowest level of testing and focuses


on verifying the individual units or components of the
software in isolation.
▪ Each unit is tested independently to ensure that it
functions correctly as per its design.
▪ Developers typically perform unit testing, and it helps
detect bugs early in the development process.
Levels of Testing continue..

2. Integration Testing
▪ Integration testing comes after unit testing and
involves testing the interactions and interfaces
between different units or modules of the software.
▪ The purpose is to identify any issues that may arise
when combining multiple units and to ensure the
integrated system works as expected.
Levels of Testing continue..

3. System Testing
▪ System testing is conducted once the integration
testing is completed. It tests the entire software
system as a whole, considering both functional and
non-functional aspects.
▪ The primary goal is to validate that the software meets
the specified requirements and performs as expected
in the target environment.
Levels of Testing continue..

4. Acceptance Testing
▪ Acceptance testing is the final testing level and is
performed to determine whether the software meets
the acceptance criteria defined by the stakeholders,
including end-users or customers. It can be further
divided into two sub-levels:
▪ User Acceptance Testing (UAT): Involves
end-users testing the software in a real-world
scenario to ensure it aligns with their needs and
expectations.
▪ Business Acceptance Testing (BAT): Performed by
business representatives to verify that the
software meets business requirements and
objectives.
Software Testing Process

Test Planning: Defining the scope, objectives, resources, and schedule for
testing. Test planning involves identifying the testing types, techniques,
and methodologies to be used.

Test Design: Creating test cases and test scenarios based on requirements
and specifications. Test data and test environments are also prepared
during this stage.

Test Execution: Running the test cases and observing the software's
behavior to detect defects or deviations from expected results.

Defect Reporting: If any defects are found during test execution, they are
documented and reported to the development team for fixing.

Defect Retesting: After the development team fixes the reported defects,
the testing team retests them to verify that the issues have been resolved.
Test-Driven Development
(TDD)
Test-Driven Development (TDD) is a software development
approach that emphasizes writing tests before writing the
actual code. The TDD process typically follows a three-step
cycle: write a test, write the code to pass the test, and then
refactor the code if necessary.
Principles of Test-Driven Development

Write Tests First Write Minimal Code Refactor Code

In TDD, the developer starts The next step is to write the After making the test pass,
by writing a test case for a minimum amount of code the developer refactors the
specific functionality or required to make the failing code to improve its design
requirement. test case pass. and maintainability while
ensuring that all tests
This test case initially fails The code is not optimized or continue to pass.
since the corresponding extended beyond what is
code has not been necessary to satisfy the
implemented yet. test.
Importance of Test-Driven Development (TDD)

Enhanced Code Quality: TDD encourages developers to think critically


about the requirements and design of their code before implementation.

Quick Feedback Loop: TDD provides developers with rapid feedback on


their code. When a test fails, developers know immediately that there is an
issue to address.

Better Design: Since tests are written before the code, TDD drives
developers to think about the interfaces and interactions between
different components of the software.

Code Refactoring: TDD promotes continuous refactoring of code to


improve its design and maintainability.

Reduced Debugging Time: By writing tests upfront, TDD helps identify


defects early in the development process.
Advantages of Using Test-Driven Development

▪ Improved Code Quality: TDD encourages developers to


focus on writing code that satisfies specific test cases.

▪ Early Detection of Defects: Writing tests first allows


developers to identify defects early in the development
process, making it easier to fix them.

▪ Faster Feedback Loop: TDD provides rapid feedback to


developers when a test fails.

▪ Better Design: The practice of writing tests first often


leads to a more modular, maintainable, and loosely
coupled codebase.
TDD Cycle
The TDD cycle, often referred to as "Red-Green-Refactor," is
a fundamental process in Test-Driven Development. It
consists of three phases that developers iterate through
when creating code using the TDD approach. Each phase
serves a specific purpose in ensuring code quality, reliability,
and maintainability.
Phases of TDD Cycle

Red Phase Green Phase Refactor Phase

In the Red phase, the In the Green phase, the In the Refactor phase, the
developer starts by writing a developer writes the developer improves the
test case for a specific minimum amount of code code's design, structure,
functionality that is yet to be necessary to make the and efficiency without
implemented. failing test pass. changing its behavior.

This test case is expected to The primary objective is to The goal is to make the
fail since the corresponding make the test case succeed code more maintainable,
code is not present in the by implementing the understandable, and
codebase. required functionality or aligned with best practices.
logic.
Advantages of TDD Cycle

▪ Higher Code Quality: The TDD cycle promotes the


creation of reliable, well-tested code.

▪ Early Detection of Defects: Writing tests first helps


identify defects early in the development process.

▪ Faster Development Feedback: The rapid feedback


loop provided by TDD helps developers catch issues
and validate code changes quickly.

▪ Better Code Design: The practice of writing tests


before implementation encourages better code design
and more thoughtful architecture.
Applying TDD in Real-World Scenarios

TDD in Unit Testing TDD in Integration Testing TDD in System Testing

In unit testing, individual In integration testing, the In system testing, the entire
units or components of the interactions and interfaces software system is
software are tested in between different units or evaluated to ensure it
isolation to ensure they modules of the software are meets the specified
function correctly. tested. requirements and functions
correctly. Although system
TDD is particularly testing involves testing the
well-suited for unit testing. software as a whole.
w le dge
e fo r K no
Ti m ck ! !
C h e
Quiz

Which of the following is NOT a principle of software testing?

Choose the Correct Answer


a b

Testing shows the presence of defects Early testing saves time and money

c d

Exhaustive testing is possible Defect clustering


Quiz

Which of the following is NOT a principle of software testing?

Choose the Correct Answer


a b

Testing shows the presence of defects Early testing saves time and money

c d

Exhaustive testing is possible Defect clustering


Principles of Software Testing

Consider a simple application, such as a calculator. Write down different test


cases to check each function (e.g., addition, subtraction, multiplication,
division). Execute these test cases to identify any defects. Reflect on how
following testing principles, such as early testing and defect clustering, could
help improve the testing process and make it more efficient.
Learn about Software Testing ,
purpose and its types

Learn about Software Testing


Principles

Learn about Test-Driven


Development (TDD)

You might also like