0% found this document useful (0 votes)
37 views12 pages

SE File

Uploaded by

ares4006115
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)
37 views12 pages

SE File

Uploaded by

ares4006115
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/ 12

Experiment No:7

Aim: -To perform unit testing and integration testing.

Unit Testing:- Unit testing, a testing technique using which individual modules are
tested to determine if there are any issues by the developer himself. It is concerned with
functional correctness of the standalone modules. The main aim is to isolate each unit
of the system to identify, analyze and fix the defects.
Unit Testing Life
cycle:-

Advantages of unit testing:

• Defects are found at an early stage. Since it is done by the dev team by testing
individual pieces of code before integration, it helps in fixing the issues early on in
source code without affecting other source codes.
• It helps maintain the code. Since it is done by individual developers, stress is being
put on making the code less inter dependent, which in turn reduces the chances of
impacting other sets of source code.
• It helps in reducing the cost of defect fixes since bugs are found early on in the
development cycle.
• It helps in simplifying the debugging process. Only latest changes made in the code
need to be debugged if a test case fails while doing unit testing.
Disadvantages:
• It’s difficult to write good unit tests and the whole process may take a lot of time
• A developer can make a mistake that will affect the whole system.
• Not all errors can be detected, since every module it tested separately and later
different integration bugs may appear.
• Testing will not catch every error in the program, because it cannot evaluate every
execution path in any but the most trivial programs. This problem is a superset of the
halting problem, which is un decidable.
• The same is true for unit testing. Additionally, unit testing by definition only tests the
functionality of the units themselves. Therefore, it will not catch integration errors or
broader system-level errors (such as functions performed across multiple units, or
non-functional test areas such as performance).
• Unit testing should be done in conjunction with other software testing activities, as
they can only show the presence or absence of particular errors; they cannot prove a
complete absence of errors.
• To guarantee correct behaviour for every execution path and every possible input,
and ensure the absence of errors, other techniques are required, namely the
application of formal methods to proving that a software component has no
unexpected behaviour. Unit Testing Techniques:
1. Black Box Testing - Using which the user interface, input and output are tested.
2. White Box Testing - used to test each one of those functions behavior is tested.
3. Gray Box Testing - Used to execute tests, risks and assessment methods.

Integration Testing:- It tests integration or interfaces between components,


interactions to different parts of the system such as an operating system, file system and
hardware or interfaces between systems.
• Also after integrating two different components together we do the integration
testing.
As displayed in the image below when two different modules ‘Module A’ and
‘Module B’ are integrated then the integration testing is done.

• Integration testing is done by a specific integration tester or test team.


• Integration testing follows two approach known as ‘Top Down’ approach and
‘Bottom Up’ approach as shown in the image below:

Below are the integration testing techniques:


1. Big Bang integration testing: - In Big Bang integration testing all components
or modules are integrated simultaneously, after which everything is tested as a
whole. As per the below image all the modules from ‘Module 1’ to ‘Module 6’ are
integrated simultaneously then the Testing is carried out.

Advantage: Big Bang testing has the advantage that everything is finished before
integration testing starts.

Disadvantage: The major disadvantage is that in general it is time consuming and


difficult to trace the cause of failures because of this late integration.

2. Top-down integration testing: Testing takes place from top to bottom,


following the control flow or architectural structure (e.g. starting from the GUI or
main menu). Components or systems are substituted by stubs. Below is the diagram
of ‘Top down Approach”

Advantages of Top-Down approach:


• The tested product is very consistent because the integration testing is basically
performed in an environment that almost similar to that of reality
• Stubs can be written with lesser time because when compared to the drivers then Stubs
are simpler to author.
Disadvantages of Top-Down approach:
• Basic functionality is tested at the end of cycle
3. Bottom-up integration testing: Testing takes place from the bottom of the
control flow upwards. Components or systems are substituted by drivers. Below is
the image of ‘Bottom up approach’:

Advantage of Bottom-Up approach:


• In this approach development and testing can be done together so that the product
or application will be efficient and as per the customer specifications.

Disadvantages of Bottom-Up approach:


• We can catch the Key interface defects at the end of cycle
• It is required to create the test drivers for modules at all levels except the top
control

System Testing: - System Testing (ST) is a black box testing technique performed to
evaluate the complete system the system's compliance against specified requirements.
In System testing, the functionalities of the system are tested from an end-to-end
perspective. System Testing is usually carried out by a team that is independent of the
development team in order to measure the quality of the system unbiased. It includes
both functional and Non- Functional testing.
Experiment No:8

Aim: - To perform various white box and black box testing techniques.
White Box Testing: -
White Box Testing is the testing of a software solution's internal coding and
infrastructure. It focuses primarily on strengthening security, the flow of inputs and
outputs through the application, and improving design and usability. White box testing
is also known as Clear Box testing, Open Box testing, Structural testing, Transparent
Box testing, Code-Based testing, and Glass Box testing.
It is one of two parts of the "box testing" approach of software testing. Its counter-
part, black box testing, involves testing from an external or end-user type perspective.
On the other hand, White box testing is based on the inner workings of an application
and revolves around internal testing.
The term "white box" was used because of the see-through box concept. The clear box
or white box name symbolizes the ability to see through the software's outer shell (or
"box") into its inner workings. Likewise, the "black box" in "Black Box Testing"
symbolizes not being able to see the inner workings of the software so that only the end-
user experience can be tested.

What do you verify in White Box Testing


White box testing involves the testing of the software code for the following:
• Internal security holes
• Broken or poorly structured paths in the coding processes
• The flow of specific inputs through the code
• Expected output
• The functionality of conditional loops
• Testing of each statement, object and function on an individual basis
The testing can be done at system, integration and unit levels of software development.
One of the basic goals of white box testing is to verify a working flow for an application.
It involves testing a series of predefined inputs against expected or desired outputs so
that when a specific input does not result in the expected output, you have encountered
a bug.
How do you perform White Box Testing
To give you a simplified explanation of white box testing, we have divided it into two
basic Steps. This is what testers do when testing an application using the white box testing
technique:
Step 1) Understand the source code
The first thing a tester will often do is learn and understand the source code of the
application. Since white box testing involves the testing of the inner workings of an
application, the tester must be very knowledgeable in the programming languages used
in the applications they are testing. Also, the testing person must be highly aware of
secure coding practices. Security is often one of the primary objectives of testing
software. The tester should be able to find security issues and prevent attacks from
hackers and naive users who might inject malicious code into the application either
knowingly or unknowingly.
Step 2) Create test cases and execute
The second basic step to white box testing involves testing the application's source code
for proper flow and structure. One way is by writing more code to test the application's
source code. The tester will develop little tests for each process or series of processes in
the application. This method requires that the tester must have intimate knowledge of
the code and is often done by the developer. Other methods include Manual Testing, trial
and error testing and the use of testing tools as we will explain further on in this article.

White Box Testing Techniques


The 3 main White Box Testing Techniques are:
• Statement Coverage
• Branch Coverage
• Path Coverage
Let’s understand these techniques one by one with a simple example.
• Statement coverage:
In a programming language, a statement is nothing but the line of code or instruction for
the computer to understand and act accordingly. A statement becomes an executable
statement when it gets compiled and converted into the object code and performs the
action when the program is in a running mode.
Hence “Statement Coverage”, as the name itself suggests, it is the method of validating
whether each and every line of the code is executed at least once.
• Branch Coverage:
“Branch” in a programming language is like the “IF statements”. An IF statement has
two branches: True and False. So in Branch coverage (also called Decision coverage),
we validate whether each branch is executed at least once.
In case of an “IF statement”, there will be two test
conditions: • One to validate the true branch and,
• Other to validate the false branch.
Hence, in theory, Branch Coverage is a testing method which is when executed ensures
that each and every branch from each decision point is executed.
• Path Coverage:
Path coverage tests all the paths of the program. This is a comprehensive technique
which ensures that all the paths of the program are traversed at least once. Path Coverage
is even more powerful than Branch coverage. This technique is useful for testing the
complex programs.
Types of White Box Testing
White box testing encompasses several testing types used to evaluate the usability of an
application, block of code or specific software package. There are listed below --

Unit Testing: It is often the first type of testing done on an application. Unit testing is
performed on each unit or block of code as it is developed. Unit Testing is essentially
done by the programmer. As a software developer, you develop a few lines of code, a
single function or an object and test it to make sure it works before continuing. Unit
testing helps identify majority of bugs, early in the software development lifecycle. Bugs
identified in this stage are cheaper and easy to fix.
Testing for Memory Leaks: - Memory leaks are the most important causes of slower
running applications. A QA specialist who is experienced at detecting memory leaks is
essential in cases where you have a slow running software application. There are many
tools available to assist developers/testers with memory leak testing, example, Rational
Purify for windows application. Apart from above a few testing types are part of both
black box and white box testing. They are listed as below:
White Box Penetration Testing: In this testing, the tester/developer has full
information of the application's source code, detailed network information, IP addresses
involved and all server information the application runs on. The aim is to attack the code
from several angles to expose security threats
White Box Mutation Testing: Mutation testing is often used to discover the best coding
techniques to use for expanding a software solution.
Integration Testing: - Integration testing is a level of software testing where individual
units are combined and tested as a group. The purpose of this level of testing is to expose
faults in the interaction between integrated units. Test drivers and test stubs are used to
assist in Integration Testing.
Advantages of White Box Testing: - •
Code optimization by finding hidden
errors.
• White box tests cases can be easily automated.
• Testing is more thorough as all code paths are usually covered.
• Testing can start early in SDLC even if GUI is not available.
Disadvantages of White Box Testing: -
• White box testing can be quite complex and expensive.
• Developers who usually execute white box test cases detest it. The white box testing
by developers is not detailed can lead to production errors.
• White box testing requires professional resources, with a detailed understanding of
programming and implementation.
• White-box testing is time-consuming, bigger programming applications take the time
to test fully
Black Box Testing
Black box testing is a software testing techniques in which functionality of the software
under test (SUT) is tested without looking at the internal code structure, implementation
details and knowledge of internal paths of the software. This type of testing is based
entirely on the software requirements and specifications. In Black Box Testing we just
focus on inputs and output of the software system without bothering about internal
knowledge of the software program.

Black Box Testing – Steps: -


Here are the generic steps followed to carry out any type of Black Box Testing.
• Initially requirements and specifications of the system are examined.
• Tester chooses valid inputs (positive test scenario) to check whether SUT processes
them correctly. Also some invalid inputs (negative test scenario) are chosen to verify
that the SUT is able to detect them.
• Tester determines expected outputs for all those inputs.
• Software tester constructs test cases with the selected inputs.
• The test cases are executed.
• Software tester compares the actual outputs with the expected outputs.
• Defects if any are fixed and re-tested.
Types of Black Box Testing
There are many types of Black Box Testing but following are the prominent ones -
• Functional testing - This black box testing type is related to functional requirements
of a system; it is done by software testers.
• Non-functional testing - This type of black box testing is not related to testing of a
specific functionality, but non-functional requirements such as performance,
scalability, usability.
• Regression testing - Regression Testing is done after code fixes, upgrades or any other
system maintenance to check the new code has not affected the existing code.

Black box testing strategy:


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 mostly suitable for
the systems where input is within certain ranges.
• Decision Table Testing: A decision table puts causes and their effects in a matrix.
There is unique combination in each column.

Advantages of Black Box


Testing Tester can be non-
technical.
• Used to verify contradictions in actual system and the specifications.
• Test cases can be designed as soon as the functional specifications are complete

Disadvantages of Black Box Testing


• The test inputs needs to be from large sample space.
• It is difficult to identify all possible inputs in limited testing time. So writing test cases
is slow and difficult
• Chances of having unidentified paths during this testing
Experiment No:9

Aim: - Testing of a web site


Website Testing refers to testing end-user scenarios on a website to test its
behaviour. These end-user scenarios are scripted by QAs using an automation
framework to mimic user interactions on a website’s UI. QAs can also follow a
written test plan that describes a set of unique test scenarios under manual
website testing.
For example, a test script can be written to test a website’s Login page. This
script will verify if the Username and Password fields accept appropriate inputs
and check whether the Login was successful.

Types of Website Testing

1. Functionality Testing: This type of testing focuses on checking if


all the features and functionalities of the website are working as intended.
2. Usability Testing: assesses how user-friendly and intuitive the
website layout, design, and overall UX is.
3. Compatibility Testing: ensures the website functions correctly
across different device-browsers-OS combinations with any
inconsistencies in rendering or behavior.
4. Cross-Browser Testing: Cross-browser testing is crucial as it
ensures the website looks and functions correctly across browsers like
Chrome, Firefox, Safari, and Edge.
5. Responsive Testing: This testing ensures that the website’s layout
and design adapt appropriately to different screen sizes and devices,
providing a consistent user experience across desktops, tablets, and
smartphones.
6. Accessibility Testing: evaluates whether the website is usable by
individuals with disabilities. QA checks if the website adheres to
accessibility standards under WCAG testing.
7. Performance Testing: evaluates the website’s speed,
responsiveness, and overall performance.
8. User Acceptance Testing (UAT): UAT involves having end-users
test the website to validate that it meets their requirements and
expectations.
9. Regression Testing: Regression testing involves retesting the
website after making changes or updates to ensure that new features or
fixes don’t introduce new issues or break existing functionalities.
10. Localization Testing: If the website is designed to be used in
multiple languages or regions, localization testing checks if the content,
formatting, and functionality work correctly for each specific locale.

How to perform Website Testing?


1. Ensure Cross Browser Compatibility
Each browser has its rendering engine. Moreover, rendering engines might also
differ for different browser versions. There’s a high probability of a website
rendering uniquely across distinct browsers. In simple terms, a website’s
appearance may get inconsistent across distinct browsers or browser versions.

 To avoid these inconsistencies in the viewing experience, QAs must


thoroughly perform cross-browser testing for their websites.
 This will help teams optimize the website’s viewing experience for all the
leading browsers and fix rendering issues appearing for specific
browsers.
 A tool like Browser Stack can be convenient in such a case as it instantly
empowers QAs to run cross-browser tests across 3000+ real device
browser combinations.
2. Test for Responsiveness
A responsive layout enables websites to resize themselves dynamically per the
screen sizes in which it is viewed. Nearly 60% of incoming website
traffic comes from mobile devices.

 Mobile users can not be ignored.


 Developers must ensure that their websites are mobile responsive, so that
end users have an optimal viewing experience across diverse screen
resolutions.
 A mobile-responsive design is essential because Google has moved to a
mobile-first indexing algorithm.
 This means opting for a responsive design elevates your SEO efforts.
 However, it is critical to remember that responsive design can also
introduce issues, such as misaligned buttons or links that are difficult to
tap.
To fix those issues in advance, it is ideal to use an online responsive design
checker tool that helps you view your websites across distinct device types
(mobiles, tablets, desktops).

You might also like