0% found this document useful (0 votes)
24 views

Lecture 10

Analysis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Lecture 10

Analysis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Testing

Dr. Jael Wekesa

Lecture 10
Overview
- Strategic approach to software testing
- Test series for conventional software
- Test strategies for OO software
- Validation testing
- System testing
- Debugging

University of Kansas 09/16/2024


Strategic approach to software testing
Testing Activities - The
first step in testing is unit
testing, followed by
integration testing and then
system testing.

All
Alltests
testsby
bydeveloper
developer

University of Kansas 09/16/2024


Testing Activities (cont…)
Client’s
Global Understanding User
Requirements of Requirements Environment

Functioning Validated Accepted


System PerformanceSystem System
Acceptance Installation
Test Test Test

Usable
Tests
Testsby
byclient
client System
Tests
Testsby
bydeveloper
developer
User’s understanding
System in
Use
Tests
Tests(?)
(?) by
byuser
user
Test Planning
¨ A test plan includes:
 Test objectives
 Schedule and logistics
 Test strategies
 Test cases
 Procedure
 Data

 Expected result

 Procedures for handling problems


Categorization of Test Types
Types of Manual Testing
 Inspections
• - A testing technique in which participants examine program code for
predictable language-specific errors.
 Walkthroughs
• - A peer-group review of any product created during the systems
development process; also called a structured walkthrough.
 Desk checking
• - A testing technique in which the program code is sequentially
executed manually by the reviewer.
Types of Automated Testing

Unit Testing:
• Individual subsystem
• Carried out by developers
• Goal: Confirm that subsystems is correctly coded and carries out the intended
functionality

Integration Testing:
• Groups of subsystems (collection of classes) and eventually the entire system
• Carried out by developers
• Goal: Test the interface among the subsystem
Stub (module) testing: A technique used in testing modules, especially where
modules are written and tested in a top-down fashion, where a few lines of code are
used to substitute for subordinate modules.
Testing (cont…)

System Testing: System testing = validation testing
• The entire system, carried out by developers
• Goal: Determine if the system meets the requirements (functional and Non-
functional/global)

Acceptance Testing:
• Evaluates the system delivered by developers
• Carried out by the client. May involve executing typical transactions on site
on a trial basis
• Goal: Demonstrate that the system meets customer requirements and is
ready to use
Acceptance Testing

Acceptance testing - The process whereby actual users test a completed
information system, the end result of which is the users’ acceptance of it once
they are satisfied with it.

Alpha Testing:
• - User testing of a completed information system using simulated data.

Beta Testing:
• - User testing of a completed information system using real data in the real
user environment.
Static and Dynamic Analysis
Static analysis:
 Hand execution: Reading the source code
 Walk-Through (informal presentation to others)
 Code Inspection (formal presentation to others)
 Automated Tools checking for
o Syntactic and semantic errors
o Departure from coding standards
Dynamic Analysis:
 Black-box testing (Test the input/output behavior)
 White-box testing (Test the internal logic of the subsystem or object)
 Data-structure based testing (Data types determine test cases)
Black-box Testing
 Involves testing a system with no prior knowledge of its internal workings
(code structure).
 Focus: I/O behavior. If for any given input, we can predict the output, then
the module passes the test.
• Almost always impossible to generate all possible inputs ("test cases")

Goal: Reduce number of test cases by equivalence partitioning:
• Divide input conditions into equivalence classes
• Choose test cases for each equivalence class. (Example: If an object is
supposed to accept a negative number, testing one negative number is
 If x = 3 then …
enough)
 If x > -5 and x < 5 then …
White-box Testing
 A method of software testing that tests internal structures or workings of
an application, as opposed to its functionality.
 Focus: Thoroughness (Coverage). Every statement in the component is
executed at least once.
 Four types of white-box testing
• - Statement Testing
• - Loop Testing
• - Path Testing
• - Branch Testing
White-box Testing Example: Determining the Paths
FindMean (FILE ScoreFile)
1
{ float SumOfScores = 0.0;
int NumberOfScores = 0;
2 float Mean=0.0; float Score;
3
Read(ScoreFile, Score);
while (! EOF(ScoreFile) {
4
if (Score > 0.0 ) {
SumOfScores = SumOfScores + Score;
5
NumberOfScores++;
} 6

Read(ScoreFile, Score);
7 }
/* Compute the mean and print the result */
if (NumberOfScores > 0) { 8
Mean = SumOfScores / NumberOfScores;
printf(“ The mean score is %f\n”, Mean); 9
} else
printf (“No scores found in file\n”);
}
The 4 Testing Steps
1.
1.Select
Selectwhat
whathas
hastotobe
bemeasured
measured 3.
3.Develop
Developtest testcases
cases
•• Analysis:
Analysis:Completeness
Completenessof of •• AAtest
testcase
caseisisaaset
setof
oftest
testdata
dataor or
requirements
requirements situations
situationsthat
thatwill
willbebeused
usedto to
•• Design:
Design:tested
testedfor
forcohesion
cohesion exercise
exercisethetheunit
unit(code,
(code,module,
module,
•• Implementation: system)
system)being
beingtested
testedororabout
aboutthethe
Implementation:CodeCodetests
tests attribute
attributebeing
beingmeasured
measured
2.
2.Decide
Decidehowhowthethetesting
testingisisdone
done 4.
4.Create
Createthethetest
testoracle
oracle
•• Code
Codeinspection
inspection •• An
Anoracle
oraclecontains
containsthethepredicted
predicted
•• Proofs
Proofs(Design
(Designby byContract)
Contract) results
resultsfor
foraaset
setof
oftest
testcases
cases
•• Black-box,
Black-box,white
whitebox,
box, •• The
Thetest
testoracle
oraclehas
hastotobe
bewritten
written
•• Select
Selectintegration
integrationtesting
testingstrategy
strategy down
downbefore
beforethe
theactual
actualtesting
testingtakes
takes
(big
(bigbang,
bang,bottom
bottomup,up,top
topdown,
down, place
place
sandwich)
sandwich)
Quality activities and OO SW
Actual Needs and Delivered
Constraints User Acceptance (alpha, beta test)
Package

Review

System System Test System


Specifications Integration
Analysis /
Review

Subsystem Integration Test Subsystem


Design/Specs
Analysis /
Review
Unit/
Unit/
Component Module Test Components
Specs

User review of external behavior as it is


determined or becomes visible
Installation
 Physically converting an old information system to a new or modified
one.
 Strategies:
1) Direct changeover.
2) Parallel conversion.
3) Gradual, or phased, conversion.
4) Modular conversion.
5) Distributed conversion.
Conversion approaches
1) Direct changeover - on a specified date, users stop using the old system,
and the new system is put into use.
2) Parallel conversion - running an old system and a new system at the
same time, in parallel. When the same results can be gained over time, the
new system continues to be used and the old one is stopped.
3) Phased or Gradual conversion - this plan, the volume of transactions
handled by the new system is gradually increased as the system is phased
in.
4) Modular conversion - uses the building of self-contained, operational
subsystems to change from old systems to new in a gradual manner. As
each module is modified and accepted, it is put into use.
5) Distributed conversion - refers to a situation in which many installations
of the same system are contemplated, as is the case in banking or in
franchises such as restaurants or clothing stores. One entire conversion is

You might also like