Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
30 views50 pages

Software Engineering Basics

The document introduces software engineering principles including defining software, different types of software, stakeholders, and quality criteria. It discusses that software engineering is the process of solving customer problems through systematic development of large, high-quality software within constraints. Key aspects of quality are usability, efficiency, reliability, and maintainability which sometimes conflict and require balancing objectives. Internal quality and long-term versus short-term quality are also introduced.

Uploaded by

henok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views50 pages

Software Engineering Basics

The document introduces software engineering principles including defining software, different types of software, stakeholders, and quality criteria. It discusses that software engineering is the process of solving customer problems through systematic development of large, high-quality software within constraints. Key aspects of quality are usability, efficiency, reliability, and maintainability which sometimes conflict and require balancing objectives. Internal quality and long-term versus short-term quality are also introduced.

Uploaded by

henok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 50

Chapter One

Introduction & Review of


principles of Object Orientation

Chapter 1: Introduction & Review of


Yodit G 1
principles of Object Orientation
1. What is Software?
• Software is a set of programs to operate
computers and related devices
• is a set of instructions, data or programs used
to operate computers and execute specific
tasks

Chapter 1: Introduction & Review of


Yodit G 2
principles of Object Orientation
1.1. The Nature of Software
• Software is intangible
– Hard to understand development effort
• Software is easy to reproduce
– Cost is in its development
• in other engineering products, manufacturing is the
costly stage
• The industry is labor-intensive
– Hard to automate

Chapter 1: Introduction & Review of


Yodit G 3
principles of Object Orientation
1.1. The Nature of Software ...
• Untrained people can hack something together
– Quality problems are hard to notice
• Software is easy to modify
– People make changes without fully understanding it
• Software does not ‘wear out’
– It deteriorates by having its design changed:
• erroneously, or
• in ways that were not anticipated, thus making it complex

Chapter 1: Introduction & Review of


Yodit G 4
principles of Object Orientation
1.1. The Nature of Software …
• Conclusions
– Much software has poor design and is getting
worse
– Demand for software is high and rising
– We are in a perpetual ‘software crisis’
– We have to learn to ‘engineer’ software

Chapter 1: Introduction & Review of


Yodit G 5
principles of Object Orientation
1.2. Types of Software...
• Custom
– For a specific customer
• Generic
– Sold on open market
– Often called
• COTS (Commercial Off The Shelf)
• Shrink-wrapped
• Embedded
– Built into hardware
– Hard to change
Chapter 1: Introduction & Review of
Yodit G 6
principles of Object Orientation
1.2. Types of Software …
• Differences among custom, generic and
embedded software

Chapter 1: Introduction & Review of


Yodit G 7
principles of Object Orientation
1.2. Types of Software …
• Real time software
– E.g. control and monitoring systems
– Must react immediately
– Safety often a concern
• Data processing software
– Used to run businesses
– Accuracy and security of data are key

• Some software has both aspects


Chapter 1: Introduction & Review of
Yodit G 8
principles of Object Orientation
1.3. What is Software Engineering?
• The process of solving customers’ problems by the
systematic development and evolution of large, high-
quality software systems within cost, time and other
constraints

• Solving customers’ problems


– This is the goal of software engineering
– Sometimes the solution is to buy, not build
– Adding unnecessary features does not help solve the problem
– Software engineers must communicate effectively to identify
and understand the problem

Chapter 1: Introduction & Review of


Yodit G 9
principles of Object Orientation
1.3. What is Software Engineering?…
• Systematic development and evolution
– An engineering process involves applying well understood
techniques in a organized and disciplined way
– Many well-accepted practices have been formally
standardized
• e.g. by the IEEE or ISO
– Most development work is evolution
• Large, high quality software systems
– Software engineering techniques are needed because large
systems cannot be completely understood by one person
– Teamwork and co-ordination are required
– Key challenge: Dividing up the work and ensuring that the
parts of the system work properly together
– The end-product that is produced must be of sufficient
Yodit G quality Chapter 1: Introduction & Review of
10
principles of Object Orientation
1.3. What is Software Engineering?...

• Cost, time and other constraints


– Finite resources
– The benefit must outweigh the cost
– Others are competing to do the job cheaper and
faster
– Inaccurate estimates of cost and time have caused
many project failures

Chapter 1: Introduction & Review of


Yodit G 11
principles of Object Orientation
1.4. Software Engineering and the
Engineering Profession
• The term Software Engineering was coined in 1968
– People began to realize that the principles of
engineering should be applied to software development
• Engineering is a licensed profession
– In order to protect the public
– Engineers design artifacts following well accepted
practices which involve the application of science,
mathematics and economics
– Ethical practice is also a key principle of the profession

Chapter 1: Introduction & Review of


Yodit G 12
principles of Object Orientation
1.5. Stakeholders in Software Engineering

• 1. Users
– Those who use the software
• 2. Customers
– Those who pay for the software
• 3. Software developers
• 4. Development Managers

• All four roles can be fulfilled by the same person

Chapter 1: Introduction & Review of


Yodit G 13
principles of Object Orientation
1.6. Software Quality...
• Usability
– Users can learn it and fast and get their job done easily
• Efficiency
– It doesn’t waste resources such as CPU time and memory
• Reliability
– It does what it is required to do without failing
• Maintainability
– It can be easily changed
• Reusability
– Its parts can be used in other projects, so reprogramming is
not needed
Chapter 1: Introduction & Review of
Yodit G 14
principles of Object Orientation
1.6. Software Quality...
Customer: User:
solves problems at easy to learn;
an acceptable cost in efficient to use;
terms of money paid and helps get work done
resources used

QUALITY
SOFTWARE

Developer: Development manager:


easy to design; sells more and
easy to maintain; pleases customers
easy to reuse its parts while costing less
to develop and maintain

Chapter 1: Introduction & Review of


Yodit G 15
principles of Object Orientation
1.6. Software Quality …
• The different qualities can conflict
– Increasing efficiency can reduce maintainability or reusability
– Increasing usability can reduce efficiency

• Setting objectives for quality is a key engineering


activity
– You then design to meet the objectives
– Avoids ‘over-engineering’ which wastes money

• Optimizing is also sometimes necessary


– E.g. obtain the highest possible reliability using a fixed
budget
Chapter 1: Introduction & Review of
Yodit G 16
principles of Object Orientation
1.6.1. Internal Quality Criteria
• These:
– Characterize aspects of the design of the software
– Have an effect on the external quality attributes
– E.g.
• The amount of commenting of the code
• The complexity of the code

Chapter 1: Introduction & Review of


Yodit G 17
principles of Object Orientation
1.6.2. Short Term Vs. Long Term Quality

• Short term:
– Does the software meet the customer’s immediate
needs?
– Is it sufficiently efficient for the volume of data we
have today?
• Long term:
– Maintainability
– Customer’s future needs

Chapter 1: Introduction & Review of


Yodit G 18
principles of Object Orientation
1.7. Basic Principles of Object
Orientation

Object Orientation

Encapsulation
Abstraction

Modularity

Hierarchy
Chapter 1: Introduction & Review of
Know This.
Yodit G 19
principles of Object Orientation
1.7.1.1. What is Abstraction?

Salesperson

Not saying
which
salesperson – just
a salesperson in
general!!!
Product
Customer

Manages Complexity
Chapter 1: Introduction & Review of
Yodit G 20
principles of Object Orientation
1.7.1.2. What is Encapsulation?
• Hide implementation from clients
– Clients depend on interface – only!
– Clients do not need to know ‘how’ the server
operates or provides the services!

How does an object encapsulate?


What does it encapsulate?
DISCUSS!!!!!
Improves Resiliency
Chapter 1: Introduction & Review of
Yodit G 21
principles of Object Orientation
1.7.1.3. What is Modularity?
• The breaking up of something complex into
manageable pieces Order
Entry

Order Processing
System Order
Fulfillment

Manages Complexity Billing

Chapter 1: Introduction & Review of


Yodit G 22
principles of Object Orientation
1.7.1.4. What is Hierarchy?
Increasing Asset
abstraction

• Levels of abstraction

BankAccount Security RealEstate

Savings Checking Stock Bond

Decreasing Elements at the same level of the hierarchy


abstraction should be at the same level of abstraction
Chapter 1: Introduction & Review of
Yodit G 23
principles of Object Orientation
1.7.2. Basic Concepts of Object
Orientation
• Object
• Class
• Attribute
• Operation
• Interface (Polymorphism)
• Component
• Package
• Subsystem
• Relationships
Chapter 1: Introduction & Review of
Yodit G 24
principles of Object Orientation
A More Formal Definition
• An object is a concept, abstraction, or thing with sharp
boundaries and meaning for an application

•  An object is something that has:


– State
– Behavior
– Identity

• Know This.
Chapter 1: Introduction & Review of
Yodit G 25
principles of Object Orientation
1.7.2.1. Representing Objects – the
beginnings…
• An object is represented as a rectangle with
underlined name (no class name shown here)
(unnamed object)
: Professor a + b = 10

ProfessorClark
Class Name Only
Professor Clark
ProfessorClark :
Professor Object Name Only

Class and Object Name


(stay tuned for classes)
Chapter 1: Introduction & Review of
Yodit G 26
principles of Object Orientation
What is a Class?
•  A class is a description of a group of
objects with common properties (attributes),
behavior (operations), relationships, and
semantics

•  A class is an ‘abstraction’ of objects….


– An object is an instance of a class

OO Principle: Abstraction
Chapter 1: Introduction & Review of
Yodit G 27
principles of Object Orientation
Representing Classes
• A class is represented using a compartmented
rectangle
– (note: no underlining)
a + b = 10
Professor

Professor Clark

Chapter 1: Introduction & Review of


Yodit G 28
principles of Object Orientation
Class Compartments – a bit more
development
• A class is comprised of three sections
– The first section contains the class name
– The second section shows the structure
(attributes)
– The third section shows the behavior (operations)
Class Name Professor
name
Attributes empID
Operations create( )
save( )
delete( )
change( )

Chapter 1: Introduction & Review of


Yodit G 29
principles of Object Orientation
The Relationship Between Classes and
Objects
• A class is an abstract definition of an object
– It defines the structure and behavior of each object in
the class
– It serves as a template for creating objects
Objects Class

Professor

Professor Smith Professor Mellon

Professor Jones
Chapter 1: Introduction & Review of
Yodit G 30
principles of Object Orientation
What is an Attribute?
Object
Class
Specific
Attribute attribute values
:CourseOffering
for different
number = 101
objects
startTime = 900
CourseOffering endTime = 1100
number
startTime
endTime :CourseOffering
number = 104
startTime = 1300
endTime = 1500

Chapter 1: Introduction & Review of


Yodit G 31
principles of Object Orientation
What is an Operation? (very general form
here…)

CourseOffering
Class
addStudent
deleteStudent
getStartTime
Operation getEndTime
Really need to show more, but here, this is sufficient.

Chapter 1: Introduction & Review of


Yodit G 32
principles of Object Orientation
What is a Component?
• A non-trivial, nearly independent, and
replaceable part of a system that fulfills a clear
function in the context of a well-defined
architecture
• A component may be OO Principle:
– A source code component Encapsulation
– A run time component or
– An executable component
Source File <<EXE>> <<DLL>>
Name Executable Component
Name Name
Component
Interface
Chapter 1: Introduction & Review of
Yodit G 33
principles of Object Orientation
What is a Package?
• A package is a general purpose mechanism for organizing like
elements into groups
• A model element which can contain other model elements
• Think: in the Java API, similar classes are found in ‘packages’
that we may import, etc.

OO Principle:
Package Name Modularity
• Uses
– Organize the model under development Know This
– A unit of configuration management

– Think: Math class. (contains math classes such as cos() )


Chapter 1: Introduction & Review of
Yodit G 34
principles of Object Orientation
Example for Data Structures Class:

• Think IO package you imported.


• Inside this package are many (often) unrelated
classes.
– FileReader
– BufferedReader
– FileWriter
– PrinterWriter, etc.
• To USE any of these classes, we merely create an
object of them and proceed – independently of any
other classes.
• To USE any of these classes in the package, we go
directly to the class, instantiate the class, and use the
methods in the objects.
Chapter 1: Introduction & Review of
Yodit G 35
principles of Object Orientation
What is a Subsystem?
• A combination of a package (contains other model
elements) and a class (has behaviors)
• A subsystem: realizes one or more interfaces which define
its behavior
• Interface is an abstract class. Subsystems implement
(realize) the interface(s)…
Realization
Subsystem
<<subsystem>>
Interface Subsystem Name
Interface

OO Principles: Encapsulation and Modularity


Know This. (stay tuned for realization relationship)
Chapter 1: Introduction & Review of
Yodit G 36
principles of Object Orientation
Example of Subsystems
Realization
Subsystem
<<subsystem>>
Interface Subsystem Name
Interface
Subsystem might be AccountsReceivable, AccountsPayable, Billing,
That is, a major hunk of functionality.

BUT, a client of the subsystem does NOT have access to the individual
Classes like in a Package. Rather, a client must go through the
public Interface to the subsystem, which contains the signatures of the
services provided within the subsystem.
The contents of the subsystem are NOT directly accesses;
They are protected;
Only the services shown in the interface are made available to clients.
Chapter 1: Introduction & Review of
Yodit G 37
principles of Object Orientation
Relationships
• Association
– Aggregation
– Composition
• Dependency
• Generalization
• Realization

Chapter 1: Introduction & Review of


Yodit G 38
principles of Object Orientation
 Relationships: Association
• Models a semantic connection among classes

Association Name

Professor Works for University

Association
Role Names

Class University
Professor
Employee Employer

Chapter 1: Introduction & Review of


Yodit G 39
principles of Object Orientation
Relationships: Aggregation (simple
aggregate)
• A special form of association that models a
whole-part relationship between an aggregate
Whole Part
(the whole) and its parts

Student Schedule

Know This Aggregation – sometimes


called ‘simple aggregation.’
This is sometimes called a
Chapter 1: Introduction & Review of
Yodit G ‘has_a’ relationship
principles of Object Orientation
40
Relationships: Composition
• A form of aggregation with strong ownership
and coincident lifetimes
Whole Part
– The parts cannot survive the whole/aggregate

Student Schedule

Aggregation
Know This
This one is called
‘composition.’
Chapter 1: Introduction & Review of
Yodit G 41
principles of Object Orientation
Association: Multiplicity and Navigation
• Multiplicity defines how many objects participate
in a relationship
– Multiplicity is a Structural Relationship!
– The number of instances (that is, ‘objects’) of one
class related to ONE instance of another class
(examples ahead)
– Specified for each end of the association

• Associations and aggregations are bi-


directional by default, but it is often desirable
to restrict navigation to one direction
– If navigation is restricted, an arrowhead is added
Yodit G
to indicate the direction of& Review
Chapter 1: Introduction theofnavigation 42
principles of Object Orientation
Association: Multiplicity
• Unspecified
• Exactly one 1

• Zero or more (many, unlimited) 0..*

1..*
• One or more
0..1
• Zero or one
2..4
• Specified range
2, 4..6
• Multiple, disjoint ranges

Chapter 1: Introduction & Review of


Yodit G 43
principles of Object Orientation
Example: Multiplicity and Navigation

Multiplicity

Student 1 0..* Schedule

Navigation

Note: A student has zero or more schedules. (Multiplicity)


Note: Aggregation: ‘has_a’ (whole-part relationship).
Chapter 1: Introduction & Review of
Yodit G 44
principles of Object Orientation
 Relationships: Dependency
• A relationship between two model elements where a change in
one may cause a change in the other
• Non-structural, “using” (or “communicates”) relationship
– (non-structural: no numbers of one kind related to another kind…)
• Can actually say the Client ‘uses’ the Supplier.
Know This
Client Supplier Component
Class

Package Client Supplier


Dependency
relationship

ClientPackage SupplierPackage
Dependency
relationship
Chapter 1: Introduction & Review of
Yodit G 45
principles of Object Orientation
 Relationships: Generalization
• A relationship among classes where one class
shares the structure and/or behavior of one or more
classes

• Defines a hierarchy of abstractions in which a


subclass inherits from one or more superclasses

•  Generalization is a “is-a-kind of”


relationship, or simply, “is_a” relationship.
Chapter 1: Introduction & Review of
Yodit G 46
principles of Object Orientation
Example: Single Inheritance

• One class inherits from another


Ancestor

Account
balance
name
Superclass number
(parent) Withdraw()
CreateStatement()
Generalization Relationship
Subclasses inherit both
attributes and methods from
base (parent) class.
Checking Savings

GetInterest()
Subclasses Withdraw()
Withdraw()

Descendents
Chapter 1: Introduction & Review of
Yodit G 47
principles of Object Orientation
Example: Multiple Inheritance
• A class can inherit from several other classes

FlyingThing Animal

multiple
inheritance

Airplane Helicopter Bird Wolf Horse

Use multiple inheritance only when needed, and


always with caution !
Chapter 1: Introduction & Review of
Yodit G 48
principles of Object Orientation
What Gets Inherited?
• A subclass inherits its parent’s attributes,
operations, and relationships
• A subclass may add:
– additional attributes, operations, relationships
– Redefine inherited operations (use caution!)

• Common attributes, operations, and/or


relationships are shown at the highest applicable
level in the hierarchy
Inheritance leverages the similarities among classes
Chapter 1: Introduction & Review of
Yodit G 49
principles of Object Orientation
Example: What Gets Inherited (note form of
arrow)
GroundVehicle
owner Person
Superclass weight
(parent) licenseNumber 0..* 1

register( )
generalization

Car Truck Trailer


Subclass size tonnage
getTax( )

What about a ‘register()’ in Car?

Chapter 1: Introduction & Review of


Yodit G 50
principles of Object Orientation

You might also like