Ch-3-Final Exam
Ch-3-Final Exam
Assurance
4
Figure 5.2. Unit testing
Continued...
METHOD
Unit Testing is performed by using the
method White Box Testing
When is it performed?
Unit Testing is the first level of testing and
is performed prior to Integration Testing
Who performs it?
Unit Testing is normally performed by
software developers themselves or their
peers.
In rare cases it may also be performed by
independent software testers.
Figure 5.3. unit testing
6
Continued…
Phase 1: Describe Unit Test Approach and Risks
In this phase of unit testing planning the general
approach to unit testing is outlined. The test planner:
a) identifies test risks;
b) describes techniques to be used for designing the test
cases for the units;
c) describes techniques to be used for data validation and
recording of test results;
d) describes the requirements for test harnesses and other
software that interfaces with the units to be tested
During this phase the planner also identifies
completeness requirements
The planner also identifies termination conditions for the
7
unit tests.
Continued…
Phase 2: Identify Unit Features to be tested
This phase requires information from the unit specification and
detailed design description.
The planner determines which features of each unit will be
tested, for example: functions, performance requirements, states,
and state transitions, control structures, messages, and data flow
patterns.
Input/output characteristics associated with each unit should
also be identified.
Phase 3: Add Levels of Detail to the Plan
In this phase the planner refines the plan as produced in the
previous two phases.
The planner adds new details to the approach, resource, and
scheduling portions of the unit test plan. 8
Designing the unit tests
Part of the preparation work for unit test involves unit
test design.
It is important to specify (i) the test cases (including input
data, and expected outputs for each test case), and, (ii) the
test procedures (steps required run the tests).
Test case data should be tabularized for ease of use, and
reuse.
To specifically support object-oriented test design and the
organization of test data
Arranging the components of a test case into a semantic
network with parts, Object ID, Test_Case_ID, Purpose,
and List_of_Test_Case_Steps.
Each of these items has component parts.
9
Test Harness
The auxiliary code developed to support testing of units
and components is called a test harness. The harness
consists of drivers that call the target code and stubs that
represent modules it calls. A driver calls the component to
be tested. A stub is called from the software component to
be tested
13
Integration Testing Strategy
The entire system is viewed as a collection of
subsystems.
The Integration testing strategy determines the order
in which the subsystems are selected for testing and
integration-
Top down integration
Bottom up integration
Sandwich testing
Big bang integration (Non incremental)
14
Integration Testing Approaches
Top Down is an approach to
Integration Testing where top
level units are tested first and
lower level units are tested step
by step after that. This approach
is taken when top down
development approach is
followed
Bottom Up is an approach to
Integration Testing where
bottom level units are tested
first and upper level units step
by step after that. This approach
is taken when bottom up
development approach is
followed.
Figure 5.6. integration testing
15
Continued...
Big Bang is an approach to
Integration Testing where all or
most of the units are combined
together and tested at one go. This
approach is taken when the testing
team receives the entire software in
a bundle.
Sandwich/Hybrid is an approach to
Integration Testing which is a
combination of Top Down and
Bottom Up approaches.
16
Figure 5.8. integration testing
Integration test planning
The plan includes the following items:
a) clusters this cluster is dependent on;
b) a natural language description of the functionality
of the cluster to be tested;
c) list of classes in the cluster;
d) a set of cluster test cases.
17
System Testing
When integration tests are completed, a software system has
been assembled and its major subsystems have been tested.
At this point the developers/ testers begin to test it as a whole.
System test planning should begin at the requirements phase
with the development of a master test plan and requirements-
based (black box) tests.
There are many components of the plan that need to be prepared
such as test approaches, costs, schedules, test cases, and test
procedures.
System testing itself requires a large amount of resources.
The goal is to ensure that the system performs according to its
requirements.
System test evaluates both functional behaviour and quality
requirements such as reliability, usability, performance and
security. 18
Continued…
This phase of testing is especially useful for detecting external
hardware and software interface defects, for example, those
causing race conditions, and deadlocks, problems with
interrupts and exception handling, and ineffective memory
usage.
After system test the software will be turned over to users for
evaluation during acceptance test or alpha/beta test.
Because system test often requires many resources, special
laboratory equipment, and long test times, it is usually
performed by a team of testers.
The best scenario is for the team to be part of an independent
testing group. The team must do their best to find any weak
areas in the software; therefore, it is best that no developers
are directly involved.
19
Types of System Testing
There are several types of system tests as shown on
Figure 5.10 The types are as follows:
Functional testing
Performance testing
Stress testing
Configuration testing
Security testing
Recovery testing
20
Continued…
22
Performance Testing
Goal: Try to violate non-functional requirements
Test how the system behaves when overloaded.
Try unusual orders of execution
Check the system’s response to large volumes of data
The users may have objectives for the software system in terms
of memory use, response time, throughput, and delays.
Testers also learn from performance test whether there are any
hardware or software factors that impact on the system’s
performance.
Performance testing allows testers to tune the system; that is, to
optimize the allocation of system resources. For example, testers
may find that they need to reallocate memory pools, or to
modify the priority level of certain system operations.
Testers may also be able to project the system’s future
performance levels. This is useful for planning subsequent
releases. 23
Stress Testing
When a system is tested with a load that causes it to
allocate its resources in maximum amounts, this is
called stress testing.
For example, if an operating system is required to
handle 10 interrupts/second and the load causes 20
interrupts/second, the system is being stressed.
The goal of stress test is to try to break the system;
find the circumstances under which it will crash. This
is sometimes called “breaking the system”.
Stress testing is important from the user/client point
of view.
When systems operate correctly under conditions of
stress then clients have confidence that the software
can perform as required. 24
Configuration Testing
Typical software systems interact with hardware devices such as
disc drives, tape drives, and printers.
Many software systems also interact with multiple CPUs, some of
which are redundant.
Software that controls real-time processes, or embedded software
also interfaces with devices, but these are very specialized
hardware items such as missile launchers, and nuclear power
device sensors.
In many cases, users require that devices be interchangeable,
removable, or reconfigurable.
For example, a printer of type X should be substitutable for a
printer of type Y, CPU A should be removable from a system
composed of several other CPUs, sensor A should be replaceable
with sensor B.
Configuration testing allows developers/testers to evaluate system
performance and availability when hardware exchanges 25 and
reconfigurations occur.
Security Testing
Designing and testing software systems to ensure that they
are safe and secure is a big issue facing software
developers and test specialists.
Recently, safety and security issues have taken on
additional importance due to the proliferation of
commercial applications for use on the Internet.
If Internet users believe that their personal information is
not secure and is available to those with intent to do harm
Security testing evaluates system characteristics that relate
to the availability, integrity, and confidentially of system
data and services.
Users/clients should be encouraged to make sure their
security needs are clearly known at requirements time, so
that security issues can be addressed by designers and
testers. 26
Other types of Performance Testing
Volume testing
Test what happens if large amounts of data are handled
Compatibility test
Test backward compatibility with existing systems
Timing testing
Evaluate response times and time to perform a function
Environmental test
Test tolerances for heat, humidity, motion
Quality testing
Test reliability, maintain- ability & availability
Recovery testing
Test system’s response to presence of errors or loss of data
Human factors testing
Test with end users. 27
Acceptance Testing
Goal: Demonstrate system is ready for
operational use
Choice of tests is made by client
Many tests can be taken from integration testing
Acceptance test is performed by the client, not by the
developer.
Acceptance test cases are based on requirements. The
user manual is an additional source for test cases.
System test cases may be reused. The software must run
under real-world conditions on operational hardware
and software.
28
Continued…
After acceptance testing the client will point out to the
developers which requirement have/have not been
satisfied. Some requirements may be deleted,
modified, or added due to changing needs.
If the client is satisfied that the software is usable and
reliable, and they give their approval, then the next
step is to install the system at the client’s site.
If the client’s site conditions are different from that of
the developers, the developers must set up the system
so that it can interface with client software and
hardware.
Retesting may have to be done to insure that the
software works as required in the client’s
environment. This is called installation test.
Alpha and Beta test
Alpha test: Beta test:
Client uses the software at Conducted at client’s environment
the developer’s (developer is not present)
environment. Software gets a realistic workout in
Software used in a target environment
controlled setting, with the Beta testing is also known as pre-
developer always ready to release testing.
fix bugs. The following will be tested
The following will be tested Users will install, run the application
in the application: and send their feedback to the project
Spelling Mistakes team.
Broken Links Typographical errors, confusing
Cloudy Directions application flow, and even crashes.
30
Information needed at different Levels of
Testing
35
Continued…
Software Change
Analysis
Software Change
Impact Analysis
Define Regression
Testing Strategy
Build Regression
Test Suite
Run Regression
Tests at different levels
Report Retest
Results
Thank you!
Questions?