Ste Question
Ste Question
CO2 :Prepare test cases for different types and levels of testing.
Levels of Testing
Unit Testing
Unit Testing is a level of software testing where individual units/ components of a
software are tested. The purpose is to validate that each unit of the software performs
as designed.
Unit Testing is the first level of testing and is performed prior to Integration Testing.
A unit is the smallest testable part of software. It usually has one or a few inputs and
usually a single output.
It is executed by the Developer.
Unit Testing is performed by using the White Box Testing method
Example: - A function, method, Loop or statement in program is working fine.
Page 1
Unit 2: Types and Levels of Testing
Drivers
Stubs
Page 3
Unit 2: Types and Levels of Testing
1. Stubs and Drivers works as a substitute for the missing or unavailable module.
2. They are specifically developed, for each module, having different functionalities.
3. Generally, developers and unit testers are involved in the development of stubs and
drivers.
4. Their most common use may be seen in the integration incremental testing, where
stubs are used in top bottom approach and drivers in a bottom up approach.
Integration Testing
Integration Testing is a level of software testing where individual units are combined and
tested as a group.
In integration Testing, individual software modules are integrated logically and tested
as a group.
Page 4
Unit 2: Types and Levels of Testing
As displayed in the image below when two different modules ‘Module A’ and
‘Module B’ are integrated then the integration testing is done.
1. Incremental Approach:
In this approach, testing is done by joining two or more modules that are logically
related. Then the other related modules are added and tested for the proper
functioning. Process continues until all of the modules are joined and tested
successfully.
This process is carried out by using dummy programs called Stubs and Drivers. Stubs and
Drivers do not implement the entire programming logic of the software module but just
simulate data communication with the calling module.
Page 5
Unit 2: Types and Levels of Testing
Page 6
Unit 2: Types and Levels of Testing
The strategy in top-down integration is look at the design hierarchy from top to bottom. Start
with the high - level modules and move downward through the design hierarchy. In this approach
testing is conducted from main module to sub module. If the sub module is not developed a
temporary program called STUB is used for simulate the sub module. Modules subordinate to the
top modules are integrated in the following two ways:
1. Depth first Integration: In this type, all modules on major control path of the design
hierarchy are integrated first. In this example shown in fig. modules 1, 2, 4/5 will be integrated
first. Next, modules 1, 3, 6 will be integrated.
2. Breadth first Integration: In this type, all modules directly subordinate at each level, moving
across the design hierarchy horizontally, are integrated first. In the example shown in figure
modules 2 and 3 will be integrated first. Next, modules 4,5 and 6 will be integrated .
Procedure:
The procedure for Top-Down integration process is discussed in the following steps:
1. Start with the top or initial module in the software. Substitute the stubs for all the
subordinate of the top module. Test the top module.
2. After testing the top module, stubs are replaced one at a time with the actual modules
for integration.
3. Perform testing on this recent integrated environment.
4. Regression testing may be conducted to ensure that new errors have not appeared.
5. Repeat steps 2-4 for whole design hierarchy.
Advantages:
Advantageous if major flaws occur toward the top of the program.
Once the I/O functions are added, representation of test cases is easier.
Early skeletal Program allows demonstrations and boosts morale.
Disadvantages:
Page 7
Unit 2: Types and Levels of Testing
4. Bottom up Integration
In this approach testing is conducted from sub module to main module, if the main module is not
developed a temporary program called DRIVERS is used to simulate the main module.
Advantages:
Advantageous if major flaws occur toward the bottom of the program.
Test conditions are easier to create.
Observation of test results is easier.
Driver Modules must be produced.
The program as an entity does not exist until the last module is added
Disadvantages:
Page 8
Unit 2: Types and Levels of Testing
Critical modules (at the top level of software architecture) which control the flow
of application are tested last and may be prone to defects.
Early prototype is not possible
4. Using stubs, it tests the user interface in isolation as well as tests the very lowest
level functions using drivers.
6. Bottom-up testing is a process where lower level modules are integrated and then tested.
7. This process is repeated until the component of the top of the hierarchy is analyzed.
It helps custom software development services find bugs easily without any problems.
8. Top down testing is a process where the top integrated modules are tested and the
procedure is continued till the end of the related module.
9. Top down testing helps developers find the missing branch link easily
Page 9
Unit 2: Types and Levels of Testing
Advantages:
1. Sandwich approach is useful for very large projects having several subprojects.
2. Both Top-down and Bottom-up approach starts at a time as per development schedule.
3. Units are tested and brought together to make a system Integration is done downwards.
Disadvantages:
1. It require very high cost for testing because one part has Top-down approach while another
part has bottom-up approach.
2. It cannot be used for smaller system with huge interdependence between different modules.
It makes sense when the individual subsystem is as good as complete system.
The idea behind Unit Testing is to test The idea behind Integration Testing is to
each part of the program and show that combine modules in the application and
the individual parts are correct. test as a group to see that they are
working fine
It can be performed at any time It usually carried out after Unit Testing
and before System Testing
Unit Testing tests only the functionality Integrating testing may detect errors
of the units themselves and may not when modules are integrated to build the
catch integration errors, or other overall system
system-wide issues
It starts with the module specification It starts with the interface specification
Unit test does not verify whether your Integration tests verify that your code
code works with external dependencies works with external dependencies
Page
10
Page
11
Unit 2: Types and Levels of Testing
correctly. correctly.
Performance Testing
Performance Testing is a type of testing to ensure software applications will perform
well under their expected workload.
The goal of Performance Testing is not to find bugs but to eliminate performance
bottlenecks.
Scalability - Determines maximum user load the software application can handle.
Response time. For example, the product catalog must be displayed in less than
3 seconds.
Throughput. For example, the system must support 100 transactions per second.
1. Load Testing
Load Testing is type of performance testing to check system with constantly increasing
the load on the system until the time load is reaches to its threshold value.
Page 12
Unit 2: Types and Levels of Testing
Page 13
Unit 2: Types and Levels of Testing
Here Increasing load means increasing number of concurrent users, transactions &
check the behavior of application under test.
It is normally carried out underneath controlled environment in order to
distinguish between two different systems.
The main purpose of load testing is to monitor the response time and staying power of
application when system is performing well under heavy load.
The successfully executed load testing is only if the specified test cases are
executed without any error in allocated time.
Load testing is testing the software under customer expected load.
In order to perform load testing on the software you feed it all that it can handle. Operate
the software with largest possible data files.
If the software operates on peripherals such as printer, or communication ports,
connect as many as you can.
If you are testing an internet server that can handle thousands of simultaneous
connections, do it. With most software it is important for it to run over long
periods.
Some software‘s should be able to run forever without being restarted. So Time acts as a
important variable.
Load testing can be best applied with the help of automation tools..
2. Stress Testing
Stress Testing is performance testing type to check the stability of software
when hardware resources are not sufficient like CPU, memory, disk space etc.
It is performed to find the upper limit capacity of the system and also to determine
how the system performs if the current load goes well above the expected maximum.
Main parameters to focus during Stress testing are “Response Time” and “Throughput”.
Stress testing is Negative testing where we load the software with large number of
concurrent users/processes which cannot be handled by the systems hardware
resources. This testing is also known as Fatigue testing
Stress testing is testing the software under less than ideal conditions. So subject your
software to low memory, low disk space, slow cps, and slow modems and so on. Look at
your software and determine what external resources and dependencies it has.
Page 14
Unit 2: Types and Levels of Testing
Page 15
Unit 2: Types and Levels of Testing
Stress testing is simply limiting them to bare minimum. With stress testing you starve
the software.
For e.g. Word processor software running on your computer with all available memory
and disk space, it works fine. But if the system runs low on resources you had a greater
potential to expect a bug. Setting the values to zero or near zero will make the software
execute different path as it attempt to handle the tight constraint. Ideally the software
would run without crashing or losing data
3. Security Testing
Security testing is a testing technique to determine if an information system protects data
and maintains functionality as intended
It also aims at verifying 6 basic principles as listed below:
Confidentiality
Integrity
Authentication
Authorization
Availability
Non-repudiation
Confidentiality
A security measure which protects against the disclosure of information to parties other than the
intended recipient is by no means the only way of ensuring the security.
Integrity
Integrity of information refers to protecting information from being modified by unauthorized
parties
Authentication
This might involve confirming the identity of a person, tracing the origins of an artifact, ensuring
that a product is what its packaging and labeling claims to be, or assuring that a computer
program is a trusted one
Authorization
The process of determining that a requester is allowed to receive a service or perform an
operation. Access control is an example of authorization.
Availability
Assuring information and communications services will be ready for use when expected.
Information must be kept available to authorized persons when they need it.
Non-repudiation (acknowledgment)
In reference to digital security, non-repudiation means to ensure that a transferred message has
been sent and received by the parties claiming to have sent and received the message. Non-
repudiation is a way to guarantee that the sender of a message cannot later deny having sent the
message and that the recipient cannot deny having received the message.
Example :
Page 16
Unit 2: Types and Levels of Testing
A Student Management System is insecure if ‘Admission’ branch can edit the data
of ‘Exam’ branch
An ERP system is not secure if DEO (data entry operator) can generate ‘Reports’
An online Shopping Mall has no security if customer’s Credit Card Detail is not
encrypted
A custom software possess inadequate security if an SQL query retrieves actual
passwords of its users
i) This type of testing usually done for 2 tier applications (usually developed for LAN) Here
we will be having front-end and backend.
ii) The application launched on front-end will be having forms and reports which will be
monitoring and manipulating data. E.g: applications developed in VB, VC++, Core Java, C,
C++, D2K, Power Builder etc.
iii) The backend for these applications would be MS Access, SQL Server, Oracle,
Sybase, MySQL, Quadbase.
iv) The tests performed on these types of applications would be– User interface testing
Manual support testing– Functionality testing– Compatibility testing & configuration testing –
Intersystem testing.
Page 17
Unit 2: Types and Levels of Testing
1. Forward Compatibility Testing: This type of testing verifies that the software
is compatible with the newer or upcoming versions, and is thus named as forward
compatible.
2. Backward Compatibility Testing: This type of testing helps to check whether the
application designed using the latest version of an environment also works seamlessly
in an older version. It is the testing performed to check the behavior of the
hardware/software with the older versions of the hardware/software.
Acceptance Testing
Acceptance Testing is a level of the software testing where a system is tested for
acceptability.
Page 18
Unit 2: Types and Levels of Testing
The purpose of this test is to evaluate the system’s compliance with the business
requirements and assess whether it is acceptable for delivery.
Acceptance Testing is performed after System Testing and before making the
system available for actual use.
The acceptance test cases are executed against the test data or using an acceptance
test script and then the results are compared with the expected ones.
Acceptance Criteria
Data Integrity
Data Conversion
Usability
Performance
Timeliness
Scalability
Documentation
Page 20
Unit 2: Types and Levels of Testing
It focuses mainly on the functionality thereby validating the fitness-for-use of the system by
the business user. The user acceptance test is performed by the users and application managers.
Also known as Production acceptance test validates whether the system meets the requirements
for operation. In most of the organization the operational acceptance test is performed by the
system administration before the system is released. The operational acceptance test may include
testing of backup/restore, disaster recovery, maintenance tasks and periodic check of security
vulnerabilities.
It is performed against the contract’s acceptance criteria for producing custom developed
software. Acceptance should be formally defined when the contract is agreed.
It is also known as regulation acceptance testing is performed against the regulations which must
be adhered to, such as governmental, legal or safety regulations.
It may not uncover subjective defects in the software, since you are only looking for defects you
expect to find
Alpha Testing
Page 21
Unit 2: Types and Levels of Testing
Page 22
Unit 2: Types and Levels of Testing
Alpha testing is final testing before the software is released to the general public. It has
two phases:
In the first phase of alpha testing, the software is tested by in-house developers. They
use either debugger software, or hardware-assisted debuggers. The goal is to catch bugs
quickly.
In the second phase of alpha testing, the software is handed over to the software QA
staff, for additional testing in an environment that is similar to the intended use.
Beta Testing
Beta Testing is also known as field testing. It takes place at customer’s site. It sends the
system/software to users who install it and use it under real-world working conditions.
A beta test is the second phase of software testing in which a sampling of the intended
audience tries the product out
The goal of beta testing is to place your application in the hands of real users outside of
your own engineering team to discover any flaws or issues from the user’s perspective
that you would not want to have in your final, released version of the application.
Page 23
Unit 2: Types and Levels of Testing
Page 24
Unit 2: Types and Levels of Testing
You have the opportunity to get your application into the hands of users prior to releasing
it to the general public.
Users can install, test your application, and send feedback to you during this beta testing
period.
Your beta testers can discover issues with your application that you may have not
noticed, such as confusing application flow, and even crashes.
Using the feedback you get from these users, you can fix problems before it is released
to the general public.
The more issues you fix that solve real user problems, the higher the quality of
your application when you release it to the general public.
Having a higher-quality application when you release to the general public will
increase customer satisfaction.
These users, who are early adopters of your application, will generate excitement
about your application.
Page 25
Unit 2: Types and Levels of Testing
Page 26
Unit 2: Types and Levels of Testing
Special tests
1. Regression Testing
Regression Testing is nothing but full or partial selection of already executed test
cases which are re-executed to ensure existing functionalities work fine.
This testing is done to make sure that new code changes should not have side effects on
the existing functionalities. It ensures that old code still works once the new code changes
are done.
Defect fixing
Retest All
This is one of the methods for Regression Testing in which all the tests in the existing test
bucket or suite should be re-executed. This is very expensive as it requires huge time and
resources.
. Page 27
Unit 2: Types and Levels of Testing
Instead of re-executing the entire test suite, it is better to select part of test suite to be run
Test cases selected can be categorized as 1) Reusable Test Cases 2) Obsolete Test
Prioritize the test cases depending on business impact, critical & frequently used
functionalities. Selection of test cases based on priority will greatly reduce the regression
test suite.
It was found from industry data that good number of the defects reported by customers were due
to last minute bug fixes creating side effects and hence selecting the Test Case for regression
testing is an art and not that easy.
Test cases of Functionalities which has undergone more and recent changes
If your software undergoes frequent changes, regression testing costs will escalate.
. Page 28
Unit 2: Types and Levels of Testing
In such cases, Manual execution of test cases increases test execution time as
well as costs.
Following are most important tools used for both functional and regression testing:
Selenium: This is an open source tool used for automating web applications. Selenium
can be used for browser based regression testing.
Rational Functional Tester (RFT): IBM's rational functional tester is a Java tool used
to automate the test cases of software applications. This is primarily used for
automating regression test cases and it also integrates with Rational Test Manager.
2. GUI Testing
Command Line Interface is where you type text and computer responds to that command.
GUI stands for Graphical User Interface where you interact with the computer using
images rather than text.
GUI testing is the process of testing the system's Graphical User Interface of the
Application Under Test. GUI testing involves checking the screens with the controls
like menus, buttons, icons, and all types of bars - toolbar, menu bar, dialog boxes and
windows, etc.
GUI is what user sees. A user does not see the source code. The interface is visible to the
user. Especially the focus is on the design structure, images that they are working
properly or not.
Following are the GUI elements which can be used for interaction between the user
and application:
. Page 29
Unit 2: Types and Levels of Testing
In addition to functionality, GUI testing evaluates design elements such as layout, colors, fonts,
font sizes, labels, text boxes, text formatting, captions, buttons, lists, icons, links and content.
GUI testing processes can be either manual or automatic, and are often performed by third -party
companies, rather than developers or end users.
Example: Consider any website like MSBTE, Google, yahoo or any login form or GUI of any
application to be tested. It includes following:
All colors used for background, control colors, and font color have a major impact on users.
Wrong color combinations and bright colors may increase fatigue of users.
All words, Fonts, Alignments, scrolling pages up and down, navigations for
different hyperlinks and pages, scrolling reduce usability.
Error messages and information given to users must be usable to the user. Reports and outputs
produced either on screen or printed should be readable. Also paper size on printer, font, size of
screen should be consider.
Screen layout in terms of number of instructions to users, number of controls and number
of pages are defined in low level design. More controls on single page and more pages reduce
usability.
Number of images on page or moving parts on screen may affect performance. These are high-
priority defects. It has direct relationships with usability testing, look, and feels of an
application. It affects emotions of users and can improve acceptability of an application.
. Page 30
Unit 2: Types and Levels of Testing
Good GUI improves feel and look of the application; it psychologically accepts the
application by the user.
GUI represents a presentation layer of an application. Good GUI helps an application due to
better experience of the users.
When number of pages is large and number of controls in a single page is huge.
Special application testing like those made for blind people or kids below age of five may
need special training for testers.
. Page 31