CH1 Swe - Part2
CH1 Swe - Part2
CH1 Swe - Part2
Lecture 2
Introduction
2
Software engineering
Software Engineering
a software engineer starts with problem definition and
applies tools of the trade to obtain a problem solution.
Programming is the craft of implementing the given blueprints.
Software engineer’s focus is on understanding the
interaction between the system-to-be and its users and
the environment.
3
4
Software Engineering
“Engineering is the analysis, design, construction, verification,
and management of technical (or social) entities”
Questions that we must answer:
What is the problem to be solved?
What characteristics of the entity are used to solve the problem?
How will the entity (and the solution) be realized?
How will the entity be constructed?
How to uncover error made in design and construction of entity?
Manage change: How to support, when corrections, adaptations,
and enhancements are requested by users of the entity.
6
7
What is Software engineering
Software engineering
Creating and maintaining software applications by applying
technologies and practices from computer science, project
management, and other fields.
8
Aspects of software engr.
1. Processes necessary to turn a concept into a robust
deliverable that can evolve over time.
2. Satisfying a customer
3. Managing risk
9
Ties to many fields
computer science (algorithms, data structures, languages, tools)
business/management (project mgmt, scheduling)
economics/marketing (selling, markets, monopolies)
communication (managing relations with stakeholders:
customers, management, developers, testers, sales)
law (patents, licenses, copyrights, reverse engineering)
sociology (modern trends in societies, localization, ethics)
political science (negotiations; topics at the intersection of
law, economics, and global societal trends; public safety)
psychology (personalities, styles, usability, what is fun)
art (GUI design, what is appealing to users)
10
Roles of people in software
customer / client: wants software built
often doesn't know what he/she wants
11
What is a software project?
Projects are a balance of three dimensions, with the goal of
producing a successful deliverable.
SOFTWARE
DELIVERABLE
TIME RESOURCES
12
ORTHOGONAL VIEWS OF THE SOFTWARE
Two Approaches:
Traditional Approach
Object-Oriented Approach
TRADITIONAL APPROACH:
Collection of programs or functions.
• A system that is designed for performing
certain actions.
• Algorithms + Data Structures =
Programs.
Software Development Models (Waterfall, 13
The traditional approach to software development
tends toward writing a lot of code to do all the things
that have to be done.
Algorithm Centric Methodology – only the algorithm
that can accomplish the task.
Data-Centric Methodology - think about the data to
build a structure based on the algorithm.
You are the only active entity and the code is just
basically a lot of building materials.
14
Object-oriented Approach
Object Oriented Development is a new way of
thinking about software based on abstractions that
exist in the real world as well as in the program.
An approach to the solution of problems in which all
computations are performed in the context of
objects.
•The objects are instances of classes, which:
are data abstractions
contain procedural abstractions that operate
on the objects
A running program can be seen as a collection of
objects collaborating to perform a given task.
15
OO development offers a different model
from the traditional software which is based
on functions and procedures.
• software is a collection of discrete object that
encapsulate their data as well as the
functionality.
• Each object has attributes (properties) and
method (procedures).
• software by building self contained modules
or objects that can be easily REPLACED,
MODIFIED AND REUSED. 16
EXAMPLES OF OBJECT ORIENTED
SYSTEMS
In OO system , “everything is object”.
A spreadsheet cell, bar chart, title in bar chart,
report,numbers, arrays, records, fields, files,
forms, an invoice, etc.
A window object is responsible for things like
opening, sizing, and closing itself.
A chart object is responsible for things like
maintaining data and labels even for drawing
itself.
17
BENEFITS OF OBJECT ORIENTATION
Faster development,
Re-usability,
Increased quality
modeling the real world and provides us with
the stronger equivalence of the real world‘s
entities (objects).
Raising the level of abstraction to the point
where application can be implemented in the
same terms as they are described.
18
Difference between Traditional and Object
Oriented Approach
19
Software Process
A software process is a set of related activities that leads to the
production of a software product.
There are many different software processes but all must include four
activities that are fundamental to software engineering:
1. Software specification: The functionality of the software and
constraints on its operation must be defined.
2. Software design and implementation: The software to meet
the specification must be produced.
3. Software validation: The software must be validated to ensure
that it does what the customer wants.
4. Software evolution: The software must evolve to meet
changing customer needs
20
Verification: are we building the product right?
Validation: are we building the right product?
21
software engineering
objectives
1. optimality
2. scalability.
22
Software process xics
Functionality: the degree of performance of the software
against its intended purpose.
Required functions are:
suitability
Accuracy
Interoperability
Compliance
Security
23
Reliability:
A set of attributes that bears on the capability of software to
maintain its level of performance under the given condition for
a stated period of time.
Required functions are
Recoverability
Fault tolerance
Maturity
24
Efficiency:
It refers to the ability of the software to use system resources
in the most effective and efficient manner.
The software should make effective use of storage space and
executive command as per desired timing requirements.
Required functions are:
efficiency In time
In resource
25
Usability: to the extent to which the software can be used
with ease.
The amount of effort or time required to learn how to use the
software.
Required functions are:
Understandability
Learnability
Operability
26
Maintainability:
It refers to the ease with which the modifications can be made in a
software system to extend its functionality, improve its performance,
or correct errors.
Stability
Changeability
Operability
27
Portability:
A set of attributes that bears on the ability of software to be
transferred from one environment to another, without or
minimum changes.
Required functions are:
Adaptability
Install ability
Replace ability
28
The "Software Lifecycle"
software lifecycle: The entire process of creating a software
product from an initial concept until the last user stops using it.
often divided into "phases":
Requirements – what does the customer want
Design – Describe how a solution that meets the requirements
Implementation – Convert the design (description) into code
Testing – Make sure the code meets the requirements
Maintenance – Fix problems while operating
other possibilities: Risk Assessment, Prototyping
29
Software is complex
Measures of complexity:
lines of code
number of classes
number of modules
module interconnections and dependencies
time to understand
# of authors
… many more
30
Life without software process
Advantages:
nothing to learn or plan!
work on whatever is interesting, ignore
the rest.
Disadvantages:
may ignore some important tasks (testing, design)
not clear when to start or stop doing each task
scales poorly to multiple people
hard to review or evaluate one's work
code may not match user's needs (no requirements!)
code was not planned for modification, not flexible
31
Software process models
Drawbacks?
No way to asses progress, quality, or risks
Unlikely to accommodate changes without a major design
Examination
Unclear delivery features (scope), timing, and support
34
Waterfall
The first published model of the software development process
derived from more general engineering processes
Perform each phase in order
35
1. Requirements analysis and definition
The system’s services, constraints, and goals are established
by consultation with system users.
They are then defined in detail and serve as a system
specification.
2. System and software design
The systems design process allocates the requirements to
either hardware or software systems by establishing an overall
system architecture.
36
3. Implementation and unit testing
During this stage, the software design is realized as a set of
programs or program units.
Unit testing involves verifying that each unit meets its
specification.
4. Integration and system testing
The individual program units or programs are integrated
and tested as a complete system to ensure that the
software requirements have been met.
37
5. Operation and maintenance
involves correcting errors which were not discovered in earlier
stages of the life cycle.
In waterfall the following phase should not start until the
previous phase has finished.
In practice, these stages overlap and feed information to each
other.
During design, problems with requirements are identified.
During coding, design problems are found and so on.
38
Waterfall model advantages
Suitable for projects that are very well understood but complex
Tackles all planning upfront
The ideal of no midstream changes equates to an efficient
software development process
39
Drawbacks of waterfall
req. change
requirements
verify
design
verify
implement
test
operations
drawbacks? retirement
assumes requirements will be clear and well-understood
requires a lot of planning up front (not always easy)
rigid, linear; not adaptable to change in the product
costly to go back to a previous phase
nothing to show until almost done
40
Spiral
steps taken at each loop:
determine objectives
and constraints
identify risks
evaluate options to
resolve risks
develop and verify
deliverables
benefits?
provides early indication of unforeseen problems
always addresses the biggest risk first
accommodates changes, growth
eliminates errors and unattractive choices early
41
Drawbacks of spiral
drawbacks?
relies on developers to have risk-assessment expertise
perhaps over-focuses on risk and "putting out fires"; other
features may go ignored because they are not "risky" enough
complex; how do you actually follow this?
works poorly when bound to an inflexible contract
42
comparison
43
Evolutionary prototyping
Develop a skeleton system and evolve it for delivery
Refine
Design and
Initial concept prototype until Complete and
implement
acceptable release
initial
prototype prototype
44
Evolutionary prototyping
for each build:
requirements arch. design operations
detailed design,
implement,
verify verify test, deliver
retirement
benefits?
produces steady signs of progress, builds customer confidence
useful when requirements are not well known or change rapidly
customer involvement ("What do you think of this version?")
45
Drawbacks of evolutionary
for each build:
requirements arch. design operations
detailed design,
implement,
verify verify test, deliver
retirement
drawbacks?
assumes user's initial spec will be flexible
Problems with planning
unclear how much iteration/time will be needed to finish
feature creep
fails for separate pieces that must then be integrated
temporary fixes become permanent constraints
46
Staged delivery
waterfall-like beginnings, then develop in
Requirements short stages
plan, design, execute, test, release
can ship at any time at the end of any
cycle
Design
48
Staged delivery model disadvantages
Disadvantages
Requires tight coordination with documentation, management,
marketing
Product must be decomposable
Extra releases cause overhead
49
Why are there so many models?
The choice of a model depends on the project circumstances
and requirements.
50
What’s the best model?
Consider
The task at hand
Risk management
Quality / cost control
Predictability
Visibility of progress
Customer involvement and feedback
51
Model category matrix
Rate each model 1-5 in each of the categories shown:
Risk Quality/ Predict- Visibility Customer
mgmt. cost ctrl. ability of progress involvement
code-and-fix
1 1 1 3 1
waterfall
3 4 4 1 2
spiral
5 5 3 3 3
evolutionary
prototyping 3 3 2 5 5
staged delivery
design-to-schedule
4 5 4 4 4
4 3 5 3 2
52
Other Models
Rapid application development (RAD) Model
incremental software development process model
emphasizes an extremely short development cycle
achieved by using component-based construction
Piece together already existing components to create what you need
The Formal-methods model
formal mathematical specification of computer software
specify, develop, and verify systems by a rigorous, mathematical
notation
SE M.Sc. And PhD researches focus here
Agile Model: is based on iterative development.
- break tasks into smaller iterations
- duration and scope of each iteration is clearly defined in
advance.
53
Software process metrics
Software Measurement
Size-Oriented Metrics(Programming language dependent)
Errors per KLOC (thousand lines of code).
Defects per KLOC.
per LOC.
Page of documentation per KLOC.
In addition, other interesting metrics can be
computed
Errors per person-month.
LOC per person-month.
per page of documentation.
54
Function oriented metrics(programming language independent)
Does the system require reliable backup and recovery?
number of user inputs
number of user outputs
Measures of errors uncovered before release
Defects delivered to and reported by end users
55
Object Oriented Methodologies
Many methodologies have been developed
for object oriented development.
• A methodology usually includes:
• Notation : Graphical representation of
classes and their relationships with
interactions.
• Process : Suggested set of steps to
carry out for transforming requirements into a
working system.
• Tool (CASE): Software for drawings and
documentation 56
WHY OBJECT ORIENTATION
OO Methods enables to develop set of objects that work
together software similar to traditional techniques.
It adapts to:
• Changing requirements
• Easier to maintain
• More robust
• Promote greater design
• Code reuse
57
OVERVIEW OF UNIFIED APPROACH(UA)
The unified approach (UA) is a methodology for software
development.
Combines with the OMT (Object Modeling Technique in
Unified Modelling Language(UML).
UA utilizes the unified modeling language (UML) which is
a set of notations and conventions used to describe and
model an application.
58
The unified approach combines all the powerful
features present in the methods of Grady booch,
james, rumbaugh and Jacobson and thus creates a
new tool for the analysis and modeling of the
system.
The result of this is the unified modeling language
(UML) .
In UML a system is represented using five different
views that describe the system form different
perspectives.
Each view is defined by a set of diagrams. A view
may be represented by a single diagram. 59
The views present in UML are:
1. Structural Model View : Static structures i.e. classes objects
relationships etc. are modeled.
2. Behavioral Model View: it represent the dynamic aspects of
a system. It also depicts the interactions or collaboration
between various structural element described in other views
3. User Model view This view represents system from the
user perspective.
4. Implementation Model View : The structural and behavioral
aspects o f the system are represented as they are
5. Environment Model View :The structural and behavioral
aspects of the environment in which the system is to be
implemented are represented.
60
Objects and classes
Objects: All entities involved in the solution design are known as
objects.
For example, person, banks, company, and users are
considered as objects.
Every entity has some attributes associated with it and has
some methods to perform on the attributes.
Classes: A class is a generalized description of an object. An object
is an instance of a class.
A class defines all the attributes, which an object can have
and methods, which represents the functionality of the object.
Messages: Objects communicate by message passing.
Messages consist of the integrity of the target object, the
name of the requested operation, and any other action
needed to perform the function.
They are often implemented as procedure or function calls. 61