Software Engineering

Download Report

Transcript Software Engineering

Software Engineering I
Preface
Lecturer:
Course web site:
Paul Dunne
http://gmitweb.gmit.ie/pdunne
Course material

The course based on:
o Ian Sommerville’s
“Software Engineering 6th Ed.”
A number of copies (of the 5th ed)
are held in the library (005.1)
See also http://www.software-engin.com/
o
Also recommended is
Robert Pressman’s
“Software Engineering –
A practitioners approach 5th Ed.”
A number of copies in the library (005.1)
Course layout

Class lectures:
o
2 hrs per week
Labs
o
o
o
o
2hrs per week
HTML and XML
Programming
Assignments must be finished on time
 Code must have comments
Course
work/assignments
Recent Disasters
‘Those
who ignore the lessons of the past are doomed to repeat
them’ (Napoleon)
o
Some prominent disasters
 London Ambulance
 Ariane 5
o
Don’t forget that most are hidden
London Ambulance Dispatching System
The full introduction of a computer system effectively did away with
o
The radio as a mechanism for staff to dispatch ambulances.

o
The computer dispatched crews to calls
Having people answer the phones

The computer queued calls from emergency callers
Problems
During the morning rush it became obvious, to crews and control room staff,
that calls were going missing in the system; ambulances were arriving late or
doubling up on calls.
 Distraught emergency callers were also held in a queuing system which failed
to put them through for up to 30 minutes.

Outcome
It was said that it was hard to verify how many people might have died
because of the delays but it could have been as many as 20.
From http://128.240.150.127/Risks/13.88.html#subj1.1
Ariane 5
http://www.around.com/ariane.html
http://www.ima.umn.edu/~arnold/disasters/ariane.html
June 4th 1996: It took the European Space Agency 10 years and $7 billion to
produce Ariane5, a giant rocket capable of propelling six tons of payload into
orbit.
The rocket exploded (39 seconds into its maiden voyage scattering fiery
rubble across the mangrove swamps of French Guiana) due to small computer
program trying to stuff a 64-bit number into a 16-bit space.
Ariane 5 (along with its payload of four expensive and uninsured scientific
satellites valued at $500 million) was destroyed.
This problem had begun an instant before, when the spacecraft swerved off
course under the pressure of the three powerful nozzles in its boosters and main
engine.
The rocket was making an abrupt course correction that was not needed,
compensating for a wrong turn that had not taken place.
Ariane 5 (2)
Steering was controlled by the on-board computer, (which mistakenly thought
the rocket needed a course change because of the numbers and which were
really an error message coming from the inertial guidance system).
The guidance system had in fact shut down 36.7 seconds after launch, when
the guidance system's own computer tried to convert one piece of data -- the
sideways velocity of the rocket -- from a 64-bit format to a 16-bit format =
overflow error.
When the guidance system shut down, it passed control to an identical,
redundant unit, which was there to provide backup in case of just such a failure.
The second unit (having the same software) failed too.
In an earlier design decision, the programmers had decided that this particular
velocity figure would never be large enough to cause trouble. After all, it never
had been before. But Ariane 5 was a faster rocket than Ariane 4.
One extra absurdity: the calculation containing the bug actually served no
purpose once the rocket was in the air. Its only function was to align the system
before launch. So it should have been turned off. But engineers chose to leave
this function running for the first 40 seconds of flight -- a "special feature"
meant to make it easy to restart the system in the event of a brief hold in the
countdown.
Understanding the Problems
Considering
the problems in software development and the
goals that software development seeks to achieve. These are:
o
o
o
o
o
o
o
Lets
Meeting the user’s needs
Low cost of production
High performance
Portability
Low cost of maintenance
High reliability;
Delivery on time
look at these in turn….
Understanding the Problems
Meeting
o
o
the User’s Needs
A piece of software must do what its users want of it (Obvious)
However,
 software not always used quite as intended

Using Microsoft Word to do drawings!
 Different people have different (conflicting) requirements

Full featured drawing package required – but only by some
 Communicating Requirements is fraught with difficulties
“When a passenger of foot heave in sight,
tootle the horn. Trumpet him melodiously
at first, but if he still obstacles your
passage tootle him with vigor.”
From a brochure at a Tokyo car rental firm
o
o
Deduce from this that a large proportion of systems do not meet the needs of
their users.
Main problem of software development seems to lie in requirements analysis
and design
Understanding the Problems
The
o
o
Cost of Software Production :
Programmer Productivity = 10 to 20 lines of code a day?
Predicting Software Costs
 how long it will take to write a piece of software?
 common for time scale to be underestimated by up to 50%
o
Hardware v Software Costs
 In 1955 software cost typically only about 10% of a project, now it is the
hardware that is only 10% (or much less)
o
The Impact of the Personal Computer
 Cheap, Available
o
Software Packages
 Off the shelf solutions.
o
The IT Revolution
 Software increasing in complexity.
Comparing Observed Bug and Productivity Rates for Java and C++
Geoffrey Phipps
http://www.spirus.com.au/papersAndTalks/javaVsC++.pdf
Spirus - 2002
An
experiment was conducted to compare programmer productivity and
defect rates for Java and C++. A modified version of the Personal Software
Process (PSP) was used to gather defect rate*, bug rate**, and productivity
data on C++ and Java during two real world development projects.
o
o
o
o
A typical C++ program had two to three times as many bugs per line of code
as a typical Java program.
C++ also generated between 15% and 50% more defects, and perhaps took six
times as long to debug.
Java was between 30% and 200% more productive, in terms of lines of code
per minute.
When defects were measured against development time, Java and C++ show
no difference, but C++ had 2 to 3 times as many bugs per hour.
The
experiment shows that it is possible to experimentally measure the
fitness of a programming language.
*A defect is either a bug, or an error detected during compile time
**A bug is defined to be a problem detected during testing or deployment.
Understanding the Problems
The
How
Cost of Software Production :
Cost to fix error
is the Cost Made Up?
Analysis &
Design
1/3
Testing
1/2
Coding
1/6
Helpful
Possibly
Detected
after
installation
to know where errors arise
Programming
Logic
1/3
Time
Detected in
testing
Design
1/2
Programming
Syntax
1/6
Detected on
compilation
Understanding the Problems
Meeting
o
o
o
o
Deadlines :
This has always been a major problem in software production.
Surveys have shown that this is the worst problem faced by IT
managers
The problem is related to the difficulty of predicting how long it will
take to develop something.
If we don’t know how long its going to take, we cannot hope to meet
any deadline.
Software
o
Performance :
Often we must make sure that:
 In interactive system responds within a reasonably short time;
 A control signal is output to a plant in sufficient time;
 batch job is not taking 12 hours when it should take 1.
Understanding the Problems
Portability
o
o
o
o
o
o
:
Ideally, software should be easy to port
High-level languages (Java , C++) and international standards
(POSIX, .NET) assist prospects.
However, market forces have dominated the situation.
Programmers can be tied to particular suppliers.
Recent years have seen the emergence of Java technologies
Does this change the portability issue?
A Definition
An application is portable across a class of environments to the degree that the effort required to
transport and adapt it to a new environment in the class is less than the effort of redevelopment.
http://www.csee.wvu.edu/~jdm/research/portability/home.html
For a portability tutorial see Jim Mooney’s
http://www.csee.wvu.edu/~jdm/research/portability/tutorial/index.html
Understanding the Problems
Maintenance
o
:
There are two types of maintenance:
 remedial maintenance is the time spent fixing bugs;
 adaptive maintenance is altering software to meet changing user
o
o
o
needs or to accommodate new hardware and OS constraints.
Managers regard maintenance as a nuisance - because they need to
ensure sufficient people to do it.
Programmers regard it as the least interesting work.
Reliability
o
o
:
You can never assume that a piece of software is ever bug free.
Therefore, every large piece of software contains errors
Understanding the Problems
A Software
o
o
o
o
o
o
o
o
Crisis ? :
We have covered various perceived problems with software
It fails to do what the users want it to do
It is expensive
It is not always fast enough
Its not always easily ported
Maintenance is expensive
Its is unreliable
It is often late
Meeting
user’s needs, reducing costs, improving reliability, and
delivery on time are the most important problems
A Solution - Software Engineering:
Greater
emphasis on systematic development.
Computer assistance for software development (CASE)
A concentration on finding out the user’s requirements
Formal/Semi Formal specification of the requirements of a
system
Demonstration of early version of a system (prototyping)
Greater emphases on trying to ensure error free code
Software Engineering
Definitions:
o
o
Simple Definition: Designing, building and maintaining large
software systems
Others:
 ‘Software engineering is concerned with the theories,
methods and tools for developing, managing and evolving
software products’ I. Sommerville
 ‘The practical application of scientific knowledge in the
design and construction of computer programs and the
associated documentation required to develop, operate and
maintain them’ B.W.Boehm
 ‘The establishment and use of sound engineering principles
in order to obtain economically software that is reliable and
works efficiently on real machines’ F.L.Bauer
Software Engineering cont.
Definitions
o
o
cont.
‘The application of a systematic, disciplined, quantifiable approach to
the development, operation, and maintenance of software’ IEEE
Standard 610.12
‘The technological and managerial discipline concerned with
systematic production and maintenance of software products that are
developed and modified on time and within cost constraints’ R.
Fairley
Learning Outcomes
o
o
o
Appreciate the problems associated with developing software
Understand the need for a managed approach to Software
Development
Be able to define the term ‘Software Engineering’
Questions (1)
1.Here
are some things that could go wrong with a Computing project (i.e. risks)
a)
Changing requirements leading to an over-budget, over-schedule system
b)
Incomplete Requirements Specification leading to incomplete/ unusable system
c)
Lack of full testing leading to a system that doesn’t work
d)
Failure to fully specify and estimate a system
e)
The project contains parts that are technically infeasible, meaning that the
system cannot be built
For each of the following infamous software projects identify the main problem that
occurred from the list above: London Ambulance Service dispatch system, Ariane 5
Guidance software
Questions (2)
Look at the following list of goals for software

a)
Meeting the user’s needs

b)
Low cost of production

c)
High performance

d)
Portability

e)
Low cost of maintenance

f)
High reliability;

g) Delivery on time.
For each of the following systems choose the three most important goals to fulfil.
(i) A system to manage students fees – to track whether they have been paid, calculate
the correct amount, issue invoices, send out reminders etc.
(ii) A system to manage the temperature of a nuclear reactor core.
(iii) An experimental program to test the efficiency of an algorithm for some
mathematical theory.
(iv) A new system for the online return of UK self assessment forms for 2002
(v) A program that allows the viewing of football scores on mobile phones.
Questions (3)
1.Typically
how many lines of code does the average programmer
produce per day
2.Which is cheaper – fixing an error at Requirements stage or at
Testing stage?
3.Which stage of software development is typically the most
expensive?
4.Where are the most errors introduced in software projects
5.What do project managers say is the worst problem
(consequence) in Software projects?
6.Differentiate between remedial and adaptive maintenance.
7.‘All Microsoft software is bug free’ (Bill Gates) – Is he correct?
8.Define Software Engineering