Unit Testing
❑A unit test is a piece of code that invokes a unit of work and checks
one specific end result of that unit of work.
❑ Unit testing is understood as testing small parts of the code in
isolation.
❑ It is done within the development process and aids in discovering
software defects at an early stage, preventing them from affecting the
other parts of the application.
Unit Testing
❑ Driver
▪Sometimes unit to be tested need input from another unit/module, and
that unit may not be implemented or under development. In such a
situation, we need to simulate the inputs required in the module to be
tested. This module, where the required inputs for the module under test
are simulated for the purpose of module or unit testing, is known as a
driver module.
Unit Testing
❑ Stubs
▪The module under testing may also call some other module that is not
ready at the time of testing. These modules also need to be simulated for
testing. For this dummy modules are prepared, which is known as stubs
Unit Testing Example
(a) Suppose main() module is not ready for the
testing of calsum() module. Design a driver
module for main().
(b) Modules caldiff() and calmul() are not
ready when called in main(). Design stubs for
these two modules.
Unit Testing Example
• driver
module for main(). Stub for caldiff() Module and
calmul() Module
System Testing
❑ System Testing is a type of software testing that evaluates the overall
functionality and performance of a complete and fully integrated
software solution.
❑ It tests if the system meets the specified requirements and if it is
suitable for delivery to the end-users.
❑ System Testing (ST) is a black box testing technique performed to
evaluate the complete system.
System Testing
❑ Different Types
▪ Performance Testing: This tests how the system performs under different
conditions, like high traffic or heavy use, to ensure it can handle the expected
load.
▪ Security Testing: This ensures the system’s security measures protect
sensitive data from unauthorized access or attacks.
▪ Compatibility Testing: This makes sure the system works well across
different hardware, software, and network environments.
▪ Usability Testing: This evaluates how easy and user-friendly the system is,
making sure it provides a good experience for users.
▪ Recovery Testing: It is the ability of a system to restart operations after the
integrity of the application has been lost. It reverts to a point where the system
was functioning correctly and then, reprocesses the transactions to the point of
failure.
System Testing
❑ Different Types
▪Load Testing: When a system is tested with a load that causes it to
allocate its resources in maximum amounts, it is called load testing.
▪Stress Testing: Stress testing tries to break the system under test by
overwhelming its resources to find the circumstances under which it
will crash.
Advantages of System Testing
❑ It checks the entire functionality of the system with different test
scripts and also it covers the technical and business requirements of
clients.
❑ The testing environment is similar to that of the real time production
or business environment.
❑ Improves system reliability and quality.
❑ Improves the system’s maintainability and scalability.
Non-Functional Testing
❑ Non-Functional Testing is defined as a type of Software testing to
check non-functional aspects (performance, usability, reliability, etc)
of a software application.
Performance Testing
❑ This tests how the system performs under different conditions, like
high traffic or heavy use, to ensure it can handle the expected load.
❑ The goal of performance testing is not to find bugs but to eliminate
performance bottlenecks
❑ Someof the factors that governs Performance testing are Throughput,
Response Time, Tuning and Benchmarking
Recovery Testing
❑ Recovery testing is a type of non-functional testing technique
performed in order to determine how quickly the system can recover
after it has gone through system crash or hardware failure.
❑ Database
Recovery, Load and Stress Recovery, Crash Recovery, Data
Recovery etc
Usability Testing
❑ Usability
testing, a non-functional testing technique that is a measure
of how easily the system can be used by end users.