2 7 SoftwareEngineering
2 7 SoftwareEngineering
Programming
COSC 2020
Unit 2: Software Development Tools
- CMU/SEI-90-TR-003
Waterfall software development
• Requires completely
finishing each step before System Design
– Known technology
V software development
• A “modified waterfall”
– Bent to show high/low level
thinking
• A series of “mini
waterfalls”
– Divide the project into
smaller tasks or objectives
• Allows step-by-step
construction
– Build a basic functionality
first
– Add more functions later
Criticisms of waterfall (and its relatives)
• Progress is slow-moving
– No moving forward until the current step is completely
done
– Useable and testable code occurs late in the process
• Not flexible or iterative
– No going backwards once the specification is set
– Feedback arrives late (or not at all)
• No way to discover requirements as you develop
– Doesn’t handle unknown requirements very well
Agile software development
• Good programming
practices
– … taken to 10 (or 11)
• Features include
– Partner coding
– Continuous integration
– Frequent client interaction
Test-driven development
1. Write a test
– Describe the expected or correct behavior for a feature
– Convert a bug report into a test that reproduces the
failure
2. Run all tests (and the new test will fail)
– This validates that the test you wrote does indeed work
properly
3. Write the simplest solution that passes your test
4. Run all tests again (to confirm your first solution
works)
UML DIAGRAMS
What is UML
• An evolving standard
– Developed at Rational Software (1994-96): UML 0.x
– Object Management Group standard (1997-2005): UML 1.x
– ISO standard (2005 – present): UML 2.x
A UML diagram of UML diagrams
Sequence diagrams
Sequence diagrams
• Indicate work by
participant
– A rectangle over the lifeline
• Typically message-driven
– Started by receiving a
message
– Can involve sending
messages too
• Can overlap
– Call method on self
– Call method on other object
that calls back
Sending a message
• A reply to an earlier
message
– Not triggering a new
execution
– Often the end of a recipient
execution
• Alternatives
– Conditional message
• Only one or the other
– Reflects an if/else style
execution
• Option
– Conditional message
– Reflects an if (without else)
Play it again
• Looping behavior
– Send the same message
again
– Often recipient is a
collection
• Loop is a for-each loop
• Can be annotated
– Min/max iterations
– Condition to continue
Class diagrams
• UML is language-independent
– These are OOP ideas without syntax
Class blocks
• Generic interactions
– Typically static relationships
– Often ornamented to explain
• Direction can be specified
– Uni- or bi-directional
• Can incorporate 2+
entities
Aggregation and composition
• HAS A relationships
– Always binary
– Arrowhead points to the
container
• Aggregation (open
arrowhead)
– Non-exclusive, non-
destructive
• Composition (filled
arrowhead)
Generalization
• IS A relationship
– Typically inheritance or
implementation
– Arrowhead points to more
general type
• Can be styled as
– Separate target
– Shared target
Activity Diagrams
Activity diagrams
• Appears as a “flowchart”
What’s in an activity?
• Activity nodes
– Represent an action taken
• Variable initialization or assignment; arithmetic; function call
– May be layered
• A “high level” activity diagram might describe an action in a
single node
• A subsequent diagram might expand that node to a full diagram
of its own
Organizing your activities
• Connectors
– Purely for spatial
organization
• A “portal” to another place or
page
– Useful for
• Avoiding a long arrow edge
• Avoiding edge crossings
• Moving between pages
Controlling activity flow
Starting and stopping
• Decision nodes
– “Decision diamond”
– Branching execution
• One way in, many ways out
• Flow follows exactly one
branch
– Branches have guards
• Conditions to choose (poss.
“else”)
– Decisions can be annotated
too
Merging paths
• Merge nodes
– Bring flows back together
• Usually after decisions
– Merge alternatives
• At most one input branch will
be taken
• NOT for concurrent execution
Doing two things at once
• Fork node
– “Branching bar”
– Concurrent execution
• All output branches occur at
the same time
– Branches represent
simultaneous activities
Putting it back together
• Join node
– Brings concurrent flows back
together
– A synchronization point
• All flows must reach the black
bar
• THEN flow continues out the
single exit