Unit II
Unit II
list=PLQ-nEJNYlEV29CBLzIDxcogm6CEZjVad2&si=_y70QWFuBDw_dJ
c_
The above Black-Box can be any software system you want to test. For
Example, an operating system like Windows, a website like Google, a
database like Oracle or even your own custom application. Under Black Box
Testing, you can test these applications by just focusing on the inputs and
outputs without knowing their internal code implementation.
Black Box Testing Techniques
Following are the prominent Test Strategy amongst the many used in Black
box Testing
● Equivalence Class Testing: It is used to minimize the number of
possible test cases to an optimum level while maintains reasonable test
coverage.
● Boundary Value Testing: Boundary value testing is focused on the
values at boundaries. This technique determines whether a certain
range of values are acceptable by the system or not. It is very useful in
reducing the number of test cases. It is most suitable for the systems
where an input is within certain ranges.
● Decision Table Testing: A decision table puts causes and their effects in
a matrix. There is a unique combination in each column.
UNIT II
In a testing level hierarchy, unit testing is the first level of testing done before
integration and other remaining levels of the testing. It uses modules for the testing
process which reduces the dependency of waiting for Unit testing frameworks,
stubs, drivers and mock objects are used for assistance in unit testing.Generally, the
software goes under four level of testing: Unit Testing, Integration Testing, System
Testing, and Acceptance Testing but sometimes due to time consumption software
testers does minimal unit testing
Unit Testing
Unit testing involves the testing of each unit or an individual component of the
software application. It is the first level of functional testing. The aim behind unit
testing is to validate unit components with its performance.
A unit is a single testable part of a software system and tested during the
development phase of the application software.
The purpose of unit testing is to test the correctness of isolated code. A unit
component is an individual function or code of the application. White box testing
approach used for unit testing and usually done by the developers.
Whenever the application is ready and given to the Test engineer, he/she will start
checking every component of the module or module of the application
independently or one by one, and this process is known as Unit testing or
components testing.
Some important reasons of Unit testing are:
○ Unit testing helps tester and developers to understand the base of code that
makes them able to change defect causing code quickly.
○ Unit testing fixes defects very early in the development phase that's why
there is a possibility to occur a smaller number of defects in upcoming
testing levels.
1. Amount transfer
1.1 From account number (FAN)→ Text Box
○ To account number(TAN)
○ Amount
○ Transfer
○ Cancel
For the FAN components
Values Description
1234 accept
Copy and paste the value Error message→ type the value
○ Provide the values just like we did in From account number (FAN) components
○ Provide the values just like we did in FAN and TAN components.
○ NUnit
○ JUnit
○ PHPunit
○ Parasoft Jtest
○ EMMA
Advantages and disadvantages of unit testing
The pros and cons of unit testing are as follows:
Advantages
○ Unit testing uses module approach due to that any part can be tested without
waiting for completion of another parts testing.
○ The developing team focuses on the provided functionality of the unit and how
functionality should look in unit test suits to understand the unit API.
○ Unit testing allows the developer to refactor code after a number of days and
ensure the module still working without any defect.
Disadvantages
○ It cannot identify integration or broad level error as it works on units of the code.
○ In the unit testing, evaluation of all execution paths is not possible, so unit testing
is not able to catch each and every error in a program.
Integration testing
Integration testing is the second level of the software testing process comes after unit
testing. In this testing, units or individual components of the software are tested in a
group. The focus of the integration testing level is to expose defects at the time of
interaction between integrated components or units.
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.
Any testing technique (Blackbox, Whitebox, and Greybox) can be used for Integration
Testing
First, we will do functional testing on the login page, which includes the various
components such as username, password, submit, and cancel button. Then only we
can perform integration testing.
○ First, we login as P users and click on the Compose mail and performing the
functional testing for the specific components.
○ Now we click on the Send and also check for Save Drafts.
○ After that, we send a mail to Q and verify in the Send Items folder of P to check if
the send mail is there.
○ Now, we will log out as P and login as Q and move to the Inbox and verify that if
the mail has reached.
Secanrios2: We also perform the integration testing on Spam folders. If the particular
contact has been marked as spam, then any mail sent by that user should go to the
spam folder and not in the inbox.
Note: We will perform functional testing for all features, such as to send items, inbox, and so
on.
As we can see in the below image, we will perform the functional testing for all the text
fields and every feature. Then we will perform integration testing for the related
functions. We first test the add user, list of users, delete user, edit user, and then search
user.
Types of Integration testing
Basically there are two types of integration testing
a) Incremental Integration Testing:
Here modules are added in ascending order one by one or according to need.The
modules are logically connected.They test data flow between modules and correctness
of each module
i) Top Down Integration Testing
ii)Bottom Up Integration Testing
b) Non Incremental Integration Testing:
In this testing all the modules are developed and tested individually,they are integrated
once and tested together at once.
i)Big Bang Integration Testing
Big-Bang Integration Testing
● In simple words, all the modules of the system are simply put
the error as the error may potentially belong to any of the modules
being integrated.
components.
● There will be quite a lot of delay because you would have to wait for
diagnose.
efforts.
costs.
● May not provide enough visibility into the interactions and data
reliability.
In bottom-up testing, each module at lower levels are tested with higher
modules until all modules are tested. It starts the testing with the lowest
units of the application and moving up one by one. Again in this case it might
be possible that higher models may not developed by the time lower
modules are being tested.The primary purpose of this integration testing is
that each subsystem tests the interfaces among various modules making up
the subsystem. This integration testing uses test drivers to drive and pass
appropriate data to the lower-level modules.Drivers are used as a dummy
program as a substitute for the missing modules..
● In this testing, the complexity that occurs when the system is made
be represented.
3. Top-Down Integration Testing
2. Create a test plan: Develop a test plan that outlines the scenarios
that the results of your integration tests are accurate and reliable.
4. Execute the tests: Execute the tests outlined in your test plan,
starting with the most critical and complex scenarios. Be sure to log
application architecture.
6. Repeat testing: Once defects have been fixed, repeat the integration
S.
Unit Testing Integration Testing
No.
3. Validation Testing
Validation Testing ensures that the product actually meets the client's needs.
It can also be defined as to demonstrate that the product fulfills its intended
use when deployed on appropriate environment.