03 Uml Testing
03 Uml Testing
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
UML & Testing
●
UML/Modelling (Recap)
●
(Unit) Testing
b: Boolean + = public
class name Window
# = protected
+ size: Area - = private
# visibility: Boolean = b
attributes - window: Pointer
+ display() italic = abstract
methods + show() underline = static
+ hide()
●
Show relations between classes
– Inheritance, implementation, …
subclass
BankAccount Wallet
Interface (“implements”)
<<interface>>
Wallet Owner
implementation IWallet usage
●
Shows relations between classes:
Composition, Associations, Multiplicity, …
Composition (“contains”, Aggregation (“has”,
is destroyed with container) can exist separately)
Car Motor Pond Duck
1 1...2 1 0...*
NonProfit Donor
* *
“Every Donor gives to arbitrary # of
NonProfits, each NonProfit has
Donation arbitrary # of Donors, and each
Amount:money Donation has an individual Amount.”
20/04/20 Software Engineering - © 2015 Dr. Florian Echtler, Bauhaus-Universität Weimar 7
Use Case Diagram
Image source (CC): https://en.wikipedia.org/wiki/Use_Case_Diagram
●
Contains actors and actions
●
Useful for communication
with customers
●
Mimics real world
●
Less focus on system
internals
●
Shows objects, lifelines and messages
●
Illustrates …
– runtime behavior
– object lifetimes
– (a)synchronous calls
download
●
Contains states and transistions
●
Transitions represent external events
●
Start transition shows initial state
[Start]
[Pause]
Simulator stopped Simulator running Simulator paused
[Continue]
[Request log]
[Stop]
●
Shows actions, decisions
and concurrency (black
bars)
●
Similar to flowchart
Outputs revealing
presence of defects
Ie Oe
Input Output
Inputs causing test test
anomalous cases System results
behaviour