CSC291 - Software Engineering
Concepts
(Spring 2024)
Software Testing
06/11/2024 CSE291 - Introduction to Software Engineering 2
Software Testing
The process of operating a system or component under
specified conditions, observing or recording the results, and
making an evaluation of some aspect of the system or
component.
06/11/2024 CSE291 - Introduction to Software Engineering 3
Software Testing
Testing can be defined as
“A process of analyzing a software item to detect the differences
between existing and required conditions and to evaluate the
features of the software item”
According to IEEE standard
06/11/2024 CSE291 - Introduction to Software Engineering 4
Software Testing
- Testing is intended to show that a program does what it is intended to
do and to discover program defects before it is put into use.
- When you test software, you execute a program using artificial data.
You check the results of the test run for errors, anomalies, or
information about the program’s non-functional attributes.
06/11/2024 CSE291 - Introduction to Software Engineering 5
Who Does Testing?
In most cases, following professionals are involved in testing of a
system within their respective capacities:
• Software Tester
• Software Developer
• Project Leader/Manager
• End User
06/11/2024 CSE291 - Introduction to Software Engineering 6
A model of the software testing process
06/11/2024 CSE291 - Introduction to Software Engineering 7
Types of Testing
Manual testing
• This type includes the testing of the Software manually i.e.
without using any automated tool.
• There are different stages for manual testing like unit testing,
Integration testing, System testing and User Acceptance
testing.
• Testers use test plan, test cases or test scenarios to test the
Software to ensure the completeness of testing.
06/11/2024 CSE291 - Introduction to Software Engineering 8
Types of Testing
Manual testing
• This type includes the testing of the Software manually i.e.
without using any automated tool.
• There are different stages for manual testing like unit testing,
Integration testing, System testing and User Acceptance
testing.
• Testers use test plan, test cases or test scenarios to test the
Software to ensure the completeness of testing.
06/11/2024 CSE291 - Introduction to Software Engineering 9
Automation Testing
• Automation testing which is also known as Test Automation, is
when the tester uses another software to test the software.
• This process involves automation of a manual process.
• Integration of computerized tools into the process of software
testing.
• Code auditing
• Coverage monitoring
• Load tests…etc
06/11/2024 CSE291 - Introduction to Software Engineering 10
Software Testing
Typically, a commercial software system has to go through three stages of testing:
Development testing, where the system is tested during development to discover
bugs and defects. System designers and programmers are likely to be involved in
the testing process.
Release testing, where a separate testing team tests a complete version of the
system before it is released to users. The aim of release testing is to check that
the system meets the requirements of system stakeholders.
User testing, where users or potential users of a system test the system in their
own environment.
For software products, the ‘user’ may be an internal marketing group who decide
if the software can be marketed, released, and sold. Acceptance testing is one
type of user testing.
06/11/2024 CSE291 - Introduction to Software Engineering 11
Classification According to Testing Concept
• Black Box Testing
• White Box Testing
06/11/2024 CSE291 - Introduction to Software Engineering 12
Black Box Testing
• The technique of testing without having any knowledge of the
interior workings of the application is Black Box testing.
• The tester does not have access to the source code.
• A tester will interact with the system's user interface by
providing inputs and examining outputs without knowing how
and where the inputs are worked upon.
06/11/2024 CSE291 - Introduction to Software Engineering 13
Black Box Testing
Advantages
• Well suited and efficient for large code segments.
• Code Access not required.
• Clearly separates user's perspective from the developer's
perspective.
• Large numbers of moderately skilled testers can test the
application with no knowledge of implementation, programming
language or operating systems.
06/11/2024 CSE291 - Introduction to Software Engineering 14
Black Box Testing
Disadvantages
• Inefficient testing, due to the fact that the tester only has limited
knowledge about an application.
• Blind Coverage, since the tester cannot target specific code
segments or error prone areas.
• The test cases are difficult to design.
06/11/2024 CSE291 - Introduction to Software Engineering 15
White Box Testing
• White box testing is the detailed investigation of internal logic
and structure of the code.
• White box testing is also called glass testing or open box
testing.
• In order to perform white box testing on an application, the
tester needs to have knowledge of the internal working of the
code.
• The tester needs to have a look inside the source code and
find out which unit/chunk of the code is behaving
inappropriately.
06/11/2024 CSE291 - Introduction to Software Engineering 16
White Box Testing
Advantages
• As the tester has knowledge of the source code, it becomes
very easy to find out which type of data can help in testing the
application effectively.
• Extra lines of code can be removed which can bring in hidden
defects.
• Due to the tester's knowledge about the code, maximum
coverage is attained during test scenario writing.
06/11/2024 CSE291 - Introduction to Software Engineering 17
White Box Testing
Disadvantages
• Due to the fact that a skilled tester is needed to perform white
box testing, the costs are increased.
• Sometimes it is impossible to look into every nook and corner
to find out hidden errors.
• It is difficult to maintain white box testing as the use of
specialized tools like code analyzers and debugging tools are
required.
06/11/2024 CSE291 - Introduction to Software Engineering 18
Black Box vs White Box
Black Box Testing White Box Testing
The Internal Workings of an application are Tester has full knowledge of the Internal workings of
not required to be known the application
Also known as closed box testing, data Also known as clear box testing, structural testing or
driven testing and functional testing code based testing
Performed by end users and also by testers
Normally done by testers and developers
and developers
Testing is based on external expectations -
Internal workings are fully known and the tester can
Internal behavior of the application is
design test data accordingly
unknown
This is the least time consuming and The most exhaustive and time consuming type of
exhaustive testing
Not suited to algorithm testing Suited for algorithm testing
06/11/2024 CSE291 - Introduction to Software Engineering 19
Testing strategies/ Development testing
• There are basically two testing strategies:
Big bang testing: tests the software as a whole, once the
completed package is available.
Incremental testing:
• Tests the software piecemeal – software modules are tested as
they are completed (unit tests)
• followed by groups of modules composed of tested modules
integrated with newly completed modules (integration tests).
• Once the entire package is completed, it is tested as a whole
(system test).
06/11/2024 CSE291 - Introduction to Software Engineering 20
Unit Testing
• Unit testing is performed by the respective developers on the
individual units of source code assigned areas.
• The goal of unit testing is to isolate each part of the program
and show that individual parts are correct in terms of
requirements and functionality.
06/11/2024 CSE291 - Introduction to Software Engineering 21
Integration Testing /System testing
The testing of combined parts of an application to determine if they
function correctly together is Integration testing.
System Testing
• This is the next level in the testing and tests the system as a whole.
• Once all the components are integrated, the application as a whole
is tested to see that it meets Quality Standards.
• This type of testing is performed by a specialized testing team.
06/11/2024 CSE291 - Introduction to Software Engineering 22
Testing Strategies
Incremental testing is also performed according to two basic
strategies:
• bottom-up and top-down
• In top-down testing, the first module tested is the main
module, the highest level module in the software structure; the
last modules to be tested are the lowest level modules.
• In bottom-up testing, the order of testing is reversed: the
lowest level modules are tested first, with the main module
tested last.
Bottom-up testing
Stage 1: Unit tests of modules 1 to 7.
Stage 2: Integration test A of modules 1
and 2, developed and tested in stage 1,
and integrated with module 8,
developed in the current stage.
Stage 3: Two separate integration tests,
B, on modules 3, 4, 5 and 8,
integrated with module 9, and C, for
modules 6 and 7, integrated with
module 10.
Stage 4: System test is performed after
B and C have been integrated with
module 11, developed in the current
stage
06/11/2024 CSE291 - Introduction to Software Engineering 24
Top-down Testing
Top-down testing
Stage 1: Unit tests of module 11.
Stage 2: Integration test A of module 11 integrated with modules
9 and 10, developed in the current stage.
Stage 3: Integration test B of A integrated with module 8,
developed in the current stage.
Stage 4: Integration test C of B integrated with modules 6 and 7,
developed in the current stage.
Stage 5: Integration test D of C integrated with modules 1 and 2,
developed in the current stage.
Stage 6: System test of D integrated with modules 3, 4 and 5,
developed in the current stage.
06/11/2024 CSE291 - Introduction to Software Engineering 26
Stubs And Drivers For Incremental Testing
• Stubs and drivers are software replacement simulators
required for modules not available when performing a unit or an
integration test.
• A stub (often termed a “dummy module”) replaces an
unavailable lower level module.
• Stubs are used in top down testing approach
• when you have the major module ready to test, but the sub
modules are still not ready yet.
• So in a simple language stubs are "called" programs, which
are called in to test the major module's functionality .
06/11/2024 CSE291 - Introduction to Software Engineering 27
Stubs And Drivers For Incremental Testing
• A driver is also a substitute module but of the upper level
module
• Drivers are required in bottom-up testing until the upper level
modules are developed (coded).
• They are used when the sub modules are ready but the main
module is still not ready.
06/11/2024 CSE291 - Introduction to Software Engineering 28
Example of Stubs and Drivers
For Example
we have 3 modules login, home, and user module. Login
module is ready and need to test it, but we call functions from
home and user (which is not ready). To test at a selective
module we write a short dummy piece of a code which
simulates home and user, which will return values for Login,
this piece of dummy code is always called Stubs and it is used
in a top down integration.
06/11/2024 CSE291 - Introduction to Software Engineering 29
Example of Stubs and Drivers
• Considering the same Example above:
If we have Home and User modules get ready and Login
module is not ready, and we need to test Home and User
modules Which return values from Login module, So to extract
the values from Login module We write a Short Piece of
Dummy code for login which returns value for home and user,
So these pieces of code is always called Drivers and it is used
in Bottom Up Integration
06/11/2024 CSE291 - Introduction to Software Engineering 30
Regression Testing
• Whenever a change in a software application is made it is quite
possible that other areas within the application have been
affected by this change.
• The intent of Regression testing is to ensure that a change,
such as a bug fix did not result in another fault being uncovered
in the application.
06/11/2024 CSE291 - Introduction to Software Engineering 31
User Testing
In practice, there are three different types of user testing:
Alpha testing, where users of the software work with the
development team to test the software at the developer’s site.
Beta testing, where a release of the software is made
available to users to allow them to experiment and to raise
problems that they discover with the system developers.
Acceptance testing, where customers test a system to decide
whether or not it is ready to be accepted from the system
developers and deployed in the customer environment.