Software Engineering
Introduction to Software Engineering
Course Outline
• To understand the process of designing, building, and maintaining software
systems.
• To acquire the skill of software project management.
• To understand software evolution, testing approaches and quality assurance
to ensure high standard/professional software
2
Software Engineering
3
What is Software Engineering
• Engineering discipline that is concerned with all aspects of software
production.
– Design
– Development
– Maintenance
• There are various types of software systems
• embedded systems
• complex, worldwide information systems
• Different types of software require different approaches
• Every software require software engineering; but not the same technique
4
Importance of Software Engineering?
The importance of Software engineering is as follows:
– Reduces complexity
– Minimizes software cost
– Decreases time
– Handles big projects
– Reliable software
– Effectiveness
5
Required Tasks in Software Engineering?
• Software engineering task requires:
Ability to quickly learn new and diverse disciplines and business processes
Ability to communicate with domain experts, extract an abstract model of the
problem, and formulate a solution.
Ability to design the software systems for the proposed solution to meet the business
needs for many years.
• Software Engineer’s task: understand the customer’s business needs and
design software accordingly.
6
The Role of Software Engineering
7
The Role of Software Engineering
Customer:
Requires a computer system to achieve some business goals
by user interaction or interaction with the environment
in a specified manner
System-to-be
Environment
Software-to-be
User
Software Engineer’s task:
To understand how the system-to-be needs to interact with
the user or the environment so that customer’s requirement is met
and design the software-to-be
May be the Programmer’s task:
same person To implement the software-to-be
designed by the software engineer
8
The Role of Software Engineering (SE)
Some Misconceptions:
Software engineering is all about Programming
Software engineering is about writing loads of documentation
Software engineering is about writing a running code
• SE is the creative activity of understanding the business problems, coming up with an
idea for solution, and designing the ‘blueprints’ of the solution.
• Programming is the ability of implementing the given blueprints
• SE is helpful to document the process (not the final solution) to know what alternatives
were considered and why particular choice were made.
• SE is about delivering value for the customer, and both code and documentation are
valuable.
9
Introduction: Software is Complex
Complex ≠ Complicated
• Complex = composed of many simple components
related to one another
• Complicated = refers to a high level of difficulty
Complexity Example:
Scheduling Fence Construction Tasks
Nailing Painting
Setting posts Cutting wood
[ 2 time units for unpainted; [ 5 time units for uncut wood;
[ 3 time units ] [ 2 time units ]
3 time units otherwise ] 4 time units otherwise ]
Setting posts < Nailing, Painting
Cutting < Nailing
In what order should these tasks be carried out to complete the project
in the shortest possible time?
[ ⇒ “simple” problem, but hard to solve without a pen and paper ] 11
Example: ATM Machine
Understanding the money-machine problem:
Communication link
1
4 2
7 5 3
8 6
0 9
Bank’s
remote
ATM machine
datacenter
Bank
customer
12
How ATM Machine Might Work
Domain model Domain Model
created with help
of domain expert
Transaction
How may I record
help you? Cash
Bookkeeper
Speakerphone Safe
Safe keeper
Phone
Window clerk
Datacenter
liaison
Dispenser
Bank’s
remote
datacenter 13
Customer
Cartoon Strip: How ATM Machine Works
A Enter B C Verify
account
D
your PIN
XYZ
Verify
this
account
Typing in XYZ valid. Account
PIN number Balance: valid.
… $100 Balance:
$100
E How may F Release
G Record
I help $60 $60 less
you?
Dispensing!
Withdraw Dispense
H
$60 $60
Please take
your cash
14
Software Engineering Lifecycle
• Any product development process includes the following phases:
• Planning/specification
• Design
• Implementation
• Evaluation
• The common software development phases are:
• Requirement specification - Understanding the usage scenarios
• Design - Assigning responsibilities to objects
• Implementation - Encoding design in a programming language
• Testing - Individual component (unit) and the entire system (integration)
• Operation and Maintenance - running the systems, fixing bugs, adding new features
15
Software Development Methods
Waterfall – Activities are proceed in a sequential manner, not practical
Iterative Waterfall Model - allows the mechanism of error correction, not
suitable for very large projects
Iterative + Incremental (Evolutionary) - suitable for large projects,
decomposed into a set of modules. Develop increment of functionality in each
iteration
Agile - an iterative approach, requires customer feedback after each Time-box.
The end date of an iteration is fixed
16
Waterfall Method
Requirements
Design
Implementation
Testing
Waterfall
method Deployment &
Maintenance
proceeds sequentially
finish this step before moving to the next
17
Modeling Languages
• Modeling is the designing of software applications before coding.
• Modeling is an Essential Part of large software projects, and helpful to
medium and even small projects as well.
• There are several modelling languages:
– UML (Unified Modeling Language)
– Activity diagram
– Use case diagram
– Sequence diagram
18
UML – Language of Symbols
UML = Unified Modeling Language
«interface»
Stereotype
BaseInterface
«⋅⋅⋅» provides
ClassName additional info/
+ operation()
annotation/
# attribute_1 : int explanation
Three common # attribute_2 : boolean
compartments: # attribute_3 : String
1. Classifier name Inheritance
+ operation_1() : void relationship:
+ operation_2() : String Class1Implement Class2Implement
2. Attributes BaseInterface
+ operation_3(arg1 : int) is implemented
+ operation() + operation()
3. Operations by two classes
Software Class
Actor Comment Software Interface Implementation
instance1 : Class1 instance5 : Class2 instance8 : Class3
doSomething()
doSomethingElse()
Interaction Diagram
doSomethingYetElse()
Online information:
http://www.uml.org
19
Requirements Analysis and System Specification
• Requirement analysis is the first step of software development process.
• Developer attempts to understand the problem and define its scope.
• Goal: Produce system specification
– what the system will do
– how the system will interact with the external players
Actors - Agents external to the system
Concepts/ Objects - Agents working inside the system
Use Cases – describes the interaction between the System and Actors
20
ATM: Gallery of Players
1
4 2
7 5 3
8 6
0 9
Bank customer System Bank’s remote
(ATM machine) datacenter
Actors (Easy to identify because they are visible!)
21
Gallery of Workers + Things
Window clerk Datacenter Bookkeeper Safe keeper Dispenser
liaison
Speakerphone Telephone Transaction Safe Cash
record
Concepts (Hard to identify because they are invisible/imaginary!) 22
Use Case: Withdraw Cash
A Enter
B Verify
account C How may
your PIN XYZ I help
you?
1
4 2
7 5 63 1
8 4 2
0 9 7 85 6 3
0 9
Typing in XYZ valid. Withdraw
PIN number Balance: $60
… $100
D E XYZ
Please take
your cash withdrew
$60
1
4 2
7 5 63
8
0 9
Collecting
cash …
Acknowledged
23
Domain Model
• Models the inside of the system.
• Design problems have unlimited number of alternative solutions
having a draftsman to draw the banknotes requested by the customer
we imagine having a courier run to a nearest bank depository to retrieve the requested
money
Which solution is the best or even feasible?
24
How ATM Machine Works (2)
Domain Model (2)
Alternative Solution
modification
solution
Transaction
How may I record
help you?
Bookkeeper
Speakerphone
Draftsman
Window clerk
Dispenser
Customer
How ATM Machine Works (3)
Domain Model (3)
Alternative Solution
modification
solution
Transaction
How may I record
help you?
Bookkeeper
Speakerphone
Courier
Window clerk
Dispenser
Remote
bank
Customer
Software Design
Recurring issues of software design include:
– Design quality evaluation
– Design for change
– Design for reuse
27
Effort Estimation and Quality measurement
Formal hedge pruning
28
Sizing the Problem (1)
Step 1: Divide the problem into small & similar parts
Step 2:
Estimate relative
sizes of all parts
Size( )=4
Size( ) = 7
Size( ) = 10
Size( ) = 3
Size( ) = 4
Size( ) = 2
Size( ) = 4
Size( ) = 7
Sizing the Problem (2)
• Step 3: Estimate the size of the total work
Total size = Σ points-for-section i (i = 1..N)
• Step 4: Estimate speed of work (velocity)
• Step 5: Estimate the work duration
Path size
Travel duration =
Travel velocity
Effort Estimation of Incremental and Iterative Process
After the first iteration you can use the measured velocity to obtain a more
accurate estimate of the project duration 31
Sizing the Problem (3)
• Advantages:
– Velocity estimate may need to be adjusted (based on
observed progress)
– However, the total duration can be computed quickly
(provided that the relative size estimates of parts are
accurate – easier to achieve if the parts are small and
similar-size)
Exponential Cost of Estimation
100%
Estimation accuracy
Estimation cost
Improving accuracy of estimation beyond a certain point requires huge cost
and effort (known as the law of diminishing returns)
In the beginning of the curve, a modest effort investment yields huge gains in
accuracy
33
Estimation Error Over Time
Estimation
error
Requirements Design Implementation
Start Completion Time
The cone of uncertainty starts high and narrows down to zero
as the project approaches completion.
Measuring Quality of Work
Good Shape Poor Shape
(Low branches get sun) (Low branches
shaded from sun) Heading back not Remove dead wood
recommended as
it alters the natural Remove water spouts
shape of the shrub and suckers
Rounded forms, which
Snow accumulates Straight lines require Peaked and rounded tops
follow nature’s tendency,
on broad flat tops more frequent trimming hinder snow accumulation
require less trimming
35
Summary
1. Incremental and iterative strategy helps in quick and more
accurate effort estimation
2. Improves the development process quality
36
Conceptual Maps
Concept maps are graphical tools for organizing and representing knowledge and
concepts. Represented by:
circles or boxes of some type, and
relationships between the concepts are connected by lines linking two
concepts.
How to construct a concept map:
• Establish a main concept or idea, topic, or issue to focus on
• Identify related concepts
• Connect the concepts - creating linking phrases and words
• Fine-tune the map
37
Conceptual Maps
Useful tool for problem domain description
SENTENCE: “My friend is coding a new program”
translated into propositions
I
Proposition Concept Relation Concept
have
1. I have friend
2. friend engages in coding friend
3. coding constructs a program engages in
4. program is new coding
constructs a
program
is
Search the Web for Concept Maps new
38
Conceptual Maps
39
Conceptual Maps
40
Conceptual Maps
41
Conceptual Maps
42
Concept Map for Home Access Control
tenant
enters
wishes key
can be
upper bound on failed attempts
causes valid key invalid key
lock opened
can be prevented by enforcing
may signal
burglar launches dictionary attack
43
Conceptual Maps
Benefits of Concept Mapping
• Help for brainstorming and generating new ideas
• Encourage to discover new concepts and the propositions that
connect them
• Allow to more clearly communicate ideas, thoughts and
information
• Help to integrate new concepts with older concepts
• Help to gain enhanced knowledge of any topic and evaluate the
information 44
Practicing!!!
Draw a Concept Map for MIST
admission process
45