bit-3101-software-engineering-manual-copy
bit-3101-software-engineering-manual-copy
BBIT 3101
UNIT: SOFTWARE ENGINEERING
Chapter Objectives
As we move into the fourth era, the problems associated with computer software continue to intensify:
Hardware sophistication has outpaced our ability to build software to tap the hardwares
potential.
Our ability to build new programs cannot keep pace with the demand for new programs.
Our ability to maintain existing programs is threatened by poor design and inadequate resources.
In addition, the quick pace in which consumers demand new software have resulted in impossible deadlines
and tough schedules that software designers have to deal with. This has also resulted in other problems:
Project overruns: i.e. the project takes far longer than expected.
Poor quality products
In Software Engineering concepts, there are three key elements (also known components): methods, tools
and procedures.
Software
Engineering
Methods: these are the how-to for building the software. Examples of these are (I) Project Planning; (2)
System and Software requirement analysis; (3) Coding, testing and maintenance.
Tools: these are the automated or semi-automated support for methods. Examples of these are CASE, or
Computer-Aided-Software-Engineering, the software equivalent of hardware design.
Procedures: this is the glue that holds the methods and tools together. It defines the sequence in which
methods are applied, and makes sure that the development of software is logical (i.e. flows in correct order)
and is on time too.
Software Engineering thus comprises of a set of steps that encompass each of the three elements above. These
steps are often referred to as Software Engineering Paradigms. Four such paradigms are of interest to us:
Classical Life Cycle
Prototyping
Fourth Generation Techniques
A combination of all three techniques
Systems
Engineering
Analysis
Design
Coding
Testing
Maintenance
Systems engineering: establish requirements for all system elements and then allocating some subset of
these requirements to software. Essential for interfacing correctly with external components, e.g. databases,
hardware
Analysis: analysis of requirements is now focused on software alone. Requirements for both system and the
software are documented and reviewed with the customer.
Design: the multi-step process that focuses on four distinctive attributes of the program: (a) data structures;
(b) software architecture; (3) Procedural detail; (4) Interface characteristics.
Coding: design is translated to machine readable form
Testing: focuses on the logical internals of the software.
Maintenance: errors/changes will invariably occur because software must accommodate changes in the real
and external environment.
Common problems faced with the Classic Life-Cycle
Real projects rarely follow sequential flow of the "waterfall" model, i.e. they jump to-and-fro. And
iterations by itself always produces problems.
It is difficult to determine requirements so explicitly and so early in the development. There is always a
lot of uncertainty at the start of the project.
The customer has to wait for a really long time before he even gets a feel of the real project, i.e. working
version of prototype is not available early in the cycle.
Despite these problems, the Classic Life-Cycle still remains the most widely used procedural model for
software engineering.
of an operating system, or the form that human-machine interaction should take. In these cases, a prototyping
approach could be considered.
A prototype can be defined as the first or original type or model in which anything is copied. The prototyping
process thus is a series of steps that enables the developer to create a model of software that must be built.
The model can take one of three forms:
Paper/PC model that depicts how human interactions will occur
A working prototype that implements some subset of the functions required for the desired software
An existing program that performs part of or all of the functions desired but has other features that will
be improved later.
Requirements
Gathering
"Quick Design"
Build Prototype
Engineer Product
Requirements
Gathering
Design
Strategy
Implementation
Product/
software
Changeover/
maintenance/Revie
A possible solution to this problem then is that the software developer and customer must both
agree that the prototype is only meant to define requirements. It is then discarded and actual
software is engineered with an eye towards quality and maintainability.
4GTs are not substitutes for good design planning necessary particularly for large
software development efforts.
Requirements
Gathering
Prototyping
Engineer
The overall demand for software will continue to rise in the future.
However, the ratio of software products developed using conventional methods and 4th
generation methods will change.
1) Peters, J.F and Pedrycz (2000) Software Engineering: An Engineering Approach, John Wiley
and sons.
2) Pressman R.S (1997)software engineering: a practitioner’s Approach, McGraw Hill
3) Somerville Ian (2002) software engineering ,Pearson’s education
Chapter Objectives
The software developer performing Requirement analysis would often be known as the analyst.
2.2.2 Review
Review of analysis documents like specification.
Review should first be conducted at a macroscopic level.
Conducted by customer and developer.
Results in modifications to
Functions;
Performance;
Information representation;
Constraints; and
Validation criteria
Software Engineering Manual 11
First Set
These questions should lead to a basic understanding of the problem
Focuses on the customer and overall goals and benefits.
Second Set
These questions should enable the analyst to gain a better picture of the problem.
Allow the customer to voice his/her perceptions about a solution.
Third Set
Focuses on the effectiveness of the meeting itself.
Information Control
Represents the individual data and control items that comprise some larger item of information.
Information Structure
Represents the internal organization of various data and control items
Ask ourselves questions like are data and control items to be organized as an n-th dimension
table or as a hierarchical structure?
2.7 Partitioning
Problems are often too large and complex to be understood as a whole, so we partition them. The word
partition means to divide into parts.
Interfaces between these divided parts must be established so that the overall function can be accomplished.
Information, functional, and behavioral domains can be partitioned.
A hierarchical representation of the function or information can then be established.
Safehome
Software
Safehome
Software
Horizontal Partitioning
Implementation view presents the real world manifestation of processing functions and
information structures.
Concerned with the physical how-is-it-going-to-be-done aspect.
1. Kotonya.G and Somerville, I (1998), Requirements engineering: Processes and Techniques, Wiley.
2. Somerville Ian (2002) software engineering ,Pearson’s education
Chapter Objectives
Definition
Common characteristics in Requirement Analysis Methods
Differences in Requirement Analysis Methods
Data Structure-Oriented Methods
Support for abstraction: abstraction permits one to concentrate on a problem at some level
of generalization without regard to irrelevant low level details.
All methods provide mechanisms for partitioning a function into a set of sub-functions.
Representation of essential and implementation views.
Order no.
Customer
Name
Billing Late
Order(1, n) Charge
(0, 1)
Amt. pd.
Deposit No
(1, dn)
Date Deposit
Deposit(1, d)
Total
Monthly
Monthly
Report
Receipts
Jackson System Development (JSD)
Focuses on models of the "real-world" information domain
Data Stream
Process-0 D Process-1
State Vector
Process-0 Process-1
SV
1. Explain why it is almost inevitable that requirements from different stakeholders in a system
development will conflict in some ways.
2. Discuss the concept of formal specification and outline its major weaknesses
1. Kotonya.G and Somerville, I (1998), Requirements engineering: Processes and Techniques, Wiley.
2. Somerville Ian (2002) software engineering ,Pearson’s education
Chapter Objectives
Architectural Design
Procedural Design
Modularity
Abstraction
Software Architecture
Control Hierarchy
Data Structure
Software Procedure
Information Hiding
Functional Independence (Cohesion andCoupling)
Criteria for Good Design
Detail design
Data design
Architectural design
Technical aspects
Procedural design
Interface design
flow of control; (IV) Two boxes connected by a line of control will indicate a Sequence.
Tabular Design Notation
Decision tables provide a notation that translates actions and conditions (described in a
processing narrative) into a tabular form.
The upper left-hand section contains a list of all conditions. The lower left-hand section lists all
actions that are possible based on the conditions. The right-hand sections form a matrix that
indicates condition combinations and the corresponding actions that will occur for a specific
combination.
Fixed rate account 1 2 3 4 5
Conditions Variable rate account T T F F F
Consumption <100KWH T F T F
24 Software Engineering Manual
Consumption 100KWH F T F T
Minimum monthly charge X
Schedule A billing X X
Actions
Schedule B billing X
Other treatment X
4.5.1 Modularity
Definition of Modularity:
Software is divided into separately named an addressable components, called modules,
that are integrated to satisfy problem requirements.
The graph shown refers to the question of Modularity and Software Cost, and is a
useful tool to consider when modularity is to be implemented. In this graph, the cost or
effort drops as more modules are considered, but the cost to interface modules
increases as we have more modules. Thus, we must take care to stay in the region of
minimum cost, i.e. a balance between the number of modules and the cost or effort.
Simplify design, making program easy to modify and reduce maintenance costs
Provide a framework for more complete testing, easier to test
Produces well-designed and more readable program
Rational Against Modularity
Execution time may be, but not necessarily, longer
Storage size may be, but is not necessarily, increased
Compilation and loading time may be longer
Intermodule communication problems may be increased
Demands more initial design time
More linkage required, run-time may be longer, more source lines must be written and
more documentation has to be done
4.5.5 Abstraction
Abstraction permits one to concentrate on a problem at some level of generalization without
regard to irrelevant low level details.
Use of abstraction also permits one to work with concepts and terms that are familiar, in the
problem environment without having to transform them to an unfamiliar structure.
Warnier-Orr and Jackson diagrams. Some terminology used in the discussion of control
hierarchy are:
Fan-Out, which is a measure of the number of modules that are directly controlled by
another module;
Fan-in, which indicates how many modules directly control a given module.
Depth: Number of levels of control
Width: Overall span of control
Some other terms used in Control Hierarchy are:
Superordinate: i.e. a module that controls another module;
Subordinate: i.e. a module that is controlled by another module.
Logical
Temporal
Procedural
Communication
Stamp
Control
Common
4.7.1 Cohesion
A module with high cohesion is able to perform a single task within a software procedure,
requiring little interaction with procedures being performed in other parts of the program.
In other words, a cohesive module does just one thing and sticks with it.
Low Levels
Coincidental Cohesion: a module that performs a set of tasks that relate to each other
loosely, if at all.
Logical Cohesion: a module that performs tasks that are related logically (e.g., a
module that produces all output regardless of type)
Temporal Cohesion: a module that performs tasks that are related by the fact that all
must be executed with the same span of time.
Moderate Levels
Procedural Cohesion: this happens when the processing elements of a module are
related and must be executed in a specific order.
Communication Cohesion: when all processing elements concentrate on one area of a
data structure.
High Levels
High cohesion is characterized by a module that performs one distinct procedural task.
4.7.2 Coupling
Coupling is a measure of interconnection among modules in a software structure.
Low Coupling Levels (desirable)
Data coupling: for example passing of simple data like an argument list from one
module to another module.
Stamp coupling: a portion of data structure, rather than a argument list, is passed via a
module interface.
Chapter Questions
Chapter Objectives
Many applications today still require fast, "tight" (i.e. low memory requirements)
programs. Languages with optimizing compilers may be attractive if software
performance is a critical requirement.
Source code portability
This generally refers to whether source code may be transported from processor to
processor and compiler to compiler with little or no modification.
Availability of development tools
These can shorten the time required to generate source code and can improve the
quality of code.
Maintainability of source code
Source code must be easy enough to understand so as to allow modifications according
to changes in design.
The technical characteristics of programming languages span an enormous number of topics. This section
introduces a brief discussion of programming language fundamentals.
5.5.2 Subprograms
A separately compatible program component that contains a data and control structure. A
subprogram exhibits a number of generic characteristics:
a specification section that includes its name and interface characteristics
an implementation section that includes data and control structures
an activation mechanism that enables the subprogram to be invoked from elsewhere
in the program.
Chapter Objectives
Transaction Flow
Information flow is characterized by a single data item, called a transaction, that triggers other
data flow along one of many paths.
The transaction is evaluated and, based on its value, flow along one of many action paths is
initiated.
The hub of information flow from which many action paths flow from is called a transaction
centre.
Based on the location of boundaries, transforms are mapped into program structure as
modules
The precise mapping and definition of modules is accomplished by distributing control top-
down in the structure
SafeHome Alarm
Software Type Alarm
Control Configure
Panel System
Configuration data
Configure
request Configure information
Interact
with User
Configuration data
Start/
Stop
Activate/
Deactivate
System
Control Panel
password
Display
Display
information
Display
Process Valid password Messages
Password and Status
Alarm
Telephone Telephone
Figure 6-1 : Level 1 DFD for Safehome number tones Line
Sensor
Information
Format
Alarm
for
Type
display
Generate
Alarm
Sensor Signal
Configuration Information ID Type,
Location
Assess
Against
Setup
Telephone
number
Sensor ID
Type
Dial
Read Phone
Sensors
Telephone
Number
Sensor Tones
Status
Figure 6-2 : Level 2 DFD That Refines the Monitors Sensors Process
Sensor
Sensor Information
Status Configuration Information
Sensor ID type,
location
Acquire Generate
Alarm alarm
Alarm condition code, condition Alarm data signal Alarm
sensor ID, timing type
information
List
of numbers Select
phone
number
Telephone
number Assess
Against
Setup
Tone ready,
telephone number Generate
pulses
to line
Telephone
number
tones
Figure 6-3 : Level 3 DFD that REFines the Monitor Sensor Process
Isolate the transform centre by specifying incoming and outgoing flow boundaries
Sensor
Sensor Information
Status Configuration Information
Flow
Boundary
Configuration data Generate
display
Read
Sensors
Formatted ID type,
location
Sensor ID
setting Acquire Format
response display
info
Sensor ID type,
location
Acquire Generate
Alarm alarm
Alarm condition code, condition Alarm data signal Alarm
sensor ID, timing type
information
List
of numbers Select
phone
number
Telephone
number Assess
Against
Setup
Tone ready,
telephone number Generate
pulses
to line
Telephone
number
tones
Incoming flow
controller
Monitor
Sensor
Executive
B
C
Main
Controller
Incoming flow
controller
D B
C A
Transform
flow boundary
Monitor
Sensor
Executive
Generate Generate
display pulses to line
Refine the "First-Cut" program structure using design heuristics for improved software quality
Monitor
sensors
executive
Read
Generate Generate
sensors
display pulses to
lines
Apply the concepts of modules of modules independence by expanding or contracting modules to produce
sensible factoring, good cohesion, minimal coupling,.i.e.. we want a structure that can be implemented within
practical limits, tested and maintained without too much difficulty.
Monitor
Sensor
executive
Establish Alarm
Acquire
alarm output
response
conditions controller
info
Generate
pulses to lines
User Build
commands Read system
configuration
and data data
file
Formatted
configuration data
Read user Configure
command
Invoke Start/Stop
command
processing Activate/Deactivate
messages
Configuration
data
Validation Activate/
Deactivate
message
Configuration
data
Password Read
password
Display
messages
and status
Four digits
Compare Valid
password password
and file Display
information
Invalid
password
Produce
invalid
message
"Try again"
message
Figure 6-10 : Refined Program Structure for Monitor Sensors
Identify the transaction centre and the flow characteristics along each of the action paths.
Transaction centre: the ©bubbleª from where all the action paths flow from
User Build
commands Read system
configuratio
and data data
n file
Formatted
configuration data
Read user Configure
command
Invoke Start/Stop
command
processing Activate/Deactivate
messages
Configuration
data
Validation Activate/
Deactivate
message
Configuration
data
Password Read
password
Display
messages
and status
Four digits
Valid
Compare
password password
and file Display
information
Invalid
password
Produce
invalid
message
"Try again"
message
Figure 6-11 : Level 2 DFD for user interaction subsystem
The structure of the dispatch branch contains a dispatcher module that controls all subordinate action path
controllers
Each action path of the DFD is mapped to a structure that corresponds to its specific flow characteristics
Transaction
control
Reception
a path
b d
Dispatcher
b
a c
Flow 1
d
p
q r s
q
p
Factor and refine the transaction structure and the structure of each action path.
User interaction
executive
Refine the ©First-Cutª program structure using design heuristics for improved software quality.
The last two steps are similar to transform analysis. In this design approach, criteria such as
module independence, practicality, and maintainability must again be considered.
User
interaction
executive
Display Produce
messages and invalid
status message
Use CASE tools that simulate run-time performance to isolate areas of inefficiency
During detail design, select modules that are suspected "time hogs" and carefully develop procedures
(algorithms) for time efficiency
Code in high-order programming language
Instrument the software to isolate modules that account for heavy processor utilization
If necessary, redesign or recode in machine dependent language to improve efficiency
Decision
Effect of
decision
Decision
Effect
1. Clearly distinguish between process oriented design and data oriented design, giving valid
examples
2. Draw a context model for a patient management information system in a hospital
3. Draw a data flow diagram for a customer withdrawing cash from an ATM in a bank.
Chapter Objectives
A A A
B C D B B C D
Iteration Selection
Sequence
A1 B1
A2 B2
A3 B3
Rules of Correspondence
Records (input and output) must be in the same order.
Records in the same number of each;
Output derived from input.
Structure Clash: occurrence where correspondences are not possible between the two data structures.
May be resolved by Program Inversion.
Examples
Example 1
We have a serial file of records and we wish to print them one record per line. The input file data
structure is simply an iteration of records for printing, and the output file data structure an iteration of
lines (each containing one record), and we want to print a report heading at the start and a line containing
a record count at the end.
Input Output
File File
Line
Process Input
To Give
Output
Process
Record To
Line
Example 2
We have a sales file which is sorted into year-within-sales area code. It is required to produce a
report to show the sales details, with appropriate high-lighting for low, moderate and high sales
(that is, a single exclamation mark when the sales value is less than 100, two exclamation marks
when the sales value is between 100 and 300, and three exclamation marks for values greater
than 300). Headings are required for each area and totals are to be produced at relevant control
breaks, that is, at change of year end area code.
Output Report
File
Sales
File
Area *
Area *
Area Area Area
Heading Body Total
Year *
Year *
Sales Report
Process *
Area
Process *
Year
Year Year
Body Total
Report to Line *
Sales Report
1,4 2,3
C1
Process Area
*
5,13,15 6
C2
Process year *
14,16 7
C3
Record to
Line *
11,12,4
8 C4 9 C5 10 else
Sales under Sales 100 to
100 300 Sales over 300
Close files
Stop
Input Operations
Read a Sales file record
Output Operations
Print area headings
Print area total
Print year total
Print a sales under 100
Print a sales from 100 to 300
Print a sales over 300
Computation Operations
Add to area total
Add to year total
Initialization Operations
Initialize area total to zero
Initialize year total to zero
Operations to support condition list
Store area code
Store year
The condition list should include:
C1 - Until end of sales file
C2 - Until end of sales file or change of area
C3 - Until end of sales file or change of area or change of year
C4 - If sales value <100
C5 - If sales value >= 100 and<= 300
1. A sequential-update program is required to maintain a master file of rental records on video tape rentals. The
transaction file contains the following types of transaction:
inserting a new video title,
amending the rental-status of a video title,
deleting a video title
These are represented by transaction type code 1,2 and 3 respectively. For transaction type 1 and 3, there
would be at most one transaction for each video title. But for type 2 record, there could be multiple
transactions for each video title.
The master and transaction files sorted in ascending sequence of video title code.
The program has to cater for possible matching errors between the master and the transaction files
Use Jackson's Structured Programming Design Methods to:
a) Draw the data structures for the respective files, and show the correspondences between their
components
b) List the conditions and operations
c) Produce the final program structure
State clearly any assumption(s) that you make
2. ABC company employs 8 salesmen. Records of sales by salesman for every month are stored in the master
file. The management wants sales report listing the salesman and their sales figures from January to
December in ascending order.
Program Specification
The program uses master file to generate a report.Master file contains
salesman name
12 monthly sales(January to December)
The master file is sorted sequentially using salesman name.The master file contains only valid data.
Given the program specification above, use Jackson's Structured Programming design method to:
a) Draw the data structures for the respective files, and show the correspondences between their
components.
b) List the conditions and operations.
c) Produce the final program structure.
Chapter Objectives
Software Reliability
Product Product
Revision Transition
Product Operations
- The effort required to test a program to ensure that it performs its intended
function.
MTTF * 100%
Availability =
MTTF + MTTR
1. Explain why software design metrics only are inadequate for predicting the quality of the software
2. Elaborate how you can asses the quality of a particular application software
3. Identify various metrics that can be used to determine the reliability of software
Software Test
Configuration Configuration
Testing
Debug
Test Results
Errors
Corrections
Evaluation
Expected
Results Error Rate
Data
Predicted
Reliability Reliability
Model
Two classes of input are provided to the test process, namely: (1) a software configuration that includes a
Software Requirements Specification, a Design Specification, and source code; (2) a test configuration that
includes a Test Plan and Procedure, any testing tools that are to be used, and test cases and their expected
results.
Tests are conducted and all results are evaluated, i.e. test results are compared with the expected results.
When erroneous data is encountered, debugging commences. As test results are gathered and evaluated, a
qualitative indication of software quality and reliability begins to surface. Two possible situations can occur
here: if there are severe errors that require design modification are encountered regularly, software quality
and reliability are suspect, and further tests are indicated. if, on the other hand , software functions appear to
be working properly and the errors encountered are easily correctable, either (1) Software quality and
reliability are acceptable, or (2) tests are inadequate to uncover severe errors.
The results accumulated during testing can be evaluated in a more formal manner: Software reliability models
use error-rate data to predict future occurrences of errors, and hence, reliability.
Finding the most errors within a minimum amount of time and effort
Sequence
If
Case
While
Until
2,
R2
6 4,
R3
7 8
R1
R4
10
11
Thus, the value of V(G) provides us with an upper bound for the number of independent paths that comprise
the basis set, and by implication, an upper bound on the number of tests that must be designed and executed
to guarantee coverage of all program statements.
The basis path testing can be applied as a series of steps:
Using the design or code as foundation , draw a corresponding flow graph.
Determine the cyclomatic complexity of the resultant flow graph.
Determine a basis set of linearly independent paths.
Prepare test cases that will force execution of each path in the basis set.
Graph Matrix
A graph matrix is a software tool that is developed that assist in basis path testing.
The graph matrix is initially nothing more than a tabular representation of a flow graph
To make it more useful , alink weight is added to each matrix entry. The link weight provides additional
information about control flow . In its simplest form, the link weight is 1 (a connection exists) or 0 (a
connection does not exist) . But link weights can be assigned other, more interesting properties:
The probability that a link (edge) will be executed
The processing time expended during traversal of a link
The memory required during traversal of a link
The resources required during traversal of a link
e b
d
5 4
f
g c
Flow Graph
Connected to node
Node 1 2 3 4 5
1 a Connections
1-1 = 0
2
2-1 = 1
3 d b
4 c 2-1 = 1
5 g e 2-1 = 1
Cyclomatic complexity : 3 + 1 = 4
A test case design method that exercises the logical conditions contained in a program module
Focuses on testing each condition in the program
Loop testing
Focuses exclusively on the validity of loop constructs
Four classes of loops : simple loops, concatenated loops, nested loops, and unstructured loops
Simple Loops
Nested Loops
Concatenated Loops
Unstructured Loops
9.5 Black Box Testing
Black box testing methods focus on the functional requirements of the software, i.e. black box testing enables
the software engineer to derive sets of input conditions that will fully exercise all functional requirements for
a program.
This is not an alternative technique to white box testing techniques , rather it is a complimentary approach
that is likely to uncover a different class of errors than white box methods.
Black box testing attempts to find errors in the following categories:
Incorrect or missing functions
Interface errors
Errors in data structures or external databses access
Performance errors
Initialisationand termination errors.
Unlike white box testing which is performed early in the testing process, black box testing tends to be applied
during later stages of testng. This is because black box testing purposely disregards control structure,
attention is focused on the information domain.
By applying black box testing techniques, a set of test cases can be derived to satisfy the folllowing criteria:
Test cases that reduce, by a count that is greater than 1, the number of additional test cases that
must be designed to achieve reasonable testing; and
Tests cases that tell us something about the presence or absence of classes of errors, rather than
an error associated only with the specific test at hand.
Black Box Testing techniques:
Equivalent Partitioning.
Boundary Value Analysis
Cause-Effect Graphing Techniques
Comparison Testing
Equivalence Partitioning
Divides the input domain of a program into classes of data
Strives to define a test case that uncovers classes of errors
Equivalence classes may be defined according to the following guideline:
If an input condition specifies a range or a specifies values, one valid and two invalid
equivalence classes are defined
If an input condition specifies a member of a set or a boolean, one valid and one invalid class
are defined
Boundary Value Analysis
Select test cases at the "edges" of the classes
Rather than focusing solely on input conditions, it also derives test cases from the output domain
Guidelines of designing test cases
If an input condition specifies a range bounded by values a and b, test cases should be designed
with values a and b, just below a and b, respectively
If an input condition specifies a number of values, test cases should be developed that exercise
the minimum and maximum numbers. Values just above and below minimum and maximum are
also tested
Apply guidelines 1 and 2 to output conditions
If internal data structures have prescibed boundaries (eg. an array has a defined limit of 100
entries), be certain to design test cases to exercise the data structure to its boundary
Comparison testing
A technique used when the reliability of software is absolutely critical
In this techinique, multiple and independent versions of software is developed for critical applications, even
when only a single version will be used in the delivered computer-based system
Each version is tested with the same test data to ensure that all provide identical output. Then all the versions
are executed in parellel with a real-time comparison of results to ensure consistency
Also known as back-to-back testing
Chapter Objectives:
At the end of this chapter, stdent should understand::
Software Testing
Types of testing
System Testing
The activities required to achieve software quality may be viewed as a set of components. Software
engineering methods provide the foundation from which quality is built. Analysis, design, and
implementation (coding) methods act to enhance quality by providing uniform techniques and predictable
results. Formal technical reviews (walk-throughs) help to ensure the quality of the products produced as a
consequence of each software engineering step. Through the process, measurement and control are applied to
every element of a software configuration. Standards and procedures help to ensure uniformity and a formal
SQA process enforces a "total quality philosophy".
A strategy for software testing may also be envisioned by moving outward along the spiral
Unit testing begins at the vortex of the spiral and concentrates on each unit of the software as implemented in
the source code.
Testing progresses by moving outward along the spiral to integration testing, where the focus is on the design
and the construction of the software architecture.
Taking another turn outward on the spiral , validation testing is encountered, where requirements established
as part of software requirement analysis are validated against the software that has been constructed.
Finally, at system testing, where the software and other system elements are tested as a whole.
Unit tests: focuses on each module and makes heavy use of white box testing
Integration tests: focuses on the design and construction of software architecture; black box testing is most
prevalent with limited white box testing.
High-order tests: conduct validation and system tests. Makes use of black box testing exclusively.
Interface
Local data structures
Driver Boundary conditions
Independent paths
Error-handling paths
Module to be
Tested
Test cases
Top-down Integration
An incremental approach
Modules are integrated by moving downward through the control hierarchy, begining with main control
module
Subordinate modules are incorporated into the structure in either a depth-first or breadth-first manner
Integration Process
The main control module is used as a test driver and stubs are substitued for all modules directly
subordinate to the main control module
Subordinate stubs are replaced one at a time with actual modules
Tests are conducted as each module is integrated
On the completion of each set of tests, another stub is replaced with the real module
Regression testing (ie, conducting all or some of the previous tests) may be conducted to ensure
that new errors have not been introduced
Major problem
Inadequate testing at upper levels when data flows at low levels in the hierarchy are required
Alternatives to the above problem
Delay many test until stubs are replaced with actual modules; but this can lead to diffculties in
determining the cause of errors and tends to violate the highly constrained nature of the top-
down approach
Develop stubs that perform limited functions that simulate the actual module; but this can lead
to significant overhead
Perform bottom-up integration
Bottom-up Integration
Integration process
Low-level modules are combined into clusters (sometimes called builds) that perform a specific
software subfunction
A driver (a control program for testing) is written to coordinate test case input and output
The cluster is tested
Drivers are removed and clusters are combined moving upward in the program structure
Recovery Testing
A system test that forces software to fail in a variety of ways and verifies that recovery is properly performed
If recovery is automatic, re-initialization, check pointing mechanisms, data recovery, and restart are each
evaluated for correctness
If recovery is manual, the mean time to repair is evaluated
Stress Training
Is designed to confront programs with abnormal situations where unusual quantity frequency, or volume of
resources are demanded
A variation is called sensitivity testing; it attempts to uncover data combinations within valid input classes
that may cause instability or improper processing
Performance Testing
To test the run-time performance of software
Extra instrumentation can monitor execution intervals, log events (eg, interrupts) as they occur, and sample
machine states on a regular basis
Use of instrumentation can uncover situations that lead to degradation and possible system failure
10.9 Debugging
Characteristics of Bugs
The symptom and the cause may be geographically remote
The symptom may disappear (temporarily) when another error is corrected
The symptom may actually be caused by non-errors(eg, round-off inaccuracies)
The symptom may be caused by a human error that is not easily traced
The symptom may be caused by a result of timing problems, rather than processing problems
It may be diffcult to accurately reproduce input conditions (eg a real-time application in which input ordering
is indeterminate)
The symptom may be intermittent. This is particularly common in embedded systems that couple hardware
and software inextricably
The symptom may be due to causes that are distributed across a number of tasks running on different
processors
Debugging Approaches
Brute force: is probably the most common and least efficient method for isolating the cause of a software
error. The program is loaded with run-time traces, and WRITE statements, and hopefully some information
will be produced that will indicated a clue to the cause of an error.
Backtracking: fairly common in small programs. Starting from where the sympton has been uncovered,
backtrack manually until the site of the cause is found. Unfortunately, as the number of source code lines
increases, the number of potential backward paths may become unmanageably large.
Cause Elimination: data related to the error occurrence are organised to isolate potential causes. A "cause
hypothesis" is devised and the above data are used to prove or disapprove the hypothesis. Alternatively, a list
of all possible causes is developed and tests are conducted to eliminate each. If the initial tests indicate that a
particular cause hypothesis shows promise, the data are refined in a attempt to isolate the bug.
Debugging Tools
Debugging compliers
Dynamic debugging aides ("tracers")
Automatic test case generators
Memory dumps
Cross reference maps
3. Kotonya.G and Somerville, I (1998), Requirements engineering: Processes and Techniques, Wiley
4. Peters, J.F and Pedrycz (2000) Software Engineering: An Engineering Approach, John Wiley and sons.
SAMPLE EXAMINATION
SOFTWARE ENGINEERING
INSTRUCTIONS
Question 1.
(b) (i) With the context of software design explain what is meant by the terms cohesion and coupling.(4marks)
(ii) How are the concepts of cohesion and coupling useful in arriving at good software design? (4marks)
(c) State two factors to be considered when selecting a programming language. (4 marks)
(d) The process of software development can be complex hence challenging. Explain how the following
techniques are applied in reducing the complexity and minimize the challenge.
Question 2.
(a) List and explain the major responsibilities of a software project manager. (4marks)
(b) Software maintenance has become an important activity of a large number of organizations. Explain the
different types of maintenance that a software product management need. (8marks).
(c) Explain the terms CASE tool and CASE environment. (6 marks)
Question 3.
(a) Discuss the following terms (10marks)
(i) Risk management
(ii) Configuration management
(iii) Scheduling
(iv) Software standards.
(v) Software
(b) Explain four major shortcomings that we might face if we use the classical waterfall model for developing all
types of software products. (4marks)
(c) Software design has two fundamental different approaches. State and give two advantages of each approach.
(6marks).
Question 4.
(a) A software development life cycle is a structure imposed on the development of a software product. Discuss
the six activities carried out in software development life cycle. (6marks)
(b) Explain how both the waterfall model of the software development and the prototyping model can be
accommodated in the spiral process model. (6marks).
(c) Describe four types of non-functional requirements that may be placed on a system. Give examples of each
of these types of requirements. (8marks)
Question 5.
(a) Software testing is one of major approaches in software development. Discuss the five software testing
strategies. (10marks)
(b) The goal of the requirements engineering process is to create and maintain a system requirements document.
The overall process includes four high level requirements engineering sub-processes. With the aid of a diagram
illustrate the relationship between these activities. (10marks)