CS 456

CS 456
Software
Engineering
1
Contents
2
Chapter 1: Introduction
3
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.
4
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.
5
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.
6
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).
7
Software Technology
8
Software Technology
• Function - Based Software
• Object- Oriented Software
• The Component - Based Software
• Agent - Based Software
9
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 - 1
Function - 2
Shared data
Function - 3
Function - 4
Function-Based System Architecture
10
Object-Oriented Software
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.
Object-2
Message-1
Message-3
Object-1
Message-2
Message-4
Object-3
Object-4
11
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.
12
Component-Based Software
The 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.
COMPONENT-1
COMPONENT-2
Client Application
COMPONENT-3
13
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").
14
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.
15
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.
16
Interacting objects
17
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.
18
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.
19
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.
20
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.
21
Employee object class (UML)
Em p lo yee
n am e: st ri ng
address: st ring
dat eOfB irt h : Dat e
em plo yeeNo: in t eger
so ci al Securit yNo : st ri ng
depar t m ent : Dep t
m anager: Em pl oy ee
salar y : in t eger
st at us: {curren t , l eft , ret ired}
t axC ode: in t eger
. ..
jo in ()
leave ()
ret ire ()
chan geDet ails ()
22
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.
23
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) ;
24
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.
25
A generalisation hierarchy
Emp loyee
M an ager
Pro grammer
budgetsCo ntro lled
p roject
p rogLanguages
dateAp po in ted
Pro ject
M an ager
Dept.
M an ager
p rojects
dept
Strateg ic
M an ager
respo nsibilities
26
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.
27
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.
28
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.
29
An association model
Emp loy ee
is-member-o f
Depar tment
is-managed-by
manages
M an ager
30