Professional Documents
Culture Documents
diagrams
Eliane Martins
Institute of Computer – State University of Campinas (Unicamp)
eliane@ic.unicamp.br
Use cases
Actors Manager
Pre-conditions The user must be logged in and selected the “Insertion” option.
Invariants None
Post-conditions The product is inserted into the database or the database remains unchanged.
Activity diagram – Inter use cases
Scenarios Control flow dependencies among use cases
(Manager view)
+
initial node
Business
Description guard «user»
Select option
Product Management
[option=SEARCH] decision node
Identify [else]
User exception edge
«use case» InvalidUser
Insert
«include» Identify user
product
manager
Update «include»
product «use case» «use case»
Validate Search product Update product «use case»
product Remove product
«include»
Remove
product
«use case» DBException
Insert product
Search
product
client final node
Activity diagrams – intra use cases
Activity: Insert Product
«system» InvalidUser
Check user authentification
«system» «user»
Exhibit product form Enter product information
«system»
Get product information
[invalid]
«use case» «system»
Validate product Exhibit error message
[else]
«user»
Confirm insertion
[no]
[yes]
DBException
«system»
«exception handler»
Save product in the database
HandleDBException
Test Case Generation
UML Activity Diagram
4. Build
executable begin 5. Generate
...
model end. test data 6. Complete
script
The test model
Call node
Call edge
Return edge
Return node
Path-oriented test selection
Problems:
How to select paths?
Control flow based criteria (e.g. all edges,
all nodes)
How to select realizable paths?
Various call-return in a path
Realizable path: each call edge is
matched with its return edge
Context sensitive search for a path
How to deal with loops to avoid infinite
number of paths?
Limit number of repetitions
Loop testing
The tools
Use case
specifications
UML Modeling
Tool
Use case Business
flows rules
XMI
Activity diagrams Context Sensitive
XMI Graph ICFG Path
Builder
Selector
Paths
Legend
Tool
Traceability Test
Matrix sequence
Some results
Test case design Test case execution
# UC 27 # executed test 76
cases
# ICFG edges 441 # fault revealing test 37
cases
# ICFG nodes 530 # Failures 131