0% found this document useful (0 votes)
40 views23 pages

7b. Software Testing

The document discusses different types and strategies for software testing including unit testing, integration testing, regression testing, smoke testing, and object-oriented testing. It provides details on when each type of testing should be used and how to implement testing at different stages of the software development lifecycle.

Uploaded by

elvis.sikapi
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)
40 views23 pages

7b. Software Testing

The document discusses different types and strategies for software testing including unit testing, integration testing, regression testing, smoke testing, and object-oriented testing. It provides details on when each type of testing should be used and how to implement testing at different stages of the software development lifecycle.

Uploaded by

elvis.sikapi
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/ 23

SOFE 2720

Principles of Software and Requirements


Engineering

Software Testing

Notes adapted from personal notes

http://www.cs. mu.edu/~kelgazza/
Strategic Approach
• Testing begins at the component level and works
"outward" toward the integration of the entire
computer-based system.
• Different testing techniques are appropriate for
different software engineering approaches and at
different points in time.
• Testing is conducted by the developer of the software
and (for large projects) an independent test group.
• Testing and debugging are different activities, but
debugging must be accommodated in any testing
strategy.
V&V

• Verification refers to the set of tasks that


ensure that software correctly implements a
specific function.
• Validation refers to a different set of tasks that
ensure that the software that has been built is
traceable to customer requirements. Boehm
[Boe81] states this another way:
–Verification: "Are we building the product right?"
–Validation: "Are we building the right product?"
Who Tests the Software?

developer independent tester

Understands the system Must learn about the system,


but, will test "gently" but, will attempt to break it
and, is driven by "delivery" and, is driven by quality
Testing Strategy

System engineering

Analysis modeling

Design modeling

Code generation Unit test

Integration test

Validation test

System test
Testing Strategy – V-Model

• Disciplined
• Requirements
are known
• Small projects
• Easy to
understand
Testing Strategy

• We begin by ‘testing-in-the-small’ and move


toward ‘testing-in-the-large’
• For conventional software
–The module (component) is our initial focus
–Integration of modules follows
• For OO software
–our focus when “testing in the small” changes from an
individual module (the conventional view) to an OO
class that encompasses attributes and operations and
implies communication and collaboration
Strategic Issues
• Specify product requirements in a quantifiable manner
long before testing commences.
• State testing objectives explicitly.
• Understand the users of the software and develop a
profile for each user category.
• Develop a testing plan that emphasizes “rapid cycle
testing.”
• Build “robust” software that is designed to test itself
• Use effective technical reviews as a filter prior to testing
• Conduct technical reviews to assess the test strategy
and test cases themselves.
• Develop a continuous improvement approach for the
testing process.
Unit Testing

module
to be
tested

results

software
engineer
test cases
Unit Testing

module
to be
tested
interface

local data structures

boundary conditions
independent paths
error handling paths

test cases
Unit Test Environment

driver
interface
local data structures

Module boundary conditions


independent paths
error handling paths

stub stub

test cases

RESULTS
Integration Testing Strategies
Options:
• the “big bang” approach
(typically results in chaos)
• an incremental construction strategy
Incremental approach: Top Down Integration
Top Down Integration

A
top module is tested with
stubs

B F G

stubs are replaced one at


a time, "depth first"
C
as new modules are integrated,
some subset of tests is re-run
D E
Incremental approach: Bottom-Up Integration
Bottom-Up Integration

B F G

drivers are replaced one at a


time, "depth first"
C

worker modules are grouped into


builds and integrated
D E
cluster
Incremental approach: Sandwich Testing
Sandwich Testing

A
Top modules are
tested with stubs

B F G

Worker modules are grouped into


builds and integrated
D E

cluster
Regression Testing
• Regression testing is the re-execution of some subset of
tests that have already been conducted to ensure that
changes have not propagated unintended side effects
• Whenever software is corrected, some aspect of the
software configuration (the program, its documentation,
or the data that support it) is changed.
• Regression testing helps to ensure that changes (due to
testing or for other reasons) do not introduce unintended
behavior or additional errors.
• Regression testing may be conducted manually, by re-
executing a subset of all test cases or using automated
capture/playback tools.
Smoke Testing
• It is to verify quickly that the software product
works without using pre-design test cases.
• The test validate the following:
–Version, configuration, data, and system
navigability.
• To verify the test:
–Execute reports, queries, add new data, and the
most relevant transitions.
General Testing Criteria

◼Interface integrity – internal and external module


interfaces are tested as each module or cluster is
added to the software

◼Functional validity – test to uncover functional defects


in the software

◼Information content – test for errors in local or global


data structures

◼Performance – verify specified performance bounds


are tested
Object-Oriented Testing
• Begins by evaluating the correctness and
consistency of the analysis and design models
• Testing strategy changes
–the concept of the ‘unit’ broadens due to encapsulation
–integration focuses on classes and their execution
across a ‘thread’ or in the context of a usage scenario
–validation uses conventional black box methods
• Test case design draws on conventional methods,
but also encompasses special features
OO Testing Strategy
• Class testing is the equivalent of unit testing
–operations within the class are tested
–the state behavior of the class is examined
• Integration applied three different strategies
–thread-based testing—integrates the set of classes
required to respond to one input or event
–use-based testing—integrates the set of classes
required to respond to one use case
–cluster testing—integrates the set of classes
required to demonstrate one collaboration
High Order Testing
• Validation testing
– Focus is on software requirements
• System testing
– Focus is on system integration
• Alpha/Beta testing
– Focus is on customer usage
• Recovery testing
– forces the software to fail in a variety of ways and verifies that recovery is properly performed
• Security testing
– verifies that protection mechanisms built into a system will, in fact, protect it from improper
penetration
• Stress testing
– executes a system in a manner that demands resources in abnormal quantity, frequency, or
volume
• Performance Testing
– test the run-time performance of software within the context of an integrated system
Class Activity
• Let’s try some Junit testing examples
• Go to https://www.javatpoint.com/junit-
tutorial
• These examples can be programmed in Eclipse
IDE.
–Remove the javatpoint package.

22

You might also like