Software Testing Unit 3
Software Testing Unit 3
Software Testing Unit 3
3.1Levels of Testing
Testing levels are the procedure for finding the missing areas and avoiding
overlapping and repetition between the development life cycle stages. We have
already seen the various phases such as Requirement collection, designing, coding
testing, deployment, and maintenance of SDLC (Software Development Life
Cycle)
In order to test any application, we need to go through all the above phases of SDLC.
Like SDLC, we have multiple levels of testing, which help us maintain the quality of
the software.
The levels of software testing involve the different methodologies, which can be used
while we are performing the software testing.
In software testing, we have four different levels of testing, which are as discussed
below:
1. Unit Testing
2. Integration Testing
3. System Testing
4. Acceptance Testing
Level1: Unit Testing
Unit testing is the first level of software testing, which is used to test if software
modules are satisfying the given requirement or not.
Unit testing is also the first level of functional testing. The primary purpose of
executing unit testing is to validate unit components with their performance.
Unit testing will help the test engineer and developers in order to understand the base
of code that makes them able to change defect causing code quickly. The developers
implement the unit.
The second level of software testing is the integration testing. The integration testing
process comes after unit testing.
It is mainly used to test the data flow from one module or component to other
modules.
In integration testing, the test engineer tests the units or separate components or
modules of the software in a group.
The primary purpose of executing the integration testing is to identify the defects at
the interaction between integrated components or units.
When each component or module works separately, we need to check the data flow
between the dependent modules, and this process is known as integration testing.
We only go for the integration testing when the functional testing has been completed
successfully on each application module.
In simple words, we can say that integration testing aims to evaluate the accuracy of
communication among all the modules.
The third level of software testing is system testing, which is used to test the
software's functional and non-functional requirements.
In system testing, we will go through all the necessary modules of an application and
test if the end features or the end business works fine, and test the product as a
complete system.
In simple words, we can say that System testing is a sequence of different types of
tests to implement and examine the entire working of an integrated software computer
system against requirements.
The last and fourth level of software testing is acceptance testing, which is used to
evaluate whether a specification or the requirements are met as per its delivery.
The software has passed through three testing levels (Unit Testing, Integration
Testing, System Testing). Some minor errors can still be identified when the end-
user uses the system in the actual scenario.
In simple words, we can say that Acceptance testing is the squeezing of all the
testing processes that are previously done.
3.2Unit Testing
Unit Testing is a fundamental aspect of software testing where individual
components or functions of a software application are tested in isolation. This
method ensures that each unit of the software performs as expected. By focusing on
small, manageable parts of the application, unit testing helps identify and fix bugs
early in the development process, significantly improving code quality and
reliability.
Unit tests are typically automated and written by developers using various
frameworks such as JUnit, NUnit, or pytest. These tests validate the correctness of
code by checking that each function or method returns the expected results given
specific inputs.
The main goal of unit testing is to ensure that each unit of the software performs as
intended and meets requirements. Unit tests help make sure that software is working
as expected before it is released.
Unit testing uses modules for testing purpose, and these modules are combined and
tested in integration testing. The Software is developed with a number of software
modules that are coded by different coders or programmers. The goal of integration
testing is to check the correctness of communication among all the modules.
Once all the components or modules are working independently, then we need to
check the data flow between the dependent modules is known as integration testing.
Let us see one sample example of a banking application, as we can see in the below
image of amount transfer.
o First, we will login as a user P to amount transfer and send Rs200 amount, the
confirmation message should be displayed on the screen as amount transfer
successfully. Now logout as P and login as user Q and go to amount balance
page and check for a balance in that account = Present balance + Received
Balance. Therefore, the integration test is successful.
o Also, we check if the amount of balance has reduced by Rs200 in P user
account.
o Click on the transaction, in P and Q, the message should be displayed
regarding the data and time of the amount transfer.
Define Test Cases: For each scenario, testers define test cases that describe
the sequence of steps required to perform the scenario. Test cases include
inputs, expected outputs, and any specific conditions or data required for the
scenario.
Execute Tests: Testers execute the test cases against the application,
following the defined scenarios. This may involve interacting with the use5 r
interface, APIs, databases, or any other components of the system.
Verify Results: After executing each test case, testers verify that the
application behaves as expected and produces the correct outcomes. They
compare the actual results with the expected results specified in the test cases.
Report Defects: If any discrepancies are found between the actual and
expected results, testers report them as defects or issues. Developers then
investigate and fix the defects, and the tests are rerun to verify that the issues
have been resolved.
System Testing
System Testing Process
System Testing is performed in the following steps:
Test Environment Setup: Create testing environment for the better quality
testing.
Create Test Case: Generate test case for the testing process.
Create Test Data: Generate the data that is to be tested.
Execute Test Case: After the generation of the test case and the test data, test
cases are executed.
Defect Reporting: Defects in the system are detected.
Regression Testing: It is carried out to test the side effects of the testing
process.
Log Defects: Defects are fixed in this step.
Retest: If the test is not successful then again test is performed.
System Testing Process
Real-life example of System testing
1. Suppose a car-making company has already made systems like the ignition
system, braking system, engine, fuel system, accelerator, GPS, air conditioner,
etc., which were tested individually(Unit testing). The collaboration of these
systems is tested(integration testing) for example the fuel system is checked in
collaboration with the car engine. But when all systems are ready, the company
will check all the systems working by actually driving the car to check if all the
systems are working fine with each other. That will be system testing.
2. Suppose an e-commerce website has different modules like a registration page,
Login page, card, dashboard, payment page, etc. These modules are tested by the
developer first, which will be unit testing. The two or more modules will be
tested in collaboration with each other. That will be integration testing. But after
the completion of all the modules, when the overall website functioning is tested,
then that is called system testing.
The main actions pertaining to a site’s functionality are worked and analyzed
upon in order to not get confused
Usability issues and bugs are identified and fixed
The functional aspects of a website or application should be efficient enough
Other usability problems should also be identified and fixed.