SE - Lecture 6 - Software Design n Construction.pptx
1. ITS 66404
Principles of Software
Engineering
Nur Haifa
Chapter 6- Software
Design and
Construction
Sequence Diagram
2. Agenda
✧ Software Development phases
✧ Software Lifecycle activities
✧ Software Design
✧ Software Construction
✧ Sequence Diagram
Chapter 1 – Intro to Software Engineering 2
3. 3
Software Development Phases
Requirements
What needs to be done
Analysis
How it should be done
Design
Create a software structure
(architecture) around which
code will be built
Construction
Fill in the software
structure with code
Testing
Check that the code does what
it is supposed to (functionality,
performance, reliability, …)
Project Management
Devise a plan, manage
resources, costs, time, …
4. 4
Software Phases Related to
this Course
Design
Create a software structure
(architecture) around which
code will be built
Construstion
Fill in the software
structure with code
7. 7
Software Life Cycle Activities
(more)
✧Requirements Specification
▪ System analyst works with users to clarify the detailed system
requirements
▪ Questions include format of input data, desired form of any
output screens, and data validation
✧Analysis
▪ Make sure you completely understand the problem before
starting the design or program a solution
▪ Evaluate different approaches to the design
8. Chapter 1: Introduction to Software Design 8
Software Life Cycle Activities
(continued) ✧Design Modelling
▪ Top-down: break system into smaller subsystems
▪ Object-oriented: identify objects and their interactions
▪ UML diagrams: tool to show interactions between:
• Use case diagram
• Class diagram
• Object diagram
• Sequence diagram
• Activity diagram
• State diagram
11. Software Construction 11
Construction
Definition of Software Construction:
Detailed creation of working, meaningful software through a
combination of coding, verification, unit testing, integration
testing, and debugging
Software construction closely tied to
▪ Software design
▪ Software testing
Design
Construction
Testing
5/9/2021
12. Software Construction 12
More on Construction
✧ Significant detailed design occurs during construction
✧ Low-level (e.g. unit and module integration) testing occurs during
construction
✧ Construction produces high volume of configuration items
▪ Thus construction linked to configuration management
✧ Construction is tool intensive
✧ Quality (or lack thereof) is very evident in the construction products
✧ Construction highly related to Computer Science due to
▪ Use of algorithms
▪ Detailed coding practices
5/9/2021
13. Software Construction 13
The fundamentals of software construction include:
▪ Minimizing complexity
▪ Anticipating change
▪ Constructing for verification
▪ Standards in construction
The following slides discuss each of these
fundamentals
5/9/2021
Software Construction
Fundamentals
14. Software Construction 14
Minimizing Complexity
✧ Humans are severely limited in our ability to hold complex
information in our working memories
✧ As a result, minimizing complexity is one the of strongest drivers in
software construction
✧ Need to reduce complexity throughout the lifecycle
✧ As functionality increases, so does complexity
✧ Accomplished through use of standards
✧ Examples:
▪ J2EE for complex, distributed Java applications
▪ UML for modeling all aspects of complex systems
▪ High-order programming languages such as C++ and Java
▪ Source code formatting rules to aid readability
5/9/2021
15. Software Construction 15
Anticipating Change
✧ Software changes over time
✧ Anticipation / hope of change affect how software is
constructed
✧ This can effect
▪ Use of control structures
▪ Handling of errors
▪ Source code organization
▪ Code documentation
▪ Coding standards
5/9/2021
16. Software Construction 16
Constructing for Verification
Construct software that allows bugs to be easily found
and fixed
Examples:
✧ Enforce coding standards
▪ Helps support code reviews
✧ Unit testing
✧ Organizing code to support automated testing
✧ Restricted use of complex or hard-to-understand
language structures
5/9/2021
17. Software Construction 17
Standards in Construction
Standards which directly affect construction issues include:
✧ Programming languages
▪ E.g. standards for languages like Java and C++
✧ Communication methods
▪ E.g. standards for document formats and contents
✧ Platforms
▪ E.g. programmer interface standards for operating system calls, J2EE
✧ Tools
▪ E.g. diagrammatic standards for notations like the Unified
Modeling Language
5/9/2021
19. Sequence diagrams
✧ Sequence diagrams are part of the UML and are
used to model the interactions between the actors
and the objects within a system.
✧ A sequence diagram shows the sequence of
interactions that take place during a particular use
case or use case instance.
✧ The objects and actors involved are listed along the
top of the diagram, with a dotted line drawn vertically
from these.
✧ Interactions between objects are indicated by
annotated arrows. 19
5/9/2021
20. Creating interaction diagrams
You should develop a class diagram and a use case
model before starting to create an interaction diagram.
▪ There are two kinds of interaction diagrams:
• Sequence diagrams
• Communication diagrams
21. Objects Interact with Messages
✧ A message shows how one object asks another
object to perform some activity.
: Car buyer
:RegistrationController :CourseCatalogSystem
getCourseOfferings(forSemester)
Message
22. What Is a Sequence Diagram?
✧ A sequence diagram is an interaction diagram that
emphasizes the time ordering of messages.
✧ The diagram shows:
▪ The objects participating in the interaction.
▪ The sequence of messages exchanged.
Sequence Diagram
28. Scenario
Scenarios are used to describe how use cases are realized as
interactions among societies of objects. A scenario is an
instance of a use case; it is one path through the flow of
events for use case. Scenarios are developed to help identify
the objects, the classes, and the objects interactions needed to
carry out a piece of functionality specified by the use case.
31. Messages
Message that go from one object to another goes from
one object timeline to the other object’s timeline.
An object can send s message to itself – that is, from its
timeline back to its own timeline –
A message can be return, synchronous, or asynchronous
32. A synchronous message is when an object sends a message,
and waits for an answer to that message before it proceeds
with its business
Synchronous
An asynchronous message is when an object sends a
message, and does not wait for an answer before it proceeds
Asynchronous
Return
Not a message but a return from the earlier message
Notations
33. Time
The sequence diagram represents time in the vertical
direction. Time starts at the top and progresses toward the
bottom. A message that’s closer to the top occurs earlier in
time than a message that’s closer to the bottom.
The sequence diagram is two-dimensional. The left-to-
right dimension is the layout of the objects, and the top-to-
bottom dimension that shows the passage of time
35. aMember: LibraryMember
: LibraryMember theCopy: Copy
0. borrow(theCopy)
1. okToBorrow
(< LoanLimit)
2. borrow()
3. updateAvaCopies()
4. borrowed
5. updateLoanItem()
6. confirm
A Simple Sequence Diagram
of Library System
36. Sequence Diagram
- A phone system
p: PhoneSystem
s : Caller r : Caller
1: pick up hand set
3: beeps and sound
4: dial number
5: create connection
7b: connect(r)
6: pick up hand set
7a: connect(s)
2: insert coins
8: return coins
40. Summary
1. There are 3 types of messages: _________,
___________ and _________
2. Sequence diagram shows interaction between _________.
3. A sequence diagram must always be initiated by an
_____________.
4. Objects in the sequence diagram should be ideally
sequenced in the order of ________, _______ and ______.
5. An object can be represented in 3 ways: ________,
________ and ____________.
6. A sequence diagram has TWO (2) dimension. The
horizontal dimension represents ________ and the vertical
dimension represents ____________.