15- Software Development
15- Software Development
Software
Development
15.5
Testing
methods
Chapter 15.6
Outline
Test strategy,
test plan, test
data
Analysis
Requirements specification - Outlines the
functional, technical, and operational
criteria that the software must meet,
serving as a blueprint to guide the
development process.
Analysis Design
Requirements specification - Outlines the Plan the algorithm - Decide
functional, technical, and operational on what identifiers are
criteria that the software must meet, needed, what data structure
serving as a blueprint to guide the needs to be used.
development process.
Plan the algorithm using a
Plan a solution. Decide whether to use flowchart or pseudocode.
• A bottom up approach - Building from
individual components to create a
whole system.
• A top down approach - Breaking down
a system by starting with its overview.
15.1 Stages in the program development life By Awab Aqib
cycle
Requirements specification - Outlines the Plan the algorithm - Decide Choose a programming Testing - systematic
functional, technical, and operational on what identifiers are language - Pick one that is process of evaluating
criteria that the software must meet, needed, what data structure the most suitable for the software to ensure it
serving as a blueprint to guide the needs to be used. solution you propose. meets specified
development process. requirements and
Plan the algorithm using a Might encounter bugs, that functions correctly.
Plan a solution. Decide whether to use flowchart or pseudocode. is when debugging comes
• A bottom up approach - Building from in.
individual components to create a
whole system. Check at the end whether
• A top down approach - Breaking down the code does what it
a system by starting with its overview. intends to do.
15.1 Stages in the program development life
cycle
Analysis
Maintenance Design
Testing Coding
Rapid
Waterfall Iterative
Application
model Model
Development
The waterfall model is a linear and sequential software development approach where
Waterfall model progress flows downwards through distinct phases, each dependent on the completion of
the previous phase.
Analysis
Design
Analysis
Design
Waterfall model
Coding
Testing
Maintenance
Advantages Disadvantages
Iterative model The iterative model is a software development approach that cycles
through repeated phases, allowing for flexible adjustments and
improvements throughout the development process.
Iterative model
Advantages
Cost-effectiveness in altering scope/requirements. Simpler testing and debugging of smaller program subsets.
Continuous delivery of operational products with each increment. Leveraging lessons from each increment for subsequent ones.
Iterative model
Disadvantages
Hard to be used in developing small software systems due to difficulty in breaking them into
manageable modules.
Advantages
Disadvantages
Only systems that can be modularised can be built using Requires highly skilled developers / designers.
RAD.
Definition
A structure chart is a visual representation outlining the hierarchical structure and
relationships between modules or components in a software system.
Sum
sum
INPUT numbers OUTPUT Sum
Calculate Sum
Terminology
Sum
Interface
sum
Module INPUT numbers OUTPUT Sum
Calculate Sum
Example - Conditionals
Eg: A program that checks whether a customer is eligible for discount
Discount Determiner
UserPurchaseAmount
Initialise OUTPUT message
MinAmountForDiscount Input
UserPurchaseAmount
UserPurchaseAmount >
MinAmountForDiscount
Example - Iterations
Eg: A program that generates numbers from 1 square to N square.
N Square Generator
UNTIL Count > N
Count
Count
OUTPUT N 2
2
Square it
Increment Count
Current State a
S1 S2
start
S1
a S1
Input
b
Current State
b
S1 S2
start
S1 S2
a S1
Input
b S2
Current State
b
S1 S2
start
S1 S2
a S1
Input
b S2 S2
Current State
b
S1 S2
start
S1 S2
a S1 S1
Input
a
b S2 S2
Current State
b
S1 S2
start
S1 S2
a S1 S1
Input a
b S2 S2
Notes: If the FSM has a final state (halting state), this is shown by a double-circle state.
15.3 Program design using state- By Awab Aqib
transition diagrams
Current State
b|x
S1 S2
start
S1 S2
a S1 S1
Input
a|z
b S2 S2
Worked Example
Design a state-transition diagram for a simplified elevator control system in a building. The
elevator operates in four distinct states: Idle on Ground Floor, Moving Up, Moving Down, and
Stopped at a Floor.
State transitions occur based on specific criteria: from "Idle on Ground Floor" to "Moving Up" or
"Moving Down" upon receiving corresponding directional commands; from "Moving Up" or "Moving
Down" to "Stopped at a Floor" when reaching a floor; from "Stopped at a Floor" to either "Moving Up,"
"Moving Down," or "Idle on Ground Floor" based on received directional commands or absence of
pending commands for two minutes respectively. Illustrate these states and transitions in a labeled
state-transition diagram.
By Awab Aqib
15.3 Program design using state-
transition diagrams
Worked Example
Design a state-transition diagram for a simplified elevator control system in a building. The
elevator operates in four distinct states: Idle on Ground Floor, Moving Up, Moving Down, and
Stopped at a Floor.
State
Moving Up
Moving Down
Stopped at a Floor
• from "Idle on Ground Floor" to "Moving Up" or "Moving Idle on Ground Floor Up Button Press Moving Up
Down" upon receiving corresponding directional
commands; Idle on Ground Floor Down Button Press Moving Down
• from "Moving Up" or "Moving Down" to "Stopped at a Floor"
when reaching a floor;
• from "Stopped at a Floor" to either "Moving Up," "Moving
Down," or "Idle on Ground Floor" based on received
directional commands or absence of pending commands
for two minutes respectively.
• from "Idle on Ground Floor" to "Moving Up" or "Moving Idle on Ground Floor Up Button Press Moving Up
Down" upon receiving corresponding directional
commands; Idle on Ground Floor Down Button Press Moving Down
• from "Moving Up" or "Moving Down" to "Stopped at a Floor"
when reaching a floor; Moving Up Reach a floor Stopped at a Floor
• from "Stopped at a Floor" to either "Moving Up," "Moving
Down," or "Idle on Ground Floor" based on received Moving Down Reach a floor Stopped at a Floor
directional commands or absence of pending
commands for two minutes respectively. Stopped at a Floor Up Button Press Moving Up
Idle on
State Transition Table
Ground Moving Up
State Event Next State
Floor
Reach a floor
Idle on Up Button
Moving Up
Ground Floor Press
Up Button
Idle on Down Button
Moving Down
Ground Floor Press
Press
Stopped at a
Moving Up Reach a floor
Floor
Stopped at a
Moving Down Reach a floor
Floor
Down Button
Stopped at a Up Button
Floor Press
Moving Up Moving Press Stopped at
Stopped at a Down Button
Moving Down
Down a Floor
Floor Press
Worked Example
Design a state-transition diagram for a two’s complement FSM.
A finite state machine has been designed that will take as input a positive binary integer, one bit at a
time, starting with the least significant bit. The FSM converts the binary integer into the two's
complement negative equivalent.
Input: Output:
Input: Output:
0 0
Input: Output:
0 0 0 0
Input: Output:
1 0 0 1 0 0
Input: Output:
0 1 0 0 1 1 0 0
Input: Output:
1 0 1 0 0 0 1 1 0 0
Input: Output:
0 1 0 1 0 0 1 0 1 1 0 0
Input: Output:
-32 16 8 4 2 1
0 1 0 1 0 0 1 0 1 1 0 0
Current State S1 S1 S2 S2
Input Bit 0 1 0 1
Next State S1 S2 S2 S2
Output Bit 0 1 1 0
1|1
start
S1 S2
Syntax Error
A syntax error occurs in programming when the code violates the language's rules or grammar,
preventing proper interpretation or execution by the compiler or interpreter.
Compiler Interpreter
If a program compiles without Syntax checking occurs only on
errors, it indicates the absence statements scheduled for
of syntax errors in the code. execution; hence, an
insufficiently tested program
might still contain undetected
syntax errors.
Logic Error
A logic error in programming refers to a flaw in the code's algorithm or logic, causing unexpected
or incorrect outputs. Eg.
Run-time Error
A run-time error occurs during program execution due to unforeseen conditions, causing the
program to terminate abnormally.
Stub
Testing
Stub Testing
Stub testing involves creating
minimal code pieces (stubs)
that mimic functionalities of
larger modules or components
to enable initial testing or
simulation of interactions
within a system.
By Awab Aqib
15.5 Testing Methods
Black
Box
Testing
White
Box
Testing
Dry running
an
algorithm
Dry-running an algorithm
Dry running an algorithm involves manually executing the algorithm step-by-step using a trace
table with varying test data to simulate its behaviour and understand how it processes inputs,
executes instructions, and produces outputs without actually running the code on a computer.
Trace Table
Inputs: 4,5,1,3,100
By Awab Aqib
15.5 Testing Methods
1 4
Inputs: 4,5,1,3,100
By Awab Aqib
15.5 Testing Methods
4 1 4
Inputs: 4,5,1,3,100
By Awab Aqib
15.5 Testing Methods
4 1 4
2 5
Inputs: 4,5,1,3,100
By Awab Aqib
15.5 Testing Methods
4 1 4
9 2 5
Inputs: 4,5,1,3,100
By Awab Aqib
15.5 Testing Methods
4 1 4
9 2 5
3 1
Inputs: 4,5,1,3,100
By Awab Aqib
15.5 Testing Methods
4 1 4
9 2 5
10 3 1
Inputs: 4,5,1,3,100
By Awab Aqib
15.5 Testing Methods
4 1 4
9 2 5
10 3 1
Inputs: 4,5,1,3,100 4 3
By Awab Aqib
15.5 Testing Methods
4 1 4
9 2 5
10 3 1
Inputs: 4,5,1,3,100 13 4 3
By Awab Aqib
15.5 Testing Methods
4 1 4
9 2 5
10 3 1
Inputs: 4,5,1,3,100 13 4 3
5 100
By Awab Aqib
15.5 Testing Methods
4 1 4
9 2 5
10 3 1
Inputs: 4,5,1,3,100 13 4 3
113 5 100
By Awab Aqib
15.5 Testing Methods
Trace Table
RunningTotal Counter NextNumber Average Output
Pseudocode 0
4 1 4
9 2 5
10 3 1
13 4 3
113 5 100
Inputs: 4,5,1,3,100
22.6 113
22.6
By Awab Aqib
15.5 Testing Methods
Integration
Testing
Integration Testing
Integration testing is the process of testing combined modules or components to ensure they
work together as expected within the entire software system.
Incremental integration testing involves gradually integrating and testing new modules with
existing components, ensuring seamless functionality as they're added to the system.
Alpha
Testing
Alpha Testing
Alpha testing is the initial testing phase conducted by internal teams or users within the
developing organization to assess a software product's functionality, usability, and
performance before wider release.
Beta
Testing
Beta Testing
Beta testing is a software testing phase
conducted by a select group of external
users who assess the software's
performance, usability, and functionality
in a real-world environment before its
official release to the public.
Acceptance
Testing
Acceptance Testing
Acceptance testing involves customers or end-users verifying if the software meets their specified
requirements and is ready for use or deployment.
Boundary
Normal Data Abnormal Data
(extreme) Data
Represents typical or Consists of input Involves input values
expected input values that fall at the edges or
values within the outside the usual extremes of valid
standard operational operational ranges, aiming to
range for a system. parameters or test system behavior
deviate from at the limits of its
expected patterns. functionality.
Examples
A program has been written to obtain a number input from the users. The input must be from 1
to 100, and it must be an integer.
Boundary
Normal Data Abnormal Data
(extreme) Data
25 -5 1( )|0( )
99 3.5
Definition
Corrective maintenance involves addressing and fixing software faults or defects identified after
deployment to restore the system's intended functionality.
Program errors may remain undetected for an extended period as they might occur infrequently,
leading to unexpected outcomes or program crashes only under rare conditions.
Definition
Adaptive maintenance adjusts program functionality in response to specification changes or
evolving requirements.
Example: How the Instagram/Facebook evolves to have similar functions like snapchat.
By Awab Aqib
15.9 Perfective Maintenance
Definition
Enhances and improves software by implementing additional features or optimising existing
functionalities to meet evolving user needs and expectations.
Example: YouTube introduces a feature that allows users to create and watch short-form
vertical videos, typically up to 60 seconds in length, making the app similar to platforms like
TikTok and Instagram Reels.