1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

30
1 CS 456 Software Engineering

Transcript of 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

Page 1: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

1

CS 456

Software Engineering

Page 2: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

2

Contents

Page 3: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

3

Chapter 1: Introduction

Page 4: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

4

Software engineering

• The economies of ALL developed nations are dependent on software.

• More and more systems are software controlled• Software engineering is concerned with theories,

methods and tools for professional software development.

• Expenditure on software represents a significant fraction of GNP in all developed countries.

Page 5: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

5

What is software?• Computer programs and associated documentation such as

requirements, design models and user manuals.

• Software products may be developed for a particular customer or may be developed for a general market.

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

customers e.g. PC software such as Excel or Word.– Bespoke (custom) - developed for a single customer

according to their specification.

• New software can be created by developing new programs, configuring generic software systems or reusing existing software.

Page 6: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

6

What is software engineering?• Software engineering is an engineering

discipline that is concerned with all aspects of software production.

• Software engineers should adopt a systematic and organised approach to their work and use appropriate tools and techniques depending on the problem to be solved, the development constraints and the resources available.

Page 7: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

7

What is the difference between software engineering and computer science?

• Computer science is concerned with theory and fundamentals; software engineering is concerned with the practicalities of developing and delivering useful software.

• Computer science theories are still insufficient to act as a complete underpinning for software engineering (unlike e.g. physics and electrical engineering).

Page 8: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

8

Software Technology

Page 9: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

9

• Function - Based Software

• Object- Oriented Software

• The Component - Based Software

• Agent - Based Software

Software Technology

Page 10: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

10

Function - Based Software

The Figure illustrates the architecture of a

software system developed based on the function

technology. The system has shared data that are processed by functions.

Function-Based System Architecture

Function - 2

Function - 4Function - 3

Function - 1

Shared data

Page 11: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

11

Object-Oriented Software

Message-1

Mess

age-3Message-4

Mes

sage-2

Object-1

Object-4Object-3

Object-2

The architecture of a developed software system based-on object technology is shown in the following figure. The system consists of many objects that are tied together through messages and/or relations.

Page 12: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

12

Component-Based Software

Why component-based software ?

The incompatible standards of the different methodologies have leaded to several problems, such as, confusion in the market, system integration, weakness, and chances for commercial success.

Therefore, to overcome these problems and to have many new features such as reusability, maintainability, and distribution, the component technology is appeared recently.

Page 13: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

13

COMPONENT-3

COMPONENT-2

COMPONENT-1

Client Application

Component-Based SoftwareThe architecture of the component-based software system is shown in the following figure (client /server architecture). The system has many components and a client. The client sends a function call to a component via the component’s interface. The component services the call and returns the results to the client.

Page 14: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

14

Agent - Based Software What is the Agent?

The term "agent" is heard frequently today. While it means a variety of things to a variety of people,

commonly it is defined as an “ Agent is independent software program, which runs

on behalf of a network user”.

An agent may run when the user is disconnected from the network, even if the user is disconnected involuntarily.

Some agents run on specialized servers, others run on standard platforms.

Many examples of agent systems exist, and they are receiving much attention on the World Wide Web("WWW").

Page 15: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

15

Agent - Based Software Agent Characteristics• Agents are fundamentally different from software packages and

other commercial programs.• Agents must have characteristics, which are required for

distributed applications development. These characteristics are Adaptability, Mobility, Transparency and accountability, Ruggedness, and Self-starters.

• Adaptability means that an agent must be able to work on multiple platforms.

• Mobility means that an agent should be able freely to roam networks and the Internet.

• Transparency and accountability means that an agent must be completely transparent to owner/user if required.

• Ruggedness means that if an agent is required to traverse networks, it should be able to solve as many problems as it can without human intervention.

• Self-starters mean that an agent must be able to start and stop on the basis of its own criteria.

Page 16: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

16

Characteristics of OOD• Objects are abstractions of real-world or

system entities and manage themselves.• Objects are independent and encapsulate

state and representation information. • System functionality is expressed in terms of

object services.• Shared data areas are eliminated. Objects

communicate by message passing.• Objects may be distributed and may execute

sequentially or in parallel.

Page 17: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

17

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 18: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

18

Advantages of OOD

• Easier maintenance. Objects may be understood as stand-alone entities.

• Objects are potentially reusable components.

• For some systems, there may be an obvious mapping from real world entities to system objects.

Page 19: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

19

Objects and object classes

• Objects are entities in a software system which represent instances of real-world and system entities.

• Object classes are templates for objects. They may be used to create objects.

• Object classes may inherit attributes and services from other object classes.

Page 20: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

20

Objects and object classes

An object is an entity that has a state and a defined set of operations which operate on that state. The state is represented as a set of object attributes. The operations associated with the object provide services to other objects (clients) which request these services when some computation is required.

Objects are created according to some object class definition. An object class definition serves as a template for objects. It includes declarations of all the attributes and services which should be associated with an object of that class.

Page 21: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

21

The Unified Modeling Language

• Several different notations for describing object-oriented designs were proposed in the 1980s and 1990s.

• The Unified Modeling Language is an integration of these notations.

• It describes notations for a number of different models that may be produced during OO analysis and design.

• It is now a de facto standard for OO modelling.

Page 22: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

22

Employee object class (UML)

Employee

name: stringaddress: stringdateOfBirth: DateemployeeNo: integersocialSecurityNo: stringdepartment: Deptmanager: Employeesalary: integerstatus: {current, left, retired}taxCode: integer. . .

join ()leave ()retire ()changeDetails ()

Page 23: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

23

Object communication

• Conceptually, objects communicate by message passing.

• Messages– The name of the service requested by the calling

object;– Copies of the information required to execute the

service and the name of a holder for the result of the service.

• In practice, messages are often implemented by procedure calls– Name = procedure name;– Information = parameter list.

Page 24: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

24

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 25: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

25

Generalisation and inheritance

• Objects are members of classes that define attribute types and operations.

• Classes may be arranged in a class hierarchy where one class (a super-class) is a generalisation of one or more other classes (sub-classes).

• A sub-class inherits the attributes and operations from its super class and may add new methods or attributes of its own.

• Generalisation in the UML is implemented as inheritance in OO programming languages.

Page 26: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

26

A generalisation hierarchy

Employee

Programmer

projectprogLanguages

Manager

ProjectManager

budgetsControlled

dateAppointed

projects

Dept.Manager

StrategicManager

dept responsibilities

Page 27: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

27

Advantages of inheritance

• It is an abstraction mechanism which may be used to classify entities.

• It is a reuse mechanism at both the design and the programming level.

• The inheritance graph is a source of organisational knowledge about domains and systems.

Page 28: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

28

Problems with inheritance

• Object classes are not self-contained. they cannot be understood without reference to their super-classes.

• Designers have a tendency to reuse the inheritance graph created during analysis. Can lead to significant inefficiency.

• The inheritance graphs of analysis, design and implementation have different functions and should be separately maintained.

Page 29: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

29

UML associations

• Objects and object classes participate in relationships with other objects and object classes.

• In the UML, a generalised relationship is indicated by an association.

• Associations may be annotated with information that describes the association.

• Associations are general but may indicate that an attribute of an object is an associated object or that a method relies on an associated object.

Page 30: 1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.

30

An association model

Employee Department

Manager

is-member-of

is-managed-by

manages