SE Lectures
SE Lectures
2
Software process models
3
- In any software development project, we have the
Client, Developer, and User.
5
1 (b) Requirements Test:
* Use of Rapid Prototype – a piece of
software hurriedly designed which
contains most functionality, but omits
aspects invisible to users (e.g. file
format, error handling, etc)
* The client experiments with this, reports
observations, then refined by the
developer, ………, until satisfied.
6
2(a) Specification:
* When the user is satisfied with the requirement,
the developer draws out the specification
document – WHAT to do
* Specification spells out:
- Functionality; precisely what the system
suppose to do
- Constraints to be satisfied
- Input/output (reports)
* Specification represents the contract
7
2(b) Specification Test:
* SQA group is responsible for ensuring that the
delivered product is what the client ordered
9
* Coupling: the strength of dependencies between two
subsystems.
* If two subsystems are loosely coupled, they are
relatively independent, and thus, modifications to
one of subsystems will have little impact on the other.
* If two subsystems are strongly coupled, modifications
to one subsystem are likely to have impact on
the other
* Desirable property of subsystem decomposition: keep
subsystems as loosely coupled as possible
- This minimizes the impact that errors or future
changes have on the correct operation of the
system.
10
* Coherence: the strength of dependencies within
a
subsystem
* Desirable property of subsystem decomposition
is
that it leads to subsystems with high coherence.
11
* The interfaces (signature of functions -
parameters passed and function names - and
values returned by the modules) must be specified
in details.
* Design is two-fold:
1) Architectural Design: description of the
modules as a whole (subsystem)
2) Detailed Design: description of each
module;
which is handed over to the programmer
12
3 (b) Design Test:
* SQA group + Design Team only – no need of
client
* They subject the design to reviews; every part of
the design should link to a statement in the
specification
13
4 (a) Implementation
* Code the various subsystems – by programmers
* Major document here is the source codes, well
commented
* Remember Structured Programming Concept!
14
4 (b) Implementation Test
* Each subsystem is debugged in the process of
development by the programmers
* Tested with test data – by the programmer
* Tested with test data thereafter (by other
programmers) – to reveal more errors
* Then reviewed (in order to detect faults); the
programmer only guides the review team, which
must
include SQA member.
15
5 (a) Integration
* Put the subsystems together to see whether the
product as a whole functions correctly
* Could be all at once or one at a time
– illustration required
* Could be Top-down or Bottom-up
– illustration required
* Stubs and Drivers required, all being dummies – to
be discarded at the end
16
5 (b) (i) Integration Test
* Great care must be placed on testing the
interfaces
(received parameters and returned values)
* Performed by the Linkers and the SQA group
5 (b) (ii) Product Test
* Performed by the SQA group (after integration
test) to check the functionality as a whole against
specification
5 (b) (iii) Acceptance Test
* Final Test, Performed by client
* Software is given to the client
- to test on real environment
- using actual data (as opposed to test data)
* If okayed, the software is delivered to the client.
17
6 (a) Maintenance
* Regarded as an integral part of software life
cycle
* Once the software product is accepted by the
client,
any changes would constitute maintenance,
after the warranty period.
18
7 Retirement
* When any further maintenance is not cost-effective,
e.g.,
- The proposed changes in requirement is so
drastic that the design itself changes
- There are changes in the hardware, with new OS
such that the cost of developing new system is
cheaper than maintaining existing one.
- e.t.c.
19
Software Lifecycle
* A Period within which a software is effective and
yielding required results
* With time,
- The # of transactions increase
- # of users increase
- Complexity of data processing multiplies
- Technology improves
* Hence, the system may become obsolete; and, the
need for a new improved system
20
Software Lifecycle – cont’d
The traditional methods of software development were
mainly characterized by:
21
Software Lifecycle – cont’d
The above mentioned downsides led to the introduction
of software development process which ensures:
* The management of software lifecycle (consisting
of phases).
* What phases are required during system
development?
* The order of the phases.
* What happens in each phase?
* The outcome of each phase.
organizing, and
running
23
Hundreds of different kinds of models are known
and used.
Many are minor variations on just a small number
of basic models.
24
Project planning is the art of scheduling
the necessary activities, in time and across staff
in order to optimize:
•profit [high]
25
A project plan contains much information, but must
at least describe:
26
Project Visibility
Unlike other engineers (e.g. civil, electronic,
chemical… etc.) software engineers do not produce
anything physical.
It is inherently difficult to monitor an SE project
due to lack of visibility.
27
This means that SE projects must produce
additional deliverables (artifacts) which are visible,
such as:
•Reports
•Project/status meetings
28
What is a Lifecycle Model?
Definition: A (software/system) lifecycle model is a
description of the sequence of activities carried out in
an SE project, and the relative order of these
activities.
It provides a fixed generic framework that can be
tailored to a specific project. Project specific
parameters will include:
30
By changing the lifecycle model, we can improve
and/or tradeoff:
Development speed (time to market)
Product quality
Project visibility
Administrative overhead
Risk exposure
Customer relations, etc, etc.
31
Note that we can sometimes combine lifecycle
models,
32
The Waterfall Model
The waterfall model is the classic lifecycle model–
it is widely known, understood and (commonly?)
used.
In some respect, waterfall is the ”commonsense”
approach.
Introduced by Royce 1970.
33
Changed
Requirement
Verify
Requirement
Verify
Specification
Verify
KEY Design
Development Verify
Maintenance Implmentatn
Test
Integration
Test
Operation
Waterfall Model
34
Advantages
36
Code-and-Fix
This model starts with an informal general product
idea and just develops code until a product is
”ready” (or money or time runs out).
Work is in random order.
Corresponds with no plan!
37
Advantages
1. No administrative overhead
2. Signs of progress (code) early.
3. Low expertise, anyone can use it!
4. Useful for small “proof of concept” projects, e.g. as part
of risk reduction.
Disadvantages
1.Dangerous!
No visibility/control
No resource planning
No deadlines
Mistakes hard to detect/correct
2. Impossible for large projects, communication breakdown,
chaos.
38
Spiral Model
Since end-user requirements are hard to obtain/
define, it is natural to develop software in an
experimental way: e.g.
39
This loop approach gives rise to structured
iterative lifecycle models.
In 1988 Boehm developed the spiral model as an
risk analysis/management.
Key idea: on each iteration identify and solve
the sub-problems with the highest risk.
40
41
Boehm’s Spiral Model
42
Each cycle follows a waterfall model by:
1. Determining objectives
2. Specifying constraints
3. Generating alternatives
4. Identifying risks
5. Resolving risks
43
Advantages
1. Realism: the model accurately reflects the iterative nature
of software development on projects with unclear
requirements
2. Flexible: incorporates the advantages of the waterfall and
rapid prototyping methods
3. Comprehensive model decreases risk
4. Good project visibility.
Disadvantages
1. Needs technical expertise in risk analysis to really work
2. Model is poorly understood by non-technical management,
hence not so widely used
3. Complicated model, needs competent professional
management. High administrative overhead.
44
Rapid Prototyping
Key idea: Customers are non-technical and usually
don’t know what they want/can have.
•evolutionary prototyping
45
46
Advantages
1.Reduces risk of incorrect user requirements
2.Good where requirements are changing/uncommitted
3.Regular visible progress aids management
4.Supports early product marketing
Disadvantages
1.An unstable/badly implemented prototype often becomes the
final product.
2.Requires extensive customer collaboration
–Costs customers money
–Needs committed customers
–Difficult to finish if customer withdraws
–May be too customer specific, no broad market
3.Difficult to know how long project will last
4.Easy to fall back into code-and-fix without proper
requirements analysis, design, customer evaluation and
feedback. 47
Agile (XP) Programming
XP = Extreme Programming emphasizes:
•Individuals and interactions – Over processes and tools
•Working software – Over documentation
•Customer collaboration – Over contract negotiation
•Responding to change – Over following a plan
48
XP Practices (Summary)
•Programming in pairs
•No overtime!
49
Advantages
•Lightweight methods suit small-medium size projects
•Produces good team cohesion
•Emphasizes final product
•Iterative (due to constant consideration for change)
•Test based approach to requirements and quality assurance
Disadvantages
•Difficult to scale up to large projects where documentation is
essential
•Needs experience and skill if not to degenerate into code-
and-fix
•Programming pairs is costly
•Test case construction is a difficult and specialized skill.
50
COTS = Commercial Off-The-Shelf software
Engineer to gather a solution from existing commercial
software packages using minimal software ”glue”.
E.g. using databases, spread sheets, word processors,
graphics software, web browsers, etc.
Advantages
•Fast, cheap solution
•May give all the basic functionality
•Well defined project, easy to run
Disadvantages
•Limited functionality
•Licensing problems, etc.
•License fees, maintenance fees, upgrade compatibility
problems
51
Fountain Model
Specifically useful for object-
oriented system development; Each
phase is regarded as a complete
entity (to be analyzed, designed,
and implemented separately from
other phases).
Phases overlap – ensuring
parallelism of development
process.
Fountain Model
52
Good practice guidelines for dependable
programming (Dependability Engineering)
Dependable programming guidelines
53
Exception handling
54
Error-prone constructs
Parallelism
Can result in subtle timing errors because of unforeseen
interaction between parallel processes.
Recursion
Errors in recursion can cause memory overflow as the
program stack fills up.
Interrupts
Interrupts can cause a critical operation to be terminated
and make a program difficult to understand.
Inheritance
Code is not localised. This can result in unexpected behaviour when changes
are made and problems of understanding the code.
55
Error-prone constructs
Aliasing
Using more than 1 name to refer to the same
state variable.
Unbounded arrays
Bufferoverflow failures can occur if no bound
checking on arrays.
Default input processing
An input action that occurs irrespective of the
input.
This can cause problems if the default action
is to transfer control elsewhere in the
program. In incorrect or deliberately malicious
56 input can then trigger a program failure.