tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000...

1373
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 1 Introduction l Getting started with software engineering

Transcript of tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000...

Page 1: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 1

Introduction

l Getting started with softwareengineering

Page 2: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 2

Objectives

l To introduce software engineering and to explainits importance

l To set out the answers to key questions aboutsoftware engineering

l To introduce ethical and professional issues andto explain why they are of concern to softwareengineers

Page 3: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 3

Topics covered

l FAQs about software engineering

l Professional and ethical responsibility

Page 4: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 4

l The economies of ALL developed nations aredependent on software

l More and more systems are software controlled

l Software engineering is concerned with theories,methods and tools for professional softwaredevelopment

l Software engineering expenditure represents asignificant fraction of GNP in all developedcountries

Software engineering

Page 5: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5

l Software costs often dominate system costs. Thecosts of software on a PC are often greater thanthe hardware cost

l Software costs more to maintain than it does todevelop. For systems with a long life,maintenance costs may be several timesdevelopment costs

l Software engineering is concerned with cost-effective software development

Software costs

Page 6: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 6

FAQs about software engineering

l What is software?

l What is software engineering?

l What is the difference between softwareengineering and computer science?

l What is the difference between softwareengineering and system engineering?

l What is a software process?

l What is a software process model?

Page 7: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 7

FAQs about software engineering

l What are the costs of software engineering?

l What are software engineering methods?

l What is CASE (Computer-Aided SoftwareEngineering)

l What are the attributes of good software?

l What are the key challenges facing softwareengineering?

Page 8: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 8

What is software?

l Computer programs and associateddocumentation

l Software products may be developed for aparticular customer or may be developed for ageneral market

l Software products may be• Generic - developed to be sold to a range of different customers

• Bespoke (custom) - developed for a single customer accordingto their specification

Page 9: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 9

What is software engineering?

l Software engineering is an engineering disciplinewhich is concerned with all aspects of softwareproduction

l Software engineers should adopt a systematic andorganised approach to their work and useappropriate tools and techniques depending on theproblem to be solved, the development constraintsand the resources available

Page 10: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 10

What is the difference between softwareengineering and computer science?

l Computer science is concerned with theory andfundamentals; software engineering is concernedwith the practicalities of developing anddelivering useful software

l Computer science theories are currentlyinsufficient to act as a complete underpinning forsoftware engineering

Page 11: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 11

What is the difference between softwareengineering and system engineering?

l System engineering is concerned with all aspectsof computer-based systems developmentincluding hardware, software and processengineering. Software engineering is part of thisprocess

l System engineers are involved in systemspecification, architectural design, integration anddeployment

Page 12: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 12

What is a software process?

l A set of activities whose goal is the developmentor evolution of software

l Generic activities in all software processes are:• Specification - what the system should do and its development

constraints

• Development - production of the software system

• Validation - checking that the software is what the customerwants

• Evolution - changing the software in response to changingdemands

Page 13: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 13

What is a software process model?

l A simplified representation of a software process,presented from a specific perspective

l Examples of process perspectives are• Workflow perspective - sequence of activities

• Data-flow perspective - information flow

• Role/action perspective - who does what

l Generic process models• Waterfall

• Evolutionary development

• Formal transformation

• Integration from reusable components

Page 14: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 14

What are the costs of software engineering?

l Roughly 60% of costs are development costs,40% are testing costs. For custom software,evolution costs often exceed development costs

l Costs vary depending on the type of system beingdeveloped and the requirements of systemattributes such as performance and systemreliability

l Distribution of costs depends on the developmentmodel that is used

Page 15: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 15

What are software engineering methods?

l Structured approaches to software developmentwhich include system models, notations, rules,design advice and process guidance

l Model descriptions• Descriptions of graphical models which should be produced

l Rules• Constraints applied to system models

l Recommendations• Advice on good design practice

l Process guidance• What activities to follow

Page 16: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 16

What is CASE (Computer-AidedSoftware Engineering)

l Software systems which are intended to provideautomated support for software process activities.CASE systems are often used for method support

l Upper-CASE• Tools to support the early process activities of requirements and

design

l Lower-CASE• Tools to support later activities such as programming,

debugging and testing

Page 17: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 17

What are the attributes of good software?

l The software should deliver the requiredfunctionality and performance to the user andshould be maintainable, dependable and usable

l Maintainability• Software must evolve to meet changing needs

l Dependability• Software must be trustworthy

l Efficiency• Software should not make wasteful use of system resources

l Usability• Software must be usable by the users for which it was designed

Page 18: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 18

What are the key challenges facingsoftware engineering?

l Coping with legacy systems, coping withincreasing diversity and coping with demands forreduced delivery times

l Legacy systems• Old, valuable systems must be maintained and updated

l Heterogeneity• Systems are distributed and include a mix of hardware and

software

l Delivery• There is increasing pressure for faster delivery of software

Page 19: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 19

Professional and ethical responsibility

l Software engineering involves widerresponsibilities than simply the application oftechnical skills

l Software engineers must behave in an honest andethically responsible way if they are to berespected as professionals

l Ethical behaviour is more than simply upholdingthe law.

Page 20: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 20

Issues of professional responsibility

l Confidentiality• Engineers should normally respect the confidentiality of their

employers or clients irrespective of whether or not a formalconfidentiality agreement has been signed.

l Competence• Engineers should not misrepresent their level of competence.

They should not knowingly accept work which is outwith theircompetence.

Page 21: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 21

Issues of professional responsibility

l Intellectual property rights• Engineers should be aware of local laws governing the use of

intellectual property such as patents, copyright, etc. They shouldbe careful to ensure that the intellectual property of employersand clients is protected.

l Computer misuse• Software engineers should not use their technical skills to

misuse other people’s computers. Computer misuse ranges fromrelatively trivial (game playing on an employer’s machine, say)to extremely serious (dissemination of viruses).

Page 22: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 22

ACM/IEEE Code of Ethics

l The professional societies in the US havecooperated to produce a code of ethical practice.

l Members of these organisations sign up to thecode of practice when they join.

l The Code contains eight Principles related to thebehaviour of and decisions made by professionalsoftware engineers, including practitioners,educators, managers, supervisors and policymakers, as well as trainees and students of theprofession.

Page 23: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 23

Code of ethics - preamble

l Preamble• The short version of the code summarizes aspirations at a high

level of the abstraction; the clauses that are included in the fullversion give examples and details of how these aspirationschange the way we act as software engineering professionals.Without the aspirations, the details can become legalistic andtedious; without the details, the aspirations can become highsounding but empty; together, the aspirations and the detailsform a cohesive code.

• Software engineers shall commit themselves to making theanalysis, specification, design, development, testing andmaintenance of software a beneficial and respected profession.In accordance with their commitment to the health, safety andwelfare of the public, software engineers shall adhere to thefollowing Eight Principles:

Page 24: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 24

Code of ethics - principles

l 1. PUBLIC• Software engineers shall act consistently with the public

interest.

l 2. CLIENT AND EMPLOYER• Software engineers shall act in a manner that is in the

best interests of their client and employer consistent withthe public interest.

l 3. PRODUCT• Software engineers shall ensure that their products and

related modifications meet the highest professionalstandards possible.

Page 25: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 25

Code of ethics - principles

l JUDGMENT• Software engineers shall maintain integrity and

independence in their professional judgment.

l 5. MANAGEMENT• Software engineering managers and leaders shall

subscribe to and promote an ethical approach to themanagement of software development and maintenance.

l 6. PROFESSION• Software engineers shall advance the integrity and

reputation of the profession consistent with the publicinterest.

Page 26: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 26

Code of ethics - principles

l 7. COLLEAGUES• Software engineers shall be fair to and supportive of their

colleagues.

l 8. SELF• Software engineers shall participate in lifelong learning

regarding the practice of their profession and shallpromote an ethical approach to the practice of theprofession.

Page 27: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 27

Ethical dilemmas

l Disagreement in principle with the policies ofsenior management

l Your employer acts in an unethical way andreleases a safety-critical system without finishingthe testing of the system

l Participation in the development of militaryweapons systems or nuclear systems

Page 28: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 28

Key points

l Software engineering is an engineering discipline which isconcerned with all aspects of software production.

l Software products consist of developed programs andassociated documentation. Essential product attributes aremaintainability, dependability, efficiency and usability.

l The software process consists of activities which are involvedin developing software products. Basic activities are softwarespecification, development, validation and evolution.

l Methods are organised ways of producing software. They includesuggestions for the process to be followed, the notations to be used,rules governing the system descriptions which are produced anddesign guidelines.

Page 29: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 29

Key points

l CASE tools are software systems which are designed tosupport routine activities in the software process such asediting design diagrams, checking diagram consistency andkeeping track of program tests which have been run.

l Software engineers have responsibilities to the engineeringprofession and society. They should not simply be concernedwith technical issues.

l Professional societies publish codes of conduct which set outthe standards of behaviour expected of their members.

Page 30: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 1

Systems Engineering

l Designing, implementing,deploying and operating systemswhich include hardware, softwareand people

Page 31: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 2

Objectives

l To explain why system software is affected bybroader system engineering issues

l To introduce the concept of emergent systemproperties such as reliability and security

l To explain why the systems environment must beconsidered in the system design process

l To explain system engineering and systemprocurement processes

Page 32: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 3

Topics covered

l Emergent system properties

l Systems and their environment

l System modelling

l The system engineering process

l System procurement

Page 33: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 4

What is a system?

l A purposeful collection of inter-related componentsworking together towards some common objective.

l A system may include software, mechanical,electrical and electronic hardware and be operatedby people.

l System components are dependent on othersystem components

l The properties and behaviour of system componentsare inextricably inter-mingled

Page 34: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 5

Problems of systems engineering

l Large systems are usually designed to solve'wicked' problems

l Systems engineering requires a great deal ofco-ordination across disciplines• Almost infinite possibilities for design trade-offs across

components

• Mutual distrust and lack of understanding across engineeringdisciplines

l Systems must be designed to last many yearsin a changing environment

Page 35: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 6

Software and systems engineering

l The proportion of software in systems is increasing.Software-driven general purpose electronics isreplacing special-purpose systems

l Problems of systems engineering are similar toproblems of software engineering

l Software is (unfortunately) seen as a problemin systems engineering. Many large system projectshave been delayed because of software problems

Page 36: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 7

Emergent properties

l Properties of the system as a whole rather thanproperties that can be derived from the properties ofcomponents of a system

l Emergent properties are a consequence of therelationships between system components

l They can therefore only be assessed and measuredonce the components have been integrated into asystem

Page 37: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 8

Examples of emergent properties

l The overall weight of the system

• This is an example of an emergent property that can be computedfrom individual component properties.

l The reliability of the system• This depends on the reliability of system components and the

relationships between the components.

l The usability of a system • This is a complex property which is not simply dependent on the

system hardware and software but also depends on the systemoperators and the environment where it is used.

Page 38: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 9

Types of emergent property

l Functional properties• These appear when all the parts of a system work together to

achieve some objective. For example, a bicycle has the functionalproperty of being a transportation device once it has beenassembled from its components.

l Non-functional emergent properties• Examples are reliability, performance, safety, and security. These

relate to the behaviour of the system in its operationalenvironment. They are often critical for computer-based systemsas failure to achieve some minimal defined level in theseproperties may make the system unusable.

Page 39: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 10

l Because of component inter-dependencies,faults can be propagated through the system

l System failures often occur because ofunforeseen inter-relationships betweencomponents

l It is probably impossible to anticipate allpossible component relationships

l Software reliability measures may give a falsepicture of the system reliability

System reliability engineering

Page 40: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 11

l Hardware reliability

• What is the probability of a hardware component failing and howlong does it take to repair that component?

l Software reliability• How likely is it that a software component will produce an

incorrect output. Software failure is usually distinct from hardwarefailure in that software does not wear out.

l Operator reliability• How likely is it that the operator of a system will make an error?

Influences on reliability

Page 41: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 12

Reliability relationships

l Hardware failure can generate spurious signals thatare outside the range of inputs expected by thesoftware

l Software errors can cause alarms to be activatedwhich cause operator stress and lead to operatorerrors

l The environment in which a system is installed canaffect its reliability

Page 42: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 13

The ‘shall-not’ properties

l Properties such as performance and reliability canbe measured

l However, some properties are properties that thesystem should not exhibit• Safety - the system should not behave in an unsafe way

• Security - the system should not permit unauthorised use

l Measuring or assessing these properties is very hard

Page 43: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 14

Systems and their environment

l Systems are not independent but exist in anenvironment

l System’s function may be to change its environment

l Environment affects the functioning of the systeme.g. system may require electrical supply from itsenvironment

l The organizational as well as the physicalenvironment may be important

Page 44: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 15

System hierarchies

Securitysystem

Heatingsystem

Lightingsystem

Powersystem

Wastesystem

Watersystem

Town

Street

Building

Page 45: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 16

Human and organisational factors

l Process changes

• Does the system require changes to the work processes in theenvironment?

l Job changes• Does the system de-skill the users in an environment or cause them to

change the way they work?

l Organisational changes• Does the system change the political power structure in an

organisation?

Page 46: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 17

System architecture modelling

l An architectural model presents an abstract view ofthe sub-systems making up a system

l May include major information flows between sub-systems

l Usually presented as a block diagram

l May identify different types of functionalcomponent in the model

Page 47: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 18

Intruder alarm system

Alarmcontroller

Voicesynthesizer

Movementsensors

Siren

Doorsensors

Telephonecaller

Externalcontrol centre

Page 48: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 19

Component types in alarm system

l Sensor• Movement sensor, door sensor

l Actuator• Siren

l Communication• Telephone caller

l Co-ordination• Alarm controller

l Interface• Voice synthesizer

Page 49: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Data comms.system

Transpondersystem

Radarsystem

Aircraftcomms.

Telephonesystem

Flight plandatabase

Backupposition

processor

Positionprocessor

Comms.processor

Backup comms.processor

Aircraftsimulation

system

Weather mapsystem

Accountingsystem

Controllerinfo. system

Controllerconsoles

Activity loggingsystem

©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 31. Slide ##

ATC systemarchitecture

Page 50: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 21

Functional system components

l Sensor components

l Actuator components

l Computation components

l Communication components

l Co-ordination components

l Interface components

Page 51: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 22

System components

l Sensor components• Collect information from the system’s environment e.g. radars in

an air traffic control system

l Actuator components• Cause some change in the system’s environment e.g. valves in a

process control system which increase or decrease material flow ina pipe

l Computation components• Carry out some computations on an input to produce an output e.g.

a floating point processor in a computer system

Page 52: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 23

System components

l Communication components• Allow system components to communicate with each other e.g.

network linking distributed computers

l Co-ordination components• Co-ordinate the interactions of other system components e.g.

scheduler in a real-time system

l Interface components• Facilitate the interactions of other system components e.g.

operator interface

l All components are now usually software controlled

Page 53: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 24

Component types in alarm system

l Sensor• Movement sensor, Door sensor

l Actuator• Siren

l Communication• Telephone caller

l Coordination• Alarm controller

l Interface• Voice synthesizer

Page 54: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 25

The system engineering process

l Usually follows a ‘waterfall’ model because of theneed for parallel development of different parts ofthe system• Little scope for iteration between phases because hardware

changes are very expensive. Software may have to compensate forhardware problems

l Inevitably involves engineers from differentdisciplines who must work together• Much scope for misunderstanding here. Different disciplines use a

different vocabulary and much negotiation is required. Engineersmay have personal agendas to fulfil

Page 55: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 26

The system engineering process

Systemintegration

Sub-systemdevelopment

Systemdesign

Requirementsdefinition

Systeminstallation

Systemevolution

Systemdecommissioning

Page 56: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 27

Inter-disciplinary involvement

ATC systemsengineering

Electronicengineering

Electricalengineering

User interfacedesign

Mechanicalengineering

Architecture

Structuralengineering

Softwareengineering

Civilengineering

Page 57: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 28

System requirements definition

l Three types of requirement defined at this stage• Abstract functional requirements. System functions are defined in

an abstract way

• System properties. Non-functional requirements for the system ingeneral are defined

• Undesirable characteristics. Unacceptable system behaviour isspecified

l Should also define overall organisational objectivesfor the system

Page 58: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 29

System objectives

l Functional objectives• To provide a fire and intruder alarm system for the building which

will provide internal and external warning of fire or unauthorizedintrusion

l Organisational objectives• To ensure that the normal functioning of work carried out in the

building is not seriously disrupted by events such as fire andunauthorized intrusion

Page 59: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 30

System requirements problems

l Changing as the system is being specified

l Must anticipate hardware/communicationsdevelopments over the lifetime of the system

l Hard to define non-functional requirements(particularly) without an impression ofcomponent structure of the system.

Page 60: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 31

The system design process

l Partition requirements• Organise requirements into related groups

l Identify sub-systems• Identify a set of sub-systems which collectively can meet the

system requirements

l Assign requirements to sub-systems• Causes particular problems when COTS are integrated

l Specify sub-system functionality

l Define sub-system interfaces• Critical activity for parallel sub-system development

Page 61: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 32

The system design process

Partitionrequirements

Identifysub-systems

Assign requirementsto sub-systems

Specify sub-systemfunctionality

Define sub-systeminterfaces

Page 62: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 33

System design problems

l Requirements partitioning to hardware,software and human components may involve a lotof negotiation

l Difficult design problems are often assumed to bereadily solved using software

l Hardware platforms may be inappropriate forsoftware requirements so software must compensatefor this

Page 63: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 34

Sub-system development

l Typically parallel projects developing thehardware, software and communications

l May involve some COTS (Commercial Off-the-Shelf) systems procurement

l Lack of communication across implementationteams

l Bureaucratic and slow mechanism forproposing system changes means that thedevelopment schedule may be extended because ofthe need for rework

Page 64: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 35

l The process of putting hardware, software andpeople together to make a system

l Should be tackled incrementally so that sub-systemsare integrated one at a time

l Interface problems between sub-systems are usuallyfound at this stage

l May be problems with uncoordinated deliveriesof system components

System integration

Page 65: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 36

l Environmental assumptions may be incorrect

l May be human resistance to the introduction ofa new system

l System may have to coexist with alternativesystems for some time

l May be physical installation problems (e.g.cabling problems)

l Operator training has to be identified

System installation

Page 66: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 37

l Will bring unforeseen requirements to light

l Users may use the system in a way which isnot anticipated by system designers

l May reveal problems in the interaction withother systems• Physical problems of incompatibility

• Data conversion problems

• Increased operator error rate because of inconsistent interfaces

System operation

Page 67: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 38

System evolution

l Large systems have a long lifetime. They mustevolve to meet changing requirements

l Evolution is inherently costly• Changes must be analysed from a technical and business

perspective

• Sub-systems interact so unanticipated problems can arise

• There is rarely a rationale for original design decisions

• System structure is corrupted as changes are made to it

l Existing systems which must be maintained aresometimes called legacy systems

Page 68: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 39

System decommissioning

l Taking the system out of service after its usefullifetime

l May require removal of materials (e.g. dangerouschemicals) which pollute the environment• Should be planned for in the system design by encapsulation

l May require data to be restructured and converted tobe used in some other system

Page 69: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 40

System procurement

l Acquiring a system for an organization to meetsome need

l Some system specification and architectural designis usually necessary before procurement• You need a specification to let a contract for system development

• The specification may allow you to buy a commercial off-the-shelf(COTS) system. Almost always cheaper than developing a systemfrom scratch

Page 70: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 41

The system procurement process

Choosesupplier

Issue requestfor bids

Choosesystem

Adaptrequirements

Survey market forexisting systems

Let contract fordevelopment

Negotiatecontract

Selecttender

Issue requestto tender

Off-the-shelfsystem available

Bespoke systemrequired

Page 71: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 42

Procurement issues

l Requirements may have to be modified to match thecapabilities of off-the-shelf components

l The requirements specification may be part of thecontract for the development of the system

l There is usually a contract negotiation period toagree changes after the contractor to build a systemhas been selected

Page 72: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 43

Contractors and sub-contractors

l The procurement of large hardware/softwaresystems is usually based around some principalcontractor

l Sub-contracts are issued to other suppliers to supplyparts of the system

l Customer liases with the principal contractor anddoes not deal directly with sub-contractors

Page 73: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 44

Contractor/Sub-contractor model

Sub-contractor 2Sub-contractor 1 Sub-contractor 3

Principalcontractor

Systemcustomer

Page 74: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 45

Key points

l System engineering involves input from a range ofdisciplines

l Emergent properties are properties that arecharacteristic of the system as a whole and not itscomponent parts

l System architectural models show major sub-systems and inter-connections. They are usuallydescribed using block diagrams

Page 75: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 46

Key points

l System component types are sensor, actuator,computation, co-ordination, communication andinterface

l The systems engineering process is usually awaterfall model and includes specification, design,development and integration.

l System procurement is concerned with decidingwhich system to buy and who to buy it from

Page 76: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 2 Slide 47

l Systems engineering is hard! There will never be aneasy answer to the problems of complex systemdevelopment

l Software engineers do not have all the answersbut may be better at taking a systemsviewpoint

l Disciplines need to recognise each othersstrengths and actively rather than reluctantlycooperate in the systems engineering process

Conclusion

Page 77: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 1

Software Processes

l Coherent sets of activities forspecifying, designing, implementingand testing software systems

Page 78: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 2

Objectives

l To introduce software process models

l To describe a number of different process modelsand when they may be used

l To describe outline process models forrequirements engineering, software development,testing and evolution

l To introduce CASE technology to supportsoftware process activities

Page 79: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 3

Topics covered

l Software process models

l Process iteration

l Software specification

l Software design and implementation

l Software validation

l Software evolution

l Automated process support

Page 80: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 4

The software process

l A structured set of activities required to develop asoftware system• Specification

• Design

• Validation

• Evolution

l A software process model is an abstractrepresentation of a process. It presents adescription of a process from some particularperspective

Page 81: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5

Software process models

Page 82: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 6

Generic software process models

l The waterfall model• Separate and distinct phases of specification and development

l Evolutionary development• Specification and development are interleaved

l Formal systems development• A mathematical system model is formally transformed to an

implementation

l Reuse-based development• The system is assembled from existing components

Page 83: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 7

Waterfall modelRequirements

definition

System andsoftware design

Implementationand unit testing

Integration andsystem testing

Operation andmaintenance

Page 84: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 8

Waterfall model phases

l Requirements analysis and definition

l System and software design

l Implementation and unit testing

l Integration and system testing

l Operation and maintenance

l The drawback of the waterfall model is thedifficulty of accommodating change after theprocess is underway

Page 85: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 9

Waterfall model problems

l Inflexible partitioning of the project into distinctstages

l This makes it difficult to respond to changingcustomer requirements

l Therefore, this model is only appropriate whenthe requirements are well-understood

Page 86: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 10

Evolutionary development

l Exploratory development• Objective is to work with customers and to evolve a final

system from an initial outline specification. Should start withwell-understood requirements

l Throw-away prototyping• Objective is to understand the system requirements. Should start

with poorly understood requirements

Page 87: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 11

Evolutionary development

Validation Finalversion

Development Intermediateversions

Specification Initialversion

Outlinedescription

Concurrentactivities

Page 88: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 12

Evolutionary development

l Problems• Lack of process visibility

• Systems are often poorly structured

• Special skills (e.g. in languages for rapid prototyping) may berequired

l Applicability• For small or medium-size interactive systems

• For parts of large systems (e.g. the user interface)

• For short-lifetime systems

Page 89: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 13

Formal systems development

l Based on the transformation of a mathematicalspecification through different representations toan executable program

l Transformations are ‘correctness-preserving’ so itis straightforward to show that the programconforms to its specification

l Embodied in the ‘Cleanroom’ approach tosoftware development

Page 90: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 14

Formal systems development

Requirementsdefinition

Formalspecification

Formaltransformation

Integration andsystem testing

Page 91: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 15

Formal transformations

R2Formalspecification R3 Executable

program

P2 P3 P4

T1 T2 T3 T4

Proofs of transformation correctness

Formal transformations

R1

P1

Page 92: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 16

Formal systems development

l Problems• Need for specialised skills and training to apply the technique

• Difficult to formally specify some aspects of the system such asthe user interface

l Applicability• Critical systems especially those where a safety or security case

must be made before the system is put into operation

Page 93: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 17

Reuse-oriented development

l Based on systematic reuse where systems areintegrated from existing components or COTS(Commercial-off-the-shelf) systems

l Process stages• Component analysis

• Requirements modification

• System design with reuse

• Development and integration

l This approach is becoming more important butstill limited experience with it

Page 94: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 18

Reuse-oriented development

Requirementsspecification

Componentanalysis

Developmentand integration

System designwith reuse

Requirementsmodification

Systemvalidation

Page 95: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 19

Process iteration

Page 96: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 20

Process iteration

l System requirements ALWAYS evolve in thecourse of a project so process iteration whereearlier stages are reworked is always part of theprocess for large systems

l Iteration can be applied to any of the genericprocess models

l Two (related) approaches• Incremental development

• Spiral development

Page 97: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 21

Incremental development

l Rather than deliver the system as a singledelivery, the development and delivery is brokendown into increments with each incrementdelivering part of the required functionality

l User requirements are prioritised and the highestpriority requirements are included in earlyincrements

l Once the development of an increment is started,the requirements are frozen though requirementsfor later increments can continue to evolve

Page 98: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 22

Incremental development

Validateincrement

Develop systemincrement

Design systemarchitecture

Integrateincrement

Validatesystem

Define outline requirements

Assign requirements to increments

System incomplete

Finalsystem

Page 99: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 23

Incremental development advantages

l Customer value can be delivered with eachincrement so system functionality is availableearlier

l Early increments act as a prototype to help elicitrequirements for later increments

l Lower risk of overall project failure

l The highest priority system services tend toreceive the most testing

Page 100: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 24

Extreme programming

l New approach to development based on thedevelopment and delivery of very smallincrements of functionality

l Relies on constant code improvement, userinvolvement in the development team andpairwise programming

Page 101: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 25

Spiral development

l Process is represented as a spiral rather than as asequence of activities with backtracking

l Each loop in the spiral represents a phase in theprocess.

l No fixed phases such as specification or design -loops in the spiral are chosen depending on whatis required

l Risks are explicitly assessed and resolvedthroughout the process

Page 102: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 26

Spiral model of the software process

Riskanalysis

Riskanalysis

Riskanalysis

Riskanalysis Proto-

type 1

Prototype 2

Prototype 3Opera-tionalprotoype

Concept ofOperation

Simulations, models, benchmarks

S/Wrequirements

Requirementvalidation

DesignV&V

Productdesign Detailed

design

Code

Unit test

IntegrationtestAcceptance

testService Develop, verifynext-level product

Evaluate alternativesidentify, resolve risks

Determine objectivesalternatives and

constraints

Plan next phase

Integrationand test plan

Developmentplan

Requirements planLife-cycle plan

REVIEW

Page 103: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 27

Spiral model sectors

l Objective setting• Specific objectives for the phase are identified

l Risk assessment and reduction• Risks are assessed and activities put in place to reduce the key

risks

l Development and validation• A development model for the system is chosen which can be

any of the generic models

l Planning• The project is reviewed and the next phase of the spiral is

planned

Page 104: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 28

Software specification

l The process of establishing what services arerequired and the constraints on the system’soperation and development

l Requirements engineering process• Feasibility study

• Requirements elicitation and analysis

• Requirements specification

• Requirements validation

Page 105: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 29

The requirements engineering process

Feasibilitystudy

Requirementselicitation and

analysisRequirementsspecification

Requirementsvalidation

Feasibilityreport

Systemmodels

User and systemrequirements

Requirementsdocument

Page 106: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 30

Software design and implementation

l The process of converting the systemspecification into an executable system

l Software design• Design a software structure that realises the specification

l Implementation• Translate this structure into an executable program

l The activities of design and implementation areclosely related and may be inter-leaved

Page 107: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 31

Design process activities

l Architectural design

l Abstract specification

l Interface design

l Component design

l Data structure design

l Algorithm design

Page 108: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 32

The software design process

Architecturaldesign

Abstractspecification

Interfacedesign

Componentdesign

Datastructuredesign

Algorithmdesign

Systemarchitecture

Softwarespecification

Interfacespecification

Componentspecification

Datastructure

specification

Algorithmspecification

Requirementsspecification

Design activities

Design products

Page 109: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 33

Design methods

l Systematic approaches to developing a softwaredesign

l The design is usually documented as a set ofgraphical models

l Possible models• Data-flow model

• Entity-relation-attribute model

• Structural model

• Object models

Page 110: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 34

Programming and debugging

l Translating a design into a program and removingerrors from that program

l Programming is a personal activity - there is nogeneric programming process

l Programmers carry out some program testing todiscover faults in the program and remove thesefaults in the debugging process

Page 111: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 35

The debugging process

Locateerror

Designerror repair

Repairerror

Re-testprogram

Page 112: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 36

Software validation

l Verification and validation is intended to showthat a system conforms to its specification andmeets the requirements of the system customer

l Involves checking and review processes andsystem testing

l System testing involves executing the systemwith test cases that are derived from thespecification of the real data to be processed bythe system

Page 113: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 37

The testing process

Sub-systemtesting

Moduletesting

Unittesting

Systemtesting

Acceptancetesting

Componenttesting

Integration testing Usertesting

Page 114: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 38

Testing stagesl Unit testing

• Individual components are tested

l Module testing• Related collections of dependent components are tested

l Sub-system testing• Modules are integrated into sub-systems and tested. The focus

here should be on interface testing

l System testing• Testing of the system as a whole. Testing of emergent properties

l Acceptance testing• Testing with customer data to check that it is acceptable

Page 115: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 39

Testing phases

Requirementsspecification

Systemspecification

Systemdesign

Detaileddesign

Module andunit codeand tess

Sub-systemintegrationtest plan

Systemintegrationtest plan

Acceptancetest plan

Service Acceptancetest

Systemintegration test

Sub-systemintegration test

Page 116: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 40

Software evolution

l Software is inherently flexible and can change.

l As requirements change through changingbusiness circumstances, the software thatsupports the business must also evolve andchange

l Although there has been a demarcation betweendevelopment and evolution (maintenance) this isincreasingly irrelevant as fewer and fewersystems are completely new

Page 117: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 41

System evolution

Assess existingsystems

Define systemrequirements

Propose systemchanges

Modifysystems

Newsystem

Existingsystems

Page 118: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 42

Automated process support

Page 119: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 43

CASE

l Computer-aided software engineering (CASE) issoftware to support software development andevolution processes

l Activity automation• Graphical editors for system model development

• Data dictionary to manage design entities

• Graphical UI builder for user interface construction

• Debuggers to support program fault finding

• Automated translators to generate new versions of a program

Page 120: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 44

Case technology

l Case technology has led to significantimprovements in the software process though notthe order of magnitude improvements that wereonce predicted• Software engineering requires creative thought - this is not

readily automatable

• Software engineering is a team activity and, for large projects,much time is spent in team interactions. CASE technology doesnot really support these

Page 121: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 45

CASE classification

l Classification helps us understand the differenttypes of CASE tools and their support for processactivities

l Functional perspective• Tools are classified according to their specific function

l Process perspective• Tools are classified according to process activities that are

supported

l Integration perspective• Tools are classified according to their organisation into

integrated units

Page 122: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 46

Functional tool classificationTool type ExamplesPlanning tools PERT tools, estimation tools,

spreadsheetsEditing tools Text editors, diagram editors, word

processorsChange management tools Requirements traceability tools, change

control systemsConfiguration management tools Version management systems, system

building toolsPrototyping tools Very high-level languages,

user interface generatorsMethod-support tools Design editors, data dictionaries, code

generatorsLanguage-processing tools Compilers, interpretersProgram analysis tools Cross reference generators, static

analysers, dynamic analysersTesting tools Test data generators, file comparatorsDebugging tools Interactive debugging systemsDocumentation tools Page layout programs, image editorsRe-engineering tools Cross-reference systems, program re-

structuring systems

Page 123: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Activity-based classification

Reengineering tools

Testing tools

Debugging tools

Program analysis tools

Language-processingtools

Method support tools

Prototyping tools

Configurationmanagement tools

Change management tools

Documentation tools

Editing tools

Planning tools

Specification Design Implementation Verificationand

Validation

Page 124: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 48

CASE integration

l Tools• Support individual process tasks such as design consistency

checking, text editing, etc.

l Workbenches• Support a process phase such as specification or design,

Normally include a number of integrated tools

l Environments• Support all or a substantial part of an entire software process.

Normally include several integrated workbenches

Page 125: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 49

Tools, workbenches, environments

Single-methodworkbenches

General-purposeworkbenches

Multi-methodworkbenches

Language-specificworkbenches

Programming TestingAnalysis anddesign

Integratedenvironments

Process-centredenvironments

FilecomparatorsCompilersEditors

EnvironmentsWorkbenchesTools

CASEtechnology

Page 126: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 50

Key points

l Software processes are the activities involved inproducing and evolving a software system. Theyare represented in a software process model

l General activities are specification, design andimplementation, validation and evolution

l Generic process models describe the organisationof software processes

l Iterative process models describe the softwareprocess as a cycle of activities

Page 127: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 51

Key points

l Requirements engineering is the process ofdeveloping a software specification

l Design and implementation processes transformthe specification to an executable program

l Validation involves checking that the systemmeets to its specification and user needs

l Evolution is concerned with modifying thesystem after it is in use

l CASE technology supports software processactivities

Page 128: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 1

Project management

l Organising, planning andscheduling software projects

Page 129: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 2

Objectives

l To introduce software project management and todescribe its distinctive characteristics

l To discuss project planning and the planningprocess

l To show how graphical schedule representationsare used by project management

l To discuss the notion of risks and the riskmanagement process

Page 130: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 3

Topics covered

l Management activities

l Project planning

l Project scheduling

l Risk management

Page 131: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 4

l Concerned with activities involved in ensuringthat software is delivered on time and onschedule and in accordance with therequirements of the organisations developingand procuring the software

l Project management is needed because softwaredevelopment is always subject to budget andschedule constraints that are set by theorganisation developing the software

Software project management

Page 132: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 5

l The product is intangible

l The product is uniquely flexible

l Software engineering is not recognized as anengineering discipline with the sane status asmechanical, electrical engineering, etc.

l The software development process is notstandardised

l Many software projects are 'one-off' projects

Software management distinctions

Page 133: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 6

Management activities

Page 134: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 7

l Proposal writing

l Project planning and scheduling

l Project costing

l Project monitoring and reviews

l Personnel selection and evaluation

l Report writing and presentations

Management activities

Page 135: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 8

l These activities are not peculiar to softwaremanagement

l Many techniques of engineering projectmanagement are equally applicable to softwareproject management

l Technically complex engineering systems tendto suffer from the same problems as softwaresystems

Management commonalities

Page 136: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 9

Project staffing

l May not be possible to appoint the ideal people towork on a project• Project budget may not allow for the use of highly-paid staff

• Staff with the appropriate experience may not be available

• An organisation may wish to develop employee skills on asoftware project

l Managers have to work within these constraintsespecially when (as is currently the case) there isan international shortage of skilled IT staff

Page 137: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 10

Project planning

Page 138: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 11

Project planning

l Probably the most time-consuming projectmanagement activity

l Continuous activity from initial concept throughto system delivery. Plans must be regularlyrevised as new information becomes available

l Various different types of plan may be developedto support the main software project plan that isconcerned with schedule and budget

Page 139: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 12

Types of project plan

Plan DescriptionQuality plan Describes the quality procedures and

standards that will be used in a project.Validation plan Describes the approach, resources and

schedule used for system validation. Configurationmanagement plan

Describes the configuration managementprocedures and structures to be used.

Maintenance plan Predicts the maintenance requirements ofthe system, maintenance costs and effortrequired.

Staff development plan. Describes how the skills and experience ofthe project team members will bedeveloped.

Page 140: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 13

Project planning process

Establish the project constraints Make initial assessments of the project parameters Define project milestones and deliverableswhile project has not been completed or cancelled loop

Draw up project scheduleInitiate activities according to schedule

Wait ( for a while ) Review project progress Revise estimates of project parameters Update the project schedule Re-negotiate project constraints and deliverables if ( problems arise ) then Initiate technical review and possible revision end ifend loop

Page 141: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 14

Project plan structure

l Introduction

l Project organisation

l Risk analysis

l Hardware and software resource requirements

l Work breakdown

l Project schedule

l Monitoring and reporting mechanisms

Page 142: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 15

Activity organization

l Activities in a project should be organised toproduce tangible outputs for management tojudge progress

l Milestones are the end-point of a process activity

l Deliverables are project results delivered tocustomers

l The waterfall process allows for thestraightforward definition of progress milestones

Page 143: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 16

Milestones in the RE process

Evaluationreport

Prototypedevelopment

Requirementsdefinition

Requirementsanalysis

Feasibilityreport

Feasibilitystudy

Architecturaldesign

Designstudy

Requirementsspecification

Requirementsspecification

ACTIVITIES

MILESTONES

Page 144: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 17

Project scheduling

Page 145: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 18

Project scheduling

l Split project into tasks and estimate time andresources required to complete each task

l Organize tasks concurrently to make optimaluse of workforce

l Minimize task dependencies to avoid delayscaused by one task waiting for another tocomplete

l Dependent on project managers intuition andexperience

Page 146: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 19

The project scheduling process

Estimate resourcesfor activities

Identify activitydependencies

Identifyactivities

Allocate peopleto activities

Create projectcharts

Softwarerequirements

Activity chartsand bar charts

Page 147: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 20

Scheduling problems

l Estimating the difficulty of problems and hencethe cost of developing a solution is hard

l Productivity is not proportional to the number ofpeople working on a task

l Adding people to a late project makes it laterbecause of communication overheads

l The unexpected always happens. Always allowcontingency in planning

Page 148: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 21

Bar charts and activity networks

l Graphical notations used to illustrate the projectschedule

l Show project breakdown into tasks. Tasks shouldnot be too small. They should take about a weekor two

l Activity charts show task dependencies and thethe critical path

l Bar charts show schedule against calendar time

Page 149: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 22

Task durations and dependenciesTask Duration (days) DependenciesT1 8T2 15T3 15 T1 (M1)T4 10T5 10 T2, T4 (M2)T6 5 T1, T2 (M3)T7 20 T1 (M1)T8 25 T4 (M5)T9 15 T3, T6 (M4)T10 15 T5, T7 (M7)T11 7 T9 (M6)T12 10 T11 (M8)

Page 150: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 23

Activity network

start

T2

M3T6

Finish

T10

M7T5

T7

M2T4

M5

T8

4/7/99

8 days

14/7/99 15 days

4/8/99

15 days

25/8/99

7 days

5/9/99

10 days

19/9/99

15 days

11/8/99

25 days

10 days

20 days

5 days25/7/99

15 days

25/7/99

18/7/99

10 days

T1

M1 T3T9

M6

T11

M8

T12

M4

Page 151: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 24

Activity timeline4/7 11/7 18/7 25/7 1/8 8/8 15/8 22/8 29/8 5/9 12/9 19/9

T4

T1T2

M1

T7T3

M5T8

M3

M2T6

T5M4

T9

M7T10

M6

T11M8

T12

Start

Finish

Page 152: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 25

Staff allocation4/7 11/7 18/7 25/ 1/8 8/8 15/8 22/8 29/8 5/9 12/9 19/9

T4

T8 T11

T12

T1

T3

T9

T2

T6 T10

T7

T5

Fred

Jane

Anne

Mary

Jim

Page 153: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 26

Risk management

Page 154: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 27

Risk management

l Risk management is concerned with identifyingrisks and drawing up plans to minimise theireffect on a project.

l A risk is a probability that some adversecircumstance will occur.• Project risks affect schedule or resources

• Product risks affect the quality or performance of the softwarebeing developed

• Business risks affect the organisation developing or procuringthe software

Page 155: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 28

Software risksRisk Risk type DescriptionStaff turnover Project Experienced staff will leave the

project before it is finished.Management change Project There will be a change of

organisational management withdifferent priorities.

Hardware unavailability Project Hardware which is essential for theproject will not be delivered onschedule.

Requirements change Project andproduct

There will be a larger number ofchanges to the requirements thananticipated.

Specification delays Project andproduct

Specifications of essential interfacesare not available on schedule

Size underestimate Project andproduct

The size of the system has beenunderestimated.

CASE tool under-performance

Product CASE tools which support theproject do not perform as anticipated

Technology change Business The underlying technology on whichthe system is built is superseded bynew technology.

Product competition Business A competitive product is marketedbefore the system is completed.

Page 156: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 29

The risk management process

l Risk identification• Identify project, product and business risks

l Risk analysis• Assess the likelihood and consequences of these risks

l Risk planning• Draw up plans to avoid or minimise the effects of the risk

l Risk monitoring• Monitor the risks throughout the project

Page 157: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 30

The risk management process

Risk avoidanceand contingency

plans

Risk planning

Prioritised risklist

Risk analysis

List of potentialrisks

Riskidentification

Riskassessment

Riskmonitoring

Page 158: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 31

Risk identification

l Technology risks

l People risks

l Organisational risks

l Requirements risks

l Estimation risks

Page 159: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 32

Risks and risk typesRisk type Possible risksTechnology The database used in the system cannot process as many

transactions per second as expected.Software components which should be reused contain defectswhich limit their functionality.

People It is impossible to recruit staff with the skills required.Key staff are ill and unavailable at critical times.Required training for staff is not available.

Organisational The organisation is restructured so that different managementare responsible for the project.Organisational financial problems force reductions in the projectbudget.

Tools The code generated by CASE tools is inefficient.CASE tools cannot be integrated.

Requirements Changes to requirements which require major design rework areproposed.Customers fail to understand the impact of requirementschanges.

Estimation The time required to develop the software is underestimated.The rate of defect repair is underestimated.The size of the software is underestimated.

Page 160: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 33

Risk analysis

l Assess probability and seriousness of each risk

l Probability may be very low, low, moderate, highor very high

l Risk effects might be catastrophic, serious,tolerable or insignificant

Page 161: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 34

Risk analysisRisk Probability EffectsOrganisational financial problems force reductionsin the project budget.

Low Catastrophic

It is impossible to recruit staff with the skillsrequired for the project.

High Catastrophic

Key staff are ill at critical times in the project. Moderate SeriousSoftware components which should be reusedcontain defects which limit their functionality.

Moderate Serious

Changes to requirements which require majordesign rework are proposed.

Moderate Serious

The organisation is restructured so that differentmanagement are responsible for the project.

High Serious

The database used in the system cannot process asmany transactions per second as expected.

Moderate Serious

The time required to develop the software isunderestimated.

High Serious

CASE tools cannot be integrated. High TolerableCustomers fail to understand the impact ofrequirements changes.

Moderate Tolerable

Required training for staff is not available. Moderate TolerableThe rate of defect repair is underestimated. Moderate TolerableThe size of the software is underestimated. High TolerableThe code generated by CASE tools is inefficient. Moderate Insignificant

Page 162: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 35

Risk planning

l Consider each risk and develop a strategy tomanage that risk

l Avoidance strategies• The probability that the risk will arise is reduced

l Minimisation strategies• The impact of the risk on the project or product will be reduced

l Contingency plans• If the risk arises, contingency plans are plans to deal with that

risk

Page 163: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 36

Risk management strategiesRisk StrategyOrganisationalfinancial problems

Prepare a briefing document for senior management showinghow the project is making a very important contribution to thegoals of the business.

Recruitmentproblems

Alert customer of potential difficulties and the possibility ofdelays, investigate buying-in components.

Staff illness Reorganise team so that there is more overlap of work andpeople therefore understand each other’s jobs.

Defectivecomponents

Replace potentially defective components with bought-incomponents of known reliability.

Requirementschanges

Derive traceability information to assess requirements changeimpact, maximise information hiding in the design.

Organisationalrestructuring

Prepare a briefing document for senior management showinghow the project is making a very important contribution to thegoals of the business.

Databaseperformance

Investigate the possibility of buying a higher-performancedatabase.

Underestimateddevelopment time

Investigate buying in components, investigate use of a programgenerator.

Page 164: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 37

Risk monitoring

l Assess each identified risks regularly to decidewhether or not it is becoming less or moreprobable

l Also assess whether the effects of the risk havechanged

l Each key risk should be discussed at managementprogress meetings

Page 165: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 38

Risk factorsRisk type Potential indicatorsTechnology Late delivery of hardware or support software, many

reported technology problemsPeople Poor staff morale, poor relationships amongst team

member, job availabilityOrganisational organisational gossip, lack of action by senior

managementTools reluctance by team members to use tools, complaints

about CASE tools, demands for higher-poweredworkstations

Requirements many requirements change requests, customercomplaints

Estimation failure to meet agreed schedule, failure to clearreported defects

Page 166: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 39

Key points

l Good project management is essential for projectsuccess

l The intangible nature of software causesproblems for management

l Managers have diverse roles but their mostsignificant activities are planning, estimating andscheduling

l Planning and estimating are iterative processeswhich continue throughout the course of aproject

Page 167: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 4 Slide 40

l A project milestone is a predictable state wheresome formal report of progress is presented tomanagement.

l Risks may be project risks, product risks orbusiness risks

l Risk management is concerned with identifyingrisks which may affect the project and planning toensure that these risks do not develop into majorthreats

Key points

Page 168: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 1

Software Requirements

l Descriptions and specifications ofa system

Page 169: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 2

Objectives

l To introduce the concepts of user and systemrequirements

l To describe functional and non-functionalrequirements

l To explain two techniques for describing systemrequirements

l To explain how software requirements may beorganised in a requirements document

Page 170: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 3

Topics covered

l Functional and non-functional requirements

l User requirements

l System requirements

l The software requirements document

Page 171: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 4

Requirements engineering

l The process of establishing the services that thecustomer requires from a system and the constraintsunder which it operates and is developed

l The requirements themselves are the descriptions ofthe system services and constraints that are generatedduring the requirements engineering process

Page 172: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 5

What is a requirement?

l It may range from a high-level abstract statement of aservice or of a system constraint to a detailedmathematical functional specification

l This is inevitable as requirements may serve a dualfunction• May be the basis for a bid for a contract - therefore must be open to

interpretation

• May be the basis for the contract itself - therefore must be defined indetail

• Both these statements may be called requirements

Page 173: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 6

Requirements abstraction (Davis)

“If a company wishes to let a contract for a large software development project, itmust define its needs in a sufficiently abstract way that a solution is not pre-defined.The requirements must be written so that several contractors can bid for the contract,offering, perhaps, different ways of meeting the client organisation’s needs. Once acontract has been awarded, the contractor must write a system definition for the clientin more detail so that the client understands and can validate what the software willdo. Both of these documents may be called the requirements document for thesystem.”

Page 174: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 7

Types of requirement

l User requirements• Statements in natural language plus diagrams of the services the

system provides and its operational constraints. Written for customers

l System requirements• A structured document setting out detailed descriptions of the system

services. Written as a contract between client and contractor

l Software specification• A detailed software description which can serve as a basis for a design

or implementation. Written for developers

Page 175: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 8

Definitions and specifications

1. The software must provide a means of representing and1. accessing external files created by other tools.

1.1 The user should be provided with facilities to define the type of1.2 external files.1.2 Each external file type may have an associated tool which may be1.2 applied to the file.1.3 Each external file type may be represented as a specific icon on1.2 the user’s display.1.4 Facilities should be provided for the icon representing an1.2 external file type to be defined by the user.1.5 When a user selects an icon representing an external file, the1.2 effect of that selection is to apply the tool associated with the type of1.2 the external file to the file represented by the selected icon.

Requirements definition

Requirements specification

Page 176: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 9

Requirements readersClient managersSystem end-usersClient engineersContractor managersSystem architects

System end-usersClient engineersSystem architectsSoftware developers

Client engineers (perhaps)System architectsSoftware developers

User requirements

System requirements

Software designspecification

Page 177: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 10

Functional and non-functional requirements

l Functional requirements• Statements of services the system should provide, how the system

should react to particular inputs and how the system should behave inparticular situations.

l Non-functional requirements• constraints on the services or functions offered by the system such as

timing constraints, constraints on the development process, standards,etc.

l Domain requirements• Requirements that come from the application domain of the system

and that reflect characteristics of that domain

Page 178: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 11

Functional requirements

l Describe functionality or system services

l Depend on the type of software, expected users andthe type of system where the software is used

l Functional user requirements may be high-levelstatements of what the system should do butfunctional system requirements should describe thesystem services in detail

Page 179: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 12

Examples of functional requirements

l The user shall be able to search either all of the initialset of databases or select a subset from it.

l The system shall provide appropriate viewers for theuser to read documents in the document store.

l Every order shall be allocated a unique identifier(ORDER_ID) which the user shall be able to copy tothe account’s permanent storage area.

Page 180: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 13

Requirements imprecision

l Problems arise when requirements are not preciselystated

l Ambiguous requirements may be interpreted indifferent ways by developers and users

l Consider the term ‘appropriate viewers’• User intention - special purpose viewer for each different document

type

• Developer interpretation - Provide a text viewer that shows thecontents of the document

Page 181: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 14

Requirements completeness and consistency

l In principle requirements should be both complete andconsistent

l Complete• They should include descriptions of all facilities required

l Consistent• There should be no conflicts or contradictions in the descriptions of

the system facilities

l In practice, it is impossible to produce a complete andconsistent requirements document

Page 182: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 15

Non-functional requirements

l Define system properties and constraints e.g.reliability, response time and storage requirements.Constraints are I/O device capability, systemrepresentations, etc.

l Process requirements may also be specified mandatinga particular CASE system, programming language ordevelopment method

l Non-functional requirements may be more criticalthan functional requirements. If these are not met, thesystem is useless

Page 183: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 16

Non-functional classifications

l Product requirements• Requirements which specify that the delivered product must behave in

a particular way e.g. execution speed, reliability, etc.

l Organisational requirements• Requirements which are a consequence of organisational policies and

procedures e.g. process standards used, implementation requirements,etc.

l External requirements• Requirements which arise from factors which are external to the

system and its development process e.g. interoperability requirements,legislative requirements, etc.

Page 184: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 17

Non-functional requirement types

Performancerequirements

Spacerequirements

Usabilityrequirements

Efficiencyrequirements

Reliabilityrequirements

Portabilityrequirements

Interoperabilityrequirements

Ethicalrequirements

Legislativerequirements

Implementationrequirements

Standardsrequirements

Deliveryrequirements

Safetyrequirements

Privacyrequirements

Productrequirements

Organizationalrequirements

Externalrequirements

Non-functionalrequirements

Page 185: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 18

Non-functional requirements examples

l Product requirement• 4.C.8 It shall be possible for all necessary communication between the APSE

and the user to be expressed in the standard Ada character set

l Organisational requirement• 9.3.2 The system development process and deliverable documents shall

conform to the process and deliverables defined in XYZCo-SP-STAN-95

l External requirement• 7.6.5 The system shall not disclose any personal information about

customers apart from their name and reference number to the operators of thesystem

Page 186: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 19

Goals and requirements

l Non-functional requirements may be very difficult tostate precisely and imprecise requirements may bedifficult to verify.

l Goal• A general intention of the user such as ease of use

l Verifiable non-functional requirement• A statement using some measure that can be objectively tested

l Goals are helpful to developers as they convey theintentions of the system users

Page 187: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 20

Examples

l A system goal• The system should be easy to use by experienced controllers and

should be organised in such a way that user errors are minimised.

l A verifiable non-functional requirement• Experienced controllers shall be able to use all the system functions

after a total of two hours training. After this training, the averagenumber of errors made by experienced users shall not exceed two perday.

Page 188: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 21

Requirements measuresProperty MeasureSpeed Processed transactions/second

User/Event response timeScreen refresh time

Size K BytesNumber of RAM chips

Ease of use Training timeNumber of help frames

Reliability Mean time to failureProbability of unavailabilityRate of failure occurrenceAvailability

Robustness Time to restart after failurePercentage of events causing failureProbability of data corruption on failure

Portability Percentage of target dependent statementsNumber of target systems

Page 189: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 22

Requirements interaction

l Conflicts between different non-functionalrequirements are common in complex systems

l Spacecraft system• To minimise weight, the number of separate chips in the system

should be minimised

• To minimise power consumption, lower power chips should be used

• However, using low power chips may mean that more chips have to beused. Which is the most critical requirement?

Page 190: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 23

Domain requirements

l Derived from the application domain and describesystem characterisics and features that reflect thedomain

l May be new functional requirements, constraints onexisting requirements or define specific computations

l If domain requirements are not satisfied, the systemmay be unworkable

Page 191: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 24

Library system domain requirements

l There shall be a standard user interface to alldatabases which shall be based on the Z39.50standard.

l Because of copyright restrictions, some documentsmust be deleted immediately on arrival. Depending onthe user’s requirements, these documents will eitherbe printed locally on the system server for manuallyforwarding to the user or routed to a network printer.

Page 192: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 25

Train protection system

l The deceleration of the train shall be computed as:• Dtrain = Dcontrol + Dgradient

where Dgradient is 9.81ms2 * compensatedgradient/alpha and where the values of 9.81ms2 /alphaare known for different types of train.

Page 193: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 26

Domain requirements problems

l Understandability• Requirements are expressed in the language of the application domain

• This is often not understood by software engineers developing thesystem

l Implicitness• Domain specialists understand the area so well that they do not think

of making the domain requirements explicit

Page 194: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 27

User requirements

l Should describe functional and non-functionalrequirements so that they are understandable bysystem users who don’t have detailed technicalknowledge

l User requirements are defined using natural language,tables and diagrams

Page 195: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 28

Problems with natural language

l Lack of clarity• Precision is difficult without making the document difficult to read

l Requirements confusion• Functional and non-functional requirements tend to be mixed-up

l Requirements amalgamation• Several different requirements may be expressed together

Page 196: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 29

Database requirement

4.A.5 The database shall support the generation and control of configuration objects; that is, objects which are themselves groupings of other objects in the database. The configuration control facilities shall allow access to the objects in a version group by the use of an incomplete name.

Page 197: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 30

Editor grid requirement

2.6 Grid facilities To assist in the positioning of entities on a diagram, the user may turn on a grid in either centimetres or inches, via an option on the control panel. Initially, the grid is off. The grid may be turned on and off at any time during an editing session and can be toggled between inches and centimetres at any time. A grid option will be provided on the reduce-to-fit view but the number of grid lines shown will be reduced to avoid filling the smaller diagram with grid lines.

Page 198: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 31

Requirement problems

l Database requirements includes both conceptual anddetailed information• Describes the concept of configuration control facilities

• Includes the detail that objects may be accessed using an incompletename

l Grid requirement mixes three different kinds ofrequirement• Conceptual functional requirement (the need for a grid)

• Non-functional requirement (grid units)

• Non-functional UI requirement (grid switching)

Page 199: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 32

Structured presentation

2.6 Grid facilities2.6.1 The editor shall provide a grid facility where a

matrix of horizontal and vertical lines provide abackground to the editor window. This grid shall bea p assive grid where the alignment of entities is theuser's responsibility.Rationale: A grid helps the user to create a tidydiagram with well-spaced entities. Although an activegrid, where entities 'snap-to' grid lines can be useful,the positioning is imprecise. The user is the best personto decide where entities should be positioned.

Specification: ECLIPSE/WS/Tools/DE/FS Section 5.6

Page 200: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 33

Detailed user requirement

3.5.1 Adding nodes to a design3.5.1.1 The editor shall provide a f acility for users to add nodes of a specified type to their

design.

3.5.1.2 The sequence of actions to add a node should be as follows:

1. The user should select the type of node to be added.

2. The user should move the cursor to the approximate node position in the diagram andindicate that the node symbol should be added at that point.

3. The user should then drag the node symbol to its final position.

Rationale: The user is the best person to decide where to position a node on the diagram.This approach gives the user direct control over node type selection and positioning.

Specification: ECLIPSE/WS/Tools/DE/FS. Section 3.5.1

Page 201: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 34

Guidelines for writing requirements

l Invent a standard format and use it for allrequirements

l Use language in a consistent way. Use shall formandatory requirements, should for desirablerequirements

l Use text highlighting to identify key parts of therequirement

l Avoid the use of computer jargon

Page 202: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 35

System requirements

l More detailed specifications of user requirements

l Serve as a basis for designing the system

l May be used as part of the system contract

l System requirements may be expressed using systemmodels discussed in Chapter 7

Page 203: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 36

Requirements and design

l In principle, requirements should state what thesystem should do and the design should describe howit does this

l In practice, requirements and design are inseparable• A system architecture may be designed to structure the requirements

• The system may inter-operate with other systems that generate designrequirements

• The use of a specific design may be a domain requirement

Page 204: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 37

Problems with NL specification

l Ambiguity• The readers and writers of the requirement must interpret the same

words in the same way. NL is naturally ambiguous so this is verydifficult

l Over-flexibility• The same thing may be said in a number of different ways in the

specification

l Lack of modularisation• NL structures are inadequate to structure system requirements

Page 205: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 38

Alternatives to NL specificationNotation DescriptionStructurednaturallanguage

This approach depends on defining standard forms ortemplates to express the requirements specification.

Designdescriptionlanguages

This approach uses a language like a programming languagebut with more abstract features to specify the requirementsby defining an operational model of the system.

Graphicalnotations

A graphical language, supplemented by text annotations isused to define the functional requirements for the system.An early example of such a graphical language was SADT(Ross, 1977; Schoman and Ross, 1977). More recently, use-case descriptions (Jacobsen, Christerson et al., 1993) havebeen used. I discuss these in the following chapter.

Mathematicalspecifications

These are notations based on mathematical concepts suchas finite-state machines or sets. These unambiguousspecifications reduce the arguments between customer andcontractor about system functionality. However, mostcustomers don’t understand formal specifications and arereluctant to accept it as a system contract. I discuss formalspecification in Chapter 9.

Page 206: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 39

Structured language specifications

l A limited form of natural language may be used toexpress requirements

l This removes some of the problems resulting fromambiguity and flexibility and imposes a degree ofuniformity on a specification

l Often bast supported using a forms-based approach

Page 207: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 40

Form-based specifications

l Definition of the function or entity

l Description of inputs and where they come from

l Description of outputs and where they go to

l Indication of other entities required

l Pre and post conditions (if appropriate)

l The side effects (if any)

Page 208: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 41

Form-based node specificationECLIPSE/Workstation/Tools/DE/FS/3.5.1

Function Add node

Description Adds a node to an existing design. The user selects the type of node, and its position.When added to the design, the node becomes the current selection. The user chooses the node position bymoving the cursor to the area where the node is added.

Inputs Node type, Node position, Design identifier.

Source Node type and Node position are input by the user, Design identifier from the database.

Outputs Design identifier.

Destination The design database. The design is committed to the database on completion of theoperation.

Requires Design graph rooted at input design identifier.

Pre-condition The design is open and displayed on the user's screen.

Post-condition The design is unchanged apart from the addition of a node of the specified typeat the given position.

Side-effects None

Definition: ECLIPSE/Workstation/Tools/DE/RD/3.5.1

Page 209: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 42

PDL-based requirements definition

l Requirements may be defined operationally using alanguage like a programming language but with moreflexibility of expression

l Most appropriate in two situations• Where an operation is specified as a sequence of actions and the order

is important

• When hardware and software interfaces have to be specified

l Disadvantages are• The PDL may not be sufficiently expressive to define domain

concepts

• The specification will be taken as a design rather than a specification

Page 210: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 43

Part of an ATM specification

class ATM {// declarations herepublic static void main (String args[]) throws InvalidCard {

try {thisCard.read () ; // may throw InvalidCard exceptionpin = KeyPad.readPin () ; attempts = 1 ;while ( !thisCard.pin.equals (pin) & attempts < 4 )

{ pin = KeyPad.readPin () ; attempts = attempts + 1 ;}if (!thisCard.pin.equals (pin))

throw new InvalidCard ("Bad PIN");thisBalance = thisCard.getBalance () ;do { Screen.prompt (" Please select a service ") ;

service = Screen.touchKey () ;switch (service) {

case Services.withdrawalWithReceipt:receiptRequired = true ;

Page 211: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 44

PDL disadvantages

l PDL may not be sufficiently expressive to express thesystem functionality in an understandable way

l Notation is only understandable to people withprogramming language knowledge

l The requirement may be taken as a designspecification rather than a model to help understandthe system

Page 212: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 45

Interface specification

l Most systems must operate with other systems and theoperating interfaces must be specified as part of therequirements

l Three types of interface may have to be defined• Procedural interfaces

• Data structures that are exchanged

• Data representations

l Formal notations are an effective technique forinterface specification

Page 213: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 46

PDL interface description

interface PrintServer {

// defines an abstract printer server// requires: interface Printer, interface PrintDoc// provides: initialize, print, displayPrintQueue, cancelPrintJob, switchPrinter

void initialize ( Printer p ) ;void print ( Printer p, PrintDoc d ) ;void displayPrintQueue ( Printer p ) ;void cancelPrintJob (Printer p, PrintDoc d) ;void switchPrinter (Printer p1, Printer p2, PrintDoc d) ;

} //PrintServer

Page 214: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 47

The requirements document

l The requirements document is the official statementof what is required of the system developers

l Should include both a definition and a specification ofrequirements

l It is NOT a design document. As far as possible, itshould set of WHAT the system should do rather thanHOW it should do it

Page 215: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Users of arequirementsdocument

Use the requirements todevelop validation tests forthe system

Use the requirementsdocument to plan a bid forthe system and to plan thesystem development process

Use the requirements tounderstand what system is tobe developed

System testengineers

Managers

System engineers

Specify the requirements andread them to check that theymeet their needs. Theyspecify changes to therequirements

System customers

Use the requirements to helpunderstand the system andthe relationships between itsparts

Systemmaintenance

engineers

Page 216: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 49

Requirements document requirements

l Specify external system behaviour

l Specify implementation constraints

l Easy to change

l Serve as reference tool for maintenance

l Record forethought about the life cycle of the systemi.e. predict changes

l Characterise responses to unexpected events

Page 217: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 50

IEEE requirements standard

l Introduction

l General description

l Specific requirements

l Appendices

l Index

l This is a generic structure that must be instantiated forspecific systems

Page 218: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 51

Requirements document structure

l Introduction

l Glossary

l User requirements definition

l System architecture

l System requirements specification

l System models

l System evolution

l Appendices

l Index

Page 219: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 52

Key points

l Requirements set out what the system should do anddefine constraints on its operation and implementation

l Functional requirements set out services the systemshould provide

l Non-functional requirements constrain the systembeing developed or the development process

l User requirements are high-level statements of whatthe system should do

Page 220: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 53

Key points

l User requirements should be written in naturallanguage, tables and diagrams

l System requirements are intended to communicate thefunctions that the system should provide

l System requirements may be written in structurednatural language, a PDL or in a formal language

l A software requirements document is an agreedstatement of the system requirements

Page 221: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 1

Requirements Engineering Processes

l Processes used to discover,analyse and validate systemrequirements

Page 222: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 2

Objectives

l To describe the principal requirementsengineering activities

l To introduce techniques for requirementselicitation and analysis

l To describe requirements validation

l To discuss the role of requirements managementin support of other requirements engineeringprocesses

Page 223: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 3

Topics covered

l Feasibility studies

l Requirements elicitation and analysis

l Requirements validation

l Requirements management

Page 224: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 4

Requirements engineering processes

l The processes used for RE vary widelydepending on the application domain, the peopleinvolved and the organisation developing therequirements

l However, there are a number of generic activitiescommon to all processes• Requirements elicitation

• Requirements analysis

• Requirements validation

• Requirements management

Page 225: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 5

The requirements engineering process

Feasibilitystudy

Requirementselicitation and

analysisRequirementsspecification

Requirementsvalidation

Feasibilityreport

Systemmodels

User and systemrequirements

Requirementsdocument

Page 226: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 6

Feasibility studies

l A feasibility study decides whether or not theproposed system is worthwhile

l A short focused study that checks• If the system contributes to organisational objectives

• If the system can be engineered using current technology andwithin budget

• If the system can be integrated with other systems that are used

Page 227: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 7

Feasibility study implementation

l Based on information assessment (what isrequired), information collection and reportwriting

l Questions for people in the organisation• What if the system wasn’t implemented?

• What are current process problems?

• How will the proposed system help?

• What will be the integration problems?

• Is new technology needed? What skills?

• What facilities must be supported by the proposed system?

Page 228: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 8

Elicitation and analysis

l Sometimes called requirements elicitation orrequirements discovery

l Involves technical staff working with customersto find out about the application domain, theservices that the system should provide and thesystem’s operational constraints

l May involve end-users, managers, engineersinvolved in maintenance, domain experts, tradeunions, etc. These are called stakeholders

Page 229: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 9

Problems of requirements analysis

l Stakeholders don’t know what they really want

l Stakeholders express requirements in their ownterms

l Different stakeholders may have conflictingrequirements

l Organisational and political factors may influencethe system requirements

l The requirements change during the analysisprocess. New stakeholders may emerge and thebusiness environment change

Page 230: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 10

The requirements analysis process

Requirementsvalidation

Domainunderstanding

Prioritization

Requirementscollection

Conflictresolution

Classification

Requirementsdefinition andspecification

Processentry

Page 231: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 11

Process activities

l Domain understanding

l Requirements collection

l Classification

l Conflict resolution

l Prioritisation

l Requirements checking

Page 232: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 12

System models

l Different models may be produced during therequirements analysis activity

l Requirements analysis may involve threestructuring activities which result in thesedifferent models• Partitioning. Identifies the structural (part-of) relationships

between entities

• Abstraction. Identifies generalities among entities

• Projection. Identifies different ways of looking at a problem

l System models covered in Chapter 7

Page 233: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 13

Viewpoint-oriented elicitation

l Stakeholders represent different ways of lookingat a problem or problem viewpoints

l This multi-perspective analysis is important asthere is no single correct way to analyse systemrequirements

Page 234: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 14

Banking ATM system

l The example used here is an auto-teller systemwhich provides some automated banking services

l I use a very simplified system which offers someservices to customers of the bank who own thesystem and a narrower range of services to othercustomers

l Services include cash withdrawal, messagepassing (send a message to request a service),ordering a statement and transferring funds

Page 235: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 15

Autoteller viewpoints

l Bank customers

l Representatives of other banks

l Hardware and software maintenance engineers

l Marketing department

l Bank managers and counter staff

l Database administrators and security staff

l Communications engineers

l Personnel department

Page 236: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 16

Types of viewpoint

l Data sources or sinks• Viewpoints are responsible for producing or consuming data.

Analysis involves checking that data is produced and consumedand that assumptions about the source and sink of data are valid

l Representation frameworks• Viewpoints represent particular types of system model. These

may be compared to discover requirements that would bemissed using a single representation. Particularly suitable forreal-time systems

l Receivers of services• Viewpoints are external to the system and receive services from

it. Most suited to interactive systems

Page 237: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 17

External viewpoints

l Natural to think of end-users as receivers ofsystem services

l Viewpoints are a natural way to structurerequirements elicitation

l It is relatively easy to decide if a viewpoint isvalid

l Viewpoints and services may be sued to structurenon-functional requirements

Page 238: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 18

Method-based analysis

l Widely used approach to requirements analysis.Depends on the application of a structuredmethod to understand the system

l Methods have different emphases. Some aredesigned for requirements elicitation, others areclose to design methods

l A viewpoint-oriented method (VORD) is used asan example here. It also illustrates the use ofviewpoints

Page 239: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 19

The VORD method

Viewpointidentification

Viewpointstructuring

Viewpointdocumentation

Viewpointsystem mapping

Page 240: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 20

VORD process model

l Viewpoint identification• Discover viewpoints which receive system services and identify

the services provided to each viewpoint

l Viewpoint structuring• Group related viewpoints into a hierarchy. Common services are

provided at higher-levels in the hierarchy

l Viewpoint documentation• Refine the description of the identified viewpoints and services

l Viewpoint-system mapping• Transform the analysis to an object-oriented design

Page 241: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 21

VORD standard forms

Viewpoint template Service templateReference: The viewpoint name. Reference: The service name.Attributes: Attributes providing

viewpoint information.Rationale: Reason why the service is

provided.Events: A reference to a set of event

scenarios describing howthe system reacts toviewpoint events.

Spec i f i ca t ion : Reference to a list of servicespecifications. These maybe expressed in differentnotations.

Serv ices A reference to a set ofservice descriptions.

Viewpoint s : List of viewpoint namesreceiving the service.

Sub-VPs: The names of sub-viewpoints.

Non-funct ionalrequirements:

Reference to a set of non-functional requirementswhich constrain the service.

Provider: Reference to a list of systemobjects which provide theservice.

Page 242: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 22

Viewpoint identification

Querybalance

Gettransactions

Cashwithdrawal

Transactionlog

Machinesupplies

Cardreturning

Remotesoftwareupgrade

Ordercheques

Userinterface

Accountinformation

Messagelog

Softwaresize Invalid

userSystem cost Printe

r Security

Cardretention

Stolencard

Orderstatement

Remotediagnostics Reliability

Updateaccount

Fundstransfer

Messagepassing

Cardvalidation

Customerdatabase

Manager

Accountholder

Foreigncustomer

Hardwaremaintenance

Bankteller

Page 243: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 23

Viewpoint service information

FOREIGNCUSTOMER

Withdraw cashQuery balance

Service list

Withdraw cashQuery balanceOrder chequesSend messageTransaction listOrder statementTransfer funds

Service list

Run diagnosticsAdd cashAdd paperSend message

Service list

ACCOUNTHOLDER

BANKTELLER

Page 244: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 24

Viewpoint data/control

Start transactionCancel transactionEnd transactionSelect service

Card detailsPINAmount requiredMessage

Control input Data inputACCOUNTHOLDER

Page 245: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 25

Viewpoint hierarchy

EngineerManagerTellerForeigncustomer

Accountholder

Services

Order chequesSend messageTransaction listOrder statementTransfer funds

Customer Bank staff

All VPs

Services

Query balanceWithdraw cash

Page 246: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 26

Customer/cash withdrawal templatesCustomer

Account numberPINStart transactionSelect serviceCanceltransactionEnd transaction

Cash withdrawalBalance enquiry

Account holderForeigncustomer

Reference:

Attributes:

Events:

Services:

Sub-VPs:

Cash withdrawal

To improve customer serviceand reduce paperwork

Users choose this service bypressing the cash withdrawalbutton. They then enter theamount required. This isconfirmed and, if funds allow,the balance is delivered.

Customer

Deliver cash within 1 minuteof amount being confirmed

Filled in later

Reference:

Rationale:

Specification:

VPs:

Non-funct.requirements:

Provider:

Page 247: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 27

Scenarios

l Scenarios are descriptions of how a system isused in practice

l They are helpful in requirements elicitation aspeople can relate to these more readily thanabstract statement of what they require from asystem

l Scenarios are particularly useful for adding detailto an outline requirements description

Page 248: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 28

Scenario descriptions

l System state at the beginning of the scenario

l Normal flow of events in the scenario

l What can go wrong and how this is handled

l Other concurrent activities

l System state on completion of the scenario

Page 249: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 29

Event scenarios

l Event scenarios may be used to describe how asystem responds to the occurrence of someparticular event such as ‘start transaction’

l VORD includes a diagrammatic convention forevent scenarios.• Data provided and delivered

• Control information

• Exception processing

• The next expected event

Page 250: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 30

Event scenario - start transaction

Validate user

Request PIN

Selectservice

Timeout

Return card

Invalid card

Return card

Stolen card

Retain card

Incorrect PIN

Re-enter PIN

Incorrect PIN

Return card

Card

PIN

Card present

Accountnumber

PIN

Accountnumber

Valid card

User OK

Page 251: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 31

Notation for data and control analysis

l Ellipses. data provided from or delivered to aviewpoint

l Control information enters and leaves at the topof each box

l Data leaves from the right of each box

l Exceptions are shown at the bottom of each box

l Name of next event is in box with thick edges

Page 252: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 32

Exception description

l Most methods do not include facilities fordescribing exceptions

l In this example, exceptions are• Timeout. Customer fails to enter a PIN within the allowed time

limit

• Invalid card. The card is not recognised and is returned

• Stolen card. The card has been registered as stolen and isretained by the machine

Page 253: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 33

Use cases

l Use-cases are a scenario based technique in theUML which identify the actors in an interactionand which describe the interaction itself

l A set of use cases should describe all possibleinteractions with the system

l Sequence diagrams may be used to add detail touse-cases by showing the sequence of eventprocessing in the system

Page 254: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 34

Lending use-case

Lending services

Page 255: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 35

Library use-cases

Lending services

User administration

Supplier Catalog services

LibraryUser

LibraryStaff

Page 256: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 36

Catalogue management

Bookshop:Supplier

Cataloguer:Library Staff

Item:Library Item

Books:Catalog

Acquire New

Catalog Item

Uncatalog Item

Dispose

Page 257: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 37

Social and organisational factors

l Software systems are used in a social andorganisational context. This can influence or evendominate the system requirements

l Social and organisational factors are not a singleviewpoint but are influences on all viewpoints

l Good analysts must be sensitive to these factorsbut currently no systematic way to tackle theiranalysis

Page 258: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 38

Example

l Consider a system which allows seniormanagement to access information without goingthrough middle managers• Managerial status. Senior managers may feel that they are too

important to use a keyboard. This may limit the type of systeminterface used

• Managerial responsibilities. Managers may have nouninterrupted time where they can learn to use the system

• Organisational resistance. Middle managers who will be maderedundant may deliberately provide misleading or incompleteinformation so that the system will fail

Page 259: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 39

Ethnography

l A social scientists spends a considerable timeobserving and analysing how people actuallywork

l People do not have to explain or articulate theirwork

l Social and organisational factors of importancemay be observed

l Ethnographic studies have shown that work isusually richer and more complex than suggestedby simple system models

Page 260: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 40

Focused ethnography

l Developed in a project studying the air trafficcontrol process

l Combines ethnography with prototyping

l Prototype development results in unansweredquestions which focus the ethnographic analysis

l Problem with ethnography is that it studiesexisting practices which may have somehistorical basis which is no longer relevant

Page 261: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 41

Ethnography and prototyping

Ethnographicanalysis

Debriefingmeetings

Focusedethnography

Prototypeevaluation

Generic systemdevelopment

Systemprotoyping

Page 262: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 42

Scope of ethnography

l Requirements that are derived from the way thatpeople actually work rather than the way I whichprocess definitions suggest that they ought towork

l Requirements that are derived from cooperationand awareness of other people’s activities

Page 263: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 43

Requirements validation

l Concerned with demonstrating that therequirements define the system that the customerreally wants

l Requirements error costs are high so validation isvery important• Fixing a requirements error after delivery may cost up to 100

times the cost of fixing an implementation error

Page 264: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 44

Requirements checking

l Validity. Does the system provide the functionswhich best support the customer’s needs?

l Consistency. Are there any requirementsconflicts?

l Completeness. Are all functions required by thecustomer included?

l Realism. Can the requirements be implementedgiven available budget and technology

l Verifiability. Can the requirements be checked?

Page 265: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 45

Requirements validation techniques

l Requirements reviews• Systematic manual analysis of the requirements

l Prototyping• Using an executable model of the system to check requirements.

Covered in Chapter 8

l Test-case generation• Developing tests for requirements to check testability

l Automated consistency analysis• Checking the consistency of a structured requirements

description

Page 266: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 46

Requirements reviews

l Regular reviews should be held while therequirements definition is being formulated

l Both client and contractor staff should beinvolved in reviews

l Reviews may be formal (with completeddocuments) or informal. Good communicationsbetween developers, customers and users canresolve problems at an early stage

Page 267: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 47

Review checks

l Verifiability. Is the requirement realisticallytestable?

l Comprehensibility. Is the requirement properlyunderstood?

l Traceability. Is the origin of the requirementclearly stated?

l Adaptability. Can the requirement be changedwithout a large impact on other requirements?

Page 268: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 48

Automated consistency checking

Requirementsdatabase

Requirementsanalyser

Requirementsproblem report

Requirementsprocessor

Requirementsin a formal language

Page 269: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 49

Requirements management

l Requirements management is the process ofmanaging changing requirements during therequirements engineering process and systemdevelopment

l Requirements are inevitably incomplete andinconsistent• New requirements emerge during the process as business needs

change and a better understanding of the system is developed

• Different viewpoints have different requirements and these areoften contradictory

Page 270: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 50

Requirements change

l The priority of requirements from differentviewpoints changes during the developmentprocess

l System customers may specify requirements froma business perspective that conflict with end-userrequirements

l The business and technical environment of thesystem changes during its development

Page 271: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 51

Requirements evolution

Changedunderstanding

of problem

Initialunderstanding

of problem

Changedrequirements

Initialrequirements

Time

Page 272: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 52

Enduring and volatile requirements

l Enduring requirements. Stable requirementsderived from the core activity of the customerorganisation. E.g. a hospital will always havedoctors, nurses, etc. May be derived from domainmodels

l Volatile requirements. Requirements whichchange during development or when the system isin use. In a hospital, requirements derived fromhealth-care policy

Page 273: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 53

Classification of requirements

l Mutable requirements• Requirements that change due to the system’s environment

l Emergent requirements• Requirements that emerge as understanding of the system

develops

l Consequential requirements• Requirements that result from the introduction of the computer

system

l Compatibility requirements• Requirements that depend on other systems or organisational

processes

Page 274: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 54

Requirements management planning

l During the requirements engineering process, youhave to plan:• Requirements identification

» How requirements are individually identified

• A change management process» The process followed when analysing a requirements change

• Traceability policies» The amount of information about requirements relationships that is

maintained

• CASE tool support» The tool support required to help manage requirements change

Page 275: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 55

Traceability

l Traceability is concerned with the relationshipsbetween requirements, their sources and thesystem design

l Source traceability• Links from requirements to stakeholders who proposed these

requirements

l Requirements traceability• Links between dependent requirements

l Design traceability• Links from the requirements to the design

Page 276: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 56

A traceability matrix

Req.id

1.1 1.2 1.3 2.1 2.2 2.3 3.1 3.2

1.1 U R1.2 U R U1.3 R R2.1 R U U2.2 U2.3 R U3.1 R3.2 R

Page 277: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 57

CASE tool support

l Requirements storage• Requirements should be managed in a secure, managed data

store

l Change management• The process of change management is a workflow process

whose stages can be defined and information flow betweenthese stages partially automated

l Traceability management• Automated retrieval of the links between requirements

Page 278: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 58

Requirements change management

l Should apply to all proposed changes to therequirements

l Principal stages• Problem analysis. Discuss requirements problem and propose

change

• Change analysis and costing. Assess effects of change on otherrequirements

• Change implementation. Modify requirements document andother documents to reflect change

Page 279: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 59

Requirements change management

Changeimplementation

Change analysisand costing

Problem analysis andchange specification

Identifiedproblem

Revisedrequirements

Page 280: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 60

Key points

l The requirements engineering process includes afeasibility study, requirements elicitation andanalysis, requirements specification andrequirements management

l Requirements analysis is iterative involvingdomain understanding, requirements collection,classification, structuring, prioritisation andvalidation

l Systems have multiple stakeholders with differentrequirements

Page 281: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 6 Slide 61

Key points

l Social and organisation factors influence systemrequirements

l Requirements validation is concerned withchecks for validity, consistency, completeness,realism and verifiability

l Business changes inevitably lead to changingrequirements

l Requirements management includes planning andchange management

Page 282: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 1

System models

l Abstract descriptions ofsystems whose requirementsare being analysed

Page 283: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 2

Objectives

l To explain why the context of a system should bemodelled as part of the RE process

l To describe behavioural modelling, datamodelling and object modelling

l To introduce some of the notations used in theUnified Modeling Language (UML)

l To show how CASE workbenches supportsystem modelling

Page 284: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 3

Topics covered

l Context models

l Behavioural models

l Data models

l Object models

l CASE workbenches

Page 285: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 4

System modelling

l System modelling helps the analyst to understandthe functionality of the system and models areused to communicate with customers

l Different models present the system fromdifferent perspectives• External perspective showing the system’s context or

environment

• Behavioural perspective showing the behaviour of the system

• Structural perspective showing the system or data architecture

Page 286: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 5

Structured methods

l Structured methods incorporate system modellingas an inherent part of the method

l Methods define a set of models, a process forderiving these models and rules and guidelinesthat should apply to the models

l CASE tools support system modelling as part of astructured method

Page 287: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 6

Method weaknesses

l They do not model non-functional systemrequirements

l They do not usually include information aboutwhether a method is appropriate for a givenproblem

l The may produce too much documentation

l The system models are sometimes too detailedand difficult for users to understand

Page 288: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 7

Model typesl Data processing model showing how the data is

processed at different stages

l Composition model showing how entities arecomposed of other entities

l Architectural model showing principal sub-systems

l Classification model showing how entities havecommon characteristics

l Stimulus/response model showing the system’sreaction to events

Page 289: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 8

Context models

l Context models are used to illustrate theboundaries of a system

l Social and organisational concerns may affect thedecision on where to position system boundaries

l Architectural models show the a system and itsrelationship with other systems

Page 290: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 9

The context of an ATM system

Auto-tellersystem

Securitysystem

Maintenancesystem

Accountdatabase

Usagedatabase

Branchaccounting

system

Branchcountersystem

Page 291: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 10

Process models

l Process models show the overall process and theprocesses that are supported by the system

l Data flow models may be used to show theprocesses and the flow of information from oneprocess to another

Page 292: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 11

Equipment procurement process

Get costestimates

Acceptdelivery ofequipment

Checkdelivered

items

Validatespecification

Specifyequipmentrequired

Choosesupplier

Placeequipment

order

Installequipment

Findsuppliers

Supplierdatabase

Acceptdelivered

equipment

Equipmentdatabase

Equipmentspec.

Checkedspec.

Deliverynote

Deliverynote

Ordernotification

Installationinstructions

Installationacceptance

Equipmentdetails

Checked andsigned order form

Orderdetails +

Blank orderform

Spec. +supplier +estimate

Supplier listEquipment

spec.

Page 293: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 12

Behavioural models

l Behavioural models are used to describe theoverall behaviour of a system

l Two types of behavioural model are shown here• Data processing models that show how data is processed as it

moves through the system

• State machine models that show the systems response to events

l Both of these models are required for adescription of the system’s behaviour

Page 294: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 13

Data-processing models

l Data flow diagrams are used to model thesystem’s data processing

l These show the processing steps as data flowsthrough a system

l Intrinsic part of many analysis methods

l Simple and intuitive notation that customers canunderstand

l Show end-to-end processing of data

Page 295: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 14

Order processing DFD

Completeorder form

Orderdetails +

blankorder form

Validateorder

Recordorder

Send tosupplier

Adjustavailablebudget

Budgetfile

Ordersfile

Completedorder form

Signedorder form

Signedorder form

Checked andsigned order

+ ordernotification

Orderamount

+ accountdetails

Signedorder form

Orderdetails

Page 296: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 15

Data flow diagrams

l DFDs model the system from a functionalperspective

l Tracking and documenting how the dataassociated with a process is helpful to develop anoverall understanding of the system

l Data flow diagrams may also be used in showingthe data exchange between a system and othersystems in its environment

Page 297: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 16

CASE toolset DFD

Designeditor

Designcross checker

Designanalyser

Reportgenerator

Designdatabase

Code skeletongenerator

Designdatabase

Inputdesign

Validdesign

Checkeddesign

Designanalysis

Userreport

andReferenced

designsCheckeddesign Output

code

Page 298: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 17

State machine models

l These model the behaviour of the system inresponse to external and internal events

l They show the system’s responses to stimuli soare often used for modelling real-time systems

l State machine models show system states asnodes and events as arcs between these nodes.When an event occurs, the system moves fromone state to another

l Statecharts are an integral part of the UML

Page 299: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 18

Microwave oven modelFull power

Enabled

do: operateoven

Fullpower

Halfpower

Halfpower

Fullpower

Number

TimerDooropen

Doorclosed

Doorclosed

Dooropen

Start

do: set power = 600

Half powerdo: set power = 300

Set time

do: get numberexit: set time

Disabled

Operation

Timer

Cancel

Waiting

do: display time

Waiting

do: display time

do: display 'Ready'

do: display 'Waiting'

Page 300: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 19

Microwave oven state descriptionState Description

Waiting The oven is waiting for input. The display shows the current time.Half power The oven power is set to 300 watts. The display shows ‘Half

power’.Full power The oven power is set to 600 watts. The display shows ‘Full

power’.Set time The cooking time is set to the user’s input value. The display

shows the cooking time selected and is updated as the time is set.Disabled Oven operation is disabled for safety. Interior oven light is on.

Display shows ‘Not ready’.Enabled Oven operation is enabled. Interior oven light is off. Display

shows ‘Ready to cook’.Operation Oven in operation. Interior oven light is on. Display shows the

timer countdown. On completion of cooking, the buzzer issounded for 5 seconds. Oven light is on. Display shows ‘Cookingcomplete’ while buzzer is sounding.

Page 301: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 20

Microwave oven stimuli

Stimulus DescriptionHalf power The user has pressed the half power buttonFull power The user has pressed the full power buttonTimer The user has pressed one of the timer buttonsNumber The user has pressed a numeric keyDoor open The oven door switch is not closedDoor closed The oven door switch is closedStart The user has pressed the start buttonCancel The user has pressed the cancel button

Page 302: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 21

Statecharts

l Allow the decomposition of a model into sub-models (see following slide)

l A brief description of the actions is includedfollowing the ‘do’ in each state

l Can be complemented by tables describing thestates and the stimuli

Page 303: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 22

Microwave oven operation

Cookdo: run generator

Done

do: buzzer on for 5 secs.

Waiting

Alarm

do: display event

do: checkstatus

Checking

Turntablefault

Emitterfault

Disabled

OK

Timeout

TimeOperation

Dooropen Cancel

Page 304: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 23

Semantic data models

l Used to describe the logical structure of dataprocessed by the system

l Entity-relation-attribute model sets out theentities in the system, the relationships betweenthese entities and the entity attributes

l Widely used in database design. Can readily beimplemented using relational databases

l No specific notation provided in the UML butobjects and associations can be used

Page 305: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 24

Software design semantic modelDesign

namedescriptionC-dateM-date

Link

nametype

Node

nametype

links

has-links

12

1 n

Label

nametexticon

has-labelshas-labels

1

n

1

n

has-linkshas-nodes is-a

1

n

1

n1

1

Page 306: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 25

Data dictionaries

l Data dictionaries are lists of all of the names usedin the system models. Descriptions of the entities,relationships and attributes are also included

l Advantages• Support name management and avoid duplication

• Store of organisational knowledge linking analysis, design andimplementation

l Many CASE workbenches support datadictionaries

Page 307: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 26

Data dictionary entries

Name Description Type Date

has-labels1:N relation between entities of typeNode or Link and entities of typeLabel.

Relation 5.10.1998

LabelHolds structured or unstructuredinformation about nodes or links.Labels are represented by an icon(which can be a transparent box) andassociated text.

Entity 8.12.1998

LinkA 1:1 relation between designentities represented as nodes. Linksare typed and may be named.

Relation 8.12.1998

name(label)

Each label has a name whichidentifies the type of label. The namemust be unique within the set of labeltypes used in a design.

Attribute 8.12.1998

name(node)

Each node has a name which must beunique within a design. The namemay be up to 64 characters long.

Attribute 15.11.1998

Page 308: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 27

Object models

l Object models describe the system in terms ofobject classes

l An object class is an abstraction over a set ofobjects with common attributes and the services(operations) provided by each object

l Various object models may be produced• Inheritance models

• Aggregation models

• Interaction models

Page 309: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 28

Object models

l Natural ways of reflecting the real-world entitiesmanipulated by the system

l More abstract entities are more difficult to modelusing this approach

l Object class identification is recognised as adifficult process requiring a deep understandingof the application domain

l Object classes reflecting domain entities arereusable across systems

Page 310: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 29

Inheritance models

l Organise the domain object classes into ahierarchy

l Classes at the top of the hierarchy reflect thecommon features of all classes

l Object classes inherit their attributes and servicesfrom one or more super-classes. these may thenbe specialised as necessary

l Class hierarchy design is a difficult process ifduplication in different branches is to be avoided

Page 311: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 30

The Unified Modeling Language

l Devised by the developers of widely used object-oriented analysis and design methods

l Has become an effective standard for object-oriented modelling

l Notation• Object classes are rectangles with the name at the top, attributes

in the middle section and operations in the bottom section

• Relationships between object classes (known as associations)are shown as lines linking objects

• Inheritance is referred to as generalisation and is shown‘upwards’ rather than ‘downwards’ in a hierarchy

Page 312: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Library class hierarchyCatalogue numberAcquisition dateCostTypeStatusNumber of copies

Library item

Acquire ()Catalogue ()Dispose ()Issue ()Return ()

AuthorEditionPublication dateISBN

Book

YearIssue

MagazineDirectorDate of releaseDistributor

Film

VersionPlatform

Computerprogram

TitlePublisher

Published item

TitleMedium

Recorded item

Page 313: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

User class hierarchyNameAddressPhoneRegistration #

Library user

Register ()De-register ()

Affiliation

Reader

Items on loanMax. loans

Borrower

DepartmentDepartment phone

Staff

Major subjectHome address

Student

Page 314: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 33

Multiple inheritance

l Rather than inheriting the attributes and servicesfrom a single parent class, a system whichsupports multiple inheritance allows objectclasses to inherit from several super-classes

l Can lead to semantic conflicts whereattributes/services with the same name indifferent super-classes have different semantics

l Makes class hierarchy reorganisation morecomplex

Page 315: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 34

Multiple inheritance

# Tapes

Talking book

AuthorEditionPublication dateISBN

Book

SpeakerDurationRecording date

Voice recording

Page 316: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 35

Object aggregation

l Aggregation model shows how classes which arecollections are composed of other classes

l Similar to the part-of relationship in semanticdata models

Page 317: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 36

Object aggregation

Videotape

Tape ids.

Lecturenotes

Text

OHP slides

Slides

Assignment

Credits

Solutions

TextDiagrams

Exercises

#Problems Description

Course titleNumberYearInstructor

Study pack

Page 318: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 37

Object behaviour modelling

l A behavioural model shows the interactionsbetween objects to produce some particularsystem behaviour that is specified as a use-case

l Sequence diagrams (or collaboration diagrams) inthe UML are used to model interaction betweenobjects

Page 319: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 38

Issue of electronic items

:Library User

Ecat:Catalog

Lookup

Issue

Display

:Library Item Lib1:NetServer

Issue licence

Accept licence

Compress

Deliver

Page 320: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 39

CASE workbenches

l A coherent set of tools that is designed to supportrelated software process activities such asanalysis, design or testing

l Analysis and design workbenches support systemmodelling during both requirements engineeringand system design

l These workbenches may support a specific designmethod or may provide support for a creatingseveral different types of system model

Page 321: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 40

An analysis and design workbench

Centralinformationrepository

Codegenerator

Querylanguagefacilities

Structureddiagramming

tools

Datadictionary

Reportgenerationfacilities

Design, analysisand checking

tools

Formscreation

tools

Import/exportfacilities

Page 322: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 41

Analysis workbench components

l Diagram editors

l Model analysis and checking tools

l Repository and associated query language

l Data dictionary

l Report definition and generation tools

l Forms definition tools

l Import/export translators

l Code generation tools

Page 323: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 42

Key points

l A model is an abstract system view.Complementary types of model provide differentsystem information

l Context models show the position of a system inits environment with other systems and processes

l Data flow models may be used to model the dataprocessing in a system

l State machine models model the system’sbehaviour in response to internal or externalevents

Page 324: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 7 Slide 43

Key points

l Semantic data models describe the logicalstructure of data which is imported to or exportedby the systems

l Object models describe logical system entities,their classification and aggregation

l Object models describe the logical system entitiesand their classification and aggregation

l CASE workbenches support the development ofsystem models

Page 325: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 1

Software Prototyping

l Rapid software development tovalidate requirements

Page 326: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 2

Objectives

l To describe the use of prototypes in differenttypes of development project

l To discuss evolutionary and throw-awayprototyping

l To introduce three rapid prototyping techniques -high-level language development, databaseprogramming and component reuse

l To explain the need for user interface prototyping

Page 327: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 3

Topics covered

l Prototyping in the software process

l Prototyping techniques

l User interface prototyping

Page 328: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 4

System prototyping

l Prototyping is the rapid development of a system

l In the past, the developed system was normallythought of as inferior in some way to the requiredsystem so further development was required

l Now, the boundary between prototyping andnormal system development is blurred and manysystems are developed using an evolutionaryapproach

Page 329: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 5

Uses of system prototypes

l The principal use is to help customers anddevelopers understand the requirements for thesystem• Requirements elicitation. Users can experiment with a prototype

to see how the system supports their work

• Requirements validation. The prototype can reveal errors andomissions in the requirements

l Prototyping can be considered as a risk reductionactivity which reduces requirements risks

Page 330: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 6

Prototyping benefits

l Misunderstandings between software users anddevelopers are exposed

l Missing services may be detected and confusingservices may be identified

l A working system is available early in the process

l The prototype may serve as a basis for deriving asystem specification

l The system can support user training and systemtesting

Page 331: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 7

Prototyping process

Establishprototypeobjectives

Defineprototype

functionality

Developprototype

Evaluateprototype

Prototypingplan

Outlinedefinition

Executableprototype

Evaluationreport

Page 332: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 8

Prototyping benefits

l Improved system usability

l Closer match to the system needed

l Improved design quality

l Improved maintainability

l Reduced overall development effort

Page 333: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 9

Prototyping in the software process

l Evolutionary prototyping• An approach to system development where an initial prototype

is produced and refined through a number of stages to the finalsystem

l Throw-away prototyping• A prototype which is usually a practical implementation of the

system is produced to help discover requirements problems andthen discarded. The system is then developed using some otherdevelopment process

Page 334: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 10

Prototyping objectives

l The objective of evolutionary prototyping is todeliver a working system to end-users. Thedevelopment starts with those requirements whichare best understood.

l The objective of throw-away prototyping is tovalidate or derive the system requirements. Theprototyping process starts with those requirementswhich are poorly understood

Page 335: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 11

Approaches to prototyping

Evolutionaryprototyping

Throw-awayPrototyping

Deliveredsystem

Executable Prototype +System Specification

OutlineRequirements

Page 336: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 12

Evolutionary prototyping

l Must be used for systems where the specificationcannot be developed in advance e.g. AI systemsand user interface systems

l Based on techniques which allow rapid systemiterations

l Verification is impossible as there is nospecification. Validation means demonstrating theadequacy of the system

Page 337: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 13

Evolutionary prototyping

Build prototypesystem

Develop abstractspecification

Use prototypesystem

Deliversystem

Systemadequate?

YES

N

Page 338: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 14

Evolutionary prototyping advantages

l Accelerated delivery of the system• Rapid delivery and deployment are sometimes more important

than functionality or long-term software maintainability

l User engagement with the system• Not only is the system more likely to meet user requirements,

they are more likely to commit to the use of the system

Page 339: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 15

Evolutionary prototyping

l Specification, design and implementation areinter-twined

l The system is developed as a series of incrementsthat are delivered to the customer

l Techniques for rapid system development areused such as CASE tools and 4GLs

l User interfaces are usually developed using a GUIdevelopment toolkit

Page 340: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 16

Evolutionary prototyping problems

l Management problems• Existing management processes assume a waterfall model of

development

• Specialist skills are required which may not be available in alldevelopment teams

l Maintenance problems• Continual change tends to corrupt system structure so long-term

maintenance is expensive

l Contractual problems

Page 341: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 17

Prototypes as specifications

l Some parts of the requirements (e.g. safety-critical functions) may be impossible to prototypeand so don’t appear in the specification

l An implementation has no legal standing as acontract

l Non-functional requirements cannot beadequately tested in a system prototype

Page 342: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 18

Incremental development

l System is developed and delivered in incrementsafter establishing an overall architecture

l Requirements and specifications for eachincrement may be developed

l Users may experiment with delivered incrementswhile others are being developed. therefore, theseserve as a form of prototype system

l Intended to combine some of the advantages ofprototyping but with a more manageable processand better system structure

Page 343: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 19

Incremental development process

Validateincrement

Build systemincrement

Specify systemincrement

Design systemarchitecture

Define systemdeliverables

Systemcomplete?

Integrateincrement

Validatesystem

Deliver finalsystem

YES

NO

Page 344: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 20

Throw-away prototyping

l Used to reduce requirements risk

l The prototype is developed from an initialspecification, delivered for experiment thendiscarded

l The throw-away prototype should NOT beconsidered as a final system• Some system characteristics may have been left out

• There is no specification for long-term maintenance

• The system will be poorly structured and difficult to maintain

Page 345: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 21

Throw-away prototyping

Outlinerequirements

Developprototype

Evaluateprototype

Specifysystem

Developsoftware

Validatesystem

Deliveredsoftwaresystem

Reusablecomponents

Page 346: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 22

Prototype delivery

l Developers may be pressurised to deliver a throw-away prototype as a final system

l This is not recommended• It may be impossible to tune the prototype to meet non-

functional requirements

• The prototype is inevitably undocumented

• The system structure will be degraded through changes madeduring development

• Normal organisational quality standards may not have beenapplied

Page 347: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 23

Rapid prototyping techniques

l Various techniques may be used for rapiddevelopment• Dynamic high-level language development

• Database programming

• Component and application assembly

l These are not exclusive techniques - they areoften used together

l Visual programming is an inherent part of mostprototype development systems

Page 348: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 24

Dynamic high-level languages

l Languages which include powerful datamanagement facilities

l Need a large run-time support system. Notnormally used for large system development

l Some languages offer excellent UI developmentfacilities

l Some languages have an integrated supportenvironment whose facilities may be used in theprototype

Page 349: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 25

Prototyping languages

Language Type Application domainSmalltalk Object-oriented Interactive systemsJava Object-oriented Interactive systemsProlog Logic Symbolic processingLisp List-based Symbolic processing

Page 350: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 26

Choice of prototyping language

l What is the application domain of the problem?

l What user interaction is required?

l What support environment comes with thelanguage?

l Different parts of the system may be programmedin different languages. However, there may beproblems with language communications

Page 351: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 27

Database programming languages

l Domain specific languages for business systemsbased around a database management system

l Normally include a database query language, ascreen generator, a report generator and aspreadsheet.

l May be integrated with a CASE toolset

l The language + environment is sometimes knownas a fourth-generation language (4GL)

l Cost-effective for small to medium sized businesssystems

Page 352: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 28

Database programming

DBprogramming

language

Interfacegenerator Spreadsheet

Reportgenerator

Database management system

Fourth-generation language

Page 353: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 29

Component and application assembly

l Prototypes can be created quickly from a set ofreusable components plus some mechanism to‘glue’ these component together

l The composition mechanism must include controlfacilities and a mechanism for componentcommunication

l The system specification must take into accountthe availability and functionality of existingcomponents

Page 354: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 30

Prototyping with reuse

l Application level development• Entire application systems are integrated with the prototype so

that their functionality can be shared

• For example, if text preparation is required, a standard wordprocessor can be used

l Component level development• Individual components are integrated within a standard

framework to implement the system

• Frame work can be a scripting language or an integrationframework such as CORBA

Page 355: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 31

Reusable component composition

Componentcompositionframework

Executableprototype

Reusablesoftware

components

Control andintegration code

Page 356: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 32

Compound documents

l For some applications, a prototype can be createdby developing a compound document

l This is a document with active elements (such asa spreadsheet) that allow user computations

l Each active element has an associated applicationwhich is invoked when that element is selected

l The document itself is the integrator for thedifferent applications

Page 357: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 33

Application linking in compound documents

Compound document

Word processor Spreadsheet Audio player

Text 1 Text 2 Text 3

Text 4 Text 5

Table 1

Table 2

Sound 1

Sound 2

Page 358: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 34

Visual programming

l Scripting languages such as Visual Basic supportvisual programming where the prototype isdeveloped by creating a user interface fromstandard items and associating components withthese items

l A large library of components exists to supportthis type of development

l These may be tailored to suit the specificapplication requirements

Page 359: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 35

Visual programming with reuse

File Edit Views Layout Options Help

GeneralIndex

Hypertextdisplay componentDate component

Range checkingscript

Tree displaycomponent

12th January 2000

3.876

Draw canvascomponent

User promptcomponent +

script

Page 360: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 36

Problems with visual development

l Difficult to coordinate team-based development

l No explicit system architecture

l Complex dependencies between parts of theprogram can cause maintainability problems

Page 361: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 37

User interface prototyping

l It is impossible to pre-specify the look and feel ofa user interface in an effective way. prototyping isessential

l UI development consumes an increasing part ofoverall system development costs

l User interface generators may be used to ‘draw’the interface and simulate its functionality withcomponents associated with interface entities

l Web interfaces may be prototyped using a website editor

Page 362: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 38

Key points

l A prototype can be used to give end-users aconcrete impression of the system’s capabilities

l Prototyping is becoming increasingly used forsystem development where rapid development isessential

l Throw-away prototyping is used to understandthe system requirements

l In evolutionary prototyping, the system isdeveloped by evolving an initial version to thefinal version

Page 363: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 8 Slide 39

Key points

l Rapid development of prototypes is essential.This may require leaving out functionality orrelaxing non-functional constraints

l Prototyping techniques include the use of veryhigh-level languages, database programming andprototype construction from reusable components

l Prototyping is essential for parts of the systemsuch as the user interface which cannot beeffectively pre-specified. Users must be involvedin prototype evaluation

Page 364: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 1

Formal Specification

l Techniques for theunambiguous specification ofsoftware

Page 365: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 2

Objectives

l To explain why formal specification techniqueshelp discover problems in system requirements

l To describe the use of algebraic techniques forinterface specification

l To describe the use of model-based techniques forbehavioural specification

Page 366: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 3

Topics covered

l Formal specification in the software process

l Interface specification

l Behavioural specification

Page 367: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 4

Formal methods

l Formal specification is part of a more generalcollection of techniques that are known as ‘formalmethods’

l These are all based on mathematicalrepresentation and analysis of software

l Formal methods include• Formal specification

• Specification analysis and proof

• Transformational development

• Program verification

Page 368: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 5

Acceptance of formal methods

l Formal methods have not become mainstreamsoftware development techniques as was oncepredicted• Other software engineering techniques have been successful at

increasing system quality. Hence the need for formal methodshas been reduced

• Market changes have made time-to-market rather than softwarewith a low error count the key factor. Formal methods do notreduce time to market

• The scope of formal methods is limited. They are not well-suitedto specifying and analysing user interfaces and user interaction

• Formal methods are hard to scale up to large systems

Page 369: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 6

Use of formal methods

l Formal methods have limited practicalapplicability

l Their principal benefits are in reducing thenumber of errors in systems so their mai area ofapplicability is critical systems

l In this area, the use of formal methods is mostlikely to be cost-effective

Page 370: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 7

Specification in the software process

l Specification and design are inextricablyintermingled.

l Architectural design is essential to structure aspecification.

l Formal specifications are expressed in amathematical notation with precisely definedvocabulary, syntax and semantics.

Page 371: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 8

Specification and design

Architecturaldesign

Requirementsspecification

Requirementsdefinition

Softwarespecification

High-leveldesign

Increasing contractor involvement

Decreasing client involvement

Specification

Design

Page 372: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 9

Specification in the software process

Requirementsspecification

Formalspecification

Systemmodelling

Architecturaldesign

Requirementsdefinition

High-leveldesign

Page 373: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 10

Specification techniques

l Algebraic approach• The system is specified in terms of its operations and their

relationships

l Model-based approach• The system is specified in terms of a state model that is

constructed using mathematical constructs such as sets andsequences. Operations are defined by modifications to thesystem’s state

Page 374: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 11

Formal specification languages

Sequential ConcurrentAlgebraic Larch (Guttag, Horning et

al., 1985; Guttag, Horninget al., 1993),OBJ (Futatsugi, Goguen etal., 1985)

Lotos (Bolognesi andBrinksma, 1987),

Model-based Z (Spivey, 1992)VDM (Jones, 1980)B (Wordsworth, 1996)

CSP (Hoare, 1985)Petri Nets (Peterson, 1981)

Page 375: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 12

Use of formal specification

l Formal specification involves investing moreeffort in the early phases of software development

l This reduces requirements errors as it forces adetailed analysis of the requirements

l Incompleteness and inconsistencies can bediscovered and resolved

l Hence, savings as made as the amount of reworkdue to requirements problems is reduced

Page 376: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 13

Development costs with formal specification

Specification

Design andImplementation

Validation

Specification

Design andImplementation

Validation

Cost

Without formalspecification

With formalspecification

Page 377: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 14

Interface specification

l Large systems are decomposed into subsystemswith well-defined interfaces between thesesubsystems

l Specification of subsystem interfaces allowsindependent development of the differentsubsystems

l Interfaces may be defined as abstract data typesor object classes

l The algebraic approach to formal specification isparticularly well-suited to interface specification

Page 378: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 15

Sub-system interfaces

Sub-systemA

Sub-systemB

Interfaceobjects

Page 379: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 16

The structure of an algebraic specification

sort < name >imports < LIST OF SPECIFICATION NAMES >

Informal description of the sort and its operations

Operation signatures setting out the names and the types ofthe parameters to the operations defined over the sort

Axioms defining the operations over the sort

< SPECIFICATION NAME > (Generic Parameter)

Page 380: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 17

Specification components

l Introduction• Defines the sort (the type name) and declares other

specifications that are used

l Description• Informally describes the operations on the type

l Signature• Defines the syntax of the operations in the interface and their

parameters

l Axioms• Defines the operation semantics by defining axioms which

characterise behaviour

Page 381: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 18

Systematic algebraic specification

l Algebraic specifications of a system may bedeveloped in a systematic way• Specification structuring.

• Specification naming.

• Operation selection.

• Informal operation specification

• Syntax definition

• Axiom definition

Page 382: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 19

Specification operations

l Constructor operations. Operations which createentities of the type being specified

l Inspection operations. Operations which evaluateentities of the type being specified

l To specify behaviour, define the inspectoroperations for each constructor operation

Page 383: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 20

Operations on a list ADT

l Constructor operations which evaluate to sort List• Create, Cons and Tail

l Inspection operations which take sort list as aparameter and return some other sort• Head and Length.

l Tail can be defined using the simplerconstructors Create and Cons. No need to defineHead and Length with Tail.

Page 384: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 21

List specification

Head (Create) = Undefined exception (empty list)Head (Cons (L, v)) = if L = Create then v else Head (L)Length (Create) = 0Length (Cons (L, v)) = Length (L) + 1Tail (Create ) = CreateTail (Cons (L, v)) = if L = Create then Create else Cons (Tail (L), v)

sort Listimports INTEGER

Defines a list where elements are added at the end and removedfrom the front. The operations are Create, which brings an empty listinto existence, Cons, which creates a new list with an added member,Length, which evaluates the list size, Head, which evaluates the frontelement of the list, and Tail, which creates a list by removing the head from itsinput list. Undefined represents an undefined value of type Elem.

Create → ListCons (List, Elem) → ListHead (List) → ElemLength (List) → IntegerTail (List) → List

LIST ( Elem )

Page 385: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 22

Recursion in specifications

l Operations are often specified recursively

l Tail (Cons (L, v)) = if L = Create then Createelse Cons (Tail (L), v)

• Cons ([5, 7], 9) = [5, 7, 9]

• Tail ([5, 7, 9]) = Tail (Cons ( [5, 7], 9)) =

• Cons (Tail ([5, 7]), 9) = Cons (Tail (Cons ([5], 7)), 9) =

• Cons (Cons (Tail ([5]), 7), 9) =

• Cons (Cons (Tail (Cons ([], 5)), 7), 9) =

• Cons (Cons ([Create], 7), 9) = Cons ([7], 9) = [7, 9]

Page 386: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 23

Interface specification in critical systems

l Consider an air traffic control system whereaircraft fly through managed sectors of airspace

l Each sector may include a number of aircraft but,for safety reasons, these must be separated

l In this example, a simple vertical separation of300m is proposed

l The system should warn the controller if aircraftare instructed to move so that the separation ruleis breached

Page 387: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 24

A sector object

l Critical operations on an object representing acontrolled sector are• Enter. Add an aircraft to the controlled airspace

• Leave. Remove an aircraft from the controlled airspace

• Move. Move an aircraft from one height to another

• Lookup. Given an aircraft identifier, return its current height

Page 388: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 25

Primitive operations

l It is sometimes necessary to introduce additionaloperations to simplify the specification

l The other operations can then be defined usingthese more primitive operations

l Primitive operations• Create. Bring an instance of a sector into existence

• Put. Add an aircraft without safety checks

• In-space. Determine if a given aircraft is in the sector

• Occupied. Given a height, determine if there is an aircraft within300m of that height

Page 389: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Sector specification

Enter (S, CS, H) = if In-space (S, CS ) then S exception (Aircraft already in sector) elsif Occupied (S, H) then S exception (Height conflict) else Put (S, CS, H)

Leave (Create, CS) = Create exception (Aircraft not in sector)Leave (Put (S, CS1, H1), CS) = if CS = CS1 then S else Put (Leave (S, CS), CS1, H1)

Move (S, CS, H) = if S = Create then Create exception (No aircraft in sector) elsif not In-space (S, CS) then S exception (Aircraft not in sector) elsif Occupied (S, H) then S exception (Height conflict) else Put (Leave (S, CS), CS, H)

-- NO-HEIGHT is a constant indicating that a valid height cannot be returned

Lookup (Create, CS) = NO-HEIGHT exception (Aircraft not in sector)Lookup (Put (S, CS1, H1), CS) = if CS = CS1 then H1 else Lookup (S, CS)

Occupied (Create, H) = falseOccupied (Put (S, CS1, H1), H) = if (H1 > H and H1 - H ≤ 300) or (H > H1 and H - H1 ≤ 300) then true else Occupied (S, H)

In-space (Create, CS) = falseIn-space (Put (S, CS1, H1), CS ) = if CS = CS1 then true else In-space (S, CS)

sort Sectorimports INTEGER, BOOLEAN

Enter - adds an aircraft to the sector if safety conditions are satisfedLeave - removes an aircraft from the sectorMove - moves an aircraft from one height to another if safe to do soLookup - Finds the height of an aircraft in the sector

Create - creates an empty sectorPut - adds an aircraft to a sector with no constraint checksIn-space - checks if an aircraft is already in a sectorOccupied - checks if a specified height is available

Enter (Sector, Call-sign, Height) → SectorLeave (Sector, Call-sign) → SectorMove (Sector, Call-sign, Height) → SectorLookup (Sector, Call-sign) → Height

Create → SectorPut (Sector, Call-sign, Height) → SectorIn-space (Sector, Call-sign) → BooleanOccupied (Sector, Height) → Boolean

SECTOR

Page 390: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 27

Specification commentary

l Use the basic constructors Create and Put tospecify other operations

l Define Occupied and In-space using Create andPut and use them to make checks in otheroperation definitions

l All operations that result in changes to the sectormust check that the safety criterion holds

Page 391: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 28

Behavioural specification

l Algebraic specification can be cumbersome whenthe object operations are not independent of theobject state

l Model-based specification exposes the systemstate and defines the operations in terms ofchanges to that state

l The Z notation is a mature technique for model-based specification. It combines formal andinformal description and uses graphicalhighlighting when presenting specifications

Page 392: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 29

The structure of a Z schema

contents ≤ capacity

Containercontents: capacity:

Schema name Schema signature Schema predicate

Page 393: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 30

An insulin pump

Needleassembly

Sensor

Display1 Display2

Alarm

Pump Clock

Power supply

Insulin reservoir

Controller

Page 394: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 31

Modelling the insulin pump

l The schema models the insulin pump as a numberof state variables• reading?

• dose, cumulative_dose

• r0, r1, r2

• capacity

• alarm!

• pump!

• display1!, display2!

l Names followed by a ? are inputs, namesfollowed by a ! are outputs

Page 395: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 32

Schema invariant

l Each Z schema has an invariant part whichdefines conditions that are always true

l For the insulin pump schema it is always true that• The dose must be less than or equal to the capacity of the insulin

reservoir

• No single dose may be more than 5 units of insulin and the totaldose delivered in a time period must not exceed 50 units ofinsulin. This is a safety constraint (see Chapters 16 and 17)

• display1! shows the status of the insulin reservoir.

Page 396: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 33

Insulin pump schema

Insulin_pumpreading? : dose, cumulative_dose: r0, r1, r2: // used to record the last 3 readings takencapacity: alarm!: {off, on}pump!: display1!, display2!: STRING

dose ≤ capacity ∧ dose ≤ 5 ∧ cumulative_dose ≤ 50capacity ≥ 40 ⇒ display1! = " "capacity ≤ 39 ∧ capacity ≥ 10 ⇒ display1! = "Insulin low"capacity ≤ 9 ⇒ alarm! = on ∧ display1! = "Insulin very low"r2 = reading?

Page 397: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 34

The dosage computation

l The insulin pump computes the amount of insulinrequired by comparing the current reading withtwo previous readings

l If these suggest that blood glucose is rising theninsulin is delivered

l Information about the total dose delivered ismaintained to allow the safety check invariant tobe applied

l Note that this invariant always applies - there isno need to repeat it in the dosage computation

Page 398: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 35

DOSAGE schemaDOSAGE∆Insulin_Pump

(dose = 0 ∧ (

(( r1 ≥ r0) ∧ ( r2 = r1)) ∨(( r1 > r0) ∧ (r2 ≤ r1)) ∨(( r1 < r0) ∧ ((r1-r2) > (r0-r1)))

) ∨ dose = 4 ∧ ( (( r1 ≤ r0) ∧ (r2=r1)) ∨ (( r1 < r0) ∧ ((r1-r2) ≤ (r0-r1))) ) ∨dose =(r2 -r1) * 4 ∧ (

(( r1 ≤ r0) ∧ (r2 > r1)) ∨(( r1 > r0) ∧ ((r2 - r1) ≥ (r1 - r0)))

))capacity' = capacity - dosecumulative_dose' = cumulative_dose + doser0' = r1 ∧ r1' = r2

Page 399: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 36

Output schemas

l The output schemas model the system displaysand the alarm that indicates some potentiallydangerous condition

l The output displays show the dose computed anda warning message

l The alarm is activated if blood sugar is very low -this indicates that the user should eat somethingto increase their blood sugar level

Page 400: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 37

Output schemas

DISPLAY∆Insulin_Pump

display2!' = Nat_to_string (dose) ∧(reading? < 3 ⇒ display1!' = "Sugar low" ∨reading? > 30 ⇒ display1!' = "Sugar high" ∨reading? ≥ 3 and reading? ≤ 30 ⇒ display1!' = "OK")

ALARM∆Insulin_Pump

( reading? < 3 ∨ reading? > 30 ) ⇒ alarm!' = on ∨ ( reading? ≥ 3 ∧ reading? ≤ 30 ) ⇒ alarm!' = off

Page 401: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 38

Schema consistency

l It is important that schemas are consistent.Inconsistency suggests a problem with the systemrequirements

l The INSULIN_PUMP schema and theDISPLAYare inconsistent• display1! shows a warning message about the insulin reservoir

(INSULIN_PUMP)

• display1! Shows the state of the blood sugar (DISPLAY)

l This must be resolved before implementation ofthe system

Page 402: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 39

Key points

l Formal system specification complementsinformal specification techniques

l Formal specifications are precise andunambiguous. They remove areas of doubt in aspecification

l Formal specification forces an analysis of thesystem requirements at an early stage. Correctingerrors at this stage is cheaper than modifying adelivered system

Page 403: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 9 Slide 40

Key points

l Formal specification techniques are mostapplicable in the development of critical systemsand standards.

l Algebraic techniques are suited to interfacespecification where the interface is defined as aset of object classes

l Model-based techniques model the system usingsets and functions. This simplifies some types ofbehavioural specification

Page 404: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 1

Architectural Design

l Establishing the overallstructure of a software system

Page 405: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 2

Objectives

l To introduce architectural design and to discussits importance

l To explain why multiple models are required todocument a software architecture

l To describe types of architectural model that maybe used

l To discuss how domain-specific reference modelsmay be used as a basis for product-lines and tocompare software architectures

Page 406: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 3

Topics covered

l System structuring

l Control models

l Modular decomposition

l Domain-specific architectures

Page 407: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 4

Software architecture

l The design process for identifying the sub-systems making up a system and the frameworkfor sub-system control and communication isarchitectural design

l The output of this design process is a descriptionof the software architecture

Page 408: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 5

Architectural design

l An early stage of the system design process

l Represents the link between specification anddesign processes

l Often carried out in parallel with somespecification activities

l It involves identifying major system componentsand their communications

Page 409: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 6

Advantages of explicit architecture

l Stakeholder communication• Architecture may be used as a focus of discussion by system

stakeholders

l System analysis• Means that analysis of whether the system can meet its non-

functional requirements is possible

l Large-scale reuse• The architecture may be reusable across a range of systems

Page 410: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 7

Architectural design process

l System structuring• The system is decomposed into several principal sub-systems

and communications between these sub-systems are identified

l Control modelling• A model of the control relationships between the different parts

of the system is established

l Modular decomposition• The identified sub-systems are decomposed into modules

Page 411: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 8

Sub-systems and modules

l A sub-system is a system in its own right whoseoperation is independent of the services providedby other sub-systems.

l A module is a system component that providesservices to other components but would notnormally be considered as a separate system

Page 412: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 9

Architectural models

l Different architectural models may be producedduring the design process

l Each model presents different perspectives on thearchitecture

Page 413: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 10

Architectural models

l Static structural model that shows the majorsystem components

l Dynamic process model that shows the processstructure of the system

l Interface model that defines sub-systeminterfaces

l Relationships model such as a data-flow model

Page 414: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 11

Architectural styles

l The architectural model of a system may conformto a generic architectural model or style

l An awareness of these styles can simplify theproblem of defining system architectures

l However, most large systems are heterogeneousand do not follow a single architectural style

Page 415: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 12

Architecture attributes

l Performance• Localise operations to minimise sub-system communication

l Security• Use a layered architecture with critical assets in inner layers

l Safety• Isolate safety-critical components

l Availability• Include redundant components in the architecture

l Maintainability• Use fine-grain, self-contained components

Page 416: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 13

System structuring

l Concerned with decomposing the system intointeracting sub-systems

l The architectural design is normally expressed asa block diagram presenting an overview of thesystem structure

l More specific models showing how sub-systemsshare data, are distributed and interface with eachother may also be developed

Page 417: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 14

Packing robot control systemVisionsystem

Objectidentification

system

Armcontroller

Grippercontroller

Packagingselectionsystem

Packingsystem

Conveyorcontroller

Page 418: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 15

The repository model

l Sub-systems must exchange data. This may bedone in two ways:• Shared data is held in a central database or repository and may

be accessed by all sub-systems

• Each sub-system maintains its own database and passes dataexplicitly to other sub-systems

l When large amounts of data are to be shared, therepository model of sharing is most commonlyused

Page 419: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 16

CASE toolset architecture

Projectrepository

Designtranslator

Programeditor

Designeditor

Codegenerator

Designanalyser

Reportgenerator

Page 420: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 17

Repository model characteristics

l Advantages• Efficient way to share large amounts of data

• Sub-systems need not be concerned with how data is producedCentralised management e.g. backup, security, etc.

• Sharing model is published as the repository schema

l Disadvantages• Sub-systems must agree on a repository data model. Inevitably a

compromise

• Data evolution is difficult and expensive

• No scope for specific management policies

• Difficult to distribute efficiently

Page 421: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 18

Client-server architecture

l Distributed system model which shows how dataand processing is distributed across a range ofcomponents

l Set of stand-alone servers which provide specificservices such as printing, data management, etc.

l Set of clients which call on these services

l Network which allows clients to access servers

Page 422: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 19

Film and picture library

Catalogueserver

Catalogue

Videoserver

Film clipfiles

Pictureserver

Digitizedphotographs

Hypertextserver

Hypertextweb

Client 1 Client 2 Client 3 Client 4

Wide-bandwidth network

Page 423: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 20

Client-server characteristics

l Advantages• Distribution of data is straightforward

• Makes effective use of networked systems. May require cheaperhardware

• Easy to add new servers or upgrade existing servers

l Disadvantages• No shared data model so sub-systems use different data

organisation. data interchange may be inefficient

• Redundant management in each server

• No central register of names and services - it may be hard tofind out what servers and services are available

Page 424: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 21

Abstract machine model

l Used to model the interfacing of sub-systems

l Organises the system into a set of layers (orabstract machines) each of which provide a set ofservices

l Supports the incremental development of sub-systems in different layers. When a layerinterface changes, only the adjacent layer isaffected

l However, often difficult to structure systems inthis way

Page 425: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 22

Version management system

Operatingsystem

Database system

Object management

Version management

Page 426: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 23

Control models

l Are concerned with the control flow betweensub-systems. Distinct from the systemdecomposition model

l Centralised control• One sub-system has overall responsibility for control and starts

and stops other sub-systems

l Event-based control• Each sub-system can respond to externally generated events

from other sub-systems or the system’s environment

Page 427: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 24

Centralised control

l A control sub-system takes responsibility formanaging the execution of other sub-systems

l Call-return model• Top-down subroutine model where control starts at the top of a

subroutine hierarchy and moves downwards. Applicable tosequential systems

l Manager model• Applicable to concurrent systems. One system component

controls the stopping, starting and coordination of other systemprocesses. Can be implemented in sequential systems as a casestatement

Page 428: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 25

Call-return model

Routine 1.2Routine 1.1 Routine 3.2Routine 3.1

Routine 2 Routine 3Routine 1

Mainprogram

Page 429: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 26

Real-time system control

Systemcontroller

Userinterface

Faulthandler

Computationprocesses

Actuatorprocesses

Sensorprocesses

Page 430: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 27

Event-driven systems

l Driven by externally generated events where thetiming of the event is outwith the control of thesub-systems which process the event

l Two principal event-driven models• Broadcast models. An event is broadcast to all sub-systems.

Any sub-system which can handle the event may do so

• Interrupt-driven models. Used in real-time systems whereinterrupts are detected by an interrupt handler and passed tosome other component for processing

l Other event driven models include spreadsheetsand production systems

Page 431: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 28

Broadcast model

l Effective in integrating sub-systems on differentcomputers in a network

l Sub-systems register an interest in specificevents. When these occur, control is transferredto the sub-system which can handle the event

l Control policy is not embedded in the event andmessage handler. Sub-systems decide on eventsof interest to them

l However, sub-systems don’t know if or when anevent will be handled

Page 432: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 29

Selective broadcasting

Sub-system1

Event and message handler

Sub-system2

Sub-system3

Sub-system4

Page 433: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 30

Interrupt-driven systems

l Used in real-time systems where fast response toan event is essential

l There are known interrupt types with a handlerdefined for each type

l Each type is associated with a memory locationand a hardware switch causes transfer to itshandler

l Allows fast response but complex to program anddifficult to validate

Page 434: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 31

Interrupt-driven control

Handler1

Handler2

Handler3

Handler4

Process1

Process2

Process3

Process4

Interrupts

Interruptvector

Page 435: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 32

Modular decomposition

l Another structural level where sub-systems aredecomposed into modules

l Two modular decomposition models covered• An object model where the system is decomposed into

interacting objects

• A data-flow model where the system is decomposed intofunctional modules which transform inputs to outputs. Alsoknown as the pipeline model

l If possible, decisions about concurrency shouldbe delayed until modules are implemented

Page 436: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 33

Object models

l Structure the system into a set of loosely coupledobjects with well-defined interfaces

l Object-oriented decomposition is concerned withidentifying object classes, their attributes andoperations

l When implemented, objects are created fromthese classes and some control model used tocoordinate object operations

Page 437: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 34

Invoice processing system

issue ()sendReminder ()acceptPayment ()sendReceipt ()

invoice#dateamountcustomer

Invoice

invoice#dateamountcustomer#

Receipt

invoice#dateamountcustomer#

Payment

customer#nameaddresscredit period

Customer

Page 438: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 35

Data-flow models

l Functional transformations process their inputs toproduce outputs

l May be referred to as a pipe and filter model (asin UNIX shell)

l Variants of this approach are very common.When transformations are sequential, this is abatch sequential model which is extensively usedin data processing systems

l Not really suitable for interactive systems

Page 439: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 36

Invoice processing system

Read issuedinvoices

Identifypayments

Issuereceipts

Findpayments

due

Receipts

Issuepaymentreminder

Reminders

Invoices Payments

Page 440: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 37

Domain-specific architectures

l Architectural models which are specific to someapplication domain

l Two types of domain-specific model• Generic models which are abstractions from a number of real

systems and which encapsulate the principal characteristics ofthese systems

• Reference models which are more abstract, idealised model.Provide a means of information about that class of system andof comparing different architectures

l Generic models are usually bottom-up models;Reference models are top-down models

Page 441: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 38

Generic models

l Compiler model is a well-known examplealthough other models exist in more specialisedapplication domains• Lexical analyser

• Symbol table

• Syntax analyser

• Syntax tree

• Semantic analyser

• Code generator

l Generic compiler model may be organisedaccording to different architectural models

Page 442: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 39

Compiler model

Lexicalanalysis

Syntacticanalysis

Semanticanalysis

Codegeneration

Symboltable

Page 443: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 40

Language processing system

Syntaxanalyser

Lexicalanalyser

Semanticanalyser

Abstractsyntax tree

Grammardefinition

Symboltable

Outputdefinition

Pretty-printer

Editor

Optimizer

Codegenerator

Repository

Page 444: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 41

Reference architectures

l Reference models are derived from a study of theapplication domain rather than from existingsystems

l May be used as a basis for systemimplementation or to compare different systems.It acts as a standard against which systems can beevaluated

l OSI model is a layered model for communicationsystems

Page 445: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 42

OSI reference model

Application

Presentation

Session

Transport

Network

Data link

Physical

7

6

5

4

3

2

1

Communica tions medium

Network

Data link

Physical

Application

Presentation

Session

Transport

Network

Data link

Physical

Application

Page 446: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 43

Key points

l The software architect is responsible for derivinga structural system model, a control model and asub-system decomposition model

l Large systems rarely conform to a singlearchitectural model

l System decomposition models include repositorymodels, client-server models and abstractmachine models

l Control models include centralised control andevent-driven models

Page 447: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10 Slide 44

Key points

l Modular decomposition models include data-flowand object models

l Domain specific architectural models areabstractions over an application domain. Theymay be constructed by abstracting from existingsystems or may be idealised reference models

Page 448: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 1

Distributed Systems Architectures

Architectural design for softwarethat executes on more than oneprocessor

Page 449: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 2

Objectives

l To explain the advantages and disadvantages ofdistributed systems architectures

l To describe different approaches to thedevelopment of client-server systems

l To explain the differences between client-serverand distributed object architectures

l To describe object request brokers and theprinciples underlying the CORBA standards

Page 450: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 3

Topics covered

l Multiprocessor architectures

l Client-server architectures

l Distributed object architectures

l CORBA

Page 451: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 4

Distributed systems

l Virtually all large computer-based systems arenow distributed systems

l Information processing is distributed over severalcomputers rather than confined to a singlemachine

l Distributed software engineering is now veryimportant

Page 452: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 5

System types

l Personal systems that are not distributed and thatare designed to run on a personal computer orworkstation.

l Embedded systems that run on a single processoror on an integrated group of processors.

l Distributed systems where the system softwareruns on a loosely integrated group of cooperatingprocessors linked by a network.

Page 453: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 6

Distributed system characteristics

l Resource sharing

l Openness

l Concurrency

l Scalability

l Fault tolerance

l Transparency

Page 454: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 7

Distributed system disadvantages

l Complexity

l Security

l Manageability

l Unpredictability

Page 455: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Issues in distributed system design

Design issue DescriptionResourceidentification

The resources in a distributed system are spread across differentcomputers and a naming scheme has to be devised so that users candiscover and refer to the resources that they need. An example ofsuch a naming scheme is the URL (Uniform Resource Locator) thatis used to identify WWW pages. If a meaningful and universallyunderstood identification scheme is not used then many of theseresources will be inaccessible to system users.

Communications The universal availability of the Internet and the efficientimplementation of Internet TCP/IP communication protocols meansthat, for most distributed systems, these are the most effective wayfor the computers to communicate. However, where there arespecific requirements for performance, reliability etc. alternativeapproaches to communications may be used.

Quality of service The quality of service offered by a system reflects its performance,availability and reliability. It is affected by a number of factors suchas the allocation of processes to processes in the system, thedistribution of resources across the system, the network and thesystem hardware and the adaptability of the system.

Softwarearchitectures

The software architecture describes how the applicationfunctionality is distributed over a number of logical components andhow these components are distributed across processors. Choosingthe right architecture for an application is essential to achieve thedesired quality of service.

Page 456: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 9

Distributed systems archiectures

l Client-server architectures• Distributed services which are called on by clients. Servers that

provide services are treated differently from clients that useservices

l Distributed object architectures• No distinction between clients and servers. Any object on the

system may provide and use services from other objects

Page 457: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 10

Middleware

l Software that manages and supports the differentcomponents of a distributed system. In essence, itsits in the middle of the system

l Middleware is usually off-the-shelf rather thanspecially written software

l Examples• Transaction processing monitors

• Data convertors

• Communication controllers

Page 458: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 11

Multiprocessor architectures

l Simplest distributed system model

l System composed of multiple processes whichmay (but need not) execute on differentprocessors

l Architectural model of many large real-timesystems

l Distribution of process to processor may be pre-ordered or may be under the control of adespatcher

Page 459: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 12

A multiprocessor traffic control system

Traffic lights

Lightcontrolprocess

Traffic light controlprocessor

Traffic flowprocessor

Operator consolesTraffic flow sensors

and cameras

Sensorprocessor

Sensorcontrolprocess

Displayprocess

Page 460: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 13

Client-server architectures

l The application is modelled as a set of servicesthat are provided by servers and a set of clientsthat use these services

l Clients know of servers but servers need notknow of clients

l Clients and servers are logical processes

l The mapping of processors to processes is notnecessarily 1 : 1

Page 461: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 14

A client-server system

s1

s2 s3

s4c1

c2 c3 c4

c5

c6c7 c8

c9

c10

c11

c12

Client process

Server process

Page 462: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 15

Computers in a C/S network

Network

SC1SC2

CC1 CC2 CC3

CC5 CC6CC4

Servercomputer

Clientcomputer

s1, s2 s3, s4

c5, c6, c7

c1 c2 c3, c4

c8, c9 c10, c11, c12

Page 463: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 16

Layered application architecture

l Presentation layer• Concerned with presenting the results of a computation to

system users and with collecting user inputs

l Application processing layer• Concerned with providing application specific functionality e.g.,

in a banking system, banking functions such as open account,close account, etc.

l Data management layer• Concerned with managing the system databases

Page 464: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 17

Application layers

Presentation layer

Application processinglayer

Data managementlayer

Page 465: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 18

Thin and fat clients

l Thin-client model• In a thin-client model, all of the application processing and data

management is carried out on the server. The client is simplyresponsible for running the presentation software.

l Fat-client model• In this model, the server is only responsible for data

management. The software on the client implements theapplication logic and the interactions with the system user.

Page 466: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 19

Thin and fat clients

Thin-clientmodel

Fat-clientmodel Client

Client

Server

Data managementApplicationprocessing

Presentation

Server

Datamanagement

PresentationApplication processing

Page 467: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 20

Thin client model

l Used when legacy systems are migrated to clientserver architectures.• The legacy system acts as a server in its own right with a

graphical interface implemented on a client

l A major disadvantage is that it places a heavyprocessing load on both the server and thenetwork

Page 468: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 21

Fat client model

l More processing is delegated to the client as theapplication processing is locally executed

l Most suitable for new C/S systems where thecapabilities of the client system are known inadvance

l More complex than a thin client model especiallyfor management. New versions of the applicationhave to be installed on all clients

Page 469: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 22

A client-server ATM system

Account server

Customeraccountdatabase

Tele-processing

monitor

ATM

ATM

ATM

ATM

Page 470: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 23

Three-tier architectures

l In a three-tier architecture, each of theapplication architecture layers may execute on aseparate processor

l Allows for better performance than a thin-clientapproach and is simpler to manage than a fat-client approach

l A more scalable architecture - as demandsincrease, extra servers can be added

Page 471: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 24

A 3-tier C/S architecture

Client

Server

Datamanagement

PresentationServer

Applicationprocessing

Page 472: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 25

An internet banking system

Database server

Customeraccountdatabase

Web server

Client

Client

Client

Client

Account serviceprovision

SQLSQL query

HTTP interaction

Page 473: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 26

Use of C/S architecturesArchitecture ApplicationsTwo-tier C/Sarchitecture withthin clients

Legacy system applications where separating applicationprocessing and data management is impracticalComputationally-intensive applications such as compilers withlittle or no data managementData-intensive applications (browsing and querying) with littleor no application processing.

Two-tier C/Sarchitecture withfat clients

Applications where application processing is provided byCOTS (e.g. Microsoft Excel) on the clientApplications where computationally-intensive processing ofdata (e.g. data visualisation) is required.Applications with relatively stable end-user functionality usedin an environment with well-established system management

Three-tier ormulti-tier C/Sarchitecture

Large scale applications with hundreds or thousands of clientsApplications where both the data and the application arevolatile.Applications where data from multiple sources are integrated

Page 474: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 27

Distributed object architectures

l There is no distinction in a distributed objectarchitectures between clients and servers

l Each distributable entity is an object that providesservices to other objects and receives servicesfrom other objects

l Object communication is through a middlewaresystem called an object request broker (softwarebus)

l However, more complex to design than C/Ssystems

Page 475: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 28

Distributed object architecture

Software bus

o1 o2 o3 o4

o5 o6

S (o1) S (o2) S (o3) S (o4)

S (o5) S (o6)

Page 476: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 29

Advantages of distributed object architecture

l It allows the system designer to delay decisionson where and how services should be provided

l It is a very open system architecture that allowsnew resources to be added to it as required

l The system is flexible and scaleable

l It is possible to reconfigure the systemdynamically with objects migrating across thenetwork as required

Page 477: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 30

Uses of distributed object architecture

l As a logical model that allows you to structureand organise the system. In this case, you thinkabout how to provide application functionalitysolely in terms of services and combinations ofservices

l As a flexible approach to the implementation ofclient-server systems. The logical model of thesystem is a client-server model but both clientsand servers are realised as distributed objectscommunicating through a software bus

Page 478: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 31

A data mining system

Database 1

Database 2

Database 3

Integrator 1

Integrator 2

Visualiser

Display

Report gen.

Page 479: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 32

Data mining system

l The logical model of the system is not one ofservice provision where there are distinguisheddata management services

l It allows the number of databases that areaccessed to be increased without disrupting thesystem

l It allows new types of relationship to be mined byadding new integrator objects

Page 480: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 33

CORBA

l CORBA is an international standard for an ObjectRequest Broker - middleware to managecommunications between distributed objects

l Several implementation of CORBA are available

l DCOM is an alternative approach by Microsoft toobject request brokers

l CORBA has been defined by the ObjectManagement Group

Page 481: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 34

Application structure

l Application objects

l Standard objects, defined by the OMG, for aspecific domain e.g. insurance

l Fundamental CORBA services such as directoriesand security management

l Horizontal (i.e. cutting across applications)facilities such as user interface facilities

Page 482: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 35

CORBA application structure

CORBA services

Object request broker

Domainfacilities

HorizontalCORBA facilities

Applicationobjects

Page 483: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 36

CORBA standards

l An object model for application objects• A CORBA object is an encapsulation of state with a well-

defined, language-neutral interface defined in an IDL (interfacedefinition language)

l An object request broker that manages requestsfor object services

l A set of general object services of use to manydistributed applications

l A set of common components built on top ofthese services

Page 484: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 37

CORBA objects

l CORBA objects are comparable, in principle, toobjects in C++ and Java

l They MUST have a separate interface definitionthat is expressed using a common language (IDL)similar to C++

l There is a mapping from this IDL toprogramming languages (C++, Java, etc.)

l Therefore, objects written in different languagescan communicate with each other

Page 485: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 38

Object request broker (ORB)

l The ORB handles object communications. Itknows of all objects in the system and theirinterfaces

l Using an ORB, the calling object binds an IDLstub that defines the interface of the called object

l Calling this stub results in calls to the ORB whichthen calls the required object through a publishedIDL skeleton that links the interface to the serviceimplementation

Page 486: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 39

ORB-based object communications

o1 o2

S (o1) S (o2)

IDLstub

IDLskeleton

Object Request Broker

Page 487: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 40

Inter-ORB communications

l ORBs are not usually separate programs but are aset of objects in a library that are linked with anapplication when it is developed

l ORBs handle communications between objectsexecuting on the sane machine

l Several ORBS may be available and eachcomputer in a distributed system will have itsown ORB

l Inter-ORB communications are used fordistributed object calls

Page 488: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 41

Inter-ORB communications

o1 o2

S (o1) S (o2)

IDL IDL

Object Request Broker

o3 o4

S (o3) S (o4)

IDL IDL

Object Request Broker

Network

Page 489: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 42

CORBA services

l Naming and trading services• These allow objects to discover and refer to other objects on the

network

l Notification services• These allow objects to notify other objects that an event has

occurred

l Transaction services• These support atomic transactions and rollback on failure

Page 490: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 43

l Almost all new large systems are distributedsystems

l Distributed systems support resource sharing,openness, concurrency, scalability, fault toleranceand transparency

l Client-server architectures involve services beingdelivered by servers to programs operating onclients

l User interface software always runs on the clientand data management on the server

Key points

Page 491: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 11 Slide 44

Key points

l In a distributed object architecture, there is nodistinction between clients and servers

l Distributed object systems require middleware tohandle object communications

l The CORBA standards are a set of middlewarestandards that support distributed objectarchitectures

Page 492: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 1

Object-oriented Design

Designing systems using self-contained objects and objectclasses

Page 493: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 2

Objectives

l To explain how a software design may berepresented as a set of interacting objects thatmanage their own state and operations

l To describe the activities in the object-orienteddesign process

l To introduce various models that describe anobject-oriented design

l To show how the UML may be used to representthese models

Page 494: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 3

Topics covered

l Objects and object classes

l An object-oriented design process

l Design evolution

Page 495: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 4

Characteristics of OOD

l Objects are abstractions of real-world or systementities and manage themselves

l Objects are independent and encapsulate state andrepresentation information.

l System functionality is expressed in terms ofobject services

l Shared data areas are eliminated. Objectscommunicate by message passing

l Objects may be distributed and may executesequentially or in parallel

Page 496: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 5

Interacting objects

state o3

o3:C3

state o4

o4: C4

state o1

o1: C1

state o6

o6: C1

state o5

o5:C5

state o2

o2: C3

ops1() ops3 () ops4 ()

ops3 () ops1 () ops5 ()

Page 497: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 6

Advantages of OOD

l Easier maintenance. Objects may beunderstood as stand-alone entities

l Objects are appropriate reusable components

l For some systems, there may be an obviousmapping from real world entities to systemobjects

Page 498: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 7

Object-oriented development

l Object-oriented analysis, design andprogramming are related but distinct

l OOA is concerned with developing an objectmodel of the application domain

l OOD is concerned with developing an object-oriented system model to implement requirements

l OOP is concerned with realising an OOD usingan OO programming language such as Java orC++

Page 499: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 8

Objects and object classes

l Objects are entities in a software system whichrepresent instances of real-world and systementities

l Object classes are templates for objects. Theymay be used to create objects

l Object classes may inherit attributes and servicesfrom other object classes

Page 500: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 9

Objects

An object is an entity which has a state and a defined set ofoperations which operate on that state. The state is represented as aset of object attributes. The operations associated with the objectprovide services to other objects (clients) which request theseservices when some computation is required.

Objects are created according to some object class definition. Anobject class definition serves as a template for objects. It includesdeclarations of all the attributes and services which should beassociated with an object of that class.

Page 501: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 10

The Unified Modeling Language

l Several different notations for describing object-oriented designs were proposed in the 1980s and1990s

l The Unified Modeling Language is an integrationof these notations

l It describes notations for a number of differentmodels that may be produced during OO analysisand design

l It is now a de facto standard for OO modelling

Page 502: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 11

Employee object class (UML)Employee

name: stringaddress: stringdateOfBirth: DateemployeeNo: integersocialSecurityNo: stringdepartment: Deptmanager: Employeesalary: integerstatus: {current, left, retired}taxCode: integer. . .

join ()leave ()retire ()changeDetails ()

Page 503: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 12

Object communication

l Conceptually, objects communicate bymessage passing.

l Messages• The name of the service requested by the calling object.

• Copies of the information required to execute the serviceand the name of a holder for the result of the service.

l In practice, messages are often implementedby procedure calls• Name = procedure name.

• Information = parameter list.

Page 504: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 13

Message examples

// Call a method associated with a buffer// object that returns the next value// in the buffer

v = circularBuffer.Get () ;

// Call the method associated with a// thermostat object that sets the// temperature to be maintained

thermostat.setTemp (20) ;

Page 505: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 14

Generalisation and inheritance

l Objects are members of classes which defineattribute types and operations

l Classes may be arranged in a class hierarchywhere one class (a super-class) is a generalisationof one or more other classes (sub-classes)

l A sub-class inherits the attributes andoperations from its super class and may addnew methods or attributes of its own

l Generalisation in the UML is implemented asinheritance in OO programming languages

Page 506: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 15

A generalisation hierarchyEmployee

Programmer

projectprogLanguage

Manager

ProjectManager

budgetsControlleddateAppointed

projects

Dept.Manager

StrategicManager

dept responsibilities

Page 507: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 16

Advantages of inheritance

l It is an abstraction mechanism which may be usedto classify entities

l It is a reuse mechanism at both the design and theprogramming level

l The inheritance graph is a source oforganisational knowledge about domains andsystems

Page 508: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 17

Problems with inheritance

l Object classes are not self-contained. they cannotbe understood without reference to their super-classes

l Designers have a tendency to reuse theinheritance graph created during analysis. Canlead to significant inefficiency

l The inheritance graphs of analysis, design andimplementation have different functions andshould be separately maintained

Page 509: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 18

Inheritance and OOD

l There are differing views as to whetherinheritance is fundamental to OOD.• View 1. Identifying the inheritance hierarchy or network is a

fundamental part of object-oriented design. Obviously this canonly be implemented using an OOPL.

• View 2. Inheritance is a useful implementation concept whichallows reuse of attribute and operation definitions. Identifyingan inheritance hierarchy at the design stage places unnecessaryrestrictions on the implementation

l Inheritance introduces complexity and this isundesirable, especially in critical systems

Page 510: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 19

UML associations

l Objects and object classes participate inrelationships with other objects and object classes

l In the UML, a generalised relationship isindicated by an association

l Associations may be annotated with informationthat describes the association

l Associations are general but may indicate that anattribute of an object is an associated object orthat a method relies on an associated object

Page 511: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 20

An association model

Employee Department

Manager

is-member-of

is-managed-by

manages

Page 512: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 21

Concurrent objects

l The nature of objects as self-contained entitiesmake them suitable for concurrentimplementation

l The message-passing model of objectcommunication can be implemented directly ifobjects are running on separate processors in adistributed system

Page 513: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 22

Servers and active objects

l Servers.• The object is implemented as a parallel process (server)

with entry points corresponding to object operations. If nocalls are made to it, the object suspends itself and waits forfurther requests for service

l Active objects• Objects are implemented as parallel processes and the

internal object state may be changed by the object itself andnot simply by external calls

Page 514: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 23

Active transponder object

l Active objects may have their attributes modifiedby operations but may also update themautonomously using internal operations

l Transponder object broadcasts an aircraft’sposition. The position may be updated using asatellite positioning system. The objectperiodically update the position by triangulationfrom satellites

Page 515: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 24

An active transponder objectclass Transponder extends Thread {

Position currentPosition ;Coords c1, c2 ;Satellite sat1, sat2 ;Navigator theNavigator ;

public Position givePosition (){

return currentPosition ;}

public void run (){

while (true){

c1 = sat1.position () ;c2 = sat2.position () ;currentPosition = theNavigator.compute (c1, c2) ;

}

}

} //Transponder

Page 516: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 25

Java threads

l Threads in Java are a simple construct forimplementing concurrent objects

l Threads must include a method called run() andthis is started up by the Java run-time system

l Active objects typically include an infinite loopso that they are always carrying out thecomputation

Page 517: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 26

An object-oriented design process

l Define the context and modes of use of thesystem

l Design the system architecture

l Identify the principal system objects

l Develop design models

l Specify object interfaces

Page 518: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 27

Weather system description

A weather data collection system is required to generate weather maps on aregular basis using data collected from remote, unattended weather stationsand other data sources such as weather observers, balloons and satellites.Weather stations transmit their data to the area computer in response to arequest from that machine.

The area computer validates the collected data and integrates it with the datafrom different sources. The integrated data is archived and, using data fromthis archive and a digitised map database a set of local weather maps iscreated. Maps may be printed for distribution on a special-purpose mapprinter or may be displayed in a number of different formats.

Page 519: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 28

Weather station description

A weather station is a package of software controlled instrumentswhich collects data, performs some data processing and transmitsthis data for further processing. The instruments include air andground thermometers, an anemometer, a wind vane, a barometerand a rain gauge. Data is collected every five minutes.

When a command is issued to transmit the weather data, theweather station processes and summarises the collected data. Thesummarised data is transmitted to the mapping computer when arequest is received.

Page 520: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 29

Layered architecture

«subsystem»Data collection

«subsystem»Data processing

«subsystem»Data archiving

«subsystem»Data display

Data collection layer where objectsare concerned with acquiring datafrom remote sources

Data processing layer where objectsare concerned with checking andintegrating the collected data

Data archiving layer where objectsare concerned with storing the data for future processing

Data display layer where objects areconcerned with preparing andpresenting the data in a human-readable form

Page 521: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 30

System context and models of use

l Develop an understanding of the relationshipsbetween the software being designed and itsexternal environment

l System context• A static model that describes other systems in the environment.

Use a subsystem model to show other systems. Following slideshows the systems around the weather station system.

l Model of system use• A dynamic model that describes how the system interacts with

its environment. Use use-cases to show interactions

Page 522: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 31

Subsystems in the weather mapping system

«subsystem»Data collection

«subsystem»Data processing

«subsystem»Data archiving

«subsystem»Data display

Weatherstation

Satellite

Comms

Balloon

Observer

Datachecking

Dataintegration

Map store Data store

Datastorage

Map

Userinterface

Mapdisplay

Mapprinter

Page 523: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 32

Use-cases for the weather station

Startup

Shutdown

Report

Calibrate

Test

Page 524: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 33

Use-case descriptionSystem Weather stationUse-case ReportActors Weather data collection system, Weather stationData The weather station sends a summary of the weather data that has been

collected from the instruments in the collection period to the weather datacollection system. The data sent are the maximum minimum and averageground and air temperatures, the maximum, minimum and average airpressures, the maximum, minimum and average wind speeds, the totalrainfall and the wind direction as sampled at 5 minute intervals.

Stimulus The weather data collection system establishes a modem link with theweather station and requests transmission of the data.

Response The summarised data is sent to the weather data collection systemComments Weather stations are usually asked to report once per hour but this

frequency may differ from one station to the other and may be modified infuture.

Page 525: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 34

Architectural design

l Once interactions between the system and itsenvironment have been understood, you use thisinformation for designing the system architecture

l Layered architecture is appropriate for theweather station• Interface layer for handling communications

• Data collection layer for managing instruments

• Instruments layer for collecting data

l There should be no more than 7 entities in anarchitectural model

Page 526: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 35

Weather station architecture

«subsystem»Data collection

«subsystem»Instruments

«subsystem»Interface

Weather station

Manages allexternal

communications

Collects andsummarisesweather data

Package ofinstruments for raw

data collections

Page 527: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 36

Object identification

l Identifying objects (or object classes) is the mostdifficult part ofobject oriented design

l There is no 'magic formula' for objectidentification. It relies on the skill, experienceand domain knowledge of system designers

l Object identification is an iterative process. Youare unlikely to get it right first time

Page 528: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 37

Approaches to identification

l Use a grammatical approach based on a naturallanguage description of the system (used in Hoodmethod)

l Base the identification on tangible things in theapplication domain

l Use a behavioural approach and identify objectsbased on what participates in what behaviour

l Use a scenario-based analysis. The objects,attributes and methods in each scenario areidentified

Page 529: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 38

Weather station object classes

l Ground thermometer, Anemometer, Barometer• Application domain objects that are ‘hardware’ objects related

to the instruments in the system

l Weather station• The basic interface of the weather station to its environment. It

therefore reflects the interactions identified in the use-casemodel

l Weather data• Encapsulates the summarised data from the instruments

Page 530: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 39

Weather station object classes

identifier

reportWeather ()calibrate (instruments)test ()startup (instruments)shutdown (instruments)

WeatherStation

test ()calibrate ()

Groundthermometer

temperature

Anemometer

windSpeedwindDirection

test ()

Barometer

pressureheight

test ()calibrate ()

WeatherData

airTemperaturesgroundTemperatureswindSpeedswindDirectionspressuresrainfall

collect ()summarise ()

Page 531: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 40

Further objects and object refinement

l Use domain knowledge to identify more objectsand operations• Weather stations should have a unique identifier

• Weather stations are remotely situated so instrument failureshave to be reported automatically. Therefore attributes andoperations for self-checking are required

l Active or passive objects• In this case, objects are passive and collect data on request

rather than autonomously. This introduces flexibility at theexpense of controller processing time

Page 532: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 41

Design models

l Design models show the objects and objectclasses and relationships between these entities

l Static models describe the static structure of thesystem in terms of object classes and relationships

l Dynamic models describe the dynamicinteractions between objects.

Page 533: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 42

Examples of design models

l Sub-system models that show logical groupingsof objects into coherent subsystems

l Sequence models that show the sequence ofobject interactions

l State machine models that show how individualobjects change their state in response to events

l Other models include use-case models,aggregation models, generalisation models,etc.

Page 534: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 43

Subsystem models

l Shows how the design is organised into logicallyrelated groups of objects

l In the UML, these are shown using packages - anencapsulation construct. This is a logical model.The actual organisation of objects in the systemmay be different.

Page 535: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 44

Weather station subsystems«subsystem»

Interface

CommsController

WeatherStation

«subsystem»Data collection

«subsystem»Instruments

Air thermometer

WeatherData

Ground thermometer

Anemometer

WindVane

RainGauge

InstrumentStatus

Barometer

Page 536: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 45

Sequence models

l Sequence models show the sequence of objectinteractions that take place• Objects are arranged horizontally across the top

• Time is represented vertically so models are read top to bottom

• Interactions are represented by labelled arrows, Different stylesof arrow represent different types of interaction

• A thin rectangle in an object lifeline represents the time whenthe object is the controlling object in the system

Page 537: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 46

Data collection sequence:CommsController

request (report)

acknowledge ()report ()

summarise ()

reply (report)

acknowledge ()

send (report)

:WeatherStation :WeatherData

Page 538: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 47

Statecharts

l Show how objects respond to different servicerequests and the state transitions triggered bythese requests• If object state is Shutdown then it responds to a Startup()

message

• In the waiting state the object is waiting for further messages

• If reportWeather () then system moves to summarising state

• If calibrate () the system moves to a calibrating state

• A collecting state is entered when a clock signal is received

Page 539: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 48

Weather station state diagram

Shutdown Waiting Testing

Transmitting

Collecting

Summarising

Calibrating

transmission done

calibrate ()

test ()startup ()

shutdown ()

calibration OK

test complete

weather summarycomplete

clock collectiondone

Operation

reportWeather ()

Page 540: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 49

Object interface specification

l Object interfaces have to be specified so that theobjects and other components can be designed inparallel

l Designers should avoid designing the interfacerepresentation but should hide this in the objectitself

l Objects may have several interfaces which areviewpoints on the methods provided

l The UML uses class diagrams for interfacespecification but Java may also be used

Page 541: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 50

Weather station interfaceinterface WeatherStation {

public void WeatherStation () ;

public void startup () ;public void startup (Instrument i) ;

public void shutdown () ;public void shutdown (Instrument i) ;

public void reportWeather ( ) ;

public void test () ;public void test ( Instrument i ) ;

public void calibrate ( Instrument i) ;

public int getID () ;

} //WeatherStation

Page 542: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 51

Design evolution

l Hiding information inside objects means thatchanges made to an object do not affect otherobjects in an unpredictable way

l Assume pollution monitoring facilities are to beadded to weather stations. These sample theair and compute the amount of differentpollutants in the atmosphere

l Pollution readings are transmitted with weatherdata

Page 543: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 52

Changes required

l Add an object class called ‘Air quality’ as part ofWeatherStation

l Add an operation reportAirQuality toWeatherStation. Modify the control software tocollect pollution readings

l Add objects representing pollution monitoringinstruments

Page 544: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 53

Pollution monitoring

NODatasmokeDatabenzeneData

collect ()summarise ()

Air qualityidentifier

reportWeather ()reportAirQuality ()calibrate (instruments)test ()startup (instruments)shutdown (instruments)

WeatherStation

Pollution monitoring instruments

NOmeter SmokeMeter

BenzeneMeter

Page 545: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 54

l OOD is an approach to design so that designcomponents have their own private state andoperations

l Objects should have constructor and inspectionoperations. They provide services to other objects

l Objects may be implemented sequentially orconcurrently

l The Unified Modeling Language providesdifferent notations for defining different objectmodels

Key points

Page 546: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12 Slide 55

Key points

l A range of different models may be producedduring an object-oriented design process. Theseinclude static and dynamic system models

l Object interfaces should be defined preciselyusing e.g. a programming language like Java

l Object-oriented design simplifies systemevolution

Page 547: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 1

Real-time Software Design

l Designing embedded softwaresystems whose behaviour issubject to timing constraints

Page 548: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 2

Objectives

l To explain the concept of a real-time system andwhy these systems are usually implemented asconcurrent processes

l To describe a design process for real-timesystems

l To explain the role of a real-time executive

l To introduce generic architectures for monitoringand control and data acquisition systems

Page 549: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 3

Topics covered

l Systems design

l Real-time executives

l Monitoring and control systems

l Data acquisition systems

Page 550: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 4

Real-time systems

l Systems which monitor and control theirenvironment

l Inevitably associated with hardware devices• Sensors: Collect data from the system environment

• Actuators: Change (in some way) the system'senvironment

l Time is critical. Real-time systems MUSTrespond within specified times

Page 551: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 5

Definition

l A real-time system is a software system where thecorrect functioning of the system depends on theresults produced by the system and the time at whichthese results are produced

l A ‘soft’ real-time system is a system whose operationis degraded if results are not produced according tothe specified timing requirements

l A ‘hard’ real-time system is a system whose operationis incorrect if results are not produced according tothe timing specification

Page 552: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 6

Stimulus/Response Systems

l Given a stimulus, the system must produce aresponse within a specified time

l Periodic stimuli. Stimuli which occur atpredictable time intervals• For example, a temperature sensor may be polled 10 times

per second

l Aperiodic stimuli. Stimuli which occur atunpredictable times• For example, a system power failure may trigger an

interrupt which must be processed by the system

Page 553: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 7

Architectural considerations

l Because of the need to respond to timingdemands made by different stimuli/responses, thesystem architecture must allow for fast switchingbetween stimulus handlers

l Timing demands of different stimuli are differentso a simple sequential loop is not usuallyadequate

l Real-time systems are usually designed ascooperating processes with a real-time executivecontrolling these processes

Page 554: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 8

A real-time system model

Real-timecontrol system

ActuatorActuator ActuatorActuator

SensorSensorSensor SensorSensorSensor

Page 555: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 9

System elements

l Sensors control processes• Collect information from sensors. May buffer information

collected in response to a sensor stimulus

l Data processor• Carries out processing of collected information and computes

the system response

l Actuator control• Generates control signals for the actuator

Page 556: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 10

Sensor/actuator processes

Dataprocessor

Actuatorcontrol

Actuator

Sensorcontrol

Sensor

Stimulus Response

Page 557: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 11

System design

l Design both the hardware and the softwareassociated with system. Partition functions toeither hardware or software

l Design decisions should be made on the basis onnon-functional system requirements

l Hardware delivers better performance butpotentially longer development and less scope forchange

Page 558: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 12

Hardware and software designEstablish system

requirements

Partitionrequirements

Hardwarerequirements

Hardwaredesign

Softwarerequirements

Softwaredesign

Page 559: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 13

R-T systems design process

l Identify the stimuli to be processed and therequired responses to these stimuli

l For each stimulus and response, identify thetiming constraints

l Aggregate the stimulus and response processinginto concurrent processes. A process may beassociated with each class of stimulus andresponse

Page 560: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 14

R-T systems design process

l Design algorithms to process each class ofstimulus and response. These must meet the giventiming requirements

l Design a scheduling system which will ensurethat processes are started in time to meet theirdeadlines

l Integrate using a real-time executive or operatingsystem

Page 561: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 15

Timing constraints

l May require extensive simulation and experimentto ensure that these are met by the system

l May mean that certain design strategies such asobject-oriented design cannot be used because ofthe additional overhead involved

l May mean that low-level programming languagefeatures have to be used for performance reasons

Page 562: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 16

State machine modelling

l The effect of a stimulus in a real-time system maytrigger a transition from one state to another.

l Finite state machines can be used for modellingreal-time systems.

l However, FSM models lack structure. Evensimple systems can have a complex model.

l The UML includes notations for defining statemachine models

l See also Chapter 7.

Page 563: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 17

Microwave oven state machineFull power

Enabled

do: operateoven

Fullpower

Halfpower

Halfpower

Fullpower

Number

TimerDooropen

Doorclosed

Doorclosed

Systemfault

Start

do: set power = 600

Half powerdo: set power = 300

Set time

do: get numberexit: set time

Disabled

Operation

Timer

Cancel

Waiting

do: display time

Waiting

do: display time

do: display 'Ready'

do: display 'Waiting'

Page 564: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 18

Real-time programming

l Hard-real time systems may have to programmedin assembly language to ensure that deadlines aremet

l Languages such as C allow efficient programs tobe written but do not have constructs to supportconcurrency or shared resource management

l Ada as a language designed to support real-timesystems design so includes a general purposeconcurrency mechanism

Page 565: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 19

Java as a real-time language

l Java supports lightweight concurrency (threadsand synchonized methods) and can be used forsome soft real-time systems

l Java 2.0 is not suitable for hard RT programmingor programming where precise control of timingis required• Not possible to specify thread execution time

• Uncontrollable garbage collection

• Not possible to discover queue sizes for shared resources

• Variable virtual machine implementation

• Not possible to do space or timing analysis

Page 566: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 20

Real-time executives

l Real-time executives are specialised operatingsystems which manage the processes in the RTS

l Responsible for process management andresource (processor and memory) allocation

l May be based on a standard RTE kernel whichis used unchanged or modified for a particularapplication

l Does not include facilities such as filemanagement

14

Page 567: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 21

Executive components

l Real-time clock• Provides information for process scheduling.

l Interrupt handler• Manages aperiodic requests for service.

l Scheduler• Chooses the next process to be run.

l Resource manager• Allocates memory and processor resources.

l Despatcher• Starts process execution.

Page 568: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 22

Non-stop system components

l Configuration manager• Responsible for the dynamic reconfiguration of the system

software and hardware. Hardware modules may be replaced andsoftware upgraded without stopping the systems

l Fault manager• Responsible for detecting software and hardware faults and

taking appropriate actions (e.g. switching to backup disks) toensure that the system continues in operation

Page 569: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Real-time executive components

Process resourcerequirements

Scheduler

Schedulinginformation

Resourcemanager

Despatcher

Real-timeclock

Processesawaitingresources

Readylist

Interrupthandler

Availableresource

list

Processorlist

Executingprocess

Readyprocesses

Releasedresources

Page 570: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 24

Process priority

l The processing of some types of stimuli mustsometimes take priority

l Interrupt level priority. Highest priority which isallocated to processes requiring a very fastresponse

l Clock level priority. Allocated to periodicprocesses

l Within these, further levels of priority may beassigned

Page 571: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 25

Interrupt servicing

l Control is transferred automatically to apre-determined memory location

l This location contains an instruction to jump toan interrupt service routine

l Further interrupts are disabled, the interruptserviced and control returned to the interruptedprocess

l Interrupt service routines MUST be short,simple and fast

Page 572: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 26

Periodic process servicing

l In most real-time systems, there will be severalclasses of periodic process, each with differentperiods (the time between executions),execution times and deadlines (the time bywhich processing must be completed)

l The real-time clock ticks periodically and eachtick causes an interrupt which schedules theprocess manager for periodic processes

l The process manager selects a process whichis ready for execution

Page 573: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 27

Process management

l Concerned with managing the set of concurrentprocesses

l Periodic processes are executed at pre-specifiedtime intervals

l The executive uses the real-time clock todetermine when to execute a process

l Process period - time between executions

l Process deadline - the time by which processingmust be complete

Page 574: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 28

RTE process management

Resource manager

Allocate memoryand processor

Scheduler

Choose processfor execution

Despatcher

Start execution on anavailable processor

Page 575: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 29

Process switching

l The scheduler chooses the next process to beexecuted by the processor. This depends on ascheduling strategy which may take the processpriority into account

l The resource manager allocates memory and aprocessor for the process to be executed

l The despatcher takes the process from ready list,loads it onto a processor and starts execution

Page 576: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 30

Scheduling strategies

l Non pre-emptive scheduling• Once a process has been scheduled for execution, it runs to

completion or until it is blocked for some reason (e.g. waitingfor I/O)

l Pre-emptive scheduling• The execution of an executing processes may be stopped if a

higher priority process requires service

l Scheduling algorithms• Round-robin

• Rate monotonic

• Shortest deadline first

Page 577: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 31

Monitoring and control systems

l Important class of real-time systems

l Continuously check sensors and take actionsdepending on sensor values

l Monitoring systems examine sensors andreport their results

l Control systems take sensor values and controlhardware actuators

Page 578: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 32

Burglar alarm system

l A system is required to monitor sensors on doorsand windows to detect the presence of intruders ina building

l When a sensor indicates a break-in, the systemswitches on lights around the area and calls policeautomatically

l The system should include provision foroperation without a mains power supply

Page 579: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 33

Burglar alarm system

l Sensors• Movement detectors, window sensors, door sensors.

• 50 window sensors, 30 door sensors and 200 movementdetectors

• Voltage drop sensor

l Actions• When an intruder is detected, police are called

automatically.

• Lights are switched on in rooms with active sensors.

• An audible alarm is switched on.

• The system switches automatically to backup power when avoltage drop is detected.

Page 580: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 34

The R-T system design process

l Identify stimuli and associated responses

l Define the timing constraints associated witheach stimulus and response

l Allocate system functions to concurrentprocesses

l Design algorithms for stimulus processing andresponse generation

l Design a scheduling system which ensures thatprocesses will always be scheduled to meettheir deadlines

Page 581: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 35

Stimuli to be processed

l Power failure• Generated aperiodically by a circuit monitor. When

received, the system must switch to backup power within 50ms

l Intruder alarm• Stimulus generated by system sensors. Response is to call

the police, switch on building lights and the audible alarm

Page 582: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 36

Timing requirements

Stimulus/Response Timing requirementsPower fail interrupt The switch to backup power must be completed

within a deadline of 50 ms.Door alarm Each door alarm should be polled twice per

second.Window alarm Each window alarm should be polled twice per

second.Movement detector Each movement detector should be polled twice

per second.Audible alarm The audible alarm should be switched on within

1/2 second of an alarm being raised by a sensor.Lights switch The lights should be switched on within 1/2

second of an alarm being raised by a sensor.Communications The call to the police should be started within 2

seconds of an alarm being raised by a sensor.Voice synthesiser A synthesised message should be available

within 4 seconds of an alarm being raised by asensor.

Page 583: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Process architecture

Lighting controlprocess

Audible alarmprocess

Voice synthesizerprocess

Alarm systemprocess

Power switchprocess

Building monitorprocess

Communicationprocess

Door sensorprocess

Movementdetector process

Window sensorprocess

560Hz

60Hz400Hz 100Hz

Power failureinterrupt

Alarmsystem

Building monitor

Alarmsystem

Alarm system

Alarm system

Detector status Sensor status Sensor status

Room number

Alert message

Room number

Room number

Page 584: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Building_monitor process 1

}

// See http://www.software-engin.com/ for links to the complete Java code for this// example

class BuildingMonitor extends Thread {

BuildingSensor win, door, move ;

Siren siren = new Siren () ;Lights lights = new Lights () ;Synthesizer synthesizer = new Synthesizer () ;DoorSensors doors = new DoorSensors (30) ;WindowSensors windows = new WindowSensors (50) ;MovementSensors movements = new MovementSensors (200) ;PowerMonitor pm = new PowerMonitor () ;

BuildingMonitor(){

// initialise all the sensors and start the processessiren.start () ; lights.start () ;synthesizer.start () ; windows.start () ;doors.start () ; movements.start () ; pm.start () ;

Page 585: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Building_monitor process 2

public void run (){

int room = 0 ;while (true){

// poll the movement sensors at least twice per second (400 Hz)move = movements.getVal () ;// poll the window sensors at least twice/second (100 Hz)win = windows.getVal () ;// poll the door sensors at least twice per second (60 Hz)door = doors.getVal () ;if (move.sensorVal == 1 | door.sensorVal == 1 | win.sensorVal == 1)

{// a sensor has indicated an intruder if (move.sensorVal == 1) room = move.room ;if (door.sensorVal == 1) room = door.room ;if (win.sensorVal == 1 ) room = win.room ;

lights.on (room) ; siren.on () ; synthesizer.on (room) ;break ;

}}lights.shutdown () ; siren.shutdown () ; synthesizer.shutdown () ;windows.shutdown () ; doors.shutdown () ; movements.shutdown () ;

} // run} //BuildingMonitor

Page 586: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 40

Control systems

l A burglar alarm system is primarily a monitoringsystem. It collects data from sensors but no real-time actuator control

l Control systems are similar but, in response tosensor values, the system sends control signals toactuators

l An example of a monitoring and control system isa system which monitors temperature andswitches heaters on and off

Page 587: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 41

A temperature control system

Thermostatprocess

Sensorprocess

Furnacecontrol process

Heater controlprocess

500Hz

500Hz

Thermostat process500Hz

Sensorvalues

Switch commandRoom number

Page 588: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 42

Data acquisition systems

l Collect data from sensors for subsequentprocessing and analysis.

l Data collection processes and processingprocesses may have different periods anddeadlines.

l Data collection may be faster than processinge.g. collecting information about an explosion.

l Circular or ring buffers are a mechanism forsmoothing speed differences.

Page 589: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 43

Reactor data collection

l A system collects data from a set of sensorsmonitoring the neutron flux from a nuclearreactor.

l Flux data is placed in a ring buffer for laterprocessing.

l The ring buffer is itself implemented as aconcurrent process so that the collection andprocessing processes may be synchronized.

Page 590: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 44

Reactor flux monitoring

DisplayProcess

dataSensor data

bufferSensorprocess

Sensoridentifier and

value

Processedflux level

Sensors (each data flow is a sensor value)

Page 591: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 45

A ring buffer

Consumerprocess

Producerprocess

Page 592: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 46

Mutual exclusion

l Producer processes collect data and add it tothe buffer. Consumer processes take data from thebuffer and make elements available

l Producer and consumer processes must bemutually excluded from accessing the sameelement.

l The buffer must stop producer processesadding information to a full buffer and consumerprocesses trying to take information from anempty buffer.

Page 593: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Java implementation of a ring buffer 1

class CircularBuffer{

int bufsize ;SensorRecord [] store ;int numberOfEntries = 0 ;int front = 0, back = 0 ;

CircularBuffer (int n) {bufsize = n ;store = new SensorRecord [bufsize] ;

} // CircularBuffer

synchronized void put (SensorRecord rec ) throws InterruptedException{

if ( numberOfEntries == bufsize)wait () ;

store [back] = new SensorRecord (rec.sensorId, rec.sensorVal) ;back = back + 1 ;if (back == bufsize)

back = 0 ;numberOfEntries = numberOfEntries + 1 ;notify () ;

} // put

Page 594: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Java implementation of a ring buffer 2

synchronized SensorRecord get () throws InterruptedException{

SensorRecord result = new SensorRecord (-1, -1) ;if (numberOfEntries == 0)

wait () ;result = store [front] ;front = front + 1 ;if (front == bufsize)

front = 0 ;numberOfEntries = numberOfEntries - 1 ;notify () ;return result ;

} // get} // CircularBuffer

Page 595: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 49

Key points

l Real-time system correctness depends not juston what the system does but also on how fast itreacts

l A general RT system model involves associatingprocesses with sensors and actuators

l Real-time systems architectures are usuallydesigned as a number of concurrent processes

Page 596: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 13 Slide 50

Key points

l Real-time executives are responsible forprocess and resource management.

l Monitoring and control systems poll sensors andsend control signal to actuators

l Data acquisition systems are usually organisedaccording to a producer consumer model

l Java has facilities for supporting concurrency butis not suitable for the development of time-criticalsystems

Page 597: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 1

Design with Reuse

l Building software fromreusable components.

Page 598: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 2

Objectives

l To explain the benefits of software reuse andsome reuse problems

l To describe different types of reusablecomponent and processes for reuse

l To introduce application families as a route toreuse

l To describe design patterns as high-levelabstractions that promote reuse

Page 599: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 3

Topics covered

l Component-based development

l Application families

l Design patterns

Page 600: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 4

Software reuse

l In most engineering disciplines, systems aredesigned by composing existing components thathave been used in other systems

l Software engineering has been more focused onoriginal development but it is now recognisedthat to achieve better software, more quickly andat lower cost, we need to adopt a design processthat is based on systematic reuse

Page 601: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 5

Reuse-based software engineering

l Application system reuse• The whole of an application system may be reused either by

incorporating it without change into other systems (COTS reuse) orby developing application families

l Component reuse• Components of an application from sub-systems to single objects

may be reused

l Function reuse• Software components that implement a single well-defined function

may be reused

Page 602: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 6

Reuse practice

l Application system reuse• Widely practised as software systems are implemented as

application families. COTS reuse is becoming increasinglycommon

l Component reuse• Now seen as the key to effective and widespread reuse through

component-based software engineering. However, it is stillrelatively immature

l Function reuse• Common in some application domains (e.g. engineering) where

domain-specific libraries of reusable functions have beenestablished

Page 603: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 7

Benefits of reuse

l Increased reliability• Components exercised in working systems

l Reduced process risk• Less uncertainty in development costs

l Effective use of specialists• Reuse components instead of people

l Standards compliance• Embed standards in reusable components

l Accelerated development• Avoid original development and hence speed-up production

Page 604: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 8

Requirements for design with reuse

l It must be possible to find appropriate reusablecomponents

l The reuser of the component must be confidentthat the components will be reliable and willbehave as specified

l The components must be documented so that theycan be understood and, where appropriate,modified

Page 605: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 9

Reuse problems

l Increased maintenance costs

l Lack of tool support

l Not-invented-here syndrome

l Maintaining a component library

l Finding and adapting reusable components

Page 606: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 10

Generator-based reuse

l Program generators involve the reuse ofstandard patterns and algorithms

l These are embedded in the generator andparameterised by user commands. A program isthen automatically generated

l Generator-based reuse is possible when domainabstractions and their mapping to executable codecan be identified

l A domain specific language is used to composeand control these abstractions

Page 607: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 11

Types of program generator

l Types of program generator• Application generators for business data processing

• Parser and lexical analyser generators for language processing

• Code generators in CASE tools

l Generator-based reuse is very cost-effective butits applicability is limited to a relatively smallnumber of application domains

l It is easier for end-users to develop programsusing generators compared to other component-based approaches to reuse

Page 608: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 12

Reuse through program generation

Program generator Generated programApplicationdescription

Application domainknowledge Database

Page 609: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 13

Component-based development

l Component-based software engineering (CBSE)is an approach to software development thatrelies on reuse

l It emerged from the failure of object-orienteddevelopment to support effective reuse. Singleobject classes are too detailed and specific

l Components are more abstract than object classesand can be considered to be stand-alone serviceproviders

Page 610: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 14

Components

l Components provide a service without regard towhere the component is executing or itsprogramming language• A component is an independent executable entity that can be

made up of one or more executable objects

• The component interface is published and all interactions arethrough the published interface

l Components can range in size from simplefunctions to entire application systems

Page 611: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 15

Component interfaces

Component Provides interfaceRequires interface

Page 612: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 16

Component interfaces

l Provides interface• Defines the services that are provided by the component to other

components

l Requires interface• Defines the services that specifies what services must be made

available for the component to execute as specified

Page 613: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 17

Printing services component

Provides interfaceRequires interface

Print

PrintService

GetQueue

Remove

Transfer

Register

Unregister

GetPDfile

PrinterInt

Page 614: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 18

Component abstractionsl Functional abstraction

• The component implements a single function such as a mathematical function

l Casual groupings• The component is a collection of loosely related entities that might be data

declarations, functions, etc.

l Data abstractions• The component represents a data abstraction or class in an object-oriented

language

l Cluster abstractions• The component is a group of related classes that work together

l System abstraction• The component is an entire self-contained system

Page 615: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 19

CBSE processes

l Component-based development can be integratedinto a standard software process by incorporatinga reuse activity in the process

l However, in reuse-driven development, thesystem requirements are modified to reflect thecomponents that are available

l CBSE usually involves a prototyping or anincremental development process withcomponents being ‘glued together’ using ascripting language

Page 616: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 20

An opportunistic reuse process

Designsystem

aachitecture

Specifycomponents

Search forreusable

components

Incorporatediscoveredcomponents

Page 617: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 21

Development with reuse

Search forreusable

components

Outlinesystem

requirements

Modify requirementsaccording todiscoveredcomponents

Search forreusable

components

Architecturaldesign

Specify systemcomponents

based on reusablecomponents

Page 618: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 22

CBSE problems

l Component incompatibilities may mean that costand schedule savings are less then expected

l Finding and understanding components

l Managing evolution as requirements change insituations where it may be impossible to changethe system components

Page 619: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 23

Application frameworks

l Frameworks are a sub-system design made up ofa collection of abstract and concrete classes andthe interfaces between them

l The sub-system is implemented by addingcomponents to fill in parts of the design and byinstantiating the abstract classes in the framework

l Frameworks are moderately large entities that canbe reused

Page 620: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 24

Framework classes

l System infrastructure frameworks• Support the development of system infrastructures such as

communications, user interfaces and compilers

l Middleware integration frameworks• Standards and classes that support component communication

and information exchange

l Enterprise application frameworks• Support the development of specific types of application such as

telecommunications or financial systems

Page 621: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 25

Extending frameworks

l Frameworks are generic and are extended tocreate a more specific application or sub-system

l Extending the framework involves• Adding concrete classes that inherit operations from abstract

classes in the framework

• Adding methods that are called in response to events that arerecognised by the framework

l Problem with frameworks is their complexity andthe time it takes to use them effectively

Page 622: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 26

Model-view controller

l System infrastructure framework for GUI design

l Allows for multiple presentations of an objectand separate interactions with these presentations

l MVC framework involves the instantiation of anumber of patterns (discussed later)

Page 623: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 27

Model-view controller

Model state

Model methods

Controller state

Controller methods

View state

View methods

User inputsview modification

messages

Model editsModel queries

and updates

Page 624: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 28

COTS product reuse

l COTS - Commercial Off-The-Shelf systems

l COTS systems are usually complete applicationsystems that offer an API (ApplicationProgramming Interface)

l Building large systems by integrating COTSsystems is now a viable development strategy forsome types of system such as E-commercesystems

Page 625: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 29

COTS system integration problems

l Lack of control over functionality andperformance• COTS systems may be less effective than they appear

l Problems with COTS system inter-operability• Different COTS systems may make different assumptions that

means integration is difficult

l No control over system evolution• COTS vendors not system users control evolution

l Support from COTS vendors• COTS vendors may not offer support over the lifetime of the

product

Page 626: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 30

Component development for reuse

l Components for reuse may be speciallyconstructed by generalising existing components

l Component reusability• Should reflect stable domain abstractions

• Should hide state representation

• Should be as independent as possible

• Should publish exceptions through the component interface

l There is a trade-off between reusability andusability.• The more general the interface, the greater the reusability but it

is then more complex and hence less usable

Page 627: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 31

Reusable components

l The development cost of reusable components ishigher than the cost of specific equivalents. Thisextra reusability enhancement cost should be anorganization rather than a project cost

l Generic components may be lessspace-efficient and may have longer executiontimes than their specific equivalents

Page 628: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 32

Reusability enhancement

l Name generalisation• Names in a component may be modified so that they are not a

direct reflection of a specific application entity

l Operation generalisation• Operations may be added to provide extra functionality and

application specific operations may be removed

l Exception generalisation• Application specific exceptions are removed and exception

management added to increase the robustness of the component

l Component certification• Component is certified as reusable

Page 629: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 33

Reusability enhancement process

Namegeneralization

Operationgeneralization

Exceptiongeneralization

Componentcertification

Reusablecomponent

Initialcomponent

Page 630: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 34

Application families

l An application family or product line is a relatedset of applications that has a common, domain-specific architecture

l The common core of the application family isreused each time a new application is required

l Each specific application is specialised in someway

Page 631: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 35

Application family specialisation

l Platform specialisation• Different versions of the application are developed for different

platforms

l Configuration specialisation• Different versions of the application are created to handle

different peripheral devices

l Functional specialisation• Different versions of the application are created for customers

with different requirements

Page 632: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 36

A resource management system

Resource database

Resource desc. Screen spec. Report spec.

Add Delete Query Browse Admin Report

User access Program access

Page 633: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 37

Inventory management systems

l Resource database• Maintains details of the things that are being managed

l I/O descriptions• Describes the structures in the resource database and input and

output formats that are used

l Query level• Provides functions implementing queries over the resources

l Access interfaces• A user interface and an application programming interface

Page 634: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 38

Application family architectures

l Architectures must be structured in such a way toseparate different sub-systems and to allow themto be modified

l The architecture should also separate entities andtheir descriptions and the higher levels in thesystem access entities through descriptions ratherthan directly

Page 635: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 39

A library system

Library holdings database

Resource desc. Screen spec. Report spec.

Add Delete Query Browse Admin Report

Library user access

Issue Return Users

Page 636: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 40

Library system

l The resources being managed are the books in thelibrary

l Additional domain-specific functionality (issue,borrow, etc.) must be added for this application

Page 637: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 41

Family member development

Elicitstakeholderrequirements

Choose closest-fit familymember Deliver new

family member

Re-negotiaterequirements

Adapt existingsystem

Page 638: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 42

Family member development

l Elicit stakeholder requirements• Use existing family member as a prototype

l Choose closest-fit family member• Find the family member that best meets the requirements

l Re-negotiate requirements• Adapt requirements as necessary to capabilities of the software

l Adapt existing system• Develop new modules and make changes for family member

l Deliver new family member• Document key features for further member development

Page 639: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 43

Design patterns

l A design pattern is a way of reusing abstractknowledge about a problem and its solution

l A pattern is a description of the problem and theessence of its solution

l It should be sufficiently abstract to be reused indifferent settings

l Patterns often rely on object characteristics suchas inheritance and polymorphism

Page 640: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 44

Pattern elements

l Name• A meaningful pattern identifier

l Problem description

l Solution description• Not a concrete design but a template for a design solution that

can be instantiated in different ways

l Consequences• The results and trade-offs of applying the pattern

Page 641: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 45

Multiple displays

Subject

A: 40B: 25C: 15D: 20

Observer 1 Observer 2

0

50

25

A B C D

A

B

C

D

Page 642: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 46

The Observer pattern

l Name• Observer

l Description• Separates the display of object state from the object itself

l Problem description• Used when multiple displays of state are needed

l Solution description• See slide with UML description

l Consequences• Optimisations to enhance display performance are impractical

Page 643: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 47

The Observer pattern

Subject Observer

Attach (Observer)Detach (Observer)Notify ()

Update ()

ConcreteSubject

GetState ()

subjectState

ConcreteObserver

Update ()

observerState

return subjectState

for all o in observers o -> Update ()

observerState = subject -> GetState ()

Page 644: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 48

l Design with reuse involves designing softwarearound good design and existing components

l Advantages are lower costs, faster softwaredevelopment and lower risks

l Component-based software engineering relies onblack-box components with defined requires andprovides interfaces

l COTS product reuse is concerned with the reuseof large, off-the-shelf systems

Key points

Page 645: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14 Slide 49

Key points

l Software components for reuse should beindependent, should reflect stable domainabstractions and should provide access to statethrough interface operations

l Application families are related applicationsdeveloped around a common core

l Design patterns are high-level abstractions thatdocument successful design solutions

Page 646: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 1

User interface design

l Designing effective interfacesfor software systems

Page 647: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 2

Objectives

l To suggest some general design principles foruser interface design

l To explain different interaction styles

l To introduce styles of information presentation

l To describe the user support which should bebuilt-in to user interfaces

l To introduce usability attributes and systemapproaches to system evaluation

Page 648: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 3

Topics covered

l User interface design principles

l User interaction

l Information presentation

l User support

l Interface evaluation

Page 649: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 4

The user interface

l System users often judge a system by itsinterface rather than its functionality

l A poorly designed interface can cause a user tomake catastrophic errors

l Poor user interface design is the reason why somany software systems are never used

Page 650: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 5

Graphical user interfaces

l Most users of business systems interact with thesesystems through graphical interfaces although, insome cases, legacy text-based interfaces are stillused

Page 651: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 6

GUI characteristics

Characteristic DescriptionWindows Multiple windows allow different information to be

displayed simultaneously on the user’s screen.Icons Icons different types of information. On some systems,

icons represent files; on others, icons representprocesses.

Menus Commands are selected from a menu rather than typedin a command language.

Pointing A pointing device such as a mouse is used for selectingchoices from a menu or indicating items of interest in awindow.

Graphics Graphical elements can be mixed with text on the samedisplay.

Page 652: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 7

GUI advantages

l They are easy to learn and use.• Users without experience can learn to use the system

quickly.

l The user may switch quickly from one task toanother and can interact with several differentapplications.• Information remains visible in its own window when

attention is switched.

l Fast, full-screen interaction is possible withimmediate access to anywhere on the screen

Page 653: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 8

User-centred design

l The aim of this chapter is to sensitise softwareengineers to key issues underlying the designrather than the implementation of user interfaces

l User-centred design is an approach to UI designwhere the needs of the user are paramount andwhere the user is involved in the design process

l UI design always involves the development ofprototype interfaces

Page 654: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 9

User interface design process

Executableprototype

Designprototype

Produce paper-based design

prototype

Producedynamic design

prototype

Evaluate designwith end-users

Implementfinal userinterface

Evaluate designwith end-users

Analyse andunderstand user

activities

Page 655: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 10

UI design principles

l UI design must take account of the needs,experience and capabilities of the system users

l Designers should be aware of people’s physicaland mental limitations (e.g. limited short-termmemory) and should recognise that people makemistakes

l UI design principles underlie interface designsalthough not all principles are applicable to alldesigns

Page 656: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 11

User interface design principles

Principle DescriptionUser familiarity The interface should use terms and concepts which are

drawn from the experience of the people who willmake most use of the system.

Consistency The interface should be consistent in that, whereverpossible, comparable operations should be activated inthe same way.

Minimal surprise Users should never be surprised by the behaviour of asystem.

Recoverability The interface should include mechanisms to allowusers to recover from errors.

User guidance The interface should provide meaningful feedbackwhen errors occur and provide context-sensitive userhelp facilities.

User diversity The interface should provide appropriate interactionfacilities for different types of system user.

Page 657: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 12

Design principles

l User familiarity• The interface should be based on user-oriented

terms and concepts rather than computer concepts. For example,an office system should use concepts such as letters, documents,folders etc. rather than directories, file identifiers, etc.

l Consistency• The system should display an appropriate level

of consistency. Commands and menus should have the sameformat, command punctuation should be similar, etc.

l Minimal surprise• If a command operates in a known way, the user should be

able to predict the operation of comparable commands

Page 658: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 13

Design principles

l Recoverability• The system should provide some resilience to

user errors and allow the user to recover from errors. This mightinclude an undo facility, confirmation of destructive actions,'soft' deletes, etc.

l User guidance• Some user guidance such as help systems, on-line manuals, etc.

should be supplied

l User diversity• Interaction facilities for different types of user should be

supported. For example, some users have seeing difficulties andso larger text should be available

Page 659: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 14

User-system interaction

l Two problems must be addressed in interactivesystems design• How should information from the user be provided to the

computer system?

• How should information from the computer system be presentedto the user?

l User interaction and information presentationmay be integrated through a coherent frameworksuch as a user interface metaphor

Page 660: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 15

Interaction styles

l Direct manipulation

l Menu selection

l Form fill-in

l Command language

l Natural language

Page 661: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Advantages anddisadvantages

Interactionstyle

Mainadvantages

Maindisadvantages

Applicationexamples

Directmanipulation

Fast and intuitiveinteractionEasy to learn

May be hard toimplementOnly suitable wherethere is a visualmetaphor for tasksand objects

Video gamesCAD systems

Menuselection

Avoids usererrorLittle typingrequired

Slow forexperienced usersCan becomecomplex if manymenu options

Most general-purpose systems

Form fill-in Simple dataentryEasy to learn

Takes up a lot ofscreen space

Stock control,Personal loanprocessing

Commandlanguage

Powerful andflexible

Hard to learnPoor errormanagement

Operating systems,Libraryinformationretrieval systems

Naturallanguage

Accessible tocasual usersEasily extended

Requires moretypingNatural languageunderstandingsystems areunreliable

Timetable systemsWWWinformationretrieval systems

Page 662: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 17

Direct manipulation advantages

l Users feel in control of the computer and are lesslikely to be intimidated by it

l User learning time is relatively short

l Users get immediate feedback on their actionsso mistakes can be quickly detected andcorrected

Page 663: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 18

Direct manipulation problems

l The derivation of an appropriate informationspace model can be very difficult

l Given that users have a large informationspace, what facilities for navigating around thatspace should be provided?

l Direct manipulation interfaces can be complex toprogram and make heavy demands on thecomputer system

Page 664: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 19

Control panel interface

Title

Method

Type

Selection

NODE LINKS FONT LABEL EDIT

JSD. example

JSD

Network

Process

Units

Reduce

cm

Full

OUIT

PRINT

Grid Busy

Page 665: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 20

Menu systems

l Users make a selection from a list ofpossibilities presented to them by the system

l The selection may be made by pointing andclicking with a mouse, using cursor keys or bytyping the name of the selection

l May make use of simple-to-use terminals such astouchscreens

Page 666: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 21

Advantages of menu systems

l Users need not remember command names asthey are always presented with a list of validcommands

l Typing effort is minimal

l User errors are trapped by the interface

l Context-dependent help can be provided. Theuser’s context is indicated by the current menuselection

Page 667: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 22

Problems with menu systems

l Actions which involve logical conjunction (and)or disjunction (or) are awkward to represent

l Menu systems are best suited to presenting asmall number of choices. If there are manychoices, some menu structuring facility must beused

l Experienced users find menus slower thancommand language

Page 668: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 23

Form-based interface

Title

Author

Publisher

Edition

Classification

Date ofpurchase

ISBN

Price

Publicationdate

Number ofcopies

Loanstatus

Orderstatus

NEW BOOK

Page 669: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 24

Command interfaces

l User types commands to give instructions to thesystem e.g. UNIX

l May be implemented using cheap terminals.

l Easy to process using compiler techniques

l Commands of arbitrary complexity can becreated by command combination

l Concise interfaces requiring minimal typing canbe created

Page 670: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 25

Problems with command interfaces

l Users have to learn and remember a commandlanguage. Command interfaces are thereforeunsuitable for occasional users

l Users make errors in command. An errordetection and recovery system is required

l System interaction is through a keyboard sotyping ability is required

Page 671: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 26

Command languages

l Often preferred by experienced users becausethey allow for faster interaction with the system

l Not suitable for casual or inexperienced users

l May be provided as an alternative to menucommands (keyboard shortcuts). In some cases, acommand language interface and a menu-basedinterface are supported at the same time

Page 672: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 27

Natural language interfaces

l The user types a command in a natural language.Generally, the vocabulary is limited and thesesystems are confined to specific applicationdomains (e.g. timetable enquiries)

l NL processing technology is now good enough tomake these interfaces effective for casual usersbut experienced users find that they require toomuch typing

Page 673: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 28

Multiple user interfaces

Operating system

GUImanager

Graphical userinterface

Commandlanguage

interpreter

Commandlanguageinterface

Page 674: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 29

Information presentation

l Information presentation is concerned withpresenting system information to system users

l The information may be presented directly (e.g.text in a word processor) or may be transformedin some way for presentation (e.g. in somegraphical form)

l The Model-View-Controller approach is a way ofsupporting multiple presentations of data

Page 675: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 30

Information presentation

Information tobe displayed

Presentationsoftware

Display

Page 676: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 31

Model-view-controller

Model state

Model methods

Controller state

Controller methods

View state

View methods

User inputsview modification

messages

Model editsModel queriesand updates

Page 677: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 32

Information presentation

l Static information• Initialised at the beginning of a session. It does not change

during the session

• May be either numeric or textual

l Dynamic information• Changes during a session and the changes must be

communicated to the system user

• May be either numeric or textual

Page 678: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 33

Information display factors

l Is the user interested in precise information ordata relationships?

l How quickly do information values change?Must the change be indicated immediately?

l Must the user take some action in response toa change?

l Is there a direct manipulation interface?

l Is the information textual or numeric? Arerelative values important?

Page 679: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 34

Alternative information presentations

0

1000

2000

3000

4000

Jan Feb Mar April May June

Jan2842

Feb2851

Mar3164

April2789

May1273

June2835

Page 680: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 35

Analogue vs. digital presentation

l Digital presentation• Compact - takes up little screen space

• Precise values can be communicated

l Analogue presentation• Easier to get an 'at a glance' impression of a value

• Possible to show relative values

• Easier to see exceptional data values

Page 681: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 36

Dynamic information display

1

3

4 20 10 20

Dial with needle Pie chart Thermometer Horizontal bar

Page 682: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 37

Displaying relative values

0 100 200 300 400 0 25 50 75 100

Pressure Temperature

Page 683: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 38

Textual highlighting

The filename you have chosen has beenused. Please choose another name

Ch. 16 User interface design!

OK Cancel

Page 684: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 39

Data visualisation

l Concerned with techniques for displaying largeamounts of information

l Visualisation can reveal relationships betweenentities and trends in the data

l Possible data visualisations are:• Weather information collected from a number of sources

• The state of a telephone network as a linked set of nodes

• Chemical plant visualised by showing pressures andtemperatures in a linked set of tanks and pipes

• A model of a molecule displayed in 3 dimensions

• Web pages displayed as a hyperbolic tree

Page 685: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 40

Colour displays

l Colour adds an extra dimension to an interfaceand can help the user understand complexinformation structures

l Can be used to highlight exceptional events

l Common mistakes in the use of colour ininterface design include:• The use of colour to communicate meaning

• Over-use of colour in the display

Page 686: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 41

Colour use guidelines

l Don't use too many colours

l Use colour coding to support use tasks

l Allow users to control colour coding

l Design for monochrome then add colour

l Use colour coding consistently

l Avoid colour pairings which clash

l Use colour change to show status change

l Be aware that colour displays are usually lowerresolution

Page 687: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 42

User support

l User guidance covers all system facilities tosupport users including on-line help, errormessages, manuals etc.

l The user guidance system should be integratedwith the user interface to help users when theyneed information about the system or when theymake some kind of error

l The help and message system should, if possible,be integrated

Page 688: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 43

Help and message system

Messagepresentation

system

Error messagetexts

Helpframes

Error messagesystem

Helpinterface

Application

Page 689: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 44

Error messages

l Error message design is critically important.Poor error messages can mean that a userrejects rather than accepts a system

l Messages should be polite, concise, consistentand constructive

l The background and experience of usersshould be the determining factor in messagedesign

Page 690: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 45

Design factors in message wordingContext The user guidance system should be aware of what the user is

doing and should adjust the output message to the currentcontext.

Experience As users become familiar with a system they become irritatedby long, ‘meaningful’ messages. However, beginners find itdifficult to understand short terse statements of the problem.The user guidance system should provide both types of messageand allow the user to control message conciseness.

Skill level Messages should be tailored to the user’s skills as well as theirexperience. Messages for the different classes of user may beexpressed in different ways depending on the terminology whichis familiar to the reader.

Style Messages should be positive rather than negative. They shoulduse the active rather than the passive mode of address. Theyshould never be insulting or try to be funny.

Culture Wherever possible, the designer of messages should be familiarwith the culture of the country where the system is sold. Thereare distinct cultural differences between Europe, Asia andAmerica. A suitable message for one culture might beunacceptable in another.

Page 691: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 46

Nurse input of a patient’s name

Please type the patient name in the box then click on OK

Bates, J.

OK Cancel

Page 692: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 47

System and user-oriented error messages

Error #27

Invalid patient id entered?OK Cancel

Patient J. Bates is not registered

Click on Patients for a list of registered patientsClick on Retry to re-input a patient nameClick on Help for more information

Patients Help Retry Cancel

System-oriented error messageUser-oriented error message

Page 693: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 48

Help system design

l Help? means ‘help I want information”

l Help! means “HELP. I'm in trouble”

l Both of these requirements have to be takeninto account in help system design

l Different facilities in the help system may berequired

Page 694: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 49

Help information

l Should not simply be an on-line manual

l Screens or windows don't map well onto paperpages.

l The dynamic characteristics of the display canimprove information presentation.

l People are not so good at reading screen asthey are text.

Page 695: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 50

Help system use

l Multiple entry points should be provided so thatthe user can get into the help system fromdifferent places.

l Some indication of where the user is positionedin the help system is valuable.

l Facilities should be provided to allow the userto navigate and traverse the help system.

Page 696: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 51

Entry points to a help system

Help frame network

Top-levelentry

Entry from errormessage system

Entry fromapplication

Page 697: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 52

Help system windows

Mail redirection

Mail may be redirected to anothernetwork user by pressing theredirect button in the controlpanel. The system asks for thename of the user or users towhom the mail has been sent

next topicsmore

Mail redirection

Mail may be redirected to anothernetwork user by pressing theredirect button in the controlpanel. The system asks for thename of the user or users towhom the mail has been sent

Help frame map

You are here

Help history

1. Mail2. Send mail3. Read mail4. Redirection

Page 698: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 53

User documentation

l As well as on-line information, paperdocumentation should be supplied with a system

l Documentation should be designed for a range ofusers from inexperienced to experienced

l As well as manuals, other easy-to-usedocumentation such as a quick reference cardmay be provided

Page 699: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 54

User document types

Description ofservices

Functionaldescription

Systemevaluators

How to installthe system

Installationdocument

Systemadministrators

Gettingstarted

Introductorymanual

Noviceusers

Facilitydescription

Referencemanual

Experiencedusers

Operation andmaintenance

Administrator’sguide

Systemadministrators

Page 700: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 55

Document types

l Functional description• Brief description of what the system can do

l Introductory manual• Presents an informal introduction to the system

l System reference manual• Describes all system facilities in detail

l System installation manual• Describes how to install the system

l System administrator’s manual• Describes how to manage the system when it is in use

Page 701: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 56

User interface evaluation

l Some evaluation of a user interface designshould be carried out to assess its suitability

l Full scale evaluation is very expensive andimpractical for most systems

l Ideally, an interface should be evaluated against ausability specification. However, it is rare forsuch specifications to be produced

Page 702: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 57

Usability attributes

Attribute DescriptionLearnability How long does it take a new user to

become productive with the system?Speed of operation How well does the system response match

the user’s work practice?Robustness How tolerant is the system of user error?Recoverability How good is the system at recovering from

user errors?Adaptability How closely is the system tied to a single

model of work?

Page 703: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 58

Simple evaluation techniques

l Questionnaires for user feedback

l Video recording of system use and subsequenttape evaluation.

l Instrumentation of code to collect informationabout facility use and user errors.

l The provision of a grip button for on-line userfeedback.

Page 704: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 59

Key points

l Interface design should be user-centred. Aninterface should be logical and consistent andhelp users recover from errors

l Interaction styles include direct manipulation,menu systems form fill-in, command languagesand natural language

l Graphical displays should be used to presenttrends and approximate values. Digital displayswhen precision is required

l Colour should be used sparingly and consistently

Page 705: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 15 Slide 60

Key points

l Systems should provide on-line help. This shouldinclude “help, I’m in trouble” and “help, I wantinformation”

l Error messages should be positive rather thannegative.

l A range of different types of user documentsshould be provided

l Ideally, a user interface should be evaluatedagainst a usability specification

Page 706: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 1

Dependability

• The extent to which a criticalsystem is trusted by its users

Page 707: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 2

The concept of dependability

• For critical systems, it is usually the case that themost important system property is the dependabilityof the system

• The dependability of a system reflects the user’sdegree of trust in that system. It reflects the extent ofthe user’s confidence that it will operate as usersexpect and that it will not ‘fail’ in normal use

• Usefulness and trustworthiness are not the samething. A system does not have to be trusted to beuseful

Page 708: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 3

Dimensions of dependability

Dependability

Availability Reliability Security

The ability of thesystem to deliver

services whenrequested

The ability of thesystem to deliver

services as specified?

The ability of thesystem to operate

without catastrophicfailure

The ability of thesystem to protect itelfagainst accidental ordeliverate intrusion

Safety

Page 709: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 4

Maintainability

• A system attribute which is concerned with the easeof repairing the system after a failure has beendiscovered or changing the system to include newfeatures

• Very important for critical systems as faults are oftenintroduced into a system because of maintenanceproblems

• Maintainability is distinct from other dimensions ofdependability because it is a static and not a dynamicsystem attribute. I do not cover it in this course.

Page 710: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 5

Survivability

• The ability of a system to continue to deliver itsservices to users in the face of deliberate oraccidental attack

• This is an increasingly important attribute fordistributed systems whose security can becompromised

• Survivability subsumes the notion of resilience - theability of a system to continue in operation in spiteof component failures

Page 711: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 6

Costs of increasing dependability

Cost

Low Medium High Veryhigh

Ultra-high

Dependability

Page 712: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 7

Dependability costs

• Dependability costs tend to increase exponentially asincreasing levels of dependability are required

• There are two reasons for this• The use of more expensive development techniques and hardware

that are required to achieve the higher levels of dependability

• The increased testing and system validation that is required toconvince the system client that the required levels of dependabilityhave been achieved

Page 713: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 8

Dependability vs performance

• Untrustworthy systems may be rejected by theirusers

• System failure costs may be very high

• It is very difficult to tune systems to make themmore dependable

• It may be possible to compensate for poorperformance

• Untrustworthy systems may cause loss of valuableinformation

Page 714: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 9

Dependability economics

• Because of very high costs of dependabilityachievement, it may be more cost effective to acceptuntrustworthy systems and pay for failure costs

• However, this depends on social and politicalfactors. A reputation for products that can’t betrusted may lose future business

• Depends on system type - for business systems inparticular, modest levels of dependability may beadequate

Page 715: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 10

Availability and reliability

• Reliability• The probability of failure-free system operation over a specified time

in a given environment for a given purpose

• Availability• The probability that a system, at a point in time, will be operational

and able to deliver the requested services

• Both of these attributes can be expressedquantitatively

Page 716: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 11

Availability and reliability

• It is sometimes possible to subsume systemavailability under system reliability• Obviously if a system is unavailable it is not delivering the specified

system services

• However, it is possible to have systems with lowreliability that must be available. So long as systemfailures can be repaired quickly and do not damagedata, low reliability may not be a problem

• Availability takes repair time into account

Page 717: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 12

Term DescriptionSystem failure An event that occurs at some point in time when

the system does not deliver a service as expectedby its users

System error Erroneous system behaviour where the behaviourof the system does not conform to itsspecification.

System fault An incorrect system state i.e. a system state thatis unexpected by the designers of the system.

Human error ormistake

Human behaviour that results in the introductionof faults into a system.

Reliability terminology

Page 718: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 13

Faults and failures

• Failures are a usually a result of system errors thatare derived from faults in the system

• However, faults do not necessarily result in systemerrors• The faulty system state may be transient and ‘corrected’ before an

error arises

• Errors do not necessarily lead to system failures• The error can be corrected by built-in error detection and recovery

• The failure can be protected against by built-in protection facilities.These may, for example, protect system resources from systemerrors

Page 719: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 14

Perceptions of reliability

• The formal definition of reliability does not alwaysreflect the user’s perception of a system’s reliability• The assumptions that are made about the environment where a

system will be used may be incorrect• Usage of a system in an office environment is likely to be quite different

from usage of the same system in a university environment

• The consequences of system failures affects the perception ofreliability• Unreliable windscreen wipers in a car may be irrelevant in a dry climate

• Failures that have serious consequences (such as an engine breakdownin a car) are given greater weight by users than failures that areinconvenient

Page 720: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 15

Reliability achievement

• Fault avoidance• Development technique are used that either minimise the possibility

of mistakes or trap mistakes before they result in the introduction ofsystem faults

• Fault detection and removal• Verification and validation techniques that increase the probability

of detecting and correcting errors before the system goes into serviceare used

• Fault tolerance• Run-time techniques are used to ensure that system faults do not

result in system errors and/or that system errors do not lead tosystem failures

Page 721: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 16

Reliability modelling

• You can model a system as an input-output mappingwhere some inputs will result in erroneous outputs

• The reliability of the system is the probability that aparticular input will lie in the set of inputs that causeerroneous outputs

• Different people will use the system in differentways so this probability is not a static systemattribute but depends on the system’s environment

Page 722: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 17

Input/output mapping

Ie

Input set

OeOutput set

Program

Inputs causingerroneousoutputs

Erroneousoutputs

Page 723: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 18

Reliability perception

Possibleinputs

User 1

User 3User 2

Erroneousinputs

Page 724: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 19

Reliability improvement

• Removing X% of the faults in a system will notnecessarily improve the reliability by X%. A studyat IBM showed that removing 60% of productdefects resulted in a 3% improvement in reliability

• Program defects may be in rarely executed sectionsof the code so may never be encountered by users.Removing these does not affect the perceivedreliability

• A program with known faults may therefore still beseen as reliable by its users

Page 725: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 20

Safety

• Safety is a property of a system that reflects thesystem’s ability to operate, normally or abnormally,without danger of causing human injury or death andwithout damage to the system’s environment

• It is increasingly important to consider softwaresafety as more and more devices incorporatesoftware-based control systems

• Safety requirements are exclusive requirements i.e.they exclude undesirable situations rather thanspecify required system services

Page 726: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 21

• Primary safety-critical systems• Embedded software systems whose failure can cause the associated

hardware to fail and directly threaten people.

• Secondary safety-critical systems• Systems whose failure results in faults in other systems which can

threaten people

• Discussion here focuses on primary safety-criticalsystems• Secondary safety-critical systems can only be considered on a one-

off basis

Safety criticality

Page 727: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 22

• Safety and reliability are related but distinct• In general, reliability and availability are necessary but not sufficient

conditions for system safety

• Reliability is concerned with conformance to a givenspecification and delivery of service

• Safety is concerned with ensuring system cannotcause damage irrespective of whetheror not it conforms to its specification

Safety and reliability

Page 728: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 23

• Specification errors• If the system specification is incorrect then the system can behave as

specified but still cause an accident

• Hardware failures generating spurious inputs• Hard to anticipate in the specification

• Context-sensitive commands i.e. issuing the rightcommand at the wrong time• Often the result of operator error

Unsafe reliable systems

Page 729: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 24

Term DefinitionAccident (ormishap)

An unplanned event or sequence of events which results in human deathor injury, damage to property or to the environment. A computer-controlled machine injuring its operator is an example of an accident.

Hazard A condition with the potential for causing or contributing to anaccident. A failure of the sensor which detects an obstacle in front of amachine is an example of a hazard.

Damage A measure of the loss resulting from a mishap. Damage can range frommany people killed as a result of an accident to minor injury or propertydamage.

Hazardseverity

An assessment of the worst possible damage which could result from aparticular hazard. Hazard severity can range from catastrophic wheremany people are killed to minor where only minor damage results

Hazardprobability

The probability of the events occurring which create a hazard.Probability values tend to be arbitrary but range from probable (say1/100 chance of a hazard occurring) to implausible (no conceivablesituations are likely where the hazard could occur).

Risk This is a measure of the probability that the system will cause anaccident. The risk is assessed by considering the hazard probability, thehazard severity and the probability that a hazard will result in anaccident.

Safety terminology

Page 730: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 25

Safety achievement

• Hazard avoidance• The system is designed so that some classes of hazard simply cannot

arise.

• Hazard detection and removal• The system is designed so that hazards are detected and removed

before they result in an accident

• Damage limitation• The system includes protection features that minimise the damage

that may result from an accident

Page 731: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 26

Normal accidents

• Accidents in complex systems rarely have a singlecause as these systems are designed to be resilient toa single point of failure• Designing systems so that a single point of failure does not cause an

accident is a fundamental principle of safe systems design

• Almost all accidents are a result of combinations ofmalfunctions

• It is probably the case that anticipating all problemcombinations, especially, in software controlledsystems is impossible so achieving complete safetyis impossible

Page 732: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 27

Security

• The security of a system is a system property thatreflects the system’s ability to protect itself fromaccidental or deliberate external attack

• Security is becoming increasingly important assystems are networked so that external access to thesystem through the Internet is possible

• Security is an essential pre-requisite for availability,reliability and safety

Page 733: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 28

Fundamental security

• If a system is a networked system and is insecurethen statements about its reliability and its safety areunreliable

• These statements depend on the executing systemand the developed system being the same. However,intrusion can change the executing system and/or itsdata

• Therefore, the reliability and safety assurance is nolonger valid

Page 734: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 29

Security terminology

Term DefinitionExposure Possible loss or harm in a computing systemVulnerability A weakness in a computer-based system that may

be exploited to cause loss or harmAttack An exploitation of a system vulnerabilityThreats Circumstances that have potential to cause loss or

harmControl A protective measure that reduces a system

vulnerability

Page 735: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 30

Damage from insecurity

• Denial of service• The system is forced into a state where normal services are

unavailable or where service provision is significantly degraded

• Corruption of programs or data• The programs or data in the system may be modified in an

unauthorised way

• Disclosure of confidential information• Information that is managed by the system may be exposed to people

who are not authorised to read or use that information

Page 736: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 31

Security assurance

• Vulnerability avoidance• The system is designed so that vulnerabilities do not occur. For

example, if there is no external network connection then externalattack is impossible

• Attack detection and elimination• The system is designed so that attacks on vulnerabilities are detected

and neutralised before they result in an exposure. For example, viruscheckers find and remove viruses before they infect a system

• Exposure limitation• The system is designed so that the adverse consequences of a

successful attack are minimised. For example, a backup policyallows damaged information to be restored

Page 737: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 32

Key points

• The dependability in a system reflects the user’s trustin that system

• The availability of a system is the probability that itwill be available to deliver services when requested

• The reliability of a system is the probability thatsystem services will be delivered as specified

• Reliability and availability are generally seen asnecessary but not sufficient conditions for safety andsecurity

Page 738: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 33

Key points

• Reliability is related to the probability of an erroroccurring in operational use. A system with knownfaults may be reliable

• Safety is a system attribute that reflects the system’sability to operate without threatening people or theenvironment

• Security is a system attribute that reflects thesystem’s ability to protect itself from external attack

Page 739: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 1

Dependability

• The extent to which a criticalsystem is trusted by its users

Page 740: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 2

The concept of dependability

• For critical systems, it is usually the case that themost important system property is the dependabilityof the system

• The dependability of a system reflects the user’sdegree of trust in that system. It reflects the extent ofthe user’s confidence that it will operate as usersexpect and that it will not ‘fail’ in normal use

• Usefulness and trustworthiness are not the samething. A system does not have to be trusted to beuseful

Page 741: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 3

Dimensions of dependability

Dependability

Availability Reliability Security

The ability of thesystem to deliver

services whenrequested

The ability of thesystem to deliver

services as specified?

The ability of thesystem to operate

without catastrophicfailure

The ability of thesystem to protect itelfagainst accidental ordeliverate intrusion

Safety

Page 742: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 4

Maintainability

• A system attribute which is concerned with the easeof repairing the system after a failure has beendiscovered or changing the system to include newfeatures

• Very important for critical systems as faults are oftenintroduced into a system because of maintenanceproblems

• Maintainability is distinct from other dimensions ofdependability because it is a static and not a dynamicsystem attribute. I do not cover it in this course.

Page 743: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 5

Survivability

• The ability of a system to continue to deliver itsservices to users in the face of deliberate oraccidental attack

• This is an increasingly important attribute fordistributed systems whose security can becompromised

• Survivability subsumes the notion of resilience - theability of a system to continue in operation in spiteof component failures

Page 744: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 6

Costs of increasing dependability

Cost

Low Medium High Veryhigh

Ultra-high

Dependability

Page 745: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 7

Dependability costs

• Dependability costs tend to increase exponentially asincreasing levels of dependability are required

• There are two reasons for this• The use of more expensive development techniques and hardware

that are required to achieve the higher levels of dependability

• The increased testing and system validation that is required toconvince the system client that the required levels of dependabilityhave been achieved

Page 746: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 8

Dependability vs performance

• Untrustworthy systems may be rejected by theirusers

• System failure costs may be very high

• It is very difficult to tune systems to make themmore dependable

• It may be possible to compensate for poorperformance

• Untrustworthy systems may cause loss of valuableinformation

Page 747: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 9

Dependability economics

• Because of very high costs of dependabilityachievement, it may be more cost effective to acceptuntrustworthy systems and pay for failure costs

• However, this depends on social and politicalfactors. A reputation for products that can’t betrusted may lose future business

• Depends on system type - for business systems inparticular, modest levels of dependability may beadequate

Page 748: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 10

Availability and reliability

• Reliability• The probability of failure-free system operation over a specified time

in a given environment for a given purpose

• Availability• The probability that a system, at a point in time, will be operational

and able to deliver the requested services

• Both of these attributes can be expressedquantitatively

Page 749: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 11

Availability and reliability

• It is sometimes possible to subsume systemavailability under system reliability• Obviously if a system is unavailable it is not delivering the specified

system services

• However, it is possible to have systems with lowreliability that must be available. So long as systemfailures can be repaired quickly and do not damagedata, low reliability may not be a problem

• Availability takes repair time into account

Page 750: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 12

Term DescriptionSystem failure An event that occurs at some point in time when

the system does not deliver a service as expectedby its users

System error Erroneous system behaviour where the behaviourof the system does not conform to itsspecification.

System fault An incorrect system state i.e. a system state thatis unexpected by the designers of the system.

Human error ormistake

Human behaviour that results in the introductionof faults into a system.

Reliability terminology

Page 751: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 13

Faults and failures

• Failures are a usually a result of system errors thatare derived from faults in the system

• However, faults do not necessarily result in systemerrors• The faulty system state may be transient and ‘corrected’ before an

error arises

• Errors do not necessarily lead to system failures• The error can be corrected by built-in error detection and recovery

• The failure can be protected against by built-in protection facilities.These may, for example, protect system resources from systemerrors

Page 752: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 14

Perceptions of reliability

• The formal definition of reliability does not alwaysreflect the user’s perception of a system’s reliability• The assumptions that are made about the environment where a

system will be used may be incorrect• Usage of a system in an office environment is likely to be quite different

from usage of the same system in a university environment

• The consequences of system failures affects the perception ofreliability• Unreliable windscreen wipers in a car may be irrelevant in a dry climate

• Failures that have serious consequences (such as an engine breakdownin a car) are given greater weight by users than failures that areinconvenient

Page 753: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 15

Reliability achievement

• Fault avoidance• Development technique are used that either minimise the possibility

of mistakes or trap mistakes before they result in the introduction ofsystem faults

• Fault detection and removal• Verification and validation techniques that increase the probability

of detecting and correcting errors before the system goes into serviceare used

• Fault tolerance• Run-time techniques are used to ensure that system faults do not

result in system errors and/or that system errors do not lead tosystem failures

Page 754: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 16

Reliability modelling

• You can model a system as an input-output mappingwhere some inputs will result in erroneous outputs

• The reliability of the system is the probability that aparticular input will lie in the set of inputs that causeerroneous outputs

• Different people will use the system in differentways so this probability is not a static systemattribute but depends on the system’s environment

Page 755: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 17

Input/output mapping

Ie

Input set

OeOutput set

Program

Inputs causingerroneousoutputs

Erroneousoutputs

Page 756: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 18

Reliability perception

Possibleinputs

User 1

User 3User 2

Erroneousinputs

Page 757: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 19

Reliability improvement

• Removing X% of the faults in a system will notnecessarily improve the reliability by X%. A studyat IBM showed that removing 60% of productdefects resulted in a 3% improvement in reliability

• Program defects may be in rarely executed sectionsof the code so may never be encountered by users.Removing these does not affect the perceivedreliability

• A program with known faults may therefore still beseen as reliable by its users

Page 758: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 20

Safety

• Safety is a property of a system that reflects thesystem’s ability to operate, normally or abnormally,without danger of causing human injury or death andwithout damage to the system’s environment

• It is increasingly important to consider softwaresafety as more and more devices incorporatesoftware-based control systems

• Safety requirements are exclusive requirements i.e.they exclude undesirable situations rather thanspecify required system services

Page 759: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 21

• Primary safety-critical systems• Embedded software systems whose failure can cause the associated

hardware to fail and directly threaten people.

• Secondary safety-critical systems• Systems whose failure results in faults in other systems which can

threaten people

• Discussion here focuses on primary safety-criticalsystems• Secondary safety-critical systems can only be considered on a one-

off basis

Safety criticality

Page 760: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 22

• Safety and reliability are related but distinct• In general, reliability and availability are necessary but not sufficient

conditions for system safety

• Reliability is concerned with conformance to a givenspecification and delivery of service

• Safety is concerned with ensuring system cannotcause damage irrespective of whetheror not it conforms to its specification

Safety and reliability

Page 761: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 23

• Specification errors• If the system specification is incorrect then the system can behave as

specified but still cause an accident

• Hardware failures generating spurious inputs• Hard to anticipate in the specification

• Context-sensitive commands i.e. issuing the rightcommand at the wrong time• Often the result of operator error

Unsafe reliable systems

Page 762: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 24

Term DefinitionAccident (ormishap)

An unplanned event or sequence of events which results in human deathor injury, damage to property or to the environment. A computer-controlled machine injuring its operator is an example of an accident.

Hazard A condition with the potential for causing or contributing to anaccident. A failure of the sensor which detects an obstacle in front of amachine is an example of a hazard.

Damage A measure of the loss resulting from a mishap. Damage can range frommany people killed as a result of an accident to minor injury or propertydamage.

Hazardseverity

An assessment of the worst possible damage which could result from aparticular hazard. Hazard severity can range from catastrophic wheremany people are killed to minor where only minor damage results

Hazardprobability

The probability of the events occurring which create a hazard.Probability values tend to be arbitrary but range from probable (say1/100 chance of a hazard occurring) to implausible (no conceivablesituations are likely where the hazard could occur).

Risk This is a measure of the probability that the system will cause anaccident. The risk is assessed by considering the hazard probability, thehazard severity and the probability that a hazard will result in anaccident.

Safety terminology

Page 763: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 25

Safety achievement

• Hazard avoidance• The system is designed so that some classes of hazard simply cannot

arise.

• Hazard detection and removal• The system is designed so that hazards are detected and removed

before they result in an accident

• Damage limitation• The system includes protection features that minimise the damage

that may result from an accident

Page 764: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 26

Normal accidents

• Accidents in complex systems rarely have a singlecause as these systems are designed to be resilient toa single point of failure• Designing systems so that a single point of failure does not cause an

accident is a fundamental principle of safe systems design

• Almost all accidents are a result of combinations ofmalfunctions

• It is probably the case that anticipating all problemcombinations, especially, in software controlledsystems is impossible so achieving complete safetyis impossible

Page 765: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 27

Security

• The security of a system is a system property thatreflects the system’s ability to protect itself fromaccidental or deliberate external attack

• Security is becoming increasingly important assystems are networked so that external access to thesystem through the Internet is possible

• Security is an essential pre-requisite for availability,reliability and safety

Page 766: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 28

Fundamental security

• If a system is a networked system and is insecurethen statements about its reliability and its safety areunreliable

• These statements depend on the executing systemand the developed system being the same. However,intrusion can change the executing system and/or itsdata

• Therefore, the reliability and safety assurance is nolonger valid

Page 767: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 29

Security terminology

Term DefinitionExposure Possible loss or harm in a computing systemVulnerability A weakness in a computer-based system that may

be exploited to cause loss or harmAttack An exploitation of a system vulnerabilityThreats Circumstances that have potential to cause loss or

harmControl A protective measure that reduces a system

vulnerability

Page 768: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 30

Damage from insecurity

• Denial of service• The system is forced into a state where normal services are

unavailable or where service provision is significantly degraded

• Corruption of programs or data• The programs or data in the system may be modified in an

unauthorised way

• Disclosure of confidential information• Information that is managed by the system may be exposed to people

who are not authorised to read or use that information

Page 769: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 31

Security assurance

• Vulnerability avoidance• The system is designed so that vulnerabilities do not occur. For

example, if there is no external network connection then externalattack is impossible

• Attack detection and elimination• The system is designed so that attacks on vulnerabilities are detected

and neutralised before they result in an exposure. For example, viruscheckers find and remove viruses before they infect a system

• Exposure limitation• The system is designed so that the adverse consequences of a

successful attack are minimised. For example, a backup policyallows damaged information to be restored

Page 770: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 32

Key points

• The dependability in a system reflects the user’s trustin that system

• The availability of a system is the probability that itwill be available to deliver services when requested

• The reliability of a system is the probability thatsystem services will be delivered as specified

• Reliability and availability are generally seen asnecessary but not sufficient conditions for safety andsecurity

Page 771: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependability Slide 33

Key points

• Reliability is related to the probability of an erroroccurring in operational use. A system with knownfaults may be reliable

• Safety is a system attribute that reflects the system’sability to operate without threatening people or theenvironment

• Security is a system attribute that reflects thesystem’s ability to protect itself from external attack

Page 772: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 1

Dependable Systems Specification

• Processes and techniques fordeveloping a specification forsystem availability, reliability,safety and security

Page 773: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 2

Functional and non-functional requirements

• System functional requirements may be generatedto define error checking and recovery facilitiesand features that provide protection againstsystem failures.

• Non-functional requirements may be generated tospecify the required reliability and availability ofthe system.

Page 774: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 3

System reliability specification

• Hardware reliability• What is the probability of a hardware component failing and how

long does it take to repair that component?

• Software reliability• How likely is it that a software component will produce an incorrect

output. Software failures are different from hardware failures in thatsoftware does not wear out. It can continue in operation even after anincorrect result has been produced.

• Operator reliability• How likely is it that the operator of a system will make an error?

Page 775: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 4

System reliability engineering

• Sub-discipline of systems engineering that isconcerned with making judgements on systemreliability

• It takes into account the probabilities of failure ofdifferent components in the system and theircombinations• Consider a system with 2 components A and B where the

probability of failure of A is P (A) and the probability of failureof B is P (B).

Page 776: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 5

Failure probabilities

• If there are 2 components and the operation of thesystem depends on both of them then theprobability of system failure is• P (S) = P (A) + P (B)

• Therefore, as the number of components increasethen the probability of system failure increases

• If components are replicated then the probabilityof failure is• P (S) = P (A) n (all components must fail)

Page 777: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 6

Functional reliability requirements

• A predefined range for all values that are input bythe operator shall be defined and the system shallcheck that all operator inputs fall within thispredefined range.

• The system shall check all disks for bad blockswhen it is initialised.

• The system must use N-version programming toimplement the braking control system.

• The system must be implemented in a safe subsetof Ada and checked using static analysis

Page 778: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 7

• The required level of system reliability requiredshould be expressed in quantitatively

• Reliability is a dynamic system attribute-reliability specifications related to the sourcecode are meaningless.• No more than N faults/1000 lines.

• This is only useful for a post-delivery process analysis whereyou are trying to assess how good your development techniquesare.

• An appropriate reliability metric should be chosento specify the overall system reliability

Non-functional reliability specification

Page 779: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 8

• Reliability metrics are units of measurement ofsystem reliability

• System reliability is measured by counting thenumber of operational failures and, whereappropriate, relating these to the demands madeon the system and the time that the system hasbeen operational

• A long-term measurement programme is requiredto assess the reliability of critical systems

Reliability metrics

Page 780: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 9

Reliability metrics

Metric ExplanationPOFODProbability of failureon demand

The likelihood that the system will fail when a service requestis made. For example, a POFOD of 0.001 means that 1 out ofa thousand service requests may result in failure.

ROCOFRate of failureoccurrence

The frequency of occurrence with which unexpectedbehaviour is likely to occur. For example, a ROCOF of 2/100means that 2 failures are likely to occur in each 100operational time units. This metric is sometimes called thefailure intensity.

MTTFMean time to failure

The average time between observed system failures. Forexample, an MTTF of 500 means that 1 failure can beexpected every 500 time units.

MTTRMean time to repair

The average time between a system failure and the return ofthat system to service.

AVAILAvailability

The probability that the system is available for use at a giventime. For example, an availability of 0.998 means that inevery 1000 time units, the system is likely to be available for998 of these.

Page 781: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 10

Availability

• Measure of the fraction of the time that thesystem is available for use

• Takes repair and restart time into account

• Availability of 0.998 means software is availablefor 998 out of 1000 time units

• Relevant for non-stop, continuously runningsystems• telephone switching systems, railway signalling systems

Page 782: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 11

Probability of failure on demand

• This is the probability that the system will failwhen a service request is made. Useful whendemands for service are intermittent andrelatively infrequent

• Appropriate for protection systems where servicesare demanded occasionally and where there areserious consequence if the service is not delivered

• Relevant for many safety-critical systems withexception management components• Emergency shutdown system in a chemical plant

Page 783: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 12

Rate of fault occurrence (ROCOF)

• Reflects the rate of occurrence of failure in thesystem

• ROCOF of 0.002 means 2 failures are likely ineach 1000 operational time units e.g. 2 failuresper 1000 hours of operation

• Relevant for operating systems, transactionprocessing systems where the system has toprocess a large number of similar requests that arerelatively frequesnt• Credit card processing system, airline booking system

Page 784: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 13

Mean time to failure

• Measure of the time between observed failures ofthe system. Is the reciprocal of ROCOF for stablesystems

• MTTF of 500 means that the mean time betweenfailures is 500 time units

• Relevant for systems with long transactions i.e.where system processing takes a long time.MTTF should be longer than transaction length• Computer-aided design systems where a designer will work on a

design for several hours, word processor systems

Page 785: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 14

Failure consequences

• Reliability measurements do NOT take theconsequences of failure into account

• Transient faults may have no real consequencesbut other faults may cause data loss or corruptionand loss of system service

• May be necessary to identify different failureclasses and use different metrics for each of these.The reliability specification must be structured.

Page 786: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 15

Failure consequences

• When specifying reliability, it is not just thenumber of system failures that matter but theconsequences of these failures

• Failures that have serious consequences areclearly more damaging than those where repairand recovery is straightforward

• In some cases, therefore, different reliabilityspecifications for different types of failure may bedefined

Page 787: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 16

Failure classification

Failure class DescriptionTransient Occurs only with certain inputsPermanent Occurs with all inputsRecoverable System can recover without operator interventionUnrecoverable Operator intervention needed to recover from failureNon-corrupting Failure does not corrupt system state or dataCorrupting Failure corrupts system state or data

Page 788: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 17

• For each sub-system, analyse theconsequences of possible system failures.

• From the system failure analysis, partitionfailures into appropriate classes.

• For each failure class identified, set out thereliability using an appropriate metric. Differentmetrics may be used for different reliabilityrequirements

• Identify functional reliability requirements toreduce the chances of critical failures

Steps to a reliability specification

Page 789: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 18

Bank auto-teller system

• Each machine in a network is used 300 times aday

• Bank has 1000 machines

• Lifetime of software release is 2 years

• Each machine handles about 200, 000transactions

• About 300, 000 database transactions in total perday

Page 790: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 19

Examples of a reliability spec.

Failure class Example Reliability metricPermanent,non-corrupting.

The system fails to operate withany card which is input. Softwaremust be restarted to correct failure.

ROCOF1 occurrence/1000 days

Transient, non-corrupting

The magnetic stripe data cannot beread on an undamaged card whichis input.

POFOD1 in 1000 transactions

Transient,corrupting

A pattern of transactions across thenetwork causes databasecorruption.

Unquantifiable! Shouldnever happen in thelifetime of the system

Page 791: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 20

Specification validation

• It is impossible to empirically validate very highreliability specifications

• No database corruptions means POFOD of lessthan 1 in 200 million

• If a transaction takes 1 second, then simulatingone day’s transactions takes 3.5 days

• It would take longer than the system’s lifetime totest it for reliability

Page 792: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 21

Key points

• There are both functional and non-functionaldependability requirements

• Non-functional availability and reliabilityrequirements should be specified quantitatively

• Metrics that may be used are AVAIL, POFOD,ROCOF and MTTF

• When deriving a reliability specification, theconsequences of different types of fault should betaken into account

Page 793: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 22

Safety specification

• The safety requirements of a system should beseparately specified

• These requirements should be based on ananalysis of the possible hazards and risks

• Safety requirements usually apply to the systemas a whole rather than to individual sub-systems.In systems engineering terms, the safety of asystem is an emergent property

Page 794: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

The safety life-cycle

©Ian Sommerville 2000 Dependable systems specification Slide 23

Hazard and riskanalysis

Safety req.allocation

Safety req.derivation

Concept andscope definition

Validation O & M Installation

Planning Safety-relatedsystems

development

External riskreductionfacilities

Operation andmaintenance

Planning and development

Systemdecommissioning

Installation andcommissioning

Safetyvalidation

Page 795: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 24

Safety processes

• Hazard and risk analysis• Assess the hazards and the risks of damage associated with the

system

• Safety requirements specification• Specify a set of safety requirements which apply to the system

• Designation of safety-critical systems• Identify the sub-systems whose incorrect operation may

compromise system safety. Ideally, these should be as small apart as possible of the whole system.

• Safety validation• Check the overall system safety

Page 796: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 25

Hazard and risk analysis

Hazarddescription

Hazardidentification

Risk analysis andhazard classification

Hazarddecomposition

Risk reductionassessment

Riskassessment

Fault treeanalysis

Preliminary safetyrequirements

Page 797: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 26

• Identification of hazards which can arise whichcompromise the safety of the system andassessing the risks associated with these hazards

• Structured into various classes of hazard analysisand carried out throughout softwareprocess from specification to implementation

• A risk analysis should be carried out anddocumented for each identified hazard and actionstaken to ensure the most serious/likely hazards donot result in accidents

Hazard and risk analysis

Page 798: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 27

Hazard analysis stages

• Hazard identification• Identify potential hazards which may arise

• Risk analysis and hazard classification• Assess the risk associated with each hazard

• Hazard decomposition• Decompose hazards to discover their potential root causes

• Risk reduction assessment• Define how each hazard must be taken into account when the

system is designed

Page 799: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 28

• Method of hazard analysis which starts with anidentified fault and works backward to the causesof the fault.

• Can be used at all stages of hazard analysis frompreliminary analysis through to detailedsoftware checking

• Top-down hazard analysis method. May becombined with bottom-up methods which startwith system failures and lead to hazards

Fault-tree analysis

Page 800: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 29

Fault- tree analysis

• Identify hazard

• Identify potential causes of the hazard. Usuallythere will be a number of alternative causes. Linkthese on the fault-tree with ‘or’ or ‘and’ symbols

• Continue process until root causes are identified

• Consider the following example which considershow data might be lost in some system where abackup process is running

Page 801: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 30

Fault treeData deleted

H/W failure S/W failureExternal attack Operator failure

Operating system failureBackup system failure

Incorrect configurationIncorrect operator input Execution failure

Timing fault Algorithm fault Data faultUI design fault Training fault Human error

or or or or

or or

or or or

oror

or

oror or

Page 802: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 31

Risk assessment

• Assesses hazard severity, hazard probability andaccident probability

• Outcome of risk assessment is a statement ofacceptability• Intolerable. Must never arise or result in an accident

• As low as reasonably practical(ALARP) Must minimisepossibility of hazard given cost and schedule constraints

• Acceptable. Consequences of hazard are acceptable and no extracosts should be incurred to reduce hazard probability

Page 803: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 32

Levels of risk

Unacceptable regionrisk cannot be tolerated

Risk tolerated only ifrisk reduction is impractical

or grossly expensive

Acceptableregion

Negligible risk

ALARPregion

Page 804: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 33

Risk acceptability

• The acceptability of a risk is determined byhuman, social and political considerations

• In most societies, the boundaries between theregions are pushed upwards with time i.e. societyis less willing to accept risk• For example, the costs of cleaning up pollution may be less than

the costs of preventing it but this may not be socially acceptable

• Risk assessment is subjective• Risks are identified as probable, unlikely, etc. This depends on

who is making the assessment

Page 805: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 34

Risk reduction

• System should be specified so that hazards do notarise or result in an accident

• Hazard avoidance• The system should be designed so that the hazard can never

arise during correct system operation

• Hazard detection and removal• The system should be designed so that hazards are detected and

neutralised before they result in an accident

• Damage limitation• The system is designed in such a way that the consequences of

an accident are minimised

Page 806: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 35

Specifying forbidden behaviour

• The system shall not allow users to modify accesspermissions on any files that they have notcreated (security)

• The system shall not allow reverse thrust mode tobe selected when the aircraft is in flight (safety)

• The system shall not allow the simultaneousactivation of more than three alarm signals(safety)

Page 807: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 36

Security specification

• Has some similarities to safety specification• Not possible to specify security requirements quantitatively

• The requirements are often ‘shall not’ rather than ‘shall’requirements

• Differences• No well-defined notion of a security life cycle for security

management

• Generic threats rather than system specific hazards

• Mature security technology (encryption, etc.). However, thereare problems in transferring this into general use

Page 808: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 37

The security specification process

System assetlist

Assetidentification

Threat analysis andrisk assessment

Threatassignment

Security req.specification

Threat andrisk matrix

Asset andthreat

description

Securityrequirements

Technologyanalysis

Securitytechnology

analysis

Page 809: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 38

Stages in security specification

• Asset identification and evaluation• The assets (data and programs) and their required degree of

protection are identified. The degree of required protectiondepends on the asset value so that a password file (say) is morevaluable than a set of public web pages.

• Threat analysis and risk assessment• Possible security threats are identified and the risks associated

with each of these threats is estimated.

• Threat assignment• Identified threats are related to the assets so that, for each

identified asset, there is a list of associated threats.

Page 810: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 39

Stages in security specification

• Technology analysis• Available security technologies and their applicability against

the identified threats are assessed.

• Security requirements specification• The security requirements are specified. Where appropriate,

these will explicitly identified the security technologies that maybe used to protect against different threats to the system.

Page 811: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable systems specification Slide 40

Key points• Hazard analysis is a key activity in the safety

specification process.

• Fault-tree analysis is a technique which can be used inthe hazard analysis process.

• Risk analysis is the process of assessing the likelihoodthat a hazard will result in an accident. Risk analysisidentifies critical hazards and classifies risks accordingto their seriousness.

• To specify security requirements, you should identify theassets that are to be protected and define how securitytechniques should be used to protect them.

Page 812: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 1

Dependable software development

• Programming techniques forbuilding dependable softwaresystems.

Page 813: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 2

Software dependability

• In general, software customers expect all softwareto be dependable. However, for non-criticalapplications, they may be willing to accept somesystem failures

• Some applications, however, have very highdependability requirements and specialprogramming techniques must be used to achievethis

Page 814: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 3

Dependability achievement

• Fault avoidance• The software is developed in such a way that human error is

avoided and thus system faults are minimised

• The development process is organised so that faults in thesoftware are detected and repaired before delivery to thecustomer

• Fault tolerance• The software is designed so that faults in the delivered software

do not result in system failure

Page 815: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 4

Fault minimisation

• Current methods of software engineering nowallow for the production of fault-free software.

• Fault-free software means software whichconforms to its specification. It does NOT meansoftware which will always perform correctly asthere may be specification errors.

• The cost of producing fault free software is veryhigh. It is only cost-effective in exceptionalsituations. May be cheaper to accept softwarefaults

Page 816: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 5

Fault removal costs

Costper errordeleted

FewNumber of residual errors

Many Veryfew

Page 817: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 6

Fault-free software development

• Needs a precise (preferably formal) specification.

• Requires an organizational committment toquality.

• Information hiding and encapsulation in softwaredesign is essential

• A programming language with strict typing andrun-time checking should be used

• Error-prone constructs should be avoided

• Dependable and repeatable development process

Page 818: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 7

Structured programming

• First discussed in the 1970's

• Programming without gotos

• While loops and if statements as the onlycontrol statements.

• Top-down design.

• Important because it promoted thought anddiscussion about programming

• Leads to programs that are easier to read andunderstand

Page 819: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 8

Error-prone constructs

• Floating-point numbers• Inherently imprecise. The imprecision may lead to invalid

comparisons

• Pointers• Pointers referring to the wrong memory areas can corrupt

data. Aliasing can make programs difficult to understandand change

• Dynamic memory allocation• Run-time allocation can cause memory overflow

• Parallelism• Can result in subtle timing errors because of unforseen

interaction between parallel processes

Page 820: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 9

Error-prone constructs

• Recursion• Errors in recursion can cause memory overflow

• Interrupts• Interrupts can cause a critical operation to be terminated

and make a program difficult to understand. they arecomparable to goto statements.

• Inheritance• Code is not localised. This can result in unexpected behaviour

when changes are made and problems of understanding

• These constructs don’t have to be avoided butthey must be used with great care.

Page 821: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 10

Information hiding

• Information should only be exposed to those partsof the program which need to access it. Thisinvolves the creation of objects or abstract datatypes which maintain state and operations on thatstate

• This avoids faults for three reasons:• the probability of accidental corruption of information

• the information is surrounded by ‘firewalls’ so that problems areless likely to spread to other parts of the program

• as all information is localised, the programmer is less likely tomake errors and reviewers are more likely to find errors

Page 822: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 11

A queue specification in Java

interface Queue {

public void put (Object o) ;public void remove (Object o) ;public int size () ;

} //Queue

Page 823: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 12

Signal declaration in Java

class Signal {

public final int red = 1 ;public final int amber = 2 ;public final int green = 3 ;

... other declarations here ...}

Page 824: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 13

Reliable software processes

• To ensure a minimal number of software faults, itis important to have a well-defined, repeatablesoftware process

• A well-defined repeatable process is one that doesnot depend entirely on individual skills; rather canbe enacted by different people

• For fault minimisation, it is clear that the procesactivities should include significant verificationand validation

Page 825: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 14

Process validation activities

• Requirements inspections

• Requirements management

• Model checking

• Design and code inspection

• Static analysis

• Test planning and management

• Configuration management is also essential

Page 826: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 15

Fault tolerance

• In critical situations, software systems must befault tolerant. Fault tolerance is required wherethere are high availability requirements or wheresystem failure costs are very high..

• Fault tolerance means that the system cancontinue in operation in spite of software failure

• Even if the system seems to be fault-free, it mustalso be fault tolerant as there may bespecification errors or the validation may beincorrect

Page 827: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 16

Fault tolerance actions

• Fault detection• The system must detect that a fault (an incorrect system state)

has occurred.

• Damage assessment• The parts of the system state affected by the fault must be

detected.

• Fault recovery• The system must restore its state to a known safe state.

• Fault repair• The system may be modified to prevent recurrence of the

fault. As many software faults are transitory, this is oftenunnecessary.

Page 828: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 17

Approaches to fault tolerance

• Defensive programming• Programmers assume that there may be faults in the code of the

system and incorporate redundant code to check the state aftermodifications to ensure that it is consistent.

• Fault-tolerant architectures

• Hardware and software system architectures that supporthardware and software redundancy and a fault tolerancecontroller that detects problems and supports fault recovery

• These are complementary rather than opposing techniques

Page 829: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 18

Exception management

• A program exception is an error or someunexpected event such as a power failure.

• Exception handling constructs allow for suchevents to be handled without the need forcontinual status checking to detect exceptions.

• Using normal control constructs to detectexceptions in a sequence of nested procedurecalls needs many additional statements to beadded to the program and adds a significanttiming overhead.

Page 830: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 19

Exceptions in Javaclass SensorFailureException extends Exception {

SensorFailureException (String msg) {super (msg) ;Alarm.activate (msg) ;

}} // SensorFailureException

class Sensor {int readVal () throws SensorFailureException {try {

int theValue = DeviceIO.readInteger () ;if (theValue < 0)

throw new SensorFailureException ("Sensor failure") ;return theValue ;

}catch (deviceIOException e)

{ throw new SensorFailureException (“ Sensor read error ”) ; }} // readVal

} // Sensor

Page 831: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 20

Programming with exceptions

• Exceptions can be used as a normal programmingtechnique and not just as a way of recoveringfrom faults

• Consider the example of a temperature controlsystem for a refrigeration unit

Page 832: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 21

A temperature controller

• Controls a freezer and keeps temperaturewithin a specified range

• Switches a refrigerant pump on and off

• Sets of an alarm is the maximum allowedtemperature is exceeded

• Uses exceptions as a normal programmingtechnique

Page 833: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Freezer controller (Java)

©Ian Sommerville 2000 Dependable Software Development Slide 22

class FreezerController {Sensor tempSensor = new Sensor () ;Dial tempDial = new Dial () ;float freezerTemp = tempSensor.readVal () ;final float dangerTemp = (float) -18.0 ;final long coolingTime = (long) 200000.0 ;public void run ( ) throws InterrupedException {try {

Pump.switchIt (Pump.on) ;do { if (freezerTemp > tempDial.setting ())

if (Pump.status == Pump.off){ Pump.switchIt (Pump.on) ;

Thread.sleep (coolingTime) ; } elseif (Pump.status == Pump.on)

Pump.switchIt (Pump.off) ;if (freezerTemp > dangerTemp)

throw new FreezerTooHotException () ;freezerTemp = tempSensor.readVal () ;

} while (true) ;} // try blockcatch (FreezerTooHotException f){ Alarm.activate ( ) ; }catch (InterruptedException e){ System.out.println (“Thread exception”) ;

throw new InterruptedException ( ) ; }} //run

} // FreezerController

Page 834: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 23

Fault detection

• Languages such as Java and Ada have a stricttype system that allows many errors to be trappedat compile-time

• However, some classes of error can only bediscovered at run-time

• Fault detection involves detecting an erroneoussystem state and throwing an exception to managethe detected fault

Page 835: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 24

Fault detection

• Preventative fault detection• The fault detetcion mechanism is initiated before the state

change is committed. If an erroneous state is detected, thechange is not made

• Retrospective fault detection• The fault detection mechanism is initiated after the system state

has been changed. Used when a incorrect sequence of correctactions leads to an erroneous state ot when preventative faultdetection involves too much overhead

Page 836: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 25

• Preventative fault detection really involvesextending the type system by including additionalconstraints as part of the type definition

• These constraints are implemented by definingbasic operations within a class definition

Type system extension

Page 837: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

PositiveEvenInteger

©Ian Sommerville 2000 Dependable Software Development Slide 26

class PositiveEvenInteger {int val = 0 ;

PositiveEvenInteger (int n) throws NumericException{

if (n < 0 | n%2 == 1)throw new NumericException () ;

elseval = n ;

} // PositiveEvenInteger

public void assign (int n) throws NumericException{

if (n < 0 | n%2 == 1)throw new NumericException ();

elseval = n ;

} // assignint toInteger (){

return val ;} //to Integer

boolean equals (PositiveEvenInteger n){

return (val == n.val) ;} // equals

} //PositiveEven

Page 838: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 27

Damage assessment

• Analyse system state to judge the extent ofcorruption caused by a system failure

• Must assess what parts of the state space havebeen affected by the failure

• Generally based on ‘validity functions’ which canbe applied to the state elements to assess if theirvalue is within an allowed range

Page 839: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 28

• Checksums are used for damage assessmentin data transmission

• Redundant pointers can be used to check theintegrity of data structures

• Watch dog timers can check for non-terminatingprocesses. If no response after a certain time, aproblem is assumed

Damage assessment techniques

Page 840: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Java class with damageassessment

class RobustArray {// Checks that all the objects in an array of objects// conform to some defined constraintboolean [] checkState ;CheckableObject [] theRobustArray ;

RobustArray (CheckableObject [] theArray){

checkState = new boolean [theArray.length] ;theRobustArray = theArray ;

} //RobustArraypublic void assessDamage () throws ArrayDamagedException{

boolean hasBeenDamaged = false ;

for (int i= 0; i <this.theRobustArray.length ; i ++){

if (! theRobustArray [i].check ()){

checkState [i] = true ;hasBeenDamaged = true ;

}else

checkState [i] = false ;}if (hasBeenDamaged)

throw new ArrayDamagedException () ;} //assessDamage

} // RobustArray

©Ian Sommerville 2000 Dependable Software Development Slide 29

Page 841: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 30

• Forward recovery• Apply repairs to a corrupted system state

• Backward recovery• Restore the system state to a known safe state

• Forward recovery is usually application specific- domain knowledge is required to computepossible state corrections

• Backward error recovery is simpler. Details of asafe state are maintained and this replaces thecorrupted system state

Fault recovery

Page 842: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 31

• Corruption of data coding• Error coding techniques which add redundancy to coded

data can be used for repairing data corrupted duringtransmission

• Redundant pointers• When redundant pointers are included in data structures

(e.g. two-way lists), a corrupted list or filestore may berebuilt if a sufficient number of pointers are uncorrupted

• Often used for database and filesystem repair

Forward recovery

Page 843: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 32

• Transactions are a frequently used method ofbackward recovery. Changes are not applieduntil computation is complete. If an erroroccurs, the system is left in the state precedingthe transaction

• Periodic checkpoints allow system to 'roll-back'to a correct state

Backward recovery

Page 844: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 33

Safe sort procedure

• Sort operation monitors its own execution andassesses if the sort has been correctly executed

• Maintains a copy of its input so that if an erroroccurs, the input is not corrupted

• Based on identifying and handling exceptions

• Possible in this case as ‘valid’ sort is known.However, in many cases it is difficult to writevalidity checks

Page 845: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Safe sort procedure (Java)

class SafeSort {static void sort ( int [] intarray, int order ) throws SortError{

int [] copy = new int [intarray.length];

// copy the input array

for (int i = 0; i < intarray.length ; i++)copy [i] = intarray [i] ;

try {Sort.bubblesort (intarray, intarray.length, order) ;if (order == Sort.ascending)

for (int i = 0; i <= intarray.length-2 ; i++)if (intarray [i] > intarray [i+1])

throw new SortError () ;else

for (int i = 0; i <= intarray.length-2 ; i++)if (intarray [i+1] > intarray [i])

throw new SortError () ;} // try blockcatch (SortError e ){

for (int i = 0; i < intarray.length ; i++)intarray [i] = copy [i] ;

throw new SortError ("Array not sorted") ;} //catch

} // sort} // SafeSort

©Ian Sommerville 2000 Dependable Software Development Slide 34

Page 846: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 35

Key points

• Fault tolerant software can continue in executionin the presence of software faults

• Fault tolerance requires failure detection, damageassessment, recovery and repair

• Defensive programming is an approach to faulttolerance that relies on the inclusion of redundantchecks in a program

• Exception handling facilities simplify the processof defensive programming

Page 847: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 36

Fault tolerant architecture

• Defensive programming cannot cope with faultsthat involve interactions between the hardwareand the software

• Misunderstandings of the requirements may meanthat checks and the associated code are incorrect

• Where systems have high availabilityrequirements, a specific architecture designed tosupport fault tolerance may be required.

• This must tolerate both hardware and softwarefailure

Page 848: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 37

Hardware fault tolerance

• Depends on triple-modular redundancy (TMR)

• There are three replicated identical componentswhich receive the same input and whose outputsare compared

• If one output is different, it is ignored andcomponent failure is assumed

• Based on most faults resulting from componentfailures rather than design faults and a lowprobability of simultaneous component failure

Page 849: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 38

Hardware reliability with TMR

A2

A1

A3

Outputcomparator

Faultmanager

Page 850: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 39

Output selection

• The output comparator is a (relatively) simplehardware unit.

• It compares its input signals and, if one isdifferent from the others, it rejects it. Essentially,selection of the actual output depends on themajority vote.

• The output comparator is connected to a faultmanagement unit that can either try to repair thefaulty unit or take it out of service.

Page 851: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 40

Fault tolerant software architectures

• The success of TMR at providing fault toleranceis based on two fundamental assumptions• The hardware components do not include common design faults

• Components fail randomly and there is a low probability ofsimultaneous component failure

• Neither of these assumptions are true for software• It isn’t possible simply to replicate the same component as they

would have common design faults

• Simultaneous component failure is therefore virtually inevitable

• Software systems must therefore be diverse

Page 852: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 41

Design diversity

• Different versions of the system are designed andimplemented in different ways. They thereforeought to have different failure modes.

• Different approaches to design (e.g object-oriented and function oriented)• Implementation in different programming languages

• Use of different tools and development environments

• Use of different algorithms in the implementation

Page 853: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 42

Software analogies to TMR

• N-version programming• The same specification is implemented in a number of

different versions by different teams. All versions computesimultaneously and the majority output is selected using a votingsystem..

• This is the most commonly used approach e.g. in Airbus320.

• Recovery blocks• A number of explicitly different versions of the same

specification are written and executed in sequence

• An acceptance test is used to select the output to be transmitted.

Page 854: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 43

N-version programming

Version 2

Version 1

Version 3

Outputcomparator

N-versions

Agreedresult

Page 855: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 44

Output comparison

• As in hardware systems, the output comparator isa simple piece of software that uses a votingmechanism to select the output.

• In real-time systems, there may be a requirementthat the results from the different versions are allproduced within a certain time frame.

Page 856: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 45

N-version programming

• The different system versions are designed andimplemented by different teams. It is assumedthat there is a low probability that they will makethe same mistakes. The algorithms used shouldbut may not be different.

• There is some empirical evidence that teamscommonly misinterpret specifications in the sameway and chose the same algorithms in theirsystems.

Page 857: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 46

Recovery blocks

Acceptancetest

Algorithm 2

Algorithm 1

Algorithm 3

Recoveryblocks

Test forsuccess

Retest

Retry

Retest

Try algorithm1

Continue execution ifacceptance test succeedsSignal exception if allalgorithms fail

Acceptance testfails – re-try

Page 858: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 47

Recovery blocks

• Force a different algorithm to be used for eachversion so they reduce the probability of commonerrors

• However, the design of the acceptance test isdifficult as it must be independent of thecomputation used

• There are problems with this approach for real-time systems because of the sequential operationof the redundant versions

Page 859: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 48

Problems with design diversity

• Teams are not culturally diverse so they tend totackle problems in the same way

• Characteristic errors• Different teams make the same mistakes. Some parts of an

implementation are more difficult than others so all teams tendto make mistakes in the same place.

• Specification errors

• If there is an error in the specification then this is reflected in allimplementations

• This can be addressed to some extent by using multiplespecification representations

Page 860: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 49

Specification dependency

• Both approaches to software redundancy aresusceptible to specification errors. If thespecification is incorrect, the system could fail

• This is also a problem with hardware but softwarespecifications are usually more complex thanhardware specifications and harder to validate

• This has been addressed in some cases bydeveloping separate software specifications fromthe same user specification

Page 861: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 50

Is software redundancy needed?

• Unlike hardware, software faults are not aninevitable consequence of the physical world

• Some people therefore believe that a higher levelof reliability and availability can be attained byinvesting effort in reducing software complexity.

• Redundant software is much more complex sothere is scope for a range of additional errors thataffect the system reliability but are caused by theexistence of the fault-tolerance controllers.

Page 862: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 51

• Dependability in a system can be achievedthrough fault avoidance and fault tolerance

• Some programming language constructs suchas gotos, recursion and pointers are inherentlyerror-prone

• Data typing allows many potential faults to betrapped at compile time.

Key points

Page 863: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Dependable Software Development Slide 52

Key points

• Fault tolerant architectures rely on replicatedhardware and software components

• The include mechanisms to detect a faultycomponent and to switch it out of the system

• N-version programming and recovery blocks aretwo different approaches to designing fault-tolerant software architectures

• Design diversity is essential for softwareredundancy

Page 864: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 1

Verification and Validation

l Assuring that a software systemmeets a user's needs

Page 865: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 2

Objectives

l To introduce software verification and validationand to discuss the distinction between them

l To describe the program inspection process andits role in V & V

l To explain static analysis as a verificationtechnique

l To describe the Cleanroom software developmentprocess

Page 866: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 3

Topics covered

l Verification and validation planning

l Software inspections

l Automated static analysis

l Cleanroom software development

Page 867: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 4

l Verification:"Are we building the product right"

l The software should conform to its specification

l Validation: "Are we building the right product"

l The software should do what the user reallyrequires

Verification vs validation

Page 868: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 5

l Is a whole life-cycle process - V & V must beapplied at each stage in the software process.

l Has two principal objectives• The discovery of defects in a system

• The assessment of whether or not the system is usable inan operational situation.

The V & V process

Page 869: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 6

l Software inspections Concerned with analysis ofthe static system representation to discoverproblems (static verification)• May be supplement by tool-based document and code analysis

l Software testing Concerned with exercising andobserving product behaviour (dynamicverification)• The system is executed with test data and its operational

behaviour is observed

Static and dynamic verification

Page 870: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 7

Static and dynamic V&V

Formalspecification

High-leveldesign

Requirementsspecification

Detaileddesign

Program

Prototype Dynamicvalidation

Staticverification

Page 871: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 8

l Can reveal the presence of errors NOT theirabsence

l A successful test is a test which discovers oneor more errors

l The only validation technique for non-functionalrequirements

l Should be used in conjunction with staticverification to provide full V&V coverage

Program testing

Page 872: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 9

l Defect testing• Tests designed to discover system defects.

• A successful defect test is one which reveals the presenceof defects in a system.

• Covered in Chapter 20

l Statistical testing• tests designed to reflect the frequence of user inputs. Used

for reliability estimation.

• Covered in Chapter 21

Types of testing

Page 873: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 10

V& V goals

l Verification and validation should establishconfidence that the software is fit for purpose

l This does NOT mean completely free of defects

l Rather, it must be good enough for its intendeduse and the type of use will determine the degreeof confidence that is needed

Page 874: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 11

V & V confidence

l Depends on system’s purpose, user expectationsand marketing environment• Software function

» The level of confidence depends on how critical the software is toan organisation

• User expectations» Users may have low expectations of certain kinds of software

• Marketing environment» Getting a product to market early may be more important than

finding defects in the program

Page 875: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 12

l Defect testing and debugging are distinctprocesses

l Verification and validation is concerned withestablishing the existence of defects in a program

l Debugging is concerned with locating andrepairing these errors

l Debugging involves formulating a hypothesisabout program behaviour then testing thesehypotheses to find the system error

Testing and debugging

Page 876: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 13

The debugging process

Locateerror

Designerror repair

Repairerror

Re-testprogram

Testresults Specification Test

cases

Page 877: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 14

l Careful planning is required to get the most out oftesting and inspection processes

l Planning should start early in the developmentprocess

l The plan should identify the balance betweenstatic verification and testing

l Test planning is about defining standards for thetesting process rather than describing producttests

V & V planning

Page 878: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 15

The V-model of development

Requirementsspecification

Systemspecification

Systemdesign

Detaileddesign

Module andunit codeand tess

Sub-systemintegrationtest plan

Systemintegrationtest plan

Acceptancetest plan

ServiceAcceptance

testSystem

integration testSub-system

integration test

Page 879: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 16

The structure of a software test plan

l The testing process

l Requirements traceability

l Tested items

l Testing schedule

l Test recording procedures

l Hardware and software requirements

l Constraints

Page 880: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 17

Software inspections

l Involve people examining the sourcerepresentation with the aim of discoveringanomalies and defects

l Do not require execution of a system so may beused before implementation

l May be applied to any representation of thesystem (requirements, design, test data, etc.)

l Very effective technique for discovering errors

Page 881: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 18

Inspection success

l Many diffreent defects may be discovered in asingle inspection. In testing, one defect ,maymask another so several executions are required

l The reuse domain and programming knowledgeso reviewers are likely to have seen the types oferror that commonly arise

Page 882: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 19

Inspections and testing

l Inspections and testing are complementary andnot opposing verification techniques

l Both should be used during the V & V process

l Inspections can check conformance with aspecification but not conformance with thecustomer’s real requirements

l Inspections cannot check non-functionalcharacteristics such as performance, usability, etc.

Page 883: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 20

Program inspections

l Formalised approach to document reviews

l Intended explicitly for defect DETECTION (notcorrection)

l Defects may be logical errors, anomalies in thecode that might indicate an erroneous condition(e.g. an uninitialised variable) or non-compliancewith standards

Page 884: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 21

Inspection pre-conditions

l A precise specification must be available

l Team members must be familiar with theorganisation standards

l Syntactically correct code must be available

l An error checklist should be prepared

l Management must accept that inspection willincrease costs early in the software process

l Management must not use inspections for staffappraisal

Page 885: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 22

The inspection process

Inspectionmeeting

Individualpreparation

Overview

Planning

Rework

Follow-up

Page 886: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 23

Inspection procedure

l System overview presented to inspection team

l Code and associated documents aredistributed to inspection team in advance

l Inspection takes place and discovered errorsare noted

l Modifications are made to repair discoverederrors

l Re-inspection may or may not be required

Page 887: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 24

Inspection teams

l Made up of at least 4 members

l Author of the code being inspected

l Inspector who finds errors, omissions andinconsistencies

l Reader who reads the code to the team

l Moderator who chairs the meeting and notesdiscovered errors

l Other roles are Scribe and Chief moderator

Page 888: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 25

Inspection checklists

l Checklist of common errors should be used todrive the inspection

l Error checklist is programming languagedependent

l The 'weaker' the type checking, the larger thechecklist

l Examples: Initialisation, Constant naming, looptermination, array bounds, etc.

Page 889: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Inspection checks

Fault class Inspection checkData faults Are all program variables initialised before their values

are used?Have all constants been named?Should the lower bound of arrays be 0, 1, or somethingelse? Should the upper bound of arrays be equal to the size ofthe array or Size -1?If character strings are used, is a delimiter explicitlyassigned?

Control faults For each conditional statement, is the condition correct?Is each loop certain to terminate?Are compound statements correctly bracketed?In case statements, are all possible cases accounted for?

Input/output faults Are all input variables used?Are all output variables assigned a value before they areoutput?

Interface faults Do all function and procedure calls have the correctnumber of parameters?Do formal and actual parameter types match? Are the parameters in the right order? If components access shared memory, do they have thesame model of the shared memory structure?

Storage managementfaults

If a linked structure is modified, have all links beencorrectly reassigned?If dynamic storage is used, has space been allocatedcorrectly?Is space explicitly de-allocated after it is no longerrequired?

Exceptionmanagement faults

Have all possible error conditions been taken intoaccount?

Page 890: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 27

Inspection rate

l 500 statements/hour during overview

l 125 source statement/hour during individualpreparation

l 90-125 statements/hour can be inspected

l Inspection is therefore an expensive process

l Inspecting 500 lines costs about 40 man/hourseffort = £2800

Page 891: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 28

Automated static analysis

l Static analysers are software tools for source textprocessing

l They parse the program text and try to discoverpotentially erroneous conditions and bring theseto the attention of the V & V team

l Very effective as an aid to inspections. Asupplement to but not a replacement forinspections

Page 892: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 29

Static analysis checksFault class Static analysis check

Data faults Variables used before initialisationVariables declared but never usedVariables assigned twice but never usedbetween assignmentsPossible array bound violations Undeclared variables

Control faults Unreachable codeUnconditional branches into loops

Input/output faults Variables output twice with no interveningassignment

Interface faults Parameter type mismatchesParameter number mismatchesNon-usage of the results of functionsUncalled functions and procedures

Storage managementfaults

Unassigned pointersPointer arithmetic

Page 893: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 30

Stages of static analysis

l Control flow analysis. Checks for loops withmultiple exit or entry points, finds unreachablecode, etc.

l Data use analysis. Detects uninitialisedvariables, variables written twice without anintervening assignment, variables which aredeclared but never used, etc.

l Interface analysis. Checks the consistency ofroutine and procedure declarations and theiruse

Page 894: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 31

Stages of static analysis

l Information flow analysis. Identifies thedependencies of output variables. Does notdetect anomalies itself but highlightsinformation for code inspection or review

l Path analysis. Identifies paths through theprogram and sets out the statements executed inthat path. Again, potentially useful in the reviewprocess

l Both these stages generate vast amounts ofinformation. Must be used with care.

Page 895: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

LINT static analysis

138% more lint_ex.c

#include <stdio.h>printarray (Anarray) int Anarray;{ printf(“%d”,Anarray);}main (){ int Anarray[5]; int i; char c; printarray (Anarray, i, c); printarray (Anarray) ;}

139% cc lint_ex.c140% lint lint_ex.c

lint_ex.c(10): warning: c may be used before setlint_ex.c(10): warning: i may be used before setprintarray: variable # of args. lint_ex.c(4) :: lint_ex.c(10)printarray, arg. 1 used inconsistently lint_ex.c(4) ::lint_ex.c(10)printarray, arg. 1 used inconsistently lint_ex.c(4) ::lint_ex.c(11)printf returns value which is always ignored

Page 896: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 33

Use of static analysis

l Particularly valuable when a language such as Cis used which has weak typing and hence manyerrors are undetected by the compiler

l Less cost-effective for languages like Java thathave strong type checking and can thereforedetect many errors during compilation

Page 897: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 34

l The name is derived from the 'Cleanroom'process in semiconductor fabrication. Thephilosophy is defect avoidance rather thandefect removal

l Software development process based on:• Incremental development

• Formal specification.

• Static verification using correctness arguments

• Statistical testing to determine program reliability.

Cleanroom software development

Page 898: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 35

The Cleanroom process

Constructstructuredprogram

Definesoftware

increments

Formallyverifycode

Integrateincrement

Formallyspecifysystem

Developoperational

profileDesign

statisticaltests

Testintegrated

system

Error rework

Page 899: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 36

Cleanroom process characteristics

l Formal specification using a state transitionmodel

l Incremental development

l Structured programming - limited control andabstraction constructs are used

l Static verification using rigorous inspections

l Statistical testing of the system (covered in Ch.21).

Page 900: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 37

Incremental development

Formalspecification

Develop s/wincrement

Establishrerquirements

Deliversoftware

Frozenspecification

Requirements change request

Page 901: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 38

Formal specification and inspections

l The state based model is a system specificationand the inspection process checks the programagainst this model

l Programming approach is defined so that thecorrespondence between the model and thesystem is clear

l Mathematical arguments (not proofs) are used toincrease confidence in the inspection process

Page 902: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 39

l Specification team. Responsible for developingand maintaining the system specification

l Development team. Responsible fordeveloping and verifying the software. Thesoftware is NOT executed or even compiledduring this process

l Certification team. Responsible for developinga set of statistical tests to exercise the softwareafter development. Reliability growth modelsused to determine when reliability is acceptable

Cleanroom process teams

Page 903: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 40

l Results in IBM have been very impressive withfew discovered faults in delivered systems

l Independent assessment shows that theprocess is no more expensive than otherapproaches

l Fewer errors than in a 'traditional' developmentprocess

l Not clear how this approach can be transferredto an environment with less skilled or lesshighly motivated engineers

Cleanroom process evaluation

Page 904: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 41

Key points

l Verification and validation are not the same thing.Verification shows conformance withspecification; validation shows that the programmeets the customer’s needs

l Test plans should be drawn up to guide the testingprocess.

l Static verification techniques involve examinationand analysis of the program for error detection

Page 905: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 19 Slide 42

Key points

l Program inspections are very effective indiscovering errors

l Program code in inspections is checked by asmall team to locate software faults

l Static analysis tools can discover programanomalies which may be an indication of faults inthe code

l The Cleanroom development process depends onincremental development, static verification andstatistical testing

Page 906: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 1

Defect testing

l Testing programs to establishthe presence of system defects

Page 907: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 2

Objectives

l To understand testing techniques that are gearedto discover program faults

l To introduce guidelines for interface testing

l To understand specific approaches to object-oriented testing

l To understand the principles of CASE toolsupport for testing

Page 908: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 3

Topics covered

l Defect testing

l Integration testing

l Object-oriented testing

l Testing workbenches

Page 909: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 4

The testing process

l Component testing• Testing of individual program components

• Usually the responsibility of the component developer (exceptsometimes for critical systems)

• Tests are derived from the developer’s experience

l Integration testing• Testing of groups of components integrated to create a system or

sub-system

• The responsibility of an independent testing team

• Tests are based on a system specification

Page 910: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 5

Testing phases

Componenttesting

Integrationtesting

Software developer Independent testing team

Page 911: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 6

Defect testing

l The goal of defect testing is to discover defects inprograms

l A successful defect test is a test which causes aprogram to behave in an anomalous way

l Tests show the presence not the absence ofdefects

Page 912: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 7

l Only exhaustive testing can show a program isfree from defects. However, exhaustive testingis impossible

l Tests should exercise a system's capabilitiesrather than its components

l Testing old capabilities is more important thantesting new capabilities

l Testing typical situations is more important thanboundary value cases

Testing priorities

Page 913: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 8

l Test data Inputs which have been devised totest the system

l Test cases Inputs to test the system and thepredicted outputs from these inputs if thesystem operates according to its specification

Test data and test cases

Page 914: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 9

The defect testing process

Design testcases

Prepare testdata

Run programwith test data

Compare resultsto test cases

Testcases

Testdata

Testresults

Testreports

Page 915: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 10

Black-box testing

l An approach to testing where the program isconsidered as a ‘black-box’

l The program test cases are based on the systemspecification

l Test planning can begin early in the softwareprocess

Page 916: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 11

Black-box testing

Ie

Input test data

OeOutput test results

System

Inputs causinganomalousbehaviour

Outputs which revealthe presence ofdefects

Page 917: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 12

Equivalence partitioning

l Input data and output results often fall intodifferent classes where all members of a class arerelated

l Each of these classes is an equivalence partitionwhere the program behaves in an equivalent wayfor each class member

l Test cases should be chosen from each partition

Page 918: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 13

Equivalence partitioning

System

Outputs

Invalid inputs Valid inputs

Page 919: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 14

l Partition system inputs and outputs into‘equivalence sets’• If input is a 5-digit integer between 10,000 and 99,999,

equivalence partitions are <10,000, 10,000-99, 999 and >10, 000

l Choose test cases at the boundary of thesesets• 00000, 09999, 10000, 99999, 10001

Equivalence partitioning

Page 920: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 15

Equivalence partitions

Between 10000 and 99999Less than 10000 More than 99999

999910000 50000

10000099999

Input values

Between 4 and 10Less than 4 More than 10

34 7

1110

Number of input values

Page 921: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 16

Search routine specification

procedure Search (Key : ELEM ; T: ELEM_ARRAY; Found : in out BOOLEAN; L: in out ELEM_INDEX) ;

Pre-condition-- the array has at least one elementT’FIRST <= T’LAST

Post-condition-- the element is found and is referenced by L( Found and T (L) = Key)

or -- the element is not in the array( not Found and

not (exists i, T’FIRST >= i <= T’LAST, T (i) = Key ))

Page 922: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 17

l Inputs which conform to the pre-conditions

l Inputs where a pre-condition does not hold

l Inputs where the key element is a member ofthe array

l Inputs where the key element is not a memberof the array

Search routine - input partitions

Page 923: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 18

Testing guidelines (sequences)

l Test software with sequences which have only asingle value

l Use sequences of different sizes in different tests

l Derive tests so that the first, middle and lastelements of the sequence are accessed

l Test with sequences of zero length

Page 924: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 19

Search routine - input partitionsArray ElementSingle value In sequenceSingle value Not in sequenceMore than 1 value First element in sequenceMore than 1 value Last element in sequenceMore than 1 value Middle element in sequenceMore than 1 value Not in sequence

Input sequence (T) Key (Key) Output (Found, L)17 17 true, 117 0 false, ??17, 29, 21, 23 17 true, 141, 18, 9, 31, 30, 16, 45 45 true, 717, 18, 21, 23, 29, 41, 38 23 true, 421, 23, 29, 33, 38 25 false, ??

Page 925: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 20

l Sometime called white-box testing

l Derivation of test cases according to programstructure. Knowledge of the program is used toidentify additional test cases

l Objective is to exercise all program statements(not all path combinations)

Structural testing

Page 926: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 21

White-box testing

Componentcode

Testoutputs

Test data

DerivesTests

Page 927: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Binary search (Java)

class BinSearch {

// This is an encapsulation of a binary search function that takes an array of// ordered objects and a key and returns an object with 2 attributes namely// index - the value of the array index// found - a boolean indicating whether or not the key is in the array// An object is returned because it is not possible in Java to pass basic types by// reference to a function and so return two values// the key is -1 if the element is not found

public static void search ( int key, int [] elemArray, Result r ){

int bottom = 0 ;int top = elemArray.length - 1 ;int mid ;r.found = false ; r.index = -1 ;while ( bottom <= top ){

mid = (top + bottom) / 2 ;if (elemArray [mid] == key){

r.index = mid ;r.found = true ;return ;

} // if partelse{

if (elemArray [mid] < key)bottom = mid + 1 ;

elsetop = mid - 1 ;

}} //while loop

} // search} //BinSearch

Page 928: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 23

l Pre-conditions satisfied, key element in array

l Pre-conditions satisfied, key element not inarray

l Pre-conditions unsatisfied, key element in array

l Pre-conditions unsatisfied, key element not inarray

l Input array has a single value

l Input array has an even number of values

l Input array has an odd number of values

Binary search - equiv. partitions

Page 929: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 24

Binary search equiv. partitions

Mid-point

Elements < Mid Elements > Mid

Equivalence class boundaries

Page 930: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 25

Binary search - test cases

Input array (T) Key (Key) Output (Found, L)17 17 true, 117 0 false, ??17, 21, 23, 29 17 true, 19, 16, 18, 30, 31, 41, 45 45 true, 717, 18, 21, 23, 29, 38, 41 23 true, 417, 18, 21, 23, 29, 33, 38 21 true, 312, 18, 21, 23, 32 23 true, 421, 23, 29, 33, 38 25 false, ??

Page 931: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 26

Path testing

l The objective of path testing is to ensure that theset of test cases is such that each path through theprogram is executed at least once

l The starting point for path testing is a programflow graph that shows nodes representingprogram decisions and arcs representing the flowof control

l Statements with conditions are therefore nodes inthe flow graph

Page 932: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 27

l Describes the program control flow. Each branchis shown as a separate path and loops are shownby arrows looping back to the loop conditionnode

l Used as a basis for computing the cyclomaticcomplexity

l Cyclomatic complexity = Number of edges -Number of nodes +2

Program flow graphs

Page 933: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 28

l The number of tests to test all controlstatements equals the cyclomatic complexity

l Cyclomatic complexity equals number ofconditions in a program

l Useful if used with care. Does not implyadequacy of testing.

l Although all paths are executed, all combinationsof paths are not executed

Cyclomatic complexity

Page 934: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Binary search flow graph

1

2

3

4

65

7

while bottom <= top

if (elemArray [mid] == key

(if (elemArray [mid]< key8

9

bottom > top

Page 935: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 30

l 1, 2, 3, 8, 9

l 1, 2, 3, 4, 6, 7, 2

l 1, 2, 3, 4, 5, 7, 2

l 1, 2, 3, 4, 6, 7, 2, 8, 9

l Test cases should be derived so that all of thesepaths are executed

l A dynamic program analyser may be used tocheck that paths have been executed

Independent paths

Page 936: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 31

Integration testing

l Tests complete systems or subsystems composedof integrated components

l Integration testing should be black-box testingwith tests derived from the specification

l Main difficulty is localising errors

l Incremental integration testing reduces thisproblem

Page 937: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 32

Incremental integration testing

T3

T2

T1

T4

T5

A

B

C

D

T2

T1

T3

T4

A

B

C

T1

T2

T3

A

B

Test sequence1

Test sequence2

Test sequence3

Page 938: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 33

Approaches to integration testing

l Top-down testing• Start with high-level system and integrate from the top-down

replacing individual components by stubs where appropriate

l Bottom-up testing• Integrate individual components in levels until the complete

system is created

l In practice, most integration involves acombination of these strategies

Page 939: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 34

Top-down testing

Level 2Level 2Level 2Level 2

Level 1 Level 1Testingsequence

Level 2stubs

Level 3stubs

. . .

Page 940: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 35

Bottom-up testing

Level NLevel NLevel NLevel NLevel N

Level N–1 Level N–1Level N–1

Testingsequence

Testdrivers

Testdrivers

Page 941: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 36

Tetsing approaches

l Architectural validation• Top-down integration testing is better at discovering errors in

the system architecture

l System demonstration• Top-down integration testing allows a limited demonstration at

an early stage in the development

l Test implementation• Often easier with bottom-up integration testing

l Test observation• Problems with both approaches. Extra code may be required to

observe tests

Page 942: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 37

l Takes place when modules or sub-systems areintegrated to create larger systems

l Objectives are to detect faults due to interfaceerrors or invalid assumptions about interfaces

l Particularly important for object-orienteddevelopment as objects are defined by theirinterfaces

Interface testing

Page 943: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 38

Interface testingTestcases

BA

C

Page 944: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 39

Interfaces types

l Parameter interfaces• Data passed from one procedure to another

l Shared memory interfaces• Block of memory is shared between procedures

l Procedural interfaces• Sub-system encapsulates a set of procedures to be called by

other sub-systems

l Message passing interfaces• Sub-systems request services from other sub-systems

Page 945: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 40

Interface errors

l Interface misuse• A calling component calls another component and makes an

error in its use of its interface e.g. parameters in the wrong order

l Interface misunderstanding• A calling component embeds assumptions about the behaviour

of the called component which are incorrect

l Timing errors• The called and the calling component operate at different speeds

and out-of-date information is accessed

Page 946: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 41

Interface testing guidelines

l Design tests so that parameters to a calledprocedure are at the extreme ends of their ranges

l Always test pointer parameters with null pointers

l Design tests which cause the component to fail

l Use stress testing in message passing systems

l In shared memory systems, vary the order inwhich components are activated

Page 947: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 42

Stress testing

l Exercises the system beyond its maximum designload. Stressing the system often causes defects tocome to light

l Stressing the system test failure behaviour..Systems should not fail catastrophically. Stresstesting checks for unacceptable loss of service ordata

l Particularly relevant to distributed systemswhich can exhibit severe degradation as anetwork becomes overloaded

Page 948: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 43

l The components to be tested are object classesthat are instantiated as objects

l Larger grain than individual functions soapproaches to white-box testing have to beextended

l No obvious ‘top’ to the system for top-downintegration and testing

Object-oriented testing

Page 949: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 44

Testing levels

l Testing operations associated with objects

l Testing object classes

l Testing clusters of cooperating objects

l Testing the complete OO system

Page 950: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 45

Object class testing

l Complete test coverage of a class involves• Testing all operations associated with an object

• Setting and interrogating all object attributes

• Exercising the object in all possible states

l Inheritance makes it more difficult to designobject class tests as the information to be tested isnot localised

Page 951: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 46

Weather station object interface

l Test cases are needed for alloperations

l Use a state model to identifystate transitions for testing

l Examples of testingsequences

• Shutdown ♦ Waiting ♦ Shutdown

• Waiting ♦ Calibrating ♦ Testing ♦Transmitting ♦ Waiting

• Waiting ♦ Collecting ♦ Waiting ♦Summarising ♦ Transmitting ♦ Waiting

identifier

reportWeather ()calibrate (instruments)test ()startup (instruments)shutdown (instruments)

WeatherStation

Page 952: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 47

Object integration

l Levels of integration are less distinct in object-oriented systems

l Cluster testing is concerned with integrating andtesting clusters of cooperating objects

l Identify clusters using knowledge of the operationof objects and the system features that areimplemented by these clusters

Page 953: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 48

Approaches to cluster testing

l Use-case or scenario testing• Testing is based on a user interactions with the system

• Has the advantage that it tests system features as experienced byusers

l Thread testing• Tests the systems response to events as processing threads

through the system

l Object interaction testing• Tests sequences of object interactions that stop when an object

operation does not call on services from another object

Page 954: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 49

Scenario-based testing

l Identify scenarios from use-cases and supplementthese with interaction diagrams that show theobjects involved in the scenario

l Consider the scenario in the weather stationsystem where a report is generated

Page 955: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 50

Collect weather data:CommsController

request (report)

acknowledge ()report ()

summarise ()

reply (report)

acknowledge ()

send (report)

:WeatherStation :WeatherData

Page 956: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 51

Weather station testing

l Thread of methods executed• CommsController:request ♦ WeatherStation:report ♦

WeatherData:summarise

l Inputs and outputs• Input of report request with associated acknowledge and a final

output of a report

• Can be tested by creating raw data and ensuring that it issummarised properly

• Use the same raw data to test the WeatherData object

Page 957: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 52

Testing workbenches

l Testing is an expensive process phase. Testingworkbenches provide a range of tools to reducethe time required and total testing costs

l Most testing workbenches are open systemsbecause testing needs are organisation-specific

l Difficult to integrate with closed design andanalysis workbenches

Page 958: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 53

A testing workbench

Dynamicanalyser

Programbeing tested

Testresults

Testpredictions

Filecomparator

Executionreport

Simulator

Sourcecode

Testmanager Test data Oracle

Test datagenerator Specification

Reportgenerator

Test resultsreport

Page 959: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 54

Tetsing workbench adaptation

l Scripts may be developed for user interfacesimulators and patterns for test data generators

l Test outputs may have to be prepared manuallyfor comparison

l Special-purpose file comparators may bedeveloped

Page 960: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 55

Key points

l Test parts of a system which are commonly usedrather than those which are rarely executed

l Equivalence partitions are sets of test cases wherethe program should behave in an equivalent way

l Black-box testing is based on the systemspecification

l Structural testing identifies test cases which causeall paths through the program to be executed

Page 961: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 20 Slide 56

Key points

l Test coverage measures ensure that all statementshave been executed at least once.

l Interface defects arise because of specificationmisreading, misunderstanding, errors or invalidtiming assumptions

l To test object classes, test all operations,attributes and states

l Integrate object-oriented systems around clustersof objects

Page 962: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 1

Critical Systems Validation

Validating the reliability, safetyand security of computer-based

systems

Page 963: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 2

Validation perspectives

• Reliability validation• Does the measured reliability of the system meet its

specification?

• Is the reliability of the system good enough to satisfy users?

• Safety validation• Does the system always operate in such a way that accidents do

not occur or that accident consequences are minimised?

• Security validation• Is the system and its data secure against external attack?

Page 964: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 3

Validation techniques

• Static techniques• Design reviews and program inspections

• Mathematical arguments and proof

• Dynamic techniques• Statistical testing

• Scenario-based testing

• Run-time checking

• Process validation• Design development processes that minimise the chances of

process errors that might compromise the dependability of thesystem

Page 965: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 4

Static validation techniques

• Static validation is concerned with analyses ofthe system documentation (requirements, design,code, test data).

• It is concerned with finding errors in the systemand identifying potential problems that may ariseduring system execution.

• Documents may be prepared (structuredarguments, mathematical proofs, etc.) to supportthe static validation

Page 966: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 5

Static techniques for safety validation

• Demonstrating safety by testing is difficultbecause testing is intended to demonstrate whatthe system does in a particular situation. Testingall possible operational situations is impossible

• Normal reviews for correctness may besupplemented by specific techniques that areintended to focus on checking that unsafesituations never arise

Page 967: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 6

Safety reviews

• Review for correct intended function

• Review for maintainable, understandablestructure

• Review to verify algorithm and data structuredesign against specification

• Review to check code consistency with algorithmand data structure design

• Review adequacy of system testing

Page 968: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 7

• Make software as simple as possible

• Use simple techniques for software developmentavoiding error-prone constructs such as pointersand recursion

• Use information hiding to localise the effect ofany data corruption

• Make appropriate use of fault-tolerant techniquesbut do not be seduced into thinking that fault-tolerant software is necessarily safe

Review guidance

Page 969: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 8

Hazard-driven analysis

• Effective safety assurance relies on hazardidentification (covered in previous lectures)

• Safety can be assured by• Hazard avoidance

• Accident avoidance

• Protection systems

• Safety reviews should demonstrate that one ormore of these techniques have been applied to allidentified hazards

Page 970: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 9

The system safety case

• It is now normal practice for a formal safety case to berequired for all safety-critical computer-based systemse.g. railway signalling, air traffic control, etc.

• A safety case presents a list of arguments, based onidentified hazards, why there is an acceptably lowprobability that these hazards will not result in anaccident

• Arguments can be based on formal proof, designrationale, safety proofs, etc. Process factors may also beincluded

Page 971: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 10

Formal methods and critical systems

• The development of critical systems is one of the‘success’ stories for formal methods

• Formal methods are mandated in Britain for thedevelopment of some types of safety-critical softwarefor defence applications

• There is not currently general agreement on the valueof formal methods in critical systems development

Page 972: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 11

Formal methods and validation

• Specification validation• Developing a formal model of a system requirements

specification forces a detailed analysis of that specification andthis usually reveals errors and omissions

• Mathematical analysis of the formal specification is possibleand this also discovers specification problems

• Formal verification• Mathematical arguments (at varying degrees of rigour) are used

to demonstrate that a program or a design is consistent with itsformal specification

Page 973: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 12

Problems with formal validation

• The formal model of the specification is notunderstandable by domain experts• It is difficult or impossible to check if the formal model is an

accurate representation of the specification for most systems

• A consistently wrong specification is not useful!

• Verification does not scale-up• Verification is complex, error-prone and requires the use of

systems such as theorem provers. The cost of verificationincreases exponentially as the system size increases.

Page 974: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 13

Formal methods conclusion

• Formal specification and checking of criticalsystem components is, in my view, useful• While formality does not provide any guarantees, it helps to

increase confidence in the system by demonstrating that someclasses of error are not present

• Formal verification is only likely to be used forvery small, critical, system components• About 5-6000 lines of code seems to be the upper limit for

practical verification

Page 975: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 14

Safety proofs

• Safety proofs are intended to show that thesystem cannot reach in unsafe state

• Weaker than correctness proofs which must showthat the system code conforms to its specification

• Generally based on proof by contradiction• Assume that an unsafe state can be reached

• Show that this is contradicted by the program code

• May be displayed graphically

Page 976: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 15

Construction of a safety proof

• Establish the safe exit conditions for a componentor a program

• Starting from the END of the code, workbackwards until you have identified all paths thatlead to the exit of the code

• Assume that the exit condition is false

• Show that, for each path leading to the exit thatthe assignments made in that path contradict theassumption of an unsafe exit from the component

Page 977: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 16

Gas warning system

• System to warn of poisonous gas. Consists of asensor, a controller and an alarm

• Two levels of gas are hazardous• Warning level - no immediate danger but take action to reduce

level

• Evacuate level - immediate danger. Evacuate the area

• The controller takes air samples, computes thegas level and then decides whether or not thealarm should be activated

Page 978: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 17

Gas sensor control

Gas_level: GL_TYPE ;loop

-- Take 100 samples of airGas_level := 0.000 ;for i in 1..100 loop

Gas_level := Gas_level + Gas_sensor.Read ;end loop ;Gas_level := Gas_level / 100 ;if Gas_level > Warning and Gas_level < Danger then

Alarm := Warning ; Wait_for_reset ;elsif Gas_level > Danger then

Alarm := Evacuate ; Wait_for_reset ;else

Alarm := off ;end if ;

end loop ;

Page 979: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 18

Graphical argument

Gas_level > Warning and Alarm = off Unsafe state

Gas_level > Warning andGas_level < Danger

Gas_level > Danger

Alarm = WarningAlarm = Evacuate Alarm = off

or or or

contradiction contradiction

Path 1 Path 2 Path 3

Page 980: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 19

Condition checking

Gas_level < Warning Path 3 Alarm = off (Contradiction)Gas_level = Warning Path 3 Alarm = off (Contradiction)Gas_level > Warning andGas_level < Danger

Path 1 Alarm = Warning(Contradiction)

Gas_level = Danger Path 3 Alarm = offGas_level > Danger Path 2 Alarm = Evacuate

(Contradiction)

Code is incorrect. Gas_level = Danger does not cause the alarm to be on

Page 981: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 20

Key points

• Safety-related systems should be developed to be assimple as possible using ‘safe’ development techniques

• Safety assurance may depend on ‘trusted’ developmentprocesses and specific development techniques such asthe use of formal methods and safety proofs

• Safety proofs are easier than proofs of consistency orcorrectness. They must demonstrate that the systemcannot reach an unsafe state. Usually proofs bycontradiction

Page 982: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 21

Dynamic validation techniques

• These are techniques that are concerned withvalidating the system in execution• Testing techniques - analysing the system outside of its

operational environment

• Run-time checking - checking during execution that the systemis operating within a dependability ‘envelope’

Page 983: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 22

Reliability validation

• Reliability validation involves exercising theprogram to assess whether or not it has reachedthe required level of reliability

• Cannot be included as part of a normal defecttesting process because data for defect testing is(usually) atypical of actual usage data

• Statistical testing must be used where astatistically significant data sample based onsimulated usage is used to assess the reliability

Page 984: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 23

• Testing software for reliability rather than fault detection

• Measuring the number of errors allows the reliability ofthe software to be predicted. Note that, for statisticalreasons, more errors than are allowed for in thereliability specification must be induced

• An acceptable level of reliability should bespecified and the software tested and amendeduntil that level of reliability is reached

Statistical testing

Page 985: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 24

Reliability validation process

• Establish the operational profile for the system

• Construct test data reflecting the operationalprofile

• Test the system and observe the number offailures and the times of these failures

• Compute the reliability after a statisticallysignificant number of failures have beenobserved

Page 986: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 25

Operational profiles

• An operational profile is a set of test data whosefrequency matches the actual frequency of these inputsfrom ‘normal’ usage of the system. A close match withactual usage is necessary otherwise the measuredreliability will not be reflected in the actual usage of thesystem

• Can be generated from real data collected from anexisting system or (more often) depends on assumptionsmade about the pattern of usage of a system

Page 987: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 26

An operational profile

Numberof inputs

Inputclasses

Page 988: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 27

Operational profile generation

• Should be generated automatically wheneverpossible

• Automatic profile generation is difficult forinteractive systems

• May be straightforward for ‘normal’ inputs but itis difficult to predict ‘unlikely’ inputs and tocreate test data for them

Page 989: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 28

• A reliability growth model is a mathematical modelof the system reliability change as it is tested andfaults are removed

• Used as a means of reliability prediction byextrapolating from current data• Simplifies test planning and customer negotiations

• Depends on the use of statistical testing to measurethe reliability of a system version

Reliability modelling

Page 990: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 29

Equal-step reliability growth

t1 t2 t3 t4 t5

Reliability(ROCOF)

Time

Page 991: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 30

Observed reliability growth

• Simple equal-step model but does not reflectreality

• Reliability does not necessarily increase withchange as the change can introduce new faults

• The rate of reliability growth tends to slow downwith time as frequently occurring faults arediscovered and removed from the software

• A random-growth model may be more accurate

Page 992: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 31

Random-step reliability growth

t1 t2 t3 t4 t5

Time

Note differentreliabilityimprovements Fault repair adds new fault

and decreases reliability(increases ROCOF)

Reliability(ROCOF)

Page 993: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 32

Growth model selection

• Many different reliability growth models havebeen proposed

• No universally applicable growth model

• Reliability should be measured and observed datashould be fitted to several models

• Best-fit model should be used for reliabilityprediction

Page 994: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 33

Reliability prediction

Reliability

Requiredreliability

Fitted reliabilitymodel curve

Estimatedtime of reliability

achievement

Time

= Measured reliability

Page 995: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 34

• Operational profile uncertainty• Is the operational profile an accurate reflection of the real use of

the system

• High costs of test data generation• Very expensive to generate and check the large number of test

cases that are required

• Statistical uncertainty for high-reliability systems• It may be impossible to generate enough failures to draw

statistically valid conclusions

Reliability validation problems

Page 996: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 35

Security validation

• Security validation has something in commonwith safety validation

• It is intended to demonstrate that the systemcannot enter some state (an unsafe or an insecurestate) rather than to demonstrate that the systemcan do something

• However, there are differences• Safety problems are accidental; security problems are deliberate

• Security problems are more generic; Safety problems arerelated to the application domain

Page 997: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 36

Security validation

• Experience-based validation• The system is reviewed and analysed against the types of attack

that are known to the validation team

• Tool-based validation• Various security tools such as password checkers are used to

analyse the system in operation

• Tiger teams• A team is established whose goal is to breach the security of the

system by simulating attacks on the system.

Page 998: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 37

Key points

• Statistical testing supplements the defect testingprocess and is intended to measure the reliability of asystem

• Reliability validation relies on exercising the systemusing an operational profile - a simulated input setwhich matches the actual usage of the system

• Reliability growth modelling is concerned withmodelling how the reliability of a software systemimproves as it is tested and faults are removed

Page 999: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 38

The portable insulin pump

Validating the safety of theinsulin pump system

Page 1000: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 39

Safety validation

• Design validation• Checking the design to ensure that hazards do not arise or that

they can be handled without causing an accident.

• Code validation• Testing the system to check the conformance of the code to its

specification and to check that the code is a true implementationof the design.

• Run-time validation• Designing safety checks while the system is in operation to

ensure that it does not reach an unsafe state.

Page 1001: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 40

• insulin overdose or underdose (biological)

• power failure (electrical)

• machine interferes electrically with other medicalequipment such as a heart pacemaker (electrical)

• parts of machine break off in patient’sbody(physical)

• infection caused by introduction of machine(biol.)

• allergic reaction to the materials or insulin usedin the machine (biol).

Insulin system hazards

Page 1002: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 41

Fault tree for software hazards

Incorrectsugar levelmeasured

Incorrectinsulin doseadministered

or

Correct dosedelivered atwrong time

Sensorfailure

or

Sugarcomputation

error

Timerfailure

Pump signalsincorrect

or

Insulincomputation

incorrect

Deliverysystemfailure

Arithmeticerror

or

Algorithmerror

Arithmeticerror

or

Algorithmerror

Page 1003: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 42

Safety proofs

• Safety proofs are intended to show that thesystem cannot reach in unsafe state

• Weaker than correctness proofs which must showthat the system code conforms to its specification

• Generally based on proof by contradiction• Assume that an unsafe state can be reached

• Show that this is contradicted by the program code

Page 1004: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 43

Insulin delivery system

• Safe state is a shutdown state where no insulin isdelivered• If hazard arises,shutting down the system will prevent an

accident

• Software may be included to detect and preventhazards such as power failure

• Consider only hazards arising from softwarefailure• Arithmetic error The insulin dose is computed incorrectly

because of some failure of the computer arithmetic

• Algorithmic error The dose computation algorithm is incorrect

Page 1005: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 44

• Use language exception handling mechanisms totrap errors as they arise

• Use explicit error checks for all errors which areidentified

• Avoid error-prone arithmetic operations(multiply and divide). Replace with add andsubtract

• Never use floating-point numbers

• Shut down system if exception detected (safestate)

Arithmetic errors

Page 1006: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 45

• Harder to detect than arithmetic errors. Systemshould always err on the side of safety

• Use reasonableness checks for the dose deliveredbased on previous dose and rate of dose change

• Set maximum delivery level in any specified timeperiod

• If computed dose is very high, medicalintervention may be necessary anyway becausethe patient may be ill

Algorithmic errors

Page 1007: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 46

Insulin delivery code// The insulin dose to be delivered is a function of blood sugar level, the previous dose// delivered and the time of delivery of the previous dose

currentDose = computeInsulin () ;

// Safety check - adjust currentDose if necessaryif (previousDose == 0) // if statement 1

{if (currentDose > 16)

currentDose = 16 ;}

elseif (currentDose > (previousDose * 2) )

currentDose = previousDose * 2 ;if ( currentDose < minimumDose ) // if statement 2

currentDose = 0 ; // then branchelse if ( currentDose > maxDose ) // else branch

currentDose = maxDose ;administerInsulin (currentDose) ;

Page 1008: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 47

Informal safety proof

Insulin_dose = 0

Insulin_dose := 0

if statement 2then partexecuted

Insulin_dose =Maximum_dose

Insulin_dose :=Maximum_dose

if statement 2elsif partexecuted

if statement 2not executed

Insulin_dose >= Minimum_dose andInsulin_dose <= Maximum_dose

or

Insulin_dose >Maximum_dose

Administerinsulin

Contradiction

Contradiction Contradiction

Pre-conditionfor unsafe state

Overdoseadministered

See Portrait slide

Page 1009: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 48

System testing

• System testing of the software has to rely onsimulators for the sensor and the insulin deliverycomponents.

• Test for normal operation using an operationalprofile. Can be constructed using data gatheredfrom existing diabetics

• Testing has to include situations where rate ofchange of glucose is very fast and very slow

• Test for exceptions using the simulator

Page 1010: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 49

Safety assertions

• Predicates included in the program indicatingconditions which should hold at that point

• May be based on pre-computed limits e.g.number of insulin pump increments in maximumdose

• Used in formal program inspections or may bepre-processed into safety checks that are executedwhen the system is in operation

Page 1011: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 CS 365 Critical Systems Validation Slide 50

Safety assertions

static void administerInsulin ( ) throws SafetyException{

int maxIncrements = InsulinPump.maxDose / 8 ;int increments = InsulinPump.currentDose / 8 ;

// assert currentDose <= InsulinPump.maxDoseif (InsulinPump.currentDose > InsulinPump.maxDose)

throw new SafetyException (Pump.doseHigh);else

for (int i=1; i<= increments; i++){

generateSignal () ;if (i > maxIncrements)

throw new SafetyException ( Pump.incorrectIncrements);} // for loop

} //administerInsulin

Page 1012: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 1

Managing people

• Managing people working asindividuals and in groups

Page 1013: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 2

Objectives

• To describe simple models of human cognitionand their relevance for software managers

• To explain the key issues that determine thesuccess or otherwise of team working

• To discuss the problems of selecting and retainingtechnical staff

• To introduce the people capability maturity model(P-CMM)

Page 1014: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 3

Topics covered

• Limits to thinking

• Group working

• Choosing and keeping people

• The people capability maturity model

Page 1015: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 4

People in the process

• People are an organisation’s most importantassets

• The tasks of a manager are essentially peopleoriented. Unless there is some understandingof people, management will be unsuccessful

• Software engineering is primarily a cognitiveactivity. Cognitive limitations effectively limit thesoftware process

Page 1016: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 5

Management activities

• Problem solving (using available people)

• Motivating (people who work on a project)

• Planning (what people are going to do)

• Estimating (how fast people will work)

• Controlling (people's activities)

• Organising (the way in which people work)

Page 1017: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 6

Limits to thinking

• People don’t all think the same way but everyoneis subject to some basic constraints on theirthinking due to• Memory organisation

• Knowledge representation

• Motivation influences

• If we understand these constraints, we canunderstand how they affect people participating inthe software process

Page 1018: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 7

Memory organisation

Working memory

Long-term memory(Large capacity, slow access)

Short-termmemory

Fromsenses

Page 1019: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 8

Short-term memory

• Fast access, limited capacity

• 5-7 locations

• Holds 'chunks' of information where the size ofa chunk may vary depending on its familiarity

• Fast decay time

Page 1020: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 9

Working memory

• Larger capacity, longer access time

• Memory area used to integrate information fromshort-term memory and long-term memory.

• Relatively fast decay time.

Page 1021: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 10

Long-term memory

• Slow access, very large capacity

• Unreliable retrieval mechanism

• Slow but finite decay time - information needsreinforced

• Relatively high threshold - work has to be doneto get information into long-term memory.

Page 1022: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 11

Information transfer

• Problem solving usually requires transferbetween short-term memory and workingmemory

• Information may be lost or corrupted during thistransfer

• Information processing occurs in the transferfrom short-term to long-term memory

Page 1023: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 12

Cognitive chunking

Swap if necessary so that smaller comes first

Compare adjacent elements

Loop (process unsorted part of array)

Loop (process entir e array)

Page 1024: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 13

Knowledge modelling

• Semantic knowledge knowledge of conceptssuch as the operation of assignment, conceptof parameter passing etc.

• Syntactic knowledge knowledge of details ofa representation e.g. an Ada while loop.

• Semantic knowledge seems to be stored in astructured, representation independent way.

Page 1025: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 14

Syntactic/semantic knowledge

Task knowledge Computer knowledge

Semantic knowledge Syntactic knowledge

Page 1026: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 15

Knowledge acquisition

• Semantic knowledge through experience andactive learning - the 'ah' factor

• Syntactic knowledge acquired by memorisation.

• New syntactic knowledge can interfere withexisting syntactic knowledge.• Problems arise for experienced programmers in mixing up

syntax of different programming languages

Page 1027: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 16

Semantic knowledge

• Computing concepts - notion of a writablestore, iteration, concept of an object, etc.

• Task concepts - principally algorithmic - how totackle a particular task

• Software development ability is the ability tointegrate new knowledge with existing computerand task knowledge and hence derive creativeproblem solutions

• Thus, problem solving is language independent

Page 1028: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 17

Problem solving

• Requires the integration of different types ofknowledge (computer, task, domain, organisation)

• Development of a semantic model of the solutionand testing of this model against the problem

• Representation of this model in an appropriatenotation or programming language

Page 1029: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 18

Problem solving

New knowledge

Existing knowledge

Long-term memory

Partialsolutions SolutionProblem

Workingmemory

Page 1030: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 19

Motivation

• An important role of a manager is to motivate thepeople working on a project

• Motivation is a complex issue but it appears thattheir are different types of motivation based on• Basic needs (e.g. food, sleep, etc.)

• Personal needs (e.g. respect, self-esteem)

• Social needs (e.g. to be accepted as part of a group)

Page 1031: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 20

Human needs hierarchy

Physiological needs

Safety needs

Social needs

Esteem needs

Self-realization needs

Page 1032: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 21

Motivating people

• Motivations depend on satisfying needs

• It can be assumed that physiological and safetyneeds are satisfied

• Social, esteem and self-realization needs aremost significant from a managerial viewpoint

Page 1033: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 22

Need satisfaction

• Social• Provide communal facilities

• Allow informal communications

• Esteem• Recognition of achievements

• Appropriate rewards

• Self-realization• Training - people want to learn more

• Responsibility

Page 1034: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 23

Personality types

• The needs hierarchy is almost certainly an over-simplification

• Motivation should also take into account differentpersonality types:• Task-oriented

• Self-oriented

• Interaction-oriented

Page 1035: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 24

Personality types

• Task-oriented.• The motivation for doing the work is the work itself

• Self-oriented.• The work is a means to an end which is the achievement of

individual goals - e.g. to get rich, to play tennis, to travel etc.

• Interaction-oriented• The principal motivation is the presence and actions of

co-workers. People go to work because they like to go towork

Page 1036: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 25

Motivation balance

• Individual motivations are made up of elementsof each class

• Balance can change depending on personalcircumstances and external events

• However, people are not just motivated bypersonal factors but also by being part of a groupand culture.

• People go to work because they are motivated bythe people that they work with

Page 1037: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 26

Group working

• Most software engineering is a group activity• The development schedule for most non-trivial software projects

is such that they cannot be completed by one person workingalone

• Group interaction is a key determinant of groupperformance

• Flexibility in group composition is limited• Managers must do the best they can with available people

Page 1038: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 27

Time distribution

50%Interaction with

other people

20%Non-productive

activities

30%Working alone

Page 1039: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 28

Group composition

• Group composed of members who share thesame motivation can be problematic• Task-oriented - everyone wants to do their own thing

• Self-oriented - everyone wants to be the boss

• Interaction-oriented - too much chatting, not enough work

• An effective group has a balance of all types

• Can be difficult to achieve because mostengineers are task-oriented

• Need for all members to be involved in decisionswhich affect the group

Page 1040: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 29

• Leadership depends on respect not titularstatus

• There may be both a technical and anadministrative leader

• Democratic leadership is more effective thatautocratic leadership

• A career path based on technical competenceshould be supported

Group leadership

Page 1041: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 30

Group cohesiveness

• In a cohesive group, members consider the groupto be more important than any individual in it

• Advantages of a cohesive group are:• Group quality standards can be developed

• Group members work closely together so inhibitions caused byignorance are reduced

• Team members learn from each other and get to know eachother’s work

• Egoless programming where members strive to improve eachother’s programs can be practised

Page 1042: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 31

Developing cohesiveness

• Cohesiveness is influenced by factors such as theorganisational culture and the personalities in thegroup

• Cohesiveness can be encouraged through• Social events

• Developing a group identity and territory

• Explicit team-building activities

• Openness with information is a simple way ofensuring all group members feel part of the group

Page 1043: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 32

• Group members tend to be loyal to cohesivegroups

• 'Groupthink' is preservation of groupirrespective of technical or organizationalconsiderations

• Management should act positively to avoidgroupthink by forcing external involvement witheach group

Group loyalties

Page 1044: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 33

Group communications

• Good communications are essential for effectivegroup working

• Information must be exchanged on the status ofwork, design decisions and changes to previousdecisions

• Good communications also strengthens groupcohesion as it promotes understanding

Page 1045: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 34

• Status of group members• Higher status members tend to dominate conversations

• Personalities in groups• Too many people of the same personality type can be a problem

• Sexual composition of group• Mixed-sex groups tend to communicate better

• Communication channels• Communications channelled though a central coordinator tend to

be ineffective

Group communications

Page 1046: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 35

Group organisation

• Software engineering group sizes should berelatively small (< 8 members)

• Break big projects down into multiple smallerprojects

• Small teams may be organised in an informal,democratic way

• Chief programmer teams try to make the mosteffective use of skills and experience

Page 1047: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 36

Democratic team organisation

• The group acts as a whole and comes to aconsensus on decisions affecting the system

• The group leader serves as the external interfaceof the group but does not allocate specific workitems

• Rather, work is discussed by the group as a wholeand tasks are allocated according to ability andexperience

• This approach is successful for groups where allmembers are experienced and competent

Page 1048: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 37

Extreme programming groups

• Extreme programming groups are variants ofdemocratic organisation

• In extreme programming groups, some‘management’ decisions are devolved to groupmembers

• Programmers work in pairs and take a collectiveresponsibility for code that is developed

Page 1049: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 38

Chief programmer teams

Test specialist

Tech. author

OS specialist

Toolsmith

Administrator

Backupprogrammer

Chiefprogrammer

Librarian

Specialist poolNucleus of chief programmer team

OutsideCommunication

Page 1050: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 39

Chief programmer teams

• Consist of a kernel of specialists helped by othersadded to the project as required

• The motivation behind their development is thewide difference in ability in differentprogrammers

• Chief programmer teams provide a supportingenvironment for very able programmers to beresponsible for most of the system development

Page 1051: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 40

Problems

• This chief programmer approach, in differentforms, has undoubtedly been successful

• However, it suffers from a number of problems• Talented designers and programmers are hard to find. Without

exception people in these roles, the approach will fail

• Other group members may resent the chief programmer takingthe credit for success so may deliberately undermine his/her role

• High project risk as the project will fail if both the chief anddeputy programmer are unavailable

• Organisational structures and grades may be unable toaccommodate this type of group

Page 1052: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 41

Choosing and keeping people

• Choosing people to work on a project is a majormanagerial responsibility

• Appointment decisions are usually based on• information provided by the candidate (their resumé or CV)

• information gained at an interview

• recommendations from other people who know the candidate

• Some companies use psychological or aptitudetests• There is no agreement on whether or not these tests are actually

useful

Page 1053: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Staff selectionfactors

Factor ExplanationApplication domainexperience

For a project to develop a successful system, thedevelopers must understand the application domain.

Platform experience May be significant if low-level programming isinvolved. Otherwise, not usually a critical attribute.

Programming languageexperience

Normally only significant for short duration projectswhere there is insufficient time to learn a newlanguage.

Educational background May provide an indicator of the basic fundamentalswhich the candidate should know and of their abilityto learn. This factor becomes increasingly irrelevantas engineers gain experience across a range ofprojects.

Communication ability Very important because of the need for project staff tocommunicate orally and in writing with otherengineers, managers and customers.

Adaptability Adaptability may be judged by looking at the differenttypes of experience which candidates have had. This isan important attribute as it indicates an ability tolearn.

Attitude Project staff should have a positive attitude to theirwork and should be willing to learn new skills. Thisis an important attribute but often very difficult toassess.

Personality Again, an important attribute but difficult to assess.Candidates must be reasonably compatible with otherteam members. No particular type of personality ismore or less suited to software engineering.

Page 1054: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 43

• Physical workplace provision has an importanteffect on individual productivity and satisfaction• Comfort

• Privacy

• Facilities

• Health and safety considerations must be takeninto account• Lighting

• Heating

• Furniture

Working environments

Page 1055: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 44

• Privacy - each engineer requires an area foruninterrupted work

• Outside awareness - people prefer to work innatural light

• Personalization - individuals adopt differentworking practices and like to organize theirenvironment in different ways

Environmental factors

Page 1056: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 45

Workspace organisation

• Workspaces should provide private spaces wherepeople can work without interruption• Providing individual offices for staff has been shown to increase

productivity

• However, teams working together also requirespaces where formal and informal meetings canbe held

Page 1057: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 46

Office layout

Office

Office

Office

Office

Office

Office

Office

OfficeCommunalarea

Meetingroom

Window

Shareddocumentation

Page 1058: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 47

The People Capability Maturity Model

• Intended as a framework for managing thedevelopment of people involved in softwaredevelopment

• Five stage model• Initial. Ad-hoc people management

• Repeatable. Policies developed for capability improvement

• Defined. Standardised people management across theorganisation

• Managed. Quantitative goals for people management in place

• Optimizing. Continuous focus on improving individualcompetence and workforce motivation

Page 1059: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

The People Capability Maturity Model

Continuous workforce innovationCoachingPersonal Competency Development

Organisational Performance AlignmentOrganisational Competency ManagementTeam-based PracticesTeam BuildingMentoring

Managed

Optimizing

Participatory CultureCompetency-based PracticesCareer DevelopmentCompetency DevelopmentWorkforce PlanningKnowledge and Skills Analysis

CompensationTrainingPerformance ManagementStaffingCommunicationWork environment

Initial

Repeatable

Defined

Continuously improve methodsfor developing personal andorganisational competence

Quantitatively manageorganisational growth inworkforce capabilities andestablish competency-basedteams

Identify primarycompetencies andalign workforceactivities with them

Instill basicdiscipline intoworkforceactivities

Page 1060: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 49

P-CMM Objectives

• To improve organisational capability byimproving workforce capability

• To ensure that software development capability isnot reliant on a small number of individuals

• To align the motivation of individuals with that ofthe organisation

• To help retain people with critical knowledge andskills

Page 1061: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 50

Key points

• Managers must have some understanding ofhuman factors to avoid making unrealisticdemands on people

• Problem solving involves integrating informationfrom long-term memory with new informationfrom short-term memory

• Staff selection factors include education, domainexperience, adaptability and personality

Page 1062: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 22 Slide 51

Key points

• Software development groups should be smalland cohesive

• Group communications are affected by status,group size, group organisation and the sexualcomposition of the group

• The working environment has a significant effecton productivity

• The People Capability Maturity Model is aframework for improving the capabilities of staffin an organisation

Page 1063: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 1

Software cost estimation

l Predicting the resourcesrequired for a softwaredevelopment process

Page 1064: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 2

Objectives

l To introduce the fundamentals of softwarecosting and pricing

l To describe three metrics for softwareproductivity assessment

l To explain why different techniques should beused for software estimation

l To describe the COCOMO 2 algorithmic costestimation model

Page 1065: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 3

Topics covered

l Productivity

l Estimation techniques

l Algorithmic cost modelling

l Project duration and staffing

Page 1066: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 4

Fundamental estimation questions

l How much effort is required to complete anactivity?

l How much calendar time is needed to completean activity?

l What is the total cost of an activity?

l Project estimation and scheduling and interleavedmanagement activities

Page 1067: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 5

Software cost components

l Hardware and software costs

l Travel and training costs

l Effort costs (the dominant factor in mostprojects)• salaries of engineers involved in the project

• Social and insurance costs

l Effort costs must take overheads into account• costs of building, heating, lighting

• costs of networking and communications

• costs of shared facilities (e.g library, staff restaurant, etc.)

Page 1068: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 6

Costing and pricing

l Estimates are made to discover the cost, to thedeveloper, of producing a software system

l There is not a simple relationship between thedevelopment cost and the price charged to thecustomer

l Broader organisational, economic, political andbusiness considerations influence the pricecharged

Page 1069: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 7

Software pricing factorsFactor DescriptionMarket opportunity A development organisation may quote a low price

because it wishes to move into a new segment of thesoftware market. Accepting a low profit on oneproject may give the opportunity of more profit later.The experience gained may allow new products to bedeveloped.

Cost estimate uncertainty If an organisation is unsure of its cost estimate, itmay increase its price by some contingency over andabove its normal profit.

Contractual terms A customer may be willing to allow the developer toretain ownership of the source code and reuse it inother projects. The price charged may then be lessthan if the software source code is handed over to thecustomer.

Requirements volatility If the requirements are likely to change, anorganisation may lower its price to win a contract. After the contract is awarded, high prices may becharged for changes to the requirements.

Financial health Developers in financial difficulty may lower theirprice to gain a contract. It is better to make a smallprofit or break even than to go out of business.

Page 1070: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 8

l A measure of the rate at which individualengineers involved in software developmentproduce software and associateddocumentation

l Not quality-oriented although quality assuranceis a factor in productivity assessment

l Essentially, we want to measure usefulfunctionality produced per time unit

Programmer productivity

Page 1071: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 9

l Size related measures based on some output fromthe software process. This may be lines ofdelivered source code, object code instructions,etc.

l Function-related measures based on an estimateof the functionality of the delivered software.Function-points are the best known of this type ofmeasure

Productivity measures

Page 1072: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 10

l Estimating the size of the measure

l Estimating the total number of programmermonths which have elapsed

l Estimating contractor productivity (e.g.documentation team) and incorporating thisestimate in overall estimate

Measurement problems

Page 1073: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 11

l What's a line of code?• The measure was first proposed when programs were typed on

cards with one line per card

• How does this correspond to statements as in Java which canspan several lines or where there can be several statements onone line

l What programs should be counted as part of thesystem?

l Assumes linear relationship between systemsize and volume of documentation

Lines of code

Page 1074: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 12

l The lower level the language, the moreproductive the programmer• The same functionality takes more code to implement in a

lower-level language than in a high-level language

l The more verbose the programmer, the higherthe productivity• Measures of productivity based on lines of code suggest that

programmers who write verbose code are more productive thanprogrammers who write compact code

Productivity comparisons

Page 1075: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 13

High and low level languages

Analysis Design Coding Validation

Low-level language

Analysis Design Coding Validation

High-level language

Page 1076: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 14

System development times

Analysis Design Coding Testing DocumentationAssembly codeHigh-level language

3 weeks3 weeks

5 weeks5 weeks

8 weeks8 weeks

10 weeks6 weeks

2 weeks2 weeks

Size Effort ProductivityAssembly codeHigh-level language

5000 lines1500 lines

28 weeks20 weeks

714 lines/month300 lines/month

Page 1077: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 15

Function points

l Based on a combination of programcharacteristics• external inputs and outputs

• user interactions

• external interfaces

• files used by the system

l A weight is associated with each of these

l The function point count is computed bymultiplying each raw count by the weight andsumming all values

Page 1078: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 16

Function points

l Function point count modified by complexity ofthe project

l FPs can be used to estimate LOC depending onthe average number of LOC per FP for a givenlanguage• LOC = AVC * number of function points

• AVC is a language-dependent factor varying from 200-300 forassemble language to 2-40 for a 4GL

l FPs are very subjective. They depend on theestimator.• Automatic function-point counting is impossible

Page 1079: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 17

Object points

l Object points are an alternative function-relatedmeasure to function points when 4Gls or similarlanguages are used for development

l Object points are NOT the same as object classes

l The number of object points in a program is aweighted estimate of• The number of separate screens that are displayed

• The number of reports that are produced by the system

• The number of 3GL modules that must be developed tosupplement the 4GL code

Page 1080: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 18

Object point estimation

l Object points are easier to estimate from aspecification than function points as they aresimply concerned with screens, reports and 3GLmodules

l They can therefore be estimated at an early pointin the development process. At this stage, it isvery difficult to estimate the number of lines ofcode in a system

Page 1081: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 19

l Real-time embedded systems, 40-160LOC/P-month

l Systems programs , 150-400 LOC/P-month

l Commercial applications, 200-800LOC/P-month

l In object points, productivity has been measuredbetween 4 and 50 object points/month dependingon tool support and developer capability

Productivity estimates

Page 1082: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 20

Factors affecting productivityFactor DescriptionApplication domainexperience

Knowledge of the application domain is essential foreffective software development. Engineers who alreadyunderstand a domain are likely to be the mostproductive.

Process quality The development process used can have a significanteffect on productivity. This is covered in Chapter 31.

Project size The larger a project, the more time required for teamcommunications. Less time is available fordevelopment so individual productivity is reduced.

Technology support Good support technology such as CASE tools,supportive configuration management systems, etc.can improve productivity.

Working environment As discussed in Chapter 28, a quiet workingenvironment with private work areas contributes toimproved productivity.

Page 1083: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 21

l All metrics based on volume/unit time areflawed because they do not take quality intoaccount

l Productivity may generally be increased at thecost of quality

l It is not clear how productivity/quality metricsare related

l If change is constant then an approach based oncounting lines of code is not meaningful

Quality and productivity

Page 1084: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 22

Estimation techniques

l There is no simple way to make an accurateestimate of the effort required to develop asoftware system• Initial estimates are based on inadequate information in a user

requirements definition

• The software may run on unfamiliar computers or use newtechnology

• The people in the project may be unknown

l Project cost estimates may be self-fulfilling• The estimate defines the budget and the product is adjusted to

meet the budget

Page 1085: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 23

Estimation techniques

l Algorithmic cost modelling

l Expert judgement

l Estimation by analogy

l Parkinson's Law

l Pricing to win

Page 1086: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 24

Algorithmic code modelling

l A formulaic approach based on historical costinformation and which is generally based on thesize of the software

l Discussed later in this chapter

Page 1087: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 25

Expert judgement

l One or more experts in both softwaredevelopment and the application domain usetheir experience to predict software costs.Process iterates until some consensus isreached.

l Advantages: Relatively cheap estimationmethod. Can be accurate if experts have directexperience of similar systems

l Disadvantages: Very inaccurate if there are noexperts!

Page 1088: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 26

Estimation by analogy

l The cost of a project is computed by comparingthe project to a similar project in the sameapplication domain

l Advantages: Accurate if project data available

l Disadvantages: Impossible if no comparableproject has been tackled. Needs systematicallymaintained cost database

Page 1089: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 27

Parkinson's Law

l The project costs whatever resources areavailable

l Advantages: No overspend

l Disadvantages: System is usually unfinished

Page 1090: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 28

Pricing to win

l The project costs whatever the customer has tospend on it

l Advantages: You get the contract

l Disadvantages: The probability that thecustomer gets the system he or she wants issmall. Costs do not accurately reflect the workrequired

Page 1091: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 29

Top-down and bottom-up estimation

l Any of these approaches may be used top-downor bottom-up

l Top-down• Start at the system level and assess the overall system

functionality and how this is delivered through sub-systems

l Bottom-up• Start at the component level and estimate the effort required for

each component. Add these efforts to reach a final estimate

Page 1092: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 30

Top-down estimation

l Usable without knowledge of the systemarchitecture and the components that might bepart of the system

l Takes into account costs such as integration,configuration management and documentation

l Can underestimate the cost of solving difficultlow-level technical problems

Page 1093: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 31

Bottom-up estimation

l Usable when the architecture of the system isknown and components identified

l Accurate method if the system has been designedin detail

l May underestimate costs of system level activitiessuch as integration and documentation

Page 1094: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 32

Estimation methods

l Each method has strengths and weaknesses

l Estimation should be based on several methods

l If these do not return approximately the sameresult, there is insufficient information available

l Some action should be taken to find out more inorder to make more accurate estimates

l Pricing to win is sometimes the only applicablemethod

Page 1095: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 33

Experience-based estimates

l Estimating is primarily experience-based

l However, new methods and technologies maymake estimating based on experience inaccurate• Object oriented rather than function-oriented development

• Client-server systems rather than mainframe systems

• Off the shelf components

• Component-based software engineering

• CASE tools and program generators

Page 1096: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 34

Pricing to win

l This approach may seem unethical andunbusinesslike

l However, when detailed information is lacking itmay be the only appropriate strategy

l The project cost is agreed on the basis of anoutline proposal and the development isconstrained by that cost

l A detailed specification may be negotiated or anevolutionary approach used for systemdevelopment

Page 1097: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 35

Algorithmic cost modelling

l Cost is estimated as a mathematical function ofproduct, project and process attributes whosevalues are estimated by project managers• Effort = A × SizeB × M

• A is an organisation-dependent constant, B reflects thedisproportionate effort for large projects and M is a multiplierreflecting product, process and people attributes

l Most commonly used product attribute for costestimation is code size

l Most models are basically similar but withdifferent values for A, B and M

Page 1098: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 36

Estimation accuracy

l The size of a software system can only be knownaccurately when it is finished

l Several factors influence the final size• Use of COTS and components

• Programming language

• Distribution of system

l As the development process progresses then thesize estimate becomes more accurate

Page 1099: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 37

Estimate uncertainty

x

2x

4x

0.5x

0.25x

Feasibility Requirements Design Code Delivery

Page 1100: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 38

The COCOMO model

l An empirical model based on project experience

l Well-documented, ‘independent’ model which isnot tied to a specific software vendor

l Long history from initial version published in1981 (COCOMO-81) through variousinstantiations to COCOMO 2

l COCOMO 2 takes into account differentapproaches to software development, reuse, etc.

Page 1101: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 39

COCOMO 81

Projectcomplexity

Formula Description

Simple PM = 2.4 (KDSI)1.05 × M Well-understood applicationsdeveloped by small teams.

Moderate PM = 3.0 (KDSI)1.12 × M More complex projects whereteam members may have limitedexperience of related systems.

Embedded PM = 3.6 (KDSI)1.20 × M Complex projects where thesoftware is part of a stronglycoupled complex of hardware,software, regulations andoperational procedures.

Page 1102: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 40

COCOMO 2 levelsl COCOMO 2 is a 3 level model that allows

increasingly detailed estimates to be prepared asdevelopment progresses

l Early prototyping level• Estimates based on object points and a simple formula is used for

effort estimation

l Early design level• Estimates based on function points that are then translated to LOC

l Post-architecture level• Estimates based on lines of source code

Page 1103: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 41

Early prototyping level

l Supports prototyping projects and projects wherethere is extensive reuse

l Based on standard estimates of developerproductivity in object points/month

l Takes CASE tool use into account

l Formula is• PM = ( NOP × (1 - %reuse/100 ) ) / PROD

• PM is the effort in person-months, NOP is the number of objectpoints and PROD is the productivity

Page 1104: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 42

Object point productivity

Developer’sexperience andcapability

Very low Low Nominal High Very high

ICASE maturity andcapability

Very low Low Nominal High Very high

PROD (NOP/month) 4 7 13 25 50

Page 1105: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 43

Early design level

l Estimates can be made after the requirementshave been agreed

l Based on standard formula for algorithmicmodels• PM = A × SizeB × M + PMm where

• M = PERS × RCPX × RUSE × PDIF × PREX × FCIL ×SCED

• PMm = (ASLOC × (AT/100)) / ATPROD

• A = 2.5 in initial calibration, Size in KLOC, B varies from 1.1 to1.24 depending on novelty of the project, developmentflexibility, risk management approaches and the processmaturity

Page 1106: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 44

Multipliers

l Multipliers reflect the capability of thedevelopers, the non-functional requirements, thefamiliarity with the development platform, etc.• RCPX - product reliability and complexity

• RUSE - the reuse required

• PDIF - platform difficulty

• PREX - personnel experience

• PERS - personnel capability

• SCED - required schedule

• FCIL - the team support facilities

l PM reflects the amount of automaticallygenerated code

Page 1107: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 45

Post-architecture levell Uses same formula as early design estimates

l Estimate of size is adjusted to take into account• Requirements volatility. Rework required to support change

• Extent of possible reuse. Reuse is non-linear and has associatedcosts so this is not a simple reduction in LOC

• ESLOC = ASLOC × (AA + SU +0.4DM + 0.3CM +0.3IM)/100

» ESLOC is equivalent number of lines of new code. ASLOC is thenumber of lines of reusable code which must be modified, DM is thepercentage of design modified, CM is the percentage of the code that ismodified , IM is the percentage of the original integration effortrequired for integrating the reused software.

» SU is a factor based on the cost of software understanding, AA is afactor which reflects the initial assessment costs of deciding if softwaremay be reused.

Page 1108: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 46

l This depends on 5 scale factors (see next slide).Their sum/100 is added to 1.01

l Example• Precedenteness - new project - 4

• Development flexibility - no client involvement - Very high - 1

• Architecture/risk resolution - No risk analysis - V. Low - 5

• Team cohesion - new team - nominal - 3

• Process maturity - some control - nominal - 3

l Scale factor is therefore 1.17

The exponent term

Page 1109: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 47

Exponent scale factorsScale factor ExplanationPrecedentedness Reflects the previous experience of the organisation

with this type of project. Very low means no previousexperience, Extra high means that the organisation iscompletely familiar with this application domain.

Developmentflexibility

Reflects the degree of flexibility in the developmentprocess. Very low means a prescribed process is used;Extra high means that the client only sets general goals.

Architecture/riskresolution

Reflects the extent of risk analysis carried out. Very lowmeans little analysis, Extra high means a complete athorough risk analysis.

Team cohesion Reflects how well the development team know eachother and work together. Very low means very difficultinteractions, Extra high means an integrated andeffective team with no communication problems.

Process maturity Reflects the process maturity of the organisation. Thecomputation of this value depends on the CMMMaturity Questionnaire but an estimate can be achievedby subtracting the CMM process maturity level from 5.

Page 1110: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 48

l Product attributes• concerned with required characteristics of the software product

being developed

l Computer attributes• constraints imposed on the software by the hardware platform

l Personnel attributes• multipliers that take the experience and capabilities of the

people working on the project into account.

l Project attributes• concerned with the particular characteristics of the software

development project

Multipliers

Page 1111: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 49

Project cost driversProduct attributesRELY Required system

reliabilityDATA Size of database used

CPLX Complexity of systemmodules

RUSE Required percentage ofreusable components

DOCU Extent of documentationrequired

Computer attributesTIME Execution time

constraintsSTOR Memory constraints

PVOL Volatility ofdevelopment platform

Personnel attributesACAP Capability of project

analystsPCAP Programmer capability

PCON Personnel continuity AEXP Analyst experience in projectdomain

PEXP Programmer experiencein project domain

LTEX Language and tool experience

Project attributesTOOL Use of software tools SITE Extent of multi-site working

and quality of sitecommunications

SCED Development schedulecompression

Page 1112: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 50

Effects of cost drivers

Exponent value 1.17System size (including factors for reuseand requirements volatility)

128, 000 DSI

Initial COCOMO estimate withoutcost drivers

730 person-months

Reliability Very high, multiplier = 1.39Complexity Very high, multiplier = 1.3Memory constraint High, multiplier = 1.21Tool use Low, multiplier = 1.12Schedule Accelerated, multiplier = 1.29Adjusted COCOMO estimate 2306 person-monthsReliability Very low, multiplier = 0.75Complexity Very low, multiplier = 0.75Memory constraint None, multiplier = 1Tool use Very high, multiplier = 0.72Schedule Normal, multiplier = 1Adjusted COCOMO estimate 295 person-months

Page 1113: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 51

l Algorithmic cost models provide a basis forproject planning as they allow alternativestrategies to be compared

l Embedded spacecraft system• Must be reliable

• Must minimise weight (number of chips)

• Multipliers on reliability and computer constraints > 1

l Cost components• Target hardware

• Development platform

• Effort required

Project planning

Page 1114: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 52

Management optionsA. Use existing hardware,development system and

development team

C. Memoryupgrade only

Hardware costincrease

B. Processor andmemory upgrade

Hardware cost increaseExperience decrease

D. Moreexperienced staff

F. Staff withhardware experience

E. New developmentsystem

Hardware cost increaseExperience decrease

Page 1115: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 53

Management options costs

Option RELY STOR TIME TOOLS LTEX Total effort Software cost Hardwarecost

Total cost

A 1.39 1.06 1.11 0.86 1 63 949393 100000 1049393

B 1.39 1 1 1.12 1.22 88 1313550 120000 1402025

C 1.39 1 1.11 0.86 1 60 895653 105000 1000653

D 1.39 1.06 1.11 0.86 0.84 51 769008 100000 897490

E 1.39 1 1 0.72 1.22 56 844425 220000 1044159

F 1.39 1 1 1.12 0.84 57 851180 120000 1002706

Page 1116: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 54

Option choice

l Option D (use more experienced staff) appears tobe the best alternative• However, it has a high associated risk as expreienced staff may

be difficult to find

l Option C (upgrade memory) has a lower costsaving but very low risk

l Overall, the model reveals the importance of staffexperience in software development

Page 1117: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 55

Project duration and staffing

l As well as effort estimation, managers mustestimate the calendar time required to complete aproject and when staff will be required

l Calendar time can be estimated using aCOCOMO 2 formula• TDEV = 3 × (PM)(0.33+0.2*(B-1.01))

• PM is the effort computation and B is the exponent computed asdiscussed above (B is 1 for the early prototyping model). Thiscomputation predicts the nominal schedule for the project

l The time required is independent of the numberof people working on the project

Page 1118: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 56

Staffing requirements

l Staff required can’t be computed by diving thedevelopment time by the required schedule

l The number of people working on a project variesdepending on the phase of the project

l The more people who work on the project, themore total effort is usually required

l A very rapid build-up of people often correlateswith schedule slippage

Page 1119: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 57

Key points

l Factors affecting productivity include individualaptitude, domain experience, the developmentproject, the project size, tool support and theworking environment

l Different techniques of cost estimation should beused when estimating costs

l Software may be priced to gain a contract and thefunctionality adjusted to the price

Page 1120: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 23 Slide 58

Key points

l Algorithmic cost estimation is difficult because ofthe need to estimate attributes of the finishedproduct

l The COCOMO model takes project, product,personnel and hardware attributes into account whenpredicting effort required

l Algorithmic cost models support quantitative optionanalysis

l The time to complete a project is not proportional tothe number of people working on the project

Page 1121: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 1

Quality Management

l Managing the quality of thesoftware process and products

Page 1122: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 2

Objectives

l To introduce the quality management process andkey quality management activities

l To explain the role of standards in qualitymanagement

l To explain the concept of a software metric,predictor metrics and control metrics

l To explain how measurement may be used inassessing software quality

Page 1123: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 3

Topics covered

l Quality assurance and standards

l Quality planning

l Quality control

l Software measurement and metrics

Page 1124: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 4

Software quality management

l Concerned with ensuring that the required level ofquality is achieved in a software product

l Involves defining appropriate quality standardsand procedures and ensuring that these arefollowed

l Should aim to develop a ‘quality culture’ wherequality is seen as everyone’s responsibility

Page 1125: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 5

What is quality?

l Quality, simplistically, means that a productshould meet its specification

l This is problematical for software systems• Tension between customer quality requirements (efficiency,

reliability, etc.) and developer quality requirements(maintainability, reusability, etc.)

• Some quality requirements are difficult to specify in anunambiguous way

• Software specifications are usually incomplete and ofteninconsistent

Page 1126: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 6

The quality compromise

l We cannot wait for specifications to improvebefore paying attention to quality management

l Must put procedures into place to improve qualityin spite of imperfect specification

l Quality management is therefore not justconcerned with reducing defects but also withother product qualities

Page 1127: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 7

Quality management activities

l Quality assurance• Establish organisational procedures and standards for quality

l Quality planning• Select applicable procedures and standards for a particular

project and modify these as required

l Quality control• Ensure that procedures and standards are followed by the

software development team

l Quality management should be separate fromproject management to ensure independence

Page 1128: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 8

Quality management and software development

Software developmentprocess

Quality managementprocess

D1 D2 D3 D4 D5

Standards andprocedures

Qualityplan

Quality review reports

Page 1129: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 9

ISO 9000

l International set ofstandards for qualitymanagement

l Applicable to a range of organisations frommanufacturing to service industries

l ISO 9001 applicable to organisations whichdesign, develop and maintain products

l ISO 9001 is a generic model of the qualityprocess Must be instantiated for each organisation

Page 1130: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 10

ISO 9001

Management responsibility Quality systemControl of non-conforming products Design controlHandling, storage, packaging anddelivery

Purchasing

Purchaser-supplied products Product identification and traceabilityProcess control Inspection and testingInspection and test equipment Inspection and test statusContract review Corrective actionDocument control Quality recordsInternal quality audits TrainingServicing Statistical techniques

Page 1131: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 11

ISO 9000 certification

l Quality standards and procedures should bedocumented in an organisational quality manual

l External body may certify that an organisation’squality manual conforms to ISO 9000 standards

l Customers are, increasingly, demanding thatsuppliers are ISO 9000 certified

Page 1132: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 12

ISO 9000 and quality management

Project 1quality plan

Project 2quality plan

Project 3quality plan

Project qualitymanagement

Organizationquality manual

ISO 9000quality models

Organizationquality process

is used to develop instantiated as

instantiated as

documents

Supports

Page 1133: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 13

l Standards are the key to effective qualitymanagement

l They may be international, national,organizational or project standards

l Product standards define characteristics that allcomponents should exhibit e.g. a commonprogramming style

l Process standards define how the softwareprocess should be enacted

Quality assurance and standards

Page 1134: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 14

l Encapsulation of best practice- avoidsrepetition of past mistakes

l Framework for quality assurance process - itinvolves checking standard compliance

l Provide continuity - new staff can understandthe organisation by understand the standardsapplied

Importance of standards

Page 1135: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 15

Product and process standards

Product standards Process standardsDesign review form Design review conductDocument naming standards Submission of documents to CMProcedure header format Version release processAda programming style standard Project plan approval processProject plan format Change control processChange request form Test recording process

Page 1136: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 16

Problems with standards

l Not seen as relevant and up-to-date by softwareengineers

l Involve too much bureaucratic form filling

l Unsupported by software tools so tedious manualwork is involved to maintain standards

Page 1137: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 17

l Involve practitioners in development. Engineersshould understand the rationale underlying astandard

l Review standards and their usage regularly.Standards can quickly become outdated and thisreduces their credibility amongst practitioners

l Detailed standards should have associated toolsupport. Excessive clerical work is the mostsignificant complaint against standards

Standards development

Page 1138: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 18

Documentation standards

l Particularly important - documents are thetangible manifestation of the software

l Documentation process standards• How documents should be developed, validated and maintained

l Document standards• Concerned with document contents, structure, and appearance

l Document interchange standards• How documents are stored and interchanged between different

documentation systems

Page 1139: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 19

Documentation process

Createinitial draft

Reviewdraft

Incorporatereview

comments

Re-draftdocument

Proofreadtext

Producefinal draft

Checkfinal draft

Layouttext

Reviewlayout

Produceprint masters

Printcopies

Stage 1:Creation

Stage 2:Polishing

Stage 3:Production

Approved document

Approved document

Page 1140: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 20

Document standards

l Document identification standards• How documents are uniquely identified

l Document structure standards• Standard structure for project documents

l Document presentation standards• Define fonts and styles, use of logos, etc.

l Document update standards• Define how changes from previous versions are reflected in a

document

Page 1141: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 21

Document interchange standards

l Documents are produced using different systemsand on different computers

l Interchange standards allow electronic documentsto be exchanged, mailed, etc.

l Need for archiving. The lifetime of wordprocessing systems may be much less than thelifetime of the software being documented

l XML is an emerging standard for documentinterchange which will be widely supported infuture

Page 1142: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 22

l The quality of a developed product is influencedby the quality of the production process

l Particularly important in software development assome product quality attributes are hard to assess

l However, there is a very complex and poorlyunderstood between software processes andproduct quality

Process and product quality

Page 1143: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 23

Process-based quality

l Straightforward link between process and productin manufactured goods

l More complex for software because:• The application of individual skills and experience is

particularly imporant in software development

• External factors such as the novelty of an application or the needfor an accelerated development schedule may impair productquality

l Care must be taken not to impose inappropriateprocess standards

Page 1144: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 24

Process-based quality

Define process Developproduct

Assess productquality

Standardizeprocess

Improveprocess

QualityOK

No Yes

Page 1145: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 25

l Define process standards such as how reviewsshould be conducted, configurationmanagement, etc.

l Monitor the development process to ensurethat standards are being followed

l Report on the process to project managementand software procurer

Practical process quality

Page 1146: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 26

Quality planning

l A quality plan sets out the desired productqualities and how these are assessed ande definethe most significant quality attributes

l It should define the quality assessment process

l It should set out which organisational standardsshould be applied and, if necessary, define newstandards

Page 1147: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 27

Quality plan structure

l Product introduction

l Product plans

l Process descriptions

l Quality goals

l Risks and risk management

l Quality plans should be short, succinct documents• If they are too long, no-one will read them

Page 1148: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 28

Software quality attributes

Safety Understandability PortabilitySecurity Testability UsabilityReliability Adaptability ReusabilityResilience Modularity EfficiencyRobustness Complexity Learnability

Page 1149: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 29

Quality control

l Checking the software development process toensure that procedures and standards are beingfollowed

l Two approaches to quality control• Quality reviews

• Automated software assessment and software measurement

Page 1150: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 30

Quality reviews

l The principal method of validating the quality ofa process or of a product

l Group examined part or all of a process or systemand its documentation to find potential problems

l There are different types of review with differentobjectives• Inspections for defect removal (product)

• Reviews for progress assessment(product and process)

• Quality reviews (product and standards)

Page 1151: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 31

Types of reviewReview type Principal purposeDesign or programinspections

To detect detailed errors in the design orcode and to check whether standards havebeen followed. The review should be drivenby a checklist of possible errors.

Progress reviews To provide information for managementabout the overall progress of the project.This is both a process and a product reviewand is concerned with costs, plans andschedules.

Quality reviews To carry out a technical analysis of productcomponents or documentation to find faultsor mismatches between the specificationand the design, code or documentation. Itmay also be concerned with broader qualityissues such as adherence to standards andother quality attributes.

Page 1152: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 32

l A group of people carefully examine part or allof a software system and its associateddocumentation.

l Code, designs, specifications, test plans,standards, etc. can all be reviewed.

l Software or documents may be 'signed off' at areview which signifies that progress to the nextdevelopment stage has been approved bymanagement.

Quality reviews

Page 1153: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 33

The review process

Selectreview team

Arrange placeand time

Distributedocuments

Hold review

Completereview forms

Page 1154: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 34

Review functions

l Quality function - they are part of the generalquality management process

l Project management function - they provideinformation for project managers

l Training and communication function - productknowledge is passed between development teammembers

Page 1155: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 35

Quality reviews

l Objective is the discovery of system defects andinconsistencies

l Any documents produced in the process may bereviewed

l Review teams should be relatively small andreviews should be fairly short

l Review should be recorded and recordsmaintained

Page 1156: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 36

l Comments made during the review should beclassified.• No action. No change to the software or documentation is

required.

• Refer for repair. Designer or programmer should correct anidentified fault.

• Reconsider overall design. The problem identified in thereview impacts other parts of the design. Some overalljudgement must be made about the most cost-effective wayof solving the problem.

l Requirements and specification errors mayhave to be referred to the client.

Review results

Page 1157: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 37

Software measurement and metrics

l Software measurement is concerned with derivinga numeric value for an attribute of a softwareproduct or process

l This allows for objective comparisons betweentechniques and processes

l Although some companies have introducedmeasurment programmes, the systematic use ofmeasurement is still uncommon

l There are few standards in this area

Page 1158: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 38

l Any type of measurement which relates to asoftware system, process or relateddocumentation• Lines of code in a program, the Fog index, number of person-

days required to develop a component

l Allow the software and the software process tobe quantified

l Measures of the software process or product

l May be used to predict product attributes or tocontrol the software process

Software metric

Page 1159: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 39

Predictor and control metrics

Managementdecisions

Controlmeasurements

Softwareprocess

Predictormeasurements

Softwareproduct

Page 1160: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 40

l A software property can be measured

l The relationship exists between what we canmeasure and what we want to know

l This relationship has been formalized andvalidated

l It may be difficult to relate what can be measuredto desirable quality attributes

Metrics assumptions

Page 1161: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 41

Internal and external attributes

Reliability

Number of procedureparameters

Cyclomatic complexity

Program size in linesof code

Number of errormessages

Length of user manual

Maintainability

Usability

Portability

Page 1162: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 42

The measurement process

l A software measurement process may be part of aquality control process

l Data collected during this process should bemaintained as an organisational resource

l Once a measurement database has beenestablished, comparisons across projects becomepossible

Page 1163: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 43

Product measurement process

Measurecomponent

characteristics

Identifyanomalous

measurements

Analyseanomalouscomponents

Selectcomponents to

be assessed

Choosemeasurements

to be made

Page 1164: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 44

Data collection

l A metrics programme should be based on a set ofproduct and process data

l Data should be collected immediately (not inretrospect) and, if possible, automatically

l Three types of automatic data collection• Static product analysis

• Dynamic product analysis

• Process data collation

Page 1165: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 45

Automated data collection

Instrumentedsoftware system

Faultdata

Usagedata

Page 1166: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 46

Data accuracy

l Don’t collect unnecessary data• The questions to be answered should be decided in advance and

the required data identified

l Tell people why the data is being collected • It should not be part of personnel evaluation

l Don’t rely on memory• Collect data when it is generated not after a project has finished

Page 1167: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 47

l A quality metric should be a predictor ofproduct quality

l Classes of product metric• Dynamic metrics which are collected by measurements made of

a program in execution

• Static metrics which are collected by measurements made of thesystem representations

• Dynamic metrics help assess efficiency and reliability; staticmetrics help assess complexity, understandability andmaintainability

Product metrics

Page 1168: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 48

Dynamic and static metrics

l Dynamic metrics are closely related to softwarequality attributes• It is relatively easy to measure the response time of a system

(performance attribute) or the number of failures (reliabilityattribute)

l Static metrics have an indirect relationship withquality attributes• You need to try and derive a relationship between these metrics

and properties such as complexity, understandability andmaintainability

Page 1169: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 49

Software product metricsSoftware metric Description

Fan in/Fan-out Fan-in is a measure of the number of functions that call some otherfunction (say X). Fan-out is the number of functions which are calledby function X. A high value for fan-in means that X is tightlycoupled to the rest of the design and changes to X will haveextensive knock-on effects. A high value for fan-out suggests that theoverall complexity of X may be high because of the complexity ofthe control logic needed to coordinate the called components.

Length of code This is a measure of the size of a program. Generally, the larger thesize of the code of a program’s components, the more complex anderror-prone that component is likely to be.

Cyclomaticcomplexity

This is a measure of the control complexity of a program. Thiscontrol complexity may be related to program understandability. Thecomputation of cyclomatic complexity is covered in Chapter 20.

Length ofidentifiers

This is a measure of the average length of distinct identifiers in aprogram. The longer the identifiers, the more likely they are to bemeaningful and hence the more understandable the program.

Depth ofconditional nesting

This is a measure of the depth of nesting of if-statements in aprogram. Deeply nested if statements are hard to understand and arepotentially error-prone.

Fog index This is a measure of the average length of words and sentences indocuments. The higher the value for the Fog index, the more difficultthe document may be to understand.

Page 1170: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 50

Object-oriented metricsObject-orientedmetric

Description

Depth ofinheritancetree

This represents the number of discrete levels in the inheritance tree wheresub-classes inherit attributes and operations (methods) from super-classes.The deeper the inheritance tree, the more complex the design as,potentially, many different object classes have to be understood tounderstand the object classes at the leaves of the tree.

Method fan-in/fan-out

This is directly related to fan-in and fan-out as described above and meansessentially the same thing. However, it may be appropriate to make adistinction between calls from other methods within the object and callsfrom external methods.

Weightedmethods perclass

This is the number of methods included in a class weighted by thecomplexity of each method. Therefore, a simple method may have acomplexity of 1 and a large and complex method a much higher value. Thelarger the value for this metric, the more complex the object class.Complex objects are more likely to be more difficult to understand. Theymay not be logically cohesive so cannot be reused effectively as super-classes in an inheritance tree.

Number ofoverridingoperations

These are the number of operations in a super-class which are over-riddenin a sub-class. A high value for this metric indicates that the super-classused may not be an appropriate parent for the sub-class.

Page 1171: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 51

Measurement analysis

l It is not always obvious what data means • Analysing collected data is very difficult

l Professional statisticians should be consulted ifavailable

l Data analysis must take local circumstances intoaccount

Page 1172: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 52

Measurement surprises

l Reducing the number of faults in a program leadsto an increased number of help desk calls• The program is now thought of as more reliable and so has a

wider more diverse market. The percentage of users who call thehelp desk may have decreased but the total may increase

• A more reliable system is used in a different way from a systemwhere users work around the faults. This leads to more helpdesk calls

Page 1173: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 53

Key points

l Software quality management is concerned withensuring that software meets its requiredstandards

l Quality assurance procedures should bedocumented in an organisational quality manual

l Software standards are an encapsulation of bestpractice

l Reviews are the most widely used approach forassessing software quality

Page 1174: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 24 Slide 54

Key points

l Software measurement gathers information aboutboth the software process and the softwareproduct

l Product quality metrics should be used to identifypotentially problematical components

l There are no standardised and universallyapplicable software metrics

Page 1175: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 1

Process Improvement

l Understanding, Modelling andImproving the Software Process

Page 1176: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 2

l To explain the principles of software processimprovement

l To explain how software process factorsinfluence software quality and productivity

l To introduce the SEI Capability Maturity Modeland to explain why it is influential. To discussthe applicability of that model

l To explain why CMM-based improvement is notuniversally applicable

Objectives

Page 1177: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 3

l Process and product quality

l Process analysis and modelling

l Process measurement

l The SEI process maturity model

l Process classification

Topics covered

Page 1178: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 4

l Understanding existing processes

l Introducing process changes to achieveorganisational objectives which are usuallyfocused on quality improvement, cost reductionand schedule acceleration

l Most process improvement work so far hasfocused on defect reduction. This reflects theincreasing attention paid by industry to quality

l However, other process attributes can be thefocus of improvement

Process improvement

Page 1179: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 5

Process attributes

Process characteristic DescriptionUnderstandability To what extent is the process explicitly defined and how easy is it to

understand the process definition?Visibility Do the process activities culminate in clear results so that the progress

of the process is externally visible?Supportability To what extent can the process activities be supported by CASE tools?Acceptability Is the defined process acceptable to and usable by the engineers

responsible for producing the software product?Reliability Is the process designed in such a way that process errors are avoided or

trapped before they result in product errors?Robustness Can the process continue in spite of unexpected problems?Maintainability Can the process evolve to reflect changing organisational requirements

or identified process improvements?Rapidity How fast can the process of delivering a system from a given

specification be completed?

Page 1180: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 6

l Process analysis• Model and analyse (quantitatively if possible) existing processes

l Improvement identification• Identify quality, cost or schedule bottlenecks

l Process change introduction• Modify the process to remove identified bottlenecks

l Process change training• Train staff involved in new process proposals

l Change tuning• Evolve and improve process improvements

Process improvement stages

Page 1181: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 7

The process improvement process

Processmodel

Process changeplan

Trainingplan

Feedback onimprovements

Revised processmodel

Analyseprocess

Identifyimprovements

Tuneprocess changes

Introduceprocess change

Trainengineers

Page 1182: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 8

l Process quality and product quality are closelyrelated

l A good process is usually required to produce agood product

l For manufactured goods, process is theprincipal quality determinant

l For design-based activity, other factors are alsoinvolved especially the capabilities of thedesigners

Process and product quality

Page 1183: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 9

Principal product quality factors

Productquality

Developmenttechnology

Cost, time andschedule

Processquality

Peoplequality

Page 1184: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 10

Quality factors

l For large projects with ‘average’ capabilities, thedevelopment process determines product quality

l For small projects, the capabilities of thedevelopers is the main determinant

l The development technology is particularlysignificant for small projects

l In all cases, if an unrealistic schedule is imposedthen product quality will suffer

Page 1185: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 11

Process analysis and modelling

l Process analysis• The study of existing processes to understand the relationships

between parts of the process and to compare them with otherprocesses

l Process modelling• The documentation of a process which records the tasks, the

roles and the entities used

• Process models may be presented from different perspectives

Page 1186: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 12

l Study an existing process to understand itsactivities

l Produce an abstract model of the process. Youshould normally represent this graphically.Several different views (e.g. activities,deliverables, etc.) may be required

l Analyse the model to discover processproblems. Involves discussing activities withstakeholders

Process analysis and modelling

Page 1187: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 13

l Published process models and processstandards• It is always best to start process analysis with an existing model.

People then may extend and change this.

l Questionnaires and interviews• Must be carefully designed. Participants may tell you what they

think you want to hear

l Ethnographic analysis• Involves assimilating process knowledge by observation

Process analysis techniques

Page 1188: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Elements of aprocess model

Process model element DescriptionActivity(represented by a round-edged rectangle with nodrop shadow)

An activity has a clearly defined objective, entry and exitconditions. Examples of activities are preparing a set of testdata to test a module, coding a function or a module, proof-reading a document, etc. Generally, an activity is atomic i.e.it is the responsibility of one person or group. It is notdecomposed into sub-activities.

Process(represented by a round-edged rectangle with dropshadow)

A process is a set of activities which have some coherenceand whose objective is generally agreed within anorganisation. Examples of processes are requirementsanalysis, architectural design, test planning, etc.

Deliverable(represented by a rectanglewith drop shadow)

A deliverable is a tangible output of an activity which ispredicted in a project plan.

Condition(represented by aparallelogram )

A condition is either a pre-condition which must hold beforea process or activity can start or a post-condition which holdsafter a process or activity has finished.

Role(represented by a circlewith drop shadow)

A role is a bounded area of responsibility. Examples of rolesmight be configuration manager, test engineer, softwaredesigner, etc. One person may have several different rolesand a single role may be associated with several differentpeople.

Exception(not shown in exampleshere but may be representedas a double edged box)

An exception is a description of how to modify the process ifsome anticipated or unanticipated event occurs. Exceptionsare often undefined and it is left to the ingenuity of theproject managers and engineers to handle the exception.

Communication(represented by an arrow)

An interchange of information between people or betweenpeople and supporting computer systems. Communicationsmay be informal or formal. Formal communications might bethe approval of a deliverable by a project manager; informalcommunications might be the interchange of electronic mailto resolve ambiguities in a document.

Page 1189: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 15

The module testing activity

Testmodule

Signed-off testrecord

Module testdata

Modulespecification

Module compileswithout syntax

errors

All defined testsrun on module

Testengineer

Pre-condition

InputProcess

RôlePost-condition

OutputsResponsible

for

Page 1190: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Activities in module testing

Prepare test dataaccording tospecification

Read modulespecification

Submit test datafor review Review test data

TEST DATA PREPARATION

Read and understandmodule interface

Checkout modulefrom configuration

management system

Prepare test harnessfor module

Compile testharness

MODULE TEST HARNESS PREPARATION

Incorporate modulewith test harness

Run approved testson module

Record test resultsfor regression tests

TEST EXECUTION

Write report on moduletesting including detailsof discovered problems

Submit reportfor approval

Submit testresults to CM

TEST REPORTING

©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 31. Slide ##

Page 1191: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 17

Process exceptions

l Software processes are complex and processmodels cannot effectively represent how tohandle exceptions• Several key people becoming ill just before a critical review

• A complete failure of a communication processor so that no e-mail is available for several days

• Organisational reorganisation

• A need to respond to an unanticipated request for new proposals

l Under these circumstances, the model issuspended and managers use their initiative todeal with the exception

Page 1192: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 18

l Wherever possible, quantitative process datashould be collected• However, where organisations do not have clearly defined

process standards this is very difficult as you don’t know whatto measure. A process may have to be defined before anymeasurement is possible

l Process measurements should be used toassess process improvements• But this does not mean that measurements should drive the

improvements. The improvement driver should be theorganizational objectives

Process measurement

Page 1193: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 19

l Time taken for process activities to becompleted• E.g. Calendar time or effort to complete an activity or

process

l Resources required for processes or activities• E.g. Total effort in person-days

l Number of occurrences of a particular event• E.g. Number of defects discovered

Classes of process measurement

Page 1194: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 20

l Goals• What is the organisation trying to achieve? The objective of

process improvement is to satisfy these goals

l Questions• Questions about areas of uncertainty related to the goals. You

need process knowledge to derive these

l Metrics• Measurements to be collected to answer the questions

Goal-Question-Metric Paradigm

Page 1195: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 21

l US Defense Dept. funded institute associatedwith Carnegie Mellon

l Mission is to promote software technologytransfer particularly to defense contractors

l Maturity model proposed in mid-1980s, refinedin early 1990s.

l Work has been very influential in processimprovement

The Software Engineering Institute

Page 1196: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 22

The SEI process maturity model

Level 3Defined

Level 2Repeatable

Level 1Initial

Level 4Managed

Level 5Optimizing

Page 1197: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 23

l Initial• Essentially uncontrolled

l Repeatable• Product management procedures defined and used

l Defined• Process management procedures and strategies defined

and used

l Managed• Quality management strategies defined and used

l Optimising• Process improvement strategies defined and used

Maturity model levels

Page 1198: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Key process areas Process change managementTechnology change managementDefect prevention

Software quality managementQuantitative process management

Peer reviewsIntergroup coordinationSoftware product engineeringIntegrated software managementTraining programmeOrganization process definitionOrganization process focus

Software configuration managementSoftware quality assuranceSoftware subcontract managementSoftware project tracking and oversightSoftware project planningRequirements management

Initial

Repeatable

Defined

Managed

Optimizing

Page 1199: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 25

l It focuses on project management rather thanproduct development.

l It ignores the use of technologies such as rapidprototyping.

l It does not incorporate risk analysis as a keyprocess area

l It does not define its domain of applicability

SEI model problems

Page 1200: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 26

The CMM and ISO 9000

l There is a clear correlation between the keyprocesses in the CMM and the qualitymanagement processes in ISO 9000

l The CMM is more detailed and prescriptive andincludes a framework for improvement

l Organisations rated as level 2 in the CMM arelikely to be ISO 9000 compliant

Page 1201: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 27

Capability assessment

l An important role of the SEI is to use the CMMto assess the capabilities of contractors biddingfor US government defence contracts

l The model is intended to represent organisationalcapability not the practices used in particularprojects

l Within the same organisation, there are oftenwide variations in processes used

l Capability assessment is questionnaire-based

Page 1202: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 28

The capability assessment process

Select projectsfor assessment

Distributequestionnaires

Analyseresponses

Clarifyresponses

Identify issuesfor discussion

Interviewproject managers

Interviewengineers

Interviewmanagers

Brief managersand engineers

Presentassessment

Write report

Page 1203: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 29

l Informal• No detailed process model. Development team chose their

own way of working

l Managed• Defined process model which drives the development

process

l Methodical• Processes supported by some development method such

as HOOD

l Supported• Processes supported by automated CASE tools

Process classification

Page 1204: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 30

Process applicability

PrototypesShort-lifetime products4GL business systems

Informalprocess

Large systemsLong-lifetime products

Managedprocess

Well-understoodapplication domains

Re-engineered systems

Methodicalprocess

Page 1205: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 31

l Process used should depend on type ofproduct which is being developed• For large systems, management is usually the principal problem

so you need a strictly managed process. For smaller systems,more informality is possible.

l There is no uniformly applicable process whichshould be standardised within an organisation• High costs may be incurred if you force an inappropriate

process on a development team

Process choice

Page 1206: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 32

Process tool support

Informalprocess

Managedprocess

Methodicalprocess

Improvingprocess

Specializedtools

Analysis anddesign

workbenches

Projectmanagement

tools

Configurationmanagement

tools

Generictools

Page 1207: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 33

l Process improvement involves process analysis,standardisation, measurement and change

l Process models include descriptions of tasks,activities, roles, exceptions, communications,deliverables and other processes

l Measurement should be used to answer specificquestions about the software process used

l The three types of process metrics which can becollected are time metrics, resource utilisation metricsand event metrics

Key points

Page 1208: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 25 Slide 34

l The SEI model classifies software processes as initial,repeatable, defined, managed and optimising. It identifieskey processes which should be used at each of theselevels

l The SEI model is appropriate for large systemsdeveloped by large teams of engineers. It cannot beapplied without modification in other situations

l Processes can be classified as informal, managed,methodical and improving. This classification can beused to identify process tool support

Key points

Page 1209: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 1

Legacy Systems

● Older software systems thatremain vital to an organisation

Page 1210: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 2

Objectives

● To explain what is meant by a legacy system andwhy these systems are important

● To introduce common legacy system structures

● To briefly describe function-oriented design

● To explain how the value of legacy systems canbe assessed

Page 1211: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 3

Topics covered

● Legacy system structures

● Legacy system design

● Legacy system assessment

Page 1212: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 4

Legacy systems

● Software systems that are developed specially foran organisation have a long lifetime

● Many software systems that are still in use weredeveloped many years ago using technologies thatare now obsolete

● These systems are still business critical that is,they are essential for the normal functioning ofthe business

● They have been given the name legacy systems

Page 1213: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 5

Legacy system replacement

● There is a significant business risk in simplyscrapping a legacy system and replacing it with asystem that has been developed using moderntechnology

● Legacy systems rarely have a complete specification. Duringtheir lifetime they have undergone major changes which maynot have been documented

● Business processes are reliant on the legacy system

● The system may embed business rules that are not formallydocumented elsewhere

● New software development is risky and may not be successful

Page 1214: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 6

Legacy system change

● Systems must change in order to remain useful

● However, changing legacy systems is oftenexpensive

● Different parts implemented by different teams so no consistentprogramming style

● The system may use an obsolete programming language

● The system documentation is often out-of-date

● The system structure may be corrupted by many years ofmaintenance

● Techniques to save space or increase speed at the expense ofunderstandability may have been used

● File structures used may be incompatible

Page 1215: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 7

The legacy dilemma

● It is expensive and risky to replace the legacysystem

● It is expensive to maintain the legacy system

● Businesses must weigh up the costs and risks andmay choose to extend the system lifetime usingtechniques such as re-engineering.

● This is covered in Chapters 27 and 28

Page 1216: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 8

Legacy system structures

● Legacy systems can be considered to be socio-technical systems and not simply softwaresystems

● System hardware - may be mainframe hardware

● Support software - operating systems and utilities

● Application software - several different programs

● Application data - data used by these programs that is oftencritical business information

● Business processes - the processes that support a businessobjective and which rely on the legacy software and hardware

● Business policies and rules - constraints on business operations

Page 1217: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 9

Legacy system components

Systemhardware

Businessprocesses

Applicationsoftware

Business policiesand rules

Supportsoftware

Application data

ConstrainsUsesUsesRuns-onRuns-on

Embedsknowledge of

Uses

Page 1218: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 10

Layered model

Socio-technical system

Hardware

Support software

Application software

Business processes

Page 1219: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 11

System change

● In principle, it should be possible to replace alayer in the system leaving the other layersunchanged

● In practice, this is usually impossible● Changing one layer introduces new facilities and higher level

layers must then change to make use of these

● Changing the software may slow it down so hardware changesare then required

● It is often impossible to maintain hardware interfaces because ofthe wide gap between mainframes and client-server systems

Page 1220: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 12

Legacy application system

File 1 File 2 File 3 File 4 File 5 File 6

Program 2Program 1 Program 3

Program 4 Program 5 Program 6 Program 7

Page 1221: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 13

Database-centred system

Program1

Program2

Program3

Program4

Databasemanagement

system

Logical andphysical

data models

describes

Page 1222: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 14

Transaction processing

Serialisedtransactions

Teleprocessingmonitor

Accountsdatabase

ATMs and terminals

Account queriesand updates

Page 1223: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 15

Legacy data

● The system may be file-based with incompatiblefiles. The change required may be to move to adatabase-management system

● In legacy systems nthat use a DBMS the databasemanagement system may be obsolete andincompatible with other DBMSs used by thebusiness

● The teleprocessing monitor may be designed for aparticular DB and mainframe. Changing to a newDB may require a new TP monitor

Page 1224: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 16

Legacy system design

● Most legacy systems were designed beforeobject-oriented development was used

● Rather than being organised as a set of interactingobjects, these systems have been designed using afunction-oriented design strategy

● Several methods and CASE tools are available tosupport function-oriented design and the approachis still used for many business applications

Page 1225: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 17

A function-oriented view of design

F2F1 F3

F4 F5

Shared memory

Page 1226: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 18

Functional design process

● Data-flow design● Model the data processing in the system using data-flow

diagrams

● Structural decomposition● Model how functions are decomposed to sub-functions using

graphical structure charts

● Detailed design● The entities in the design and their interfaces are described in

detail. These may be recorded in a data dictionary and thedesign expressed using a PDL

Page 1227: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 19

Input-process-output model

System

Input Process Output

Page 1228: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 20

Input-process-output

● Input components read and validate data from aterminal or file

● Processing components carry out sometransformations on that data

● Output components format and print the results ofthe computation

● Input, process and output can all be represented asfunctions with data ‘flowing’ between them

Page 1229: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 21

Functional design process

l Data-flow design● Model the data processing in the system using data-flow

diagrams

l Structural decomposition● Model how functions are decomposed to sub-functions using

graphical structure charts that reflect the input/process/outputstructure

l Detailed design● The functions in the design and their interfaces are described in

detail.

Page 1230: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 22

Data flow diagrams

l Show how an input data item is functionallytransformed by a system into an output dataitem

l Are an integral part of many design methodsand are supported by many CASE systems

l May be translated into either a sequential orparallel design. In a sequential design,processing elements are functions orprocedures; in a parallel design, processingelements are tasks or processes

Page 1231: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 23

Payroll system DFD

Read employeerecord

Read monthlypay data

Computesalary

Write taxtransaction

Monthly paydata

Taxtables

Taxtransactions

Pension data

Validateemployee data

Write pensiondata

Write banktransaction

Write socialsecurity data

Employeerecords

Monthly payrates

Banktransactions

Socialsecurity data

Print payslipPRINTER

Decodedemployee

record

Pay information

Validemployee record

Tax deduction +SSnumber +tax office

Pensiondeduction +SS number

Empoyee data +deductions

Net payment + bankaccount info.

Social securitydeduction + SS number

Page 1232: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 24

Payroll batch processing

● The functions on the left of the DFD are inputfunctions

● Read employee record, Read monthly pay data, Validateemployee data

● The central function - Compute salary - carriesout the processing

● The functions to the right are output functions● Write tax transaction, Write pension data, Print payslip, Write

bank transaction, Write social security data

Page 1233: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 25

Transaction processing

● A ban ATM system is an example of a transactionprocessing system

● Transactions are stateless in that they do not relyon the result of previous transactions. Therefore, afunctional approach is a natural way to implementtransaction processing

Page 1234: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Designdescription of anATM

INPUT

looprepeat

Print_input_message (” Welcome - Please enter your card”) ; until Card_input ; Account_number := Read_card ; Get_account_details (PIN, Account_balance, Cash_available) ;

PROCESS

if Invalid_card (PIN) thenRetain_card ;Print ("Card retained - please contact your bank") ;

else repeat Print_operation_select_message ;

Button := Get_button ; case Get_button is when Cash_only => Dispense_cash (Cash_available, Amount_dispensed) ; when Print_balance => Print_customer_balance (Account_balance) ; when Statement => Order_statement (Account_number) ; when Check_book =>

Order_checkbook (Account_number) ; end case ;

Print ("Press CONTINUE for more services or STOP to finish");Button := Get_button ;

until Button = STOP ;

OUTPUT

Eject_card ; Print (“Please take your card ) ;

Update_account_information (Account_number, Amount_dispensed) ; end loop ;

Page 1235: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 27

Using function-oriented design

● For some classes of system, such as sometransaction processing systems, a function-oriented approach may be a better approach todesign than an object-oriented approach

● Companies may have invested in CASE tools andmethods for function-oriented design and may notwish to incur the costs and risks of moving to anobject-oriented approach

Page 1236: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 28

Legacy system assessment

● Organisations that rely on legacy systems mustchoose a strategy for evolving these systems

● Scrap the system completely and modify business processes sothat it is no longer required

● Continue maintaining the system

● Transform the system by re-engineering to improve itsmaintainability

● Replace the system with a new system

● The strategy chosen should depend on the systemquality and its business value

Page 1237: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 29

System quality and business value

12

3 4 5

67

89

10

System quality

Business valueHigh business valueLow quality High business value

High quality

Low business valueLow quality

Low business valueHigh quality

Page 1238: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 30

Legacy system categories

● Low quality, low business value● These systems should be scrapped

● Low-quality, high-business value● These make an important business contribution but are

expensive to maintain. Should be re-engineered or replaced if asuitable system is available

● High-quality, low-business value● Replace with COTS, scrap completely or maintain

● High-quality, high business value● Continue in operation using normal system maintenance

Page 1239: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 31

Business value assessment

● Assessment should take different viewpoints intoaccount

● System end-users

● Business customers

● Line managers

● IT managers

● Senior managers

● Interview different stakeholders and collateresults

Page 1240: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 32

System quality assessment

● Business process assessment● How well does the business process support the current goals of

the business?

● Environment assessment● How effective is the system’s environment and how expensive

is it to maintain

● Application assessment● What is the quality of the application software system

Page 1241: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 33

Business process assessment

● Use a viewpoint-oriented approach and seekanswers from system stakeholders

● Is there a defined process model and is it followed?

● Do different parts of the organisation use different processes forthe same function?

● How has the process been adapted?

● What are the relationships with other business processes and arethese necessary?

● Is the process effectively supported by the legacy applicationsoftware?

Page 1242: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 34

Environment assessmentFactor QuestionsSupplierstability

Is the supplier is still in existence? Is the supplier financially stable andlikely to continue in existence? If the supplier is no longer in business,are the systems maintained by someone else?

Failure rate Does the hardware have a high rate of reported failures? Does thesupport software crash and force system restarts?

Age How old is the hardware and software? The older the hardware andsupport software, the more obsolete it will be. It may still functioncorrectly but there could be significant economic and business benefitsto moving to more modern systems.

Performance Is the performance of the system adequate? Do performance problemshave a significant effect on system users?

Supportrequirements

What local support is required by the hardware and software? If thereare high costs associated with this support, it may be worth consideringsystem replacement.

Maintenancecosts

What are the costs of hardware maintenance and support softwarelicences? Older hardware may have higher maintenance costs thanmodern systems. Support software may have high annual licensingcosts.

Interoperability Are there problems interfacing the system to other systems? Cancompilers etc. be used with current versions of the operating system? Ishardware emulation required?

Page 1243: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 35

Application assessmentFactor QuestionsUnderstandability How difficult is it to understand the source code of the current system?

How complex are the control structures which are used? Do variableshave meaningful names that reflect their function?

Documentation What system documentation is available? Is the documentationcomplete, consistent and up-to-date?

Data Is there an explicit data model for the system? To what extent is dataduplicated in different files? Is the data used by the system up-to-dateand consistent?

Performance Is the performance of the application adequate? Do performanceproblems have a significant effect on system users?

Programminglanguage

Are modern compilers available for the programming language used todevelop the system? Is the programming language still used for newsystem development?

Configurationmanagement

Are all versions of all parts of the system managed by a configurationmanagement system? Is there an explicit description of the versions ofcomponents that are used in the current system?

Test data Does test data for the system exist? Is there a record of regression testscarried out when new features have been added to the system?

Personnel skills Are there people available who have the skills to maintain theapplication? Are there only a limited number of people who understandthe system?

Page 1244: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 36

System measurement

● You may collect quantitative data to make anassessment of the quality of the applicationsystem

● The number of system change requests

● The number of different user interfaces used by the system

● The volume of data used by the system

Page 1245: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 37

Key points

● A legacy system is an old system that stillprovides essential business services

● Legacy systems are not just application softwarebut also include business processes, supportsoftware and hardware

● Most legacy systems are made up of severaldifferent programs and shared data

● A function-oriented approach has been used in thedesign of most legacy systems

Page 1246: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 26 Slide 38

Key points

● The structure of legacy business systemsnormally follows an input-process-output model

● The business value of a system and its qualityshould be used to choose an evolution strategy

● The business value reflects the system’seffectiveness in supporting business goals

● System quality depends on business processes,the system’s environment and the applicationsoftware

Page 1247: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 1

Software change

l Managing the processes ofsoftware system change

Page 1248: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 2

Objectives

l To explain different strategies for changingsoftware systems• Software maintenance

• Architectural evolution

• Software re-engineering

l To explain the principles of software maintenance

l To describe the transformation of legacy systemsfrom centralised to distributed architectures

Page 1249: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 3

Topics covered

l Program evolution dynamics

l Software maintenance

l Architectural evolution

Page 1250: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 4

Software change

l Software change is inevitable• New requirements emerge when the software is used

• The business environment changes

• Errors must be repaired

• New equipment must be accommodated

• The performance or reliability may have to be improved

l A key problem for organisations is implementingand managing change to their legacy systems

Page 1251: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 5

Software change strategies

l Software maintenance• Changes are made in response to changed requirements but the

fundamental software structure is stable

l Architectural transformation• The architecture of the system is modified generally from a

centralised architecture to a distributed architecture

l Software re-engineering• No new functionality is added to the system but it is restructured

and reorganised to facilitate future changes

l These strategies may be applied separately ortogether

Page 1252: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 6

l Program evolution dynamics is the study of theprocesses of system change

l After major empirical study, Lehman and Beladyproposed that there were a number of ‘laws’which applied to all systems as they evolved

l There are sensible observations rather than laws.They are applicable to large systems developedby large organisations. Perhaps less applicable inother cases

Program evolution dynamics

Page 1253: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 7

Lehman’s lawsLaw DescriptionContinuing change A program that is used in a real-world environment

necessarily must change or become progressively lessuseful in that environment.

Increasing complexity As an evolving program changes, its structure tendsto become more complex. Extra resources must bedevoted to preserving and simplifying the structure.

Large program evolution Program evolution is a self-regulating process.System attributes such as size, time between releasesand the number of reported errors are approximatelyinvariant for each system release.

Organisational stability Over a program’s lifetime, its rate of development isapproximately constant and independent of theresources devoted to system development.

Conservation offamiliarity

Over the lifetime of a system, the incremental changein each release is approximately constant.

Page 1254: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 8

Applicability of Lehman’s laws

l This has not yet been established

l They are generally applicable to large, tailoredsystems developed by large organisations

l It is not clear how they should be modified for• Shrink-wrapped software products

• Systems that incorporate a significant number of COTScomponents

• Small organisations

• Medium sized systems

Page 1255: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 9

l Modifying a program after it has been put intouse

l Maintenance does not normally involve majorchanges to the system’s architecture

l Changes are implemented by modifying existingcomponents and adding new components to thesystem

Software maintenance

Page 1256: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 10

l The system requirements are likely to changewhile the system is being developed becausethe environment is changing. Therefore adelivered system won't meet its requirements!

l Systems are tightly coupled with theirenvironment. When a system is installed in anenvironment it changes that environment andtherefore changes the system requirements.

l Systems MUST be maintained therefore if theyare to remain useful in an environment

Maintenance is inevitable

Page 1257: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 11

l Maintenance to repair software faults• Changing a system to correct deficiencies in the way meets

its requirements

l Maintenance to adapt software to a differentoperating environment• Changing a system so that it operates in a different environment

(computer, OS, etc.) from its initial implementation

l Maintenance to add to or modify the system’sfunctionality• Modifying the system to satisfy new requirements

Types of maintenance

Page 1258: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 12

Distribution of maintenance effort

Functionalityaddition or

modification(65%)

Fault repair(17%)

Softwareadaptation

(18%)

Page 1259: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 13

Spiral maintenance model

Specification Implemention

ValidationOperation

Start

Release 1

Release 2

Release 3

Page 1260: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 14

l Usually greater than development costs (2* to100* depending on the application)

l Affected by both technical and non-technicalfactors

l Increases as software is maintained.Maintenance corrupts the software structure somakes further maintenance more difficult.

l Ageing software can have high support costs(e.g. old languages, compilers etc.)

Maintenance costs

Page 1261: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 15

Development/maintenance costs

0 50 100 150 200 250 300 350 400 450 500

System 1

System 2

Development costs Maintenance costs

$

Page 1262: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 16

l Team stability• Maintenance costs are reduced if the same staff are involved with

them for some time

l Contractual responsibility• The developers of a system may have no contractual responsibility

for maintenance so there is no incentive to design for future change

l Staff skills• Maintenance staff are often inexperienced and have limited domain

knowledge

l Program age and structure• As programs age, their structure is degraded and they become

harder to understand and change

Maintenance cost factors

Page 1263: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 17

Evolutionary software

l Rather than think of separate development andmaintenance phases, evolutionary software issoftware that is designed so that it cancontinuously evolve throughout its lifetime

Page 1264: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 18

The maintenance process

System releaseplanning

Changeimplementation

Systemrelease

Impactanalysis

Changerequests

Adaptivemaintenance

Correctivemaintenance

Perfectivemaintenance

Page 1265: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 19

Change requests

l Change requests are requests for system changesfrom users, customers or management

l In principle, all change requests should becarefully analysed as part of the maintenanceprocess and then implemented

l In practice, some change requests must beimplemented urgently• Fault repair

• Changes to the system’s environment

• Urgently required business changes

Page 1266: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 20

Change implementation

Requirementsupdating

Softwaredevelopment

Requirementsanalysis

Proposedchanges

Page 1267: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 21

Emergency repair

Modifysource code

Deliver modifiedsystem

Analyzesource code

Changerequests

Page 1268: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 22

Maintenance prediction

l Maintenance prediction is concerned withassessing which parts of the system may causeproblems and have high maintenance costs• Change acceptance depends on the maintainability of the

components affected by the change

• Implementing changes degrades the system and reduces itsmaintainability

• Maintenance costs depend on the number of changes and costsof change depend on maintainability

Page 1269: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 23

Maintenance prediction

Predictingmaintainability

Predicting systemchanges

Predictingmaintenance

costs

What will be the lifetimemaintenance costs of this

system?

What will be the costs ofmaintaining this system

over the next year?

What parts of the systemwill be the most expensive

to maintain?

How many changerequests can be

expected?

What parts of the system aremost likely to be affected by

change requests?

Page 1270: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 24

Change prediction

l Predicting the number of changes requires andunderstanding of the relationships between asystem and its environment

l Tightly coupled systems require changeswhenever the environment is changed

l Factors influencing this relationship are• Number and complexity of system interfaces

• Number of inherently volatile system requirements

• The business processes where the system is used

Page 1271: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 25

Complexity metrics

l Predictions of maintainability can be made byassessing the complexity of system components

l Studies have shown that most maintenance effortis spent on a relatively small number of systemcomponents

l Complexity depends on• Complexity of control structures

• Complexity of data structures

• Procedure and module size

Page 1272: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 26

Process metrics

l Process measurements may be used to assessmaintainability• Number of requests for corrective maintenance

• Average time required for impact analysis

• Average time taken to implement a change request

• Number of outstanding change requests

l If any or all of these is increasing, this mayindicate a decline in maintainability

Page 1273: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 27

Architectural evolution

l There is a need to convert many legacy systemsfrom a centralised architecture to a client-serverarchitecture

l Change drivers• Hardware costs. Servers are cheaper than mainframes

• User interface expectations. Users expect graphical userinterfaces

• Distributed access to systems. Users wish to access the systemfrom different, geographically separated, computers

Page 1274: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 28

Distribution factorsFactor DescriptionBusinessimportance

Returns on the investment of distributing a legacy systemdepend on its importance to the business and how long itwill remain important. If distribution provides more efficientsupport for stable business processes then it is more likely tobe a cost-effective evolution strategy.

System age The older the system the more difficult it will be to modifyits architecture because previous changes will have degradedthe structure of the system.

System structure The more modular the system, the easier it will be to changethe architecture. If the application logic, the datamanagement and the user interface of the system are closelyintertwined, it will be difficult to separate functions formigration.

Hardwareprocurementpolicies

Application distribution may be necessary if there iscompany policy to replace expensive mainframe computerswith cheaper servers. .

Page 1275: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 29

Legacy system structure

l Ideally, for distribution, there should be a clearseparation between the user interface, the systemservices and the system data management

l In practice, these are usually intermingled in olderlegacy systems

Page 1276: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 30

Legacy system structures

Database

User interface

Services

Ideal model for distribution Real legacy systems

Database

User interface

Services

Page 1277: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 31

Layered distribution model

Database

Application services

Interaction control

Data validation

Presentation

Page 1278: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 32

Legacy system distribution

User interface

Applicationservices

Database

Character terminals

Legacy system

Desktop PC clients running application

Middleware layer (wrapper)

Legacy system

Page 1279: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 33

Distribution options

l The more that is distributed from the server to theclient, the higher the costs of architecturalevolution

l The simplest distribution model is UI distributionwhere only the user interface is implemented onthe server

l The most complex option is where the serversimply provides data management and applicationservices are implemented on the client

Page 1280: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 34

Distribution option spectrum

Increasing costand effort

Server: Interaction controlData validationServicesDatabase

Client: Presentation

Server:DatabaseServer: Services

Database

Client: PresentationInteraction controlData validation

Client: PresentationInteraction controlData validationServices

Page 1281: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 35

User interface distribution

l UI distribution takes advantage of the localprocessing power on PCs to implement agraphical user interface

l Where there is a clear separation between the UIand the application then the legacy system can bemodified to distribute the UI

l Otherwise, screen management middleware cantranslate text interfaces to graphical interfaces

Page 1282: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 36

User interface distribution

User interface

Applicationservices

Database

Desktop PC clients withGUI interface

Screen managementmiddleware

Legacy system

Screen descriptions

Page 1283: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 37

UI migration strategies

Strategy Advantages DisadvantagesImplementationusing the windowmanagementsystem

Access to all UI functions so noreal restrictions on UI designBetter UI performance

Platform dependentMay be more difficult to achieveinterface consistency

Implementationusing a webbrowser

Platform independentLower training costs due to userfamiliarity with the WWWEasier to achieve interfaceconsistency

Potentially poorer UIperformanceInterface design is constrainedby the facilities provided by webbrowsers

Page 1284: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 38

Key points

l Software change strategies include softwaremaintenance, architectural evolution and softwarere-engineering

l Lehman’s Laws are invariant relationships thataffect the evolution of a software system

l Maintenance types are• Maintenance for repair

• Maintenance for a new operating environment

• Maintenance to implement new requirements

Page 1285: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 27 Slide 39

Key points

l The costs of software change usually exceed thecosts of software development

l Factors influencing maintenance costs include staffstability, the nature of the development contract,skill shortages and degraded system structure

l Architectural evolution is concerned with evolvingcentralised to distributed architectures

l A distributed user interface can be supported usingscreen management middleware

Page 1286: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 1

Software re-engineering

● Reorganising and modifyingexisting software systems tomake them more maintainable

Page 1287: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 2

Objectives

● To explain why software re-engineering is a cost-effective option for system evolution

● To describe the activities involved in the softwarere-engineering process

● To distinguish between software and data re-engineering and to explain the problems of datare-engineering

Page 1288: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 3

Topics covered

● Source code translation

● Reverse engineering

● Program structure improvement

● Program modularisation

● Data re-engineering

Page 1289: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 4

● Re-structuring or re-writing part or all of alegacy system without changing itsfunctionality

● Applicable where some but not all sub-systemsof a larger system require frequentmaintenance

● Re-engineering involves adding effort to makethem easier to maintain. The system may be re-structured and re-documented

System re-engineering

Page 1290: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 5

● When system changes are mostly confined topart of the system then re-engineer that part

● When hardware or software support becomesobsolete

● When tools to support re-structuring areavailable

When to re-engineer

Page 1291: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 6

Re-engineering advantages

● Reduced risk• There is a high risk in new software development. There may be

development problems, staffing problems and specificationproblems

● Reduced cost• The cost of re-engineering is often significantly less than the

costs of developing new software

Page 1292: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 7

Business process re-engineering

● Concerned with re-designing business processesto make them more responsive and more efficient

● Often reliant on the introduction of new computersystems to support the revised processes

● May force software re-engineering as the legacysystems are designed to support existingprocesses

Page 1293: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 8

Forward engineering and re-engineering

Understanding andtransformation

Existingsoftware system

Re-engineeredsystem

Design andimplementation

Systemspecification

Newsystem

Software re-engineering

Forward engineering

Page 1294: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 9

The re-engineering process

Reverseengineering

Programdocumentation

Datareengineering

Original data

Programstructure

improvement

Programmodularisation

Structuredprogram

Reengineereddata

Modularisedprogram

Originalprogram

Source codetranslation

Page 1295: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 10

Re-engineering cost factors

● The quality of the software to be re-engineered

● The tool support available for re-engineering

● The extent of the data conversion which isrequired

● The availability of expert staff for re-engineering

Page 1296: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 11

Re-engineering approaches

Automated r estructuringwith manual changes

Automated sourcecode conversion

Restructuring plusarchitectural changes

Automated programrestructuring

Program and datarestructuring

Increased cost

Page 1297: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 12

Source code translation

● Involves converting the code from one language(or language version) to another e.g. FORTRANto C

● May be necessary because of:• Hardware platform update

• Staff skill shortages

• Organisational policy changes

● Only realistic if an automatic translator isavailable

Page 1298: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 13

The program translation process

Automaticallytranslate code

Design translatorinstructions

Identify sourcecode differences

Manuallytranslate code

System to bere-engineered

System to bere-engineered

Re-engineeredsystem

Page 1299: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 14

Reverse engineering

● Analysing software with a view to understandingits design and specification

● May be part of a re-engineering process but mayalso be used to re-specify a system for re-implementation

● Builds a program data base and generatesinformation from this

● Program understanding tools (browsers, cross-reference generators, etc.) may be used in thisprocess

Page 1300: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 15

The reverse engineering process

Data stucturediagrams

Program stucturediagrams

Traceabilitymatrices

Documentgeneration

Systeminformation

store

Automatedanalysis

Manualannotation

System to bere-engineered

Page 1301: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 16

Reverse engineering

● Reverse engineering often precedes re-engineering but is sometimes worthwhile in itsown right• The design and specification of a system may be reverse

engineered so that they can be an input to the requirementsspecification process for the system’s replacement

• The design and specification may be reverse engineered tosupport program maintenance

Page 1302: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 17

Program structure improvement

● Maintenance tends to corrupt the structure of aprogram. It becomes harder and harder tounderstand

● The program may be automatically restructured toremove unconditional branches

● Conditions may be simplified to make them morereadable

Page 1303: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 18

Spaghetti logicStart: Get (Time-on, Time-off, Time, Setting, Temp, Switch)

if Switch = off goto offif Switch = on goto ongoto Cntrld

off: if Heating-status = on goto Sw-offgoto loop

on: if Heating-status = off goto Sw-ongoto loop

Cntrld: if Time = Time-on goto onif Time = Time-off goto offif Time < Time-on goto Startif Time > Time-off goto Startif Temp > Setting then goto offif Temp < Setting then goto on

Sw-off: Heating-status := offgoto Switch

Sw-on: Heating-status := onSwitch: Switch-heatingloop: goto Start

Page 1304: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 19

Structured control logicloop

-- The Get statement finds values for the given variables from the system’s-- environment.

Get (Time-on, Time-off, Time, Setting, Temp, Switch) ;case Switch of

when On => if Heating-status = off thenSwitch-heating ; Heating-status := on ;

end if ;when Off => if Heating-status = on then

Switch-heating ; Heating-status := off ;end if;

when Controlled =>if Time >= Time-on and Time < = Time-off then

if Temp > Setting and Heating-status = on thenSwitch-heating; Heating-status = off;

elsif Temp < Setting and Heating-status = off thenSwitch-heating; Heating-status := on ;

end if;end if ;

end case ;end loop ;

Page 1305: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 20

Condition simplification

-- Complex conditionif not (A > B and (C < D or not ( E > F) ) )...

-- Simplified conditionif (A <= B and (C>= D or E > F)...

Page 1306: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 21

Automatic program restructuring

Graphrepresentation

Programgenerator

Restructuredprogram

Analyser andgraph builder

Program to berestructured

Page 1307: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 22

Restructuring problems

● Problems with re-structuring are:• Loss of comments

• Loss of documentation

• Heavy computational demands

● Restructuring doesn’t help with poormodularisation where related components aredispersed throughout the code

● The understandability of data-driven programsmay not be improved by re-structuring

Page 1308: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 23

Program modularisation

● The process of re-organising a program so thatrelated program parts are collected together in asingle module

● Usually a manual process that is carried out byprogram inspection and re-organisation

Page 1309: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 24

Module types

● Data abstractions• Abstract data types where datastructures and associated

operations are grouped

● Hardware modules• All functions required to interface with a hardware unit

● Functional modules• Modules containing functions that carry out closely related tasks

● Process support modules• Modules where the functions support a business process or

process fragment

Page 1310: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 25

Recovering data abstractions

● Many legacy systems use shared tables and globaldata to save memory space

● Causes problems because changes have a wideimpact in the system

● Shared global data may be converted to objects orADTs• Analyse common data areas to identify logical abstractions

• Create an ADT or object for these abstractions

• Use a browser to find all data references and replace withreference to the data abstraction

Page 1311: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 26

Data abstraction recovery

● Analyse common data areas to identify logicalabstractions

● Create an abstract data type or object class foreach of these abstractions

● Provide functions to access and update each fieldof the data abstraction

● Use a program browser to find calls to these dataabstractions and replace these with the newdefined functions

Page 1312: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 27

Data re-engineering

● Involves analysing and reorganising the datastructures (and sometimes the data values) in aprogram

● May be part of the process of migrating from afile-based system to a DBMS-based system orchanging from one DBMS to another

● Objective is to create a managed dataenvironment

Page 1313: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 28

Approaches to data re-engineering

Approach DescriptionData cleanup The data records and values are analysed to improve their quality.

Duplicates are removed, redundant information is deleted and a consistentformat applied to all records. This should not normally require anyassociated program changes.

Data extension In this case, the data and associated programs are re-engineered to removelimits on the data processing. This may require changes to programs toincrease field lengths, modify upper limits on the tables, etc. The data itselfmay then have to be rewritten and cleaned up to reflect the programchanges.

Data migration In this case, data is moved into the control of a modern databasemanagement system. The data may be stored in separate files or may bemanaged by an older type of DBMS.

Page 1314: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 29

Data problems

● End-users want data on their desktop machinesrather than in a file system. They need to be ableto download this data from a DBMS

● Systems may have to process much more datathan was originally intended by their designers

● Redundant data may be stored in different formatsin different places in the system

Page 1315: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

Datamigration

Databasemanagement

system

Logical andphysical

data models

describes

File 1 File 2 File 3 File 4 File 5 File 6

Program 2 Program 3

Program 4 Program 5 Program 6 Program 7

Program 1

Program 3 Program 4 Program 5 Program 6

Program 2Program 7

Program 1

Becomes

Page 1316: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 31

Data problems

● Data naming problems• Names may be hard to understand. The same data may have

different names in different programs

● Field length problems• The same item may be assigned different lengths in different

programs

● Record organisation problems• Records representing the same entity may be organised

differently in different programs

● Hard-coded literals

● No data dictionary

Page 1317: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 32

Data value inconsistenciesData inconsistency DescriptionInconsistent defaultvalues

Different programs assign different default values to the same logical dataitems. This causes problems for programs other than those that created thedata. The problem is compounded when missing values are assigned adefault value that is valid. The missing data cannot then be discovered.

Inconsistent units The same information is represented in different units in differentprograms. For example, in the US or the UK, weight data may berepresented in pounds in older programs but in kilograms in more recentsystems. A major problem of this type has arisen in Europe with theintroduction of a single European currency. Legacy systems have beenwritten to deal with national currency units and data has to be converted toeuros.

Inconsistent validationrules

Different programs apply different data validation rules. Data written byone program may be rejected by another. This is a particular problem forarchival data which may not have been updated in line with changes todata validation rules.

Inconsistentrepresentationsemantics

Programs assume some meaning in the way items are represented. Forexample, some programs may assume that upper-case text means anaddress. Programs may use different conventions and may therefore rejectdata which is semantically valid.

Inconsistent handlingof negative values

Some programs reject negative values for entities which must always bepositive. Others, however, may accept these as negative values or fail torecognise them as negative and convert them to a positive value.

Page 1318: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 33

Data conversion

● Data re-engineering may involve changing thedata structure organisation without changing thedata values

● Data value conversion is very expensive. Special-purpose programs have to be written to carry outthe conversion

Page 1319: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 34

The data re-engineering process

Entity namemodification

Literalreplacement

Data definitionre-ordering

Datare-formattingDefault value

conversion

Validation rulemodification

Dataanalysis

Dataconversion

Dataanalysis

Modifieddata

Program to be re-engineered

Change summary tables

Stage 1 Stage 2 Stage 3

Page 1320: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 35

Key points

● The objective of re-engineering is to improve thesystem structure to make it easier to understandand maintain

● The re-engineering process involves source codetranslation, reverse engineering, programstructure improvement, program modularisationand data re-engineering

● Source code translation is the automaticconversion of of program in one language toanother

Page 1321: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 28 Slide 36

Key points

● Reverse engineering is the process of deriving thesystem design and specification from its sourcecode

● Program structure improvement replacesunstructured control constructs with while loopsand simple conditionals

● Program modularisation involves reorganisationto group related items

● Data re-engineering may be necessary because ofinconsistent data management

Page 1322: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 1

Configuration management

● Managing the products ofsystem change

Page 1323: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 2

Objectives

● To explain the importance of softwareconfiguration management (CM)

● To describe key CM activities namely CMplanning, change management, versionmanagement and system building

● To discuss the use of CASE tools to supportconfiguration management processes

Page 1324: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 3

Topics covered

● Configuration management planning

● Change management

● Version and release management

● System building

● CASE tools for configuration management

Page 1325: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 4

● New versions of software systems are created asthey change• For different machines/OS

• Offering different functionality

• Tailored for particular user requirements

● Configuration management is concerned withmanaging evolving software systems• System change is a team activity

• CM aims to control the costs and effort involved in makingchanges to a system

Configuration management

Page 1326: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 5

Configuration management

● Involves the development and application ofprocedures and standards to manage an evolvingsoftware product

● May be seen as part of a more general qualitymanagement process

● When released to CM, software systems aresometimes called baselines as they are a startingpoint for further development

Page 1327: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 6

System families

Workstationversion

Unixversion

DECversion

Initialsystem

Mainframeversion

VMSversion

PCversion

Sunversion

Page 1328: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 7

CM standards

● CM should always be based on a set of standardswhich are applied within an organisation

● Standards should define how items are identified,how changes are controlled and how new versionsare managed

● Standards may be based on external CMstandards (e.g. IEEE standard for CM)

● Existing standards are based on a waterfallprocess model - new standards are needed forevolutionary development

Page 1329: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 8

Concurrent development and testing

● A time for delivery of system components isagreed

● A new version of a system is built from thesecomponents by compiling and linking them

● This new version is delivered for testing usingpre-defined tests

● Faults that are discovered during testing aredocumented and returned to the systemdevelopers

Page 1330: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 9

Daily system building

● It is easier to find problems that stem fromcomponent interactions early in the process

● This encourages thorough unit testing -developers are under pressure not to ‘break thebuild’

● A stringent change management process isrequired to keep track of problems that have beendiscovered and repaired

Page 1331: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 10

● All products of the software process may haveto be managed• Specifications

• Designs

• Programs

• Test data

• User manuals

● Thousands of separate documents aregenerated for a large software system

Configuration management planning

Page 1332: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 11

● Starts during the early phases of the project

● Must define the documents or documentclasses which are to be managed (Formaldocuments)

● Documents which might be required for futuresystem maintenance should be identified andspecified as managed documents

CM planning

Page 1333: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 12

● Defines the types of documents to be managedand a document naming scheme

● Defines who takes responsibility for the CMprocedures and creation of baselines

● Defines policies for change control and versionmanagement

● Defines the CM records which must bemaintained

The CM plan

Page 1334: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 13

The CM plan

● Describes the tools which should be used to assistthe CM process and any limitations on their use

● Defines the process of tool use

● Defines the CM database used to recordconfiguration information

● May include information such as the CM ofexternal software, process auditing, etc.

Page 1335: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 14

● Large projects typically produce thousands ofdocuments which must be uniquely identified

● Some of these documents must be maintained forthe lifetime of the software

● Document naming scheme should be definedso that related documents have related names.

● A hierarchical scheme with multi-level names isprobably the most flexible approach

Configuration item identification

Page 1336: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 15

Configuration hierarchyPCL-TOOLS

EDIT

STRUCTURES

BIND

FORM

COMPILE MAKE-GEN

HELP

DISPLAY QUERY

AST-INTERFACEFORM-SPECS FORM-IO

CODEOBJECTS TESTS

Page 1337: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 16

● All CM information should be maintained in aconfiguration database

● This should allow queries about configurations tobeanswered• Who has a particular system version?

• What platform is required for a particular version?

• What versions are affected by a change to component X?

• How many reported faults in version T?

● The CM database should preferably be linked tothe software being managed

The configuration database

Page 1338: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 17

CM database implementation

● May be part of an integrated environment tosupport software development. The CM databaseand the managed documents are all maintained onthe same system

● CASE tools may be integrated with this so thatthere is a close relationship between the CASEtools and the CM tools

● More commonly, the CM database is maintainedseparately as this is cheaper and more flexible

Page 1339: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 18

● Software systems are subject to continualchange requests• From users

• From developers

• From market forces

● Change management is concerned with keepingmanaging of these changes and ensuring thatthey are implemented in the most cost-effectiveway

Change management

Page 1340: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 19

Request change by completing a change request formAnalyze change requestif change is valid then Assess how change might be implemented Assess change cost Submit request to change control board if change is accepted then repeat make changes to software submit changed software for quality approval until software quality is adequate create new system versionelse reject change requestelse reject change request

The change management process

Page 1341: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 20

● Definition of change request form is part of theCM planning process

● Records change required, suggestor of change,reason why change was suggested andurgency of change(from requestor of thechange)

● Records change evaluation, impact analysis,change cost and recommendations (Systemmaintenance staff)

Change request form

Page 1342: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 21

Change request formChange Request Form

Project: Proteus/PCL-Tools Number: 23/94Change requester: I. Sommerville Date: 1/12/98Requested change: When a component is selected from the structure,display the name of the file where it is stored.

Change analyser: G. Dean Analysis date: 10/12/98Components affected: Display-Icon.Select, Display-Icon.Display

Associated components: FileTable

Change assessment: Relatively simple to implement as a file name tableis available. Requires the design and implementation of a display field. Nochanges to associated components are required.

Change priority: LowChange implementation:Estimated effort: 0.5 daysDate to CCB: 15/12/98 CCB decision date: 1/2/99CCB decision: Accept change. Change to be implemented in Release 2.1.Change implementor: Date of change:Date submitted to QA: QA decision:Date submitted to CM:Comments

Page 1343: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 22

● A major problem in change management istracking change status

● Change tracking tools keep track the status ofeach change request and automatically ensurethat change requests are sent to the rightpeople at the right time.

● Integrated with E-mail systems allowingelectronic change request distribution

Change tracking tools

Page 1344: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 23

● Changes should be reviewed by an external groupwho decide whether or not they are cost-effectivefrom a strategic and organizational viewpointrather than a technical viewpoint

● Should be independent of project responsiblefor system. The group is sometimes called achange control board

● May include representatives from client andcontractor staff

Change control board

Page 1345: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 24

● Record of changes applied to a document orcode component

● Should record, in outline, the change made, therationale for the change, who made the changeand when it was implemented

● May be included as a comment in code. If astandard prologue style is used for the derivationhistory, tools can process this automatically

Derivation history

Page 1346: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 25

Component header information

// PROTEUS project (ESPRIT 6087)//// PCL-TOOLS/EDIT/FORMS/DISPLAY/AST-INTERFACE//// Object: PCL-Tool-Desc// Author: G. Dean// Creation date: 10th November 1998//// © Lancaster University 1998//// Modification history// Version Modifier Date Change Reason// 1.0 J. Jones 1/12/1998 Add header Submitted to CM// 1.1 G. Dean 9/4/1999 New field Change req. R07/99

Page 1347: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 26

● Invent identification scheme for systemversions

● Plan when new system version is to beproduced

● Ensure that version management procedures andtools are properly applied

● Plan and distribute new system releases

Version and release management

Page 1348: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 27

● Version An instance of a system which isfunctionally distinct in some way from othersystem instances

● Variant An instance of a system which isfunctionally identical but non-functionallydistinct from other instances of a system

● Release An instance of a system which isdistributed to users outside of the developmentteam

Versions/variants/releases

Page 1349: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 28

Version identification

● Procedures for version identification shoulddefine an unambiguous way of identifyingcomponent versions

● Three basic techniques for componentidentification• Version numbering

• Attribute-based identification

• Change-oriented identification

Page 1350: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 29

● Simple naming scheme uses a linear derivatione.g. V1, V1.1, V1.2, V2.1, V2.2 etc.

● Actual derivation structure is a tree or anetwork rather than a sequence

● Names are not meaningful.

● Hierarchical naming scheme may be better

Version numbering

Page 1351: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 30

Version derivation structure

V1.0 V1.1 V1.2 V2.0 V2.1 V2.2

V1.1b V1.1.1

V1.1a

Page 1352: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 31

● Attributes can be associated with a version withthe combination of attributes identifying thatversion

● Examples of attributes are Date, Creator,Programming Language, Customer, Status etc.

● More flexible than an explicit naming schemefor version retrieval; Can cause problems withuniqueness

● Needs an associated name for easy reference

Attribute-based identification

Page 1353: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 32

Attribute-based queries

● An important advantage of attribute-basedidentification is that it can support queries so thatyou can find ‘the most recent version in Java’ etc.

● Example• AC3D (language =Java, platform = NT4, date = Jan 1999)

Page 1354: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 33

Change-oriented identification

● Integrates versions and the changes made tocreate these versions

● Used for systems rather than components

● Each proposed change has a change set thatdescribes changes made to implement that change

● Change sets are applied in sequence so that, inprinciple, a version of the system thatincorporates an arbitrary set of changes may becreated

Page 1355: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 34

● Releases must incorporate changes forced onthe system by errors discovered by users andby hardware changes

● They must also incorporate new systemfunctionality

● Release planning is concerned with when toissue a system version as a release

Release management

Page 1356: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 35

System releases

● Not just a set of executable programs

● May also include• Configuration files defining how the release is configured for a

particular installation

• Data files needed for system operation

• An installation program or shell script to install the system ontarget hardware

• Electronic and paper documentation

• Packaging and associated publicity

● Systems are now normally released on CD-ROMor as downloadable installation files from the web

Page 1357: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 36

● Customer may not want a new release of thesystem• They may be happy with their current system as the new version

may provide unwanted functionality

● Release management must not assume that allprevious releases have been accepted. All filesrequired for a release should be re-created when anew release is installed

Release problems

Page 1358: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 37

Release decision making

● Preparing and distributing a system release is anexpensive process

● Factors such as the technical quality of thesystem, competition, marketing requirements andcustomer change requests should all influence thedecision of when to issue a new system release

Page 1359: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 38

System release strategy

Factor DescriptionTechnical quality ofthe system

If serious system faults are reported which affect the way in whichmany customers use the system, it may be necessary to issue afault repair release. However, minor system faults may be repairedby issuing patches (often distributed over the Internet) that can beapplied to the current release of the system.

Lehman’s fifth law(see Chapter 27)

This suggests that the increment of functionality which is includedin each release is approximately constant. Therefore, if there hasbeen a system release with significant new functionality, then itmay have to be followed by a repair release.

Competition A new system release may be necessary because a competingproduct is available.

Marketingrequirements

The marketing department of an organisation may have made acommitment for releases to be available at a particular date.

Customer changeproposals

For customised systems, customers may have made and paid for aspecific set of system change proposals and they expect a systemrelease as soon as these have been implemented.

Page 1360: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 39

Release creation

● Release creation involves collecting all files anddocumentation required to create a system release

● Configuration descriptions have to be written fordifferent hardware and installation scripts have tobe written

● The specific release must be documented torecord exactly what files were used to create it.This allows it to be re-created if necessary

Page 1361: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 40

● The process of compiling and linking softwarecomponents into an executable system

● Different systems are built from differentcombinations of components

● Invariably supported by automated tools that aredriven by ‘build scripts’

System building

Page 1362: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 41

● Do the build instructions include all requiredcomponents?• When there are many hundreds of components making up

a system, it is easy to miss one out. This should normallybe detected by the linker

● Is the appropriate component versionspecified?• A more significant problem. A system built with the wrong

version may work initially but fail after delivery

● Are all data files available?• The build should not rely on 'standard' data files. Standards

vary from place to place

System building problems

Page 1363: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 42

● Are data file references within componentscorrect?• Embedding absolute names in code almost always causes

problems as naming conventions differ from place to place

● Is the system being built for the right platform• Sometimes must build for a specific OS version or hardware

configuration

● Is the right version of the compiler and othersoftware tools specified?• Different compiler versions may actually generate different code and

the compiled component will exhibit different behaviour

System building problems

Page 1364: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 43

System building

Buildscript

Source codecomponent

versions

Object codecomponents

Executablesystem

Systembuilder

CompilersVersion

managementsystem

Linker

Page 1365: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 44

System representation

● Systems are normally represented for building byspecifying the file name to be processed bybuilding tools. Dependencies between these aredescribed to the building tools

● Mistakes can be made as users lose track of whichobjects are stored in which files

● A system modelling language addresses thisproblem by using a logical rather than a physicalsystem representation

Page 1366: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 45

CASE tools for configuration management

● CM processes are standardised and involveapplying pre-defined procedures

● Large amounts of data must be managed

● CASE tool support for CM is therefore essential

● Mature CASE tools to support configurationmanagement are available ranging from stand-alone tools to integrated CM workbenches

Page 1367: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 46

Change management tools

● Change management is a procedural process so itcan be modelled and integrated with a versionmanagement system

● Change management tools• Form editor to support processing the change request forms

• Workflow system to define who does what and to automateinformation transfer

• Change database that manages change proposals and is linked toa VM system

Page 1368: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 47

Version management tools

● Version and release identification• Systems assign identifiers automatically when a new version is

submitted to the system

● Storage management.• System stores the differences between versions rather than all

the version code

● Change history recording• Record reasons for version creation

● Independent development• Only one version at a time may be checked out for change.

Parallel working on different versions

Page 1369: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 48

Delta-based versioning

Version1.0

Version1.1

Version1.2

Version1.3

D1 D2 D3

Creation date

Page 1370: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 49

System building

● Building a large system is computationallyexpensive and may take several hours

● Hundreds of files may be involved

● System building tools may provide• A dependency specification language and interpreter

• Tool selection and instantiation support

• Distributed compilation

• Derived object management

Page 1371: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 50

Component dependencies

comp

scan.o

scan.c

defs.h

syn.o

syn.c

sem.o

sem.c

cgen.o

cgen.c

Page 1372: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 51

● Configuration management is the management ofsystem change to software products

● A formal document naming scheme should beestablished and documents should be managed ina database

● The configuration data base should recordinformation about changes and change requests

● A consistent scheme of version identificationshould be established using version numbers,attributes or change sets

Key points

Page 1373: tksctcse.weebly.comtksctcse.weebly.com/.../3/5/8835936/ian_sommerville... · ©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 1 Slide 5 l Software costs often dominate

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 29 Slide 52

Key points

● System releases include executable code, data,configuration files and documentation

● System building involves assembling componentsinto a system

● CASE tools are available to support all CMactivities

● CASE tools may be stand-alone tools or may beintegrated systems which integrate support forversion management, system building and changemanagement