Unit 6 SW Testing
Unit 6 SW Testing
SOFTWARE ENGINEERING
• Manual testing can be further divided into three types of testing, which are as
follows:
• White box testing
• Black box testing
• Gray box testing
• White Box Testing
• In white-box testing, the developer will inspect every line of code before handing it
over to the testing team or the concerned test engineers.
• Subsequently, the code is noticeable for developers throughout testing; that's why
this process is known as WBT (White Box Testing).
• In other words, we can say that the developer will execute the complete white-box
testing for the particular software and send the specific application to the testing
team.
• The purpose of implementing the white box testing is to emphasize the flow of
inputs and outputs over the software and enhance the security of an application.
• White box testing is also known as open box testing, glass box testing, structural
testing, clear box testing, and transparent box testing.
• Black Box Testing
• Another type of manual testing is black-box testing.
• In this testing, the test engineer will analyze the software against requirements,
identify the defects or bug, and sends it back to the development team.
• Then, the developers will fix those defects, do one round of White box testing, and
send it to the testing team.
• Here, fixing the bugs means the defect is resolved, and the particular feature is
working according to the given requirement.
• In other words, we can say that black box testing is a process of checking the
functionality of an application as per the customer requirement.
• The source code is not visible in this testing; that's why it is known as black-box
testing.
Types of Black Box Testing
Black box testing further categorizes into two parts, which are as discussed below:
•Functional Testing
•Non-function Testing
Functional Testing
The test engineer will check all the components systematically against requirement
specifications is known as functional testing.
Functional testing is also known as Component testing.
In functional testing, all the components are tested by giving the value, defining the
output, and validating the actual output with the expected value.
Types of Functional Testing
Just like another type of testing is divided into several parts, functional testing is also
classified into various categories.
The diverse types of Functional Testing contain the following:
•Unit Testing
•Integration Testing
•System Testing
• 1. Unit Testing
• Unit testing is the first level of functional testing in order to test any software.
• In this, the test engineer will test the module of an application independently or
test all the module functionality is called unit testing.
• The primary objective of executing the unit testing is to confirm the unit
components with their performance.
• Here, a unit is defined as a single testable function of a software or an application.
• And it is verified throughout the specified application development phase.
• 2. Integration Testing
• Once we are successfully implementing the unit testing, we will go
integration testing.
• It is the second level of functional testing, where we test the data flow between
dependent modules or interface between two features is called integration testing.
• The purpose of executing the integration testing is to test the statement's accuracy
between each module.
• 3. System Testing
• Whenever we are done with the unit and integration testing, we can proceed with
the system testing.
• In system testing, the test environment is parallel to the production environment.
• It is also known as end-to-end testing.
• In this type of testing, we will undergo each attribute of the software and test if the
end feature works according to the business requirement.
• And analysis the software product as a complete system.
• Non-function Testing
• The next part of black-box testing is non-functional testing. It provides detailed
information on software product performance and used technologies.
• Non-functional testing will help us minimize the risk of production and related
costs of the software.
• Non-functional testing is a combination of performance, load, stress, usability
and, compatibility testing.
•Automation testing
• Automation testing is a process of converting any manual test cases into the test scripts with the
help of automation tools, or any programming language is known as automation testing.
• With the help of automation testing, we can enhance the speed of our test execution because
here, we do not require any human efforts.
• We need to write a test script and execute those scripts.
System Testing
Validation Testing
Integration Testing
Unit Testing
Code
Design
Requirements
System Engineering
Levels of Testing for Conventional Software
Unit testing
Concentrates on each component/function of the software as implemented in
the source code
Integration testing
Focuses on the design and construction of the software architecture
Validation testing
Requirements are validated against the constructed software
System testing
The software and other system elements are tested as a whole
Testing Strategy applied to Conventional Software
Unit testing
Exercises specific paths in a component's control structure to ensure complete
coverage and maximum error detection
Components are then assembled and integrated
Integration testing
Focuses on inputs and outputs, and how well the components fit together and
work together
Validation testing
Provides final assurance that the software meets all functional, behavioral, and
performance requirements
System testing
Verifies that all system elements (software, hardware, people, databases) mesh
properly and that overall system function and performance is achieved
Testing Strategy applied to Object-Oriented Software
A strategy for software testing integrates the design of software test cases
into a well-planned series of steps that result in successful development of
the software
The strategy provides a road map that describes the steps to be taken,
when, and how much effort, time, and resources will be required
The strategy incorporates test planning, test case design, test execution,
and test result collection and evaluation
The strategy provides guidance for the practitioner and a set of milestones
for the manager
Because of time pressures, progress must be measurable and problems
must surface as early as possible
Test Strategies for
Conventional Software
Unit Testing
Module interface
Ensure that information flows properly into and out of the module
Local data structures
Ensure that data stored temporarily maintains its integrity during all steps in an
algorithm execution
Boundary conditions
Ensure that the module operates properly at boundary values established to
limit or restrict processing
Independent paths (basis paths)
Paths are exercised to ensure that all statements in a module have been
executed at least once
Error handling paths
Ensure that the algorithms respond correctly to specific error conditions
Common Computational Errors in Execution Paths
Driver
A simple main program that accepts test case data, passes such data to the
component being tested, and prints the returned results
Stubs
Serve to replace modules that are subordinate to (called by) the component to
be tested
It uses the module’s exact interface, may do minimal data manipulation,
provides verification of entry, and returns control to the module undergoing
testing
Drivers and stubs both represent overhead
Both must be written but don’t constitute part of the installed software product
Unit Test Procedure
Integration Testing
Three kinds
Top-down integration
Bottom-up integration
Sandwich integration
The program is constructed and tested in small increments
Errors are easier to isolate and correct
Interfaces are more likely to be tested completely
A systematic test approach is applied
Top-down Integration
Integration and testing starts with the most atomic modules in the control
hierarchy
Advantages
This approach verifies low-level data processing early in the testing process
Need for stubs is eliminated
Disadvantages
Driver modules need to be built to test the lower-level modules; this code is
later discarded or expanded into a full-featured version
Drivers inherently do not contain the complete algorithms that will eventually
use the services of the lower-level modules; consequently, testing may be
incomplete or more testing may be needed later when the upper level modules
are available
Sandwich Integration
Alpha testing
Conducted at the developer’s site by end users
Software is used in a natural setting with developers watching intently
Testing is conducted in a controlled environment
Beta testing
Conducted at end-user sites
Developer is generally not present
It serves as a live application of the software in an environment that cannot be
controlled by the developer
The end-user records all problems that are encountered and reports these to
the developers at regular intervals
After beta testing is complete, software engineers make software
modifications and prepare for release of the software product to the entire
customer base
System Testing
Recovery testing
Tests for recovery from system faults
Forces the software to fail in a variety of ways and verifies that recovery is
properly performed
Tests reinitialization, checkpointing mechanisms, data recovery, and restart for
correctness
Security testing
Verifies that protection mechanisms built into a system will, in fact, protect it
from improper access
Stress testing
Executes a system in a manner that demands resources in abnormal quantity,
frequency, or volume
Performance testing
Tests the run-time performance of software within the context of an integrated
system
Often coupled with stress testing and usually requires both hardware and
software instrumentation
Can uncover situations that lead to degradation and possible system failure