Chapter-3-Testing Modeling and System Specification
Chapter-3-Testing Modeling and System Specification
SOFTWARE
ENGINEERING
LECTURE 3: Testing, Modeling and System
Specification
Asst.Prof.Dr Ervin Domazet
International Balkan University
Software Testing - Topics
• Overview of Software Testing
1. Make a plan for systematic testing
2. Write and run tests; test automation
• Designing Tests for High Coverage
• Practical Aspects of Unit Testing
• Integration and System Testing
• Security Testing
2
Do I Need to Do Testing?
• Everyone who develops software does testing—that’s
unavoidable
• The only question is whether testing is conducted
haphazardly by random trial-and-error, or systematically,
with a plan
• Why it matters? —The goal is to try as many “critical” input
combinations as possible, given the time and resource
constraints
– i.e., to achieve as high coverage of the input space as is practical,
while testing first the “highest-priority” combinations
– Key issue: strategies for identifying the “highest priority” tests
3
Overview of Software Testing
• “Testing shows the presence, not the absence of bugs.” —Edsger
W. Dijkstra
• A fault, also called “defect” or “bug,” is an erroneous hardware
or software element of a system that can cause the system to fail
• Test-Driven Development (TDD)
• Every step in the development process must start with a plan of how to verify
that the result meets a goal
• The developer should not create a software artifact (a system requirement, a UML
diagram, or source code) unless they know how it will be tested
5
Logical Organization of Testing
( Usually not done in a linear step-by-step order and completed when the last step is reached! )
Component
(unit) code
Unit White box testing Black box testing
test (by developer) (by customer)
Component
(unit) code
Unit
test Integrated
modules
Integration System
test test
System
in use
Ensures that all
Component components
(unit) code work together
Unit
test
7
Example: Test Case for Use
Case
[ Recall Section 2.3.3: Detailed Use Case Specification ]
Pass/fail Criteria: The test passes if the user enters a key that is contained in the database,
with less than a maximum allowed number of unsuccessful attempts
Step 2. Type in the correct System flashes a green light to indicate success;
keycode and door identifier records successful access in the database;
disarms the lock device
8 8
Test Coverage
• Test coverage measures the degree to which the
specification or code of a software program has
been exercised by tests
– “Big picture”: Specification testing focuses on the
coverage of the input space, without necessarily
testing each part of the software Acceptance tests
– “Implementation details”: Code coverage measures
the degree to which the elements of the program
source code have been tested Unit tests
9
Heuristic: Some Tests are
More “Critical” than Others
• Test cases should be prioritized—some tests are more
likely to uncover faults
• Tests are about finding developer errors, and people are
prone to make certain kind of errors
• Some tests can easier pinpoint problems than others
• (some) Heuristics for achieving high coverage:
(could be applied individually or in combination)
– equivalence testing
– boundary testing mostly for “black-box” testing
– control-flow testing
– state-based testing mostly for “white-box” testing
10
Input Space Coverage:
Equivalence Testing
• Equivalence testing is a black-box testing method that divides
the space of all possible inputs into equivalence groups such
that the program is expected to “behave the same” on each
input from the same group
• Assumption: A well-intentioned developer may have made mistakes that affect a
whole class of input values
• Assumption: We do not have any reason to believe that the developer intentionally
programmed special behavior for any input combinations that belong to a single class
of input values
• Two steps:
1. partitioning the values of input parameters into equivalence groups
2. choosing the test input values from each group
Equivalence classes:
valid equivalence class
0 100
11
invalid equivalence classes
Heuristics for
Finding Equivalence Classes
• For an input parameter specified over a range of values, e.g., a
number or a letter, partition the value space into one valid and
two invalid equivalence classes
• For an input parameter specified with a single value, e.g., a
unique “security code,” partition the value space into one valid
and two invalid equivalence classes
• For an input parameter specified with a set of values, e.g., day or
month names, partition the value space into one valid and one
invalid equivalence class
• For an input parameter specified as a Boolean value, partition the
value space into one valid and one invalid equivalence class
12
Input Space Coverage:
Boundary Testing
• Boundary testing is a special case of equivalence
testing that focuses on the boundary values of
input parameters
– Based on the assumption that developers often
overlook special cases at the boundary of
equivalence classes (e.g., Microsoft Zune bug:
https://en.m.wikipedia.org/wiki/Leap_year_bug )
a a not a a not a
a a not a
b
b b c
b
15
State-based Testing Example
(Safe Home Access System)
state valid-key /
signal-success
transition Blocked
valid-key /
signal-success
Unlocked
17
State-based Testing Example
invalid-key / invalid-key
signal-failure [numOfAttemps maxNumOfAttempts] /
Locked Accepting sound-alarm
(counting attempts)
valid-key /
signal-success
valid-key / Blocked
signal-success
Unlocked
18
Controller State Diagram Elements
• Four states
{ Locked, Unlocked, Accepting, Blocked }
• Two events
{ valid-key, invalid-key }
• Five valid transitions
{ LockedUnlocked, LockedAccepting,
AcceptingAccepting, AcceptingUnlocked,
AcceptingBlocked }
19
Ensure State Coverage Conditions
20
Practical Aspects of Unit Testing
• Mock objects:
– A test driver simulates the part of the system that invokes
operations on the tested component
– A test stub simulates the components that are called by the
tested component
• Mock objects needed because:
– The corresponding actual objects are not available
– Easier to locate faults using mock objects that are trivial
and therefore not a source of faults
• The unit to be tested is also known as the fixture
• Unit testing follows this cycle:
1. Create the thing to be tested (fixture), the driver, and the
stub(s)
2. Have the test driver invoke an operation on the fixture
3. Evaluate that the actual state equals expected state
21
Testing the KeyChecker (Unlock Use
Case)
enterKey() start()
k := create() k := create()
display
result
(a) (b)
22
Example Test Case
Listing 2-1: Example test case for the Key Checker class.
// 2. act // test driver (this object) invokes tested object (Key Checker)
Key invalidTestKey = new Key( /* setup with invalid code */ );
boolean result = fixture.checkKey(invalidTestKey);
1. Set up
methodName_startingState_expectedResult
2. Act
3. Verify
checkKey_anyState_invalidKeyRejected()
24
xUnit / JUnit
• Verification of the expected result is usually
done using the assert_*_() methods that
define the expected state and report errors if
the actual state differs
• http://www.junit.org/
• Examples:
– assertTrue(4 == (2 * 2));
– assertEquals(expected, actual);
– assertNull(Object object);
– etc. 25
Another Test Case Example
Listing 2-2: Example test case for the Controller class.
// 2. act
fixture.enterKey(invalidTestKey);
// 3. verify
assertEqual( // the resulting state must be "Blocked"
fixture.getNumOfAttempts(), fixture.getMaxNumOfAttempts()
);
assertEqual(fixture.isBlocked(), true);
}
26
}
Integration Testing
• Key Issue:
– How to assemble individually-tested “units” and quickly locate faults that
surface during integration
• Horizontal Integration Testing
– “Big bang” integration
• Problem: hard to isolate individual unit(s) that caused an integration fault
– Bottom-up integration
– Top-down integration
– Sandwich integration
Level-3 KeyChecker
System
hierarchy: Level-2 KeyStorage Key
testing: Test
DeviceCtrl Test KeyChecker
Advantages:
& KeyStorage & • only few mock objects need to be implemented
Key
Test Key & Drawbacks:
KeyStorage
• end user cannot see any functionality
until late in the development process
Implementation and testing proceeds from Level-4 (top) to Level-1 (bottom)
Top-down Test Controller &
Test Test Controller &
integration Test
Controller
Controller &
KeyChecker
KeyChecker &
KeyStorage & Key
KeyChecker & KeyStorage &
Key & Logger & PhotoSObsrv
& DeviceCtrl
testing: 28
Vertical Integration Testing
User User User
story-1 story-2 story-N inner feedback loop
Write a
Write a failing Make the
failing
acceptance test test pass
unit test
Refactor
outer feedback loop
Component
code
Unit
test Integrated
modules
Integration System
test test
System
in use
Ensures that all
Component components
code work together
Unit
test
• Attackers:
– Access the VM set up for them
• Researchers
– Access the host, the attackers’ VM
– Should not erase files by mistake…
33
Honeypot Access Control Matrix
Role capabilities
34
Honeypot Access Control
Part/Domain I Part/Domain J
Phenomena in Part i
Phenomena in Part j
Shared
phenomena
Phenomena in Part k
Part/Domain K
37
Example of a Problem Domains
PROBLEM WORLD & DOMAINS (PARTS)
(5) Device
(6) Photosensor
preferences
(3) Key
(7) Light
(2) Landlord
(10) Tenant
(9) Desktop computer accounts
38
Example of Problem Domains
PROBLEM WORLD & DOMAINS (PARTS)
(5) Device
(6) Photosensor
preferences
(3) Key
(7) Light
(2) Landlord
(10) Tenant
(9) Desktop computer accounts
39
Example of Problem Domains
(5) Device
(6) Photosensor
preference
(3) Key
s (7) Light
(2) Landlord
(10) Tenant
(9) Desktop computer accounts
40
Definitions …
• A phenomenon is a fact, or object, or occurrence that
appears or is perceived to exist
2 Event: Kick
1
State:
Ball standing 4
Event: Splash
Event: Splash
State:
5 Ball floating 42
Time
Relations: Examples
Set of all pairs of persons
Set of neighbors
Set of sandwiches
Relation:
Sandwich (Bread-slice, Ham-slice, Bread-slice)
43
Example: States of a DVD Player
State 1: NotPowered (the player is not powered up)
State 2: Powered (the player is powered up)
State 3: Loaded (a disc is in the tray)
State 4: Playing
DVD player
Power Disc
button tray
45
Example: States of a DVD Player
… …
46
State Variables
State variable = a physical part or an attribute of an obje
47
Hidden States
Observable state:
apple’s appearance
Goal:
48
States Example: Stock Market
Market
index
Market
Open Closed
gate
1.00 1.01 1.02
1.00 1 1.00 1
1.01 2 1.01 2
1.02 3 1.02 3
( prices & number of
shares
for all listed stocks )
49
Defining States
• CountingDown(Timer) =
The relation Equals(Timer, ) holds true for
decreasing with time
• Idle(Timer) =
The relation Equals(Timer, ) holds true for
remaining constant with time
50
Microstates and Macrostates
Microstates representing the number of offered shares are aggregated:
OrderPending OrderExecuted
51
Events
Events marking transitions between the states of a trading order:
Event Description
trade Causes transition between stock states Buy, Sell, or Hold
submit Causes transition between trading-order states
InPreparation OrderPending
matched Causes transition between trading-order states
OrderPending OrderExecuted
… …
… … 52 52
Context Diagram: DVD Player
eject
A box with no stripe
load
is a given domain
enable notify
disable Eject
button
53
Context Diagram: Stock Trading
Investmen Trading
t portfolio order
Software-to- Stock
Trader be exchang
(Machine) e
ith stock
Bank
54
Problem Decomposition
REQ1, REQ2,
REQ3 REQ3, REQ4
PROBLEM DOMAIN
(5) Device
(6) Photosensor
preferences
(7) Light
Subsystem-2
(3) Key
REQ4
Subsystem-3 (8) Alarm bell (11) Log of
accesses
Software-to-be
(2) Landlord
(10) Tenant
Subsystem-4 (9) Desktop computer accounts
REQ5, REQ7,
REQ8, REQ9
55
Machine and Problem Domain
Domain properties
seen by the requirement
(b)
Software-to- a Problem
b The
be
Domain Requirement
(The Machine)
56
Boolean Logic
Propositional Logic
57 57
Example: From Req’t to Propositions
Closed Open
lock
0 1 2 M
60
FSMs with Outputs
lock unlock / beep unlock
lock / beep
lock / beep
61
Sys. Specifications - State Diagrams
Topics
• UML State Machine Diagrams
– State Activities: Entry, Do, and Exit Activities
– Composite States and Nested States
– Concurrency
• UML Object Constraint Language (OCL)
– OCL Syntax
– OCL Constraints and Contracts
62
State Machine Diagram:
Basic Notation
States of Stock_i
event
trade bankruptcy,
merger,
initial-listing acquisition, …
Listing
Traded Delisted
planned
transition
initial state terminal state
indicated by indicated by
They are only labels that indicate the actual initial/terminal states
63
UML Diagrams Differ from FSMs
• Modularization of states
• Concurrent behaviors
• State activities
64
States of Stock_i
trade bankruptcy,
merger,
initial-listing acquisition, …
Listing
Traded Delisted
planned
composite state
Traded
Listing
Delisted
planned Buy Hold Sell
sub-states:
(based on analyst recommendations)
trade
trade trade
trade trade
Buy Hold Sell
trade trade
65
trade
States of Stock_i
trade bankruptcy,
acquisition,
initial-listing merger, …
IPO
Traded Delisted
planned
IPO = initial public offering
Traded
bankruptcy,
trade
acquisition,
initial- trade trade merger, …
listing
IPO trade trade
Delisted
planned Buy Hold Sell
trade trade
nested
trade
composite state state
66
State Activities:
Entry, Do, and Exit Activities
States of a Trading Order
completion transition
view
Pending
submit matched
do: check_price & supply [buy]
InPreparation Executed Archived
check_price & demand [sell]
data cancel,
entry reject
trade Cancelled
“do”
state
activity
(order placed and waiting for
the specified market conditions)
67
State Diagram for Controller
[ Recall Section 2.7.4: Test Coverage and Code Coverage ]
How state diagram motivates you to consider alternative usage scenarios and provides “crutches”:
invalid-key /
signal-failure invalid-key
[numOfAttemps maxNumOfAttempts] /
sound-alarm
Locked Accepting
timer-expired /
signal-reset,
set numOfAttemps := 0
autoLockInterval
-expired /
valid-key /
signal-success valid-key / Blocked
signal-success,
set numOfAttemps := 0
Unlocked
invalid-key /
signal-failure invalid-key
Accepting [numOfAttemps maxNumOfAttempts] /
sound-alarm
Locked entry: start timer
do: countdown
timer-expired /
signal-reset,
set numOfAttemps := 0
autoLockInterval
-expired /
valid-key /
signal-success Blocked
valid-key /
signal-success
Unlocked
entry: start timer
do: countdown
Accepting
timer-expired /
signal-reset,
set numOfAttemps := 0
invalid-key / invalid-key /
invalid-key / signal-failure signal-failure invalid-key /
signal-failure sound-alarm
One Two MaxNumOfAttempts
valid-key / valid-key /
signal-success signal-success valid-key /
signal-success
Vacant arrive /
depart /
Occupied
C make-reservation
B make-reservation
Reserved Reserved
by guest B by guest C
Reserved
States
Occupied
Vacant
Time [days]
A depart
B depart
C arrive
A arrive
B arrive
C depart
72
Problem: States of a Hotel Room
C make-reservation
B make-reservation
What if the guest is late? – “Holding” state?
What if the room is overbooked?
Reserved Reserved
What when it is being cleaned?
by guest B by guest C
Reserved
Issue: state transitions
What state? are weird—”Reserved” is a
future state but
Occupied transitioned to by a
current event!
Vacant
Time [days]
A arrive
B arrive
A depart
B depart
C arrive
C depart
73
Problem: States of a Hotel Room
SOLUTION:
C make-reservation
B make-reservation
Introduce a new object!
Reserved Reserved
by guest B by guest C
Reserved
Object:
Reservation table
Available
reserve
free
Occupied
Object:
Room occupancy
Vacant
current time
Time [days]
A arrive
A depart
Reserved
Object 2:
Reservation table
Available
Occupied
Object 1:
Room occupancy
Vacant
current time
Time [days]
A arrive
B arrive
A depart
B depart
C arrive
C depart
75
OCL: Object Constraint Language
• OCL is used in UML diagrams to
– write constraints in class diagrams
– guard conditions in state and activity diagrams
• based on Boolean logic
• Boolean expressions (“OCL constraints”) used
to state facts about elements of UML diagrams
• The implementation must ensure that the
constraints always hold true
76
Basic OCL Types and Operations
String 'With more exploration comes more text.' concat(), size(), substring()
77 77
OCL: Types of Navigation
(a) Local attribute (b) Directly related class (c) Indirectly related class
Class_A Class_A Class_A
– attribute1 * assocBA * assocBA
– attribute2
– …
* assocAB * assocAB
Class_B Class_B
* assocCB
* assocBC
Class_C
Returns true if there exists at least one element in c for which expr is true. This implements existential
c->exists(var | expr)
quantification .
c->isUnique(var | expr) Returns true if expr evaluates to a different value when applied to every element of c.
c->select(expr) Returns a collection that contains only the elements of c for which expr is true.
82
xUnit / JUnit assert_*_()
• Verification is usually done using the
assert_*_() methods that define the
expected state and raise errors if the actual
state differs
• http://www.junit.org/
• Examples:
– assertTrue(4 == (2 * 2));
– assertEquals(expected, actual);
– assertNull(Object object);
– etc. 83
TLA+ Specification
lock,
unlock(invalid key)
unlock(valid key)
[closed, unlit] [open, lit]
turnLightOff
(?) [closed, lit]
lock,
unlock(invalid key)
MAIN CONFUSION:
What is this state diagram representing?
The state of _what_ object?
84
Problem Frames – Decomposition
Topics
• Typical System Requirements and Problems
→ Analysis Reuse
• Five Problem Frames:
• Transformation
• Simple Editing (a.k.a. “Simple Workpieces”)
• Required Behavior
• Information Display
• Commanded Behavior
• Frame Concern
Why Problem Frames?
• Because the best way to start solving your problem
is by understanding it first
– Problem frames help us analyze and understand the
problem that we are to solve
• Problem frames are the building blocks of SE
problems
– They are the most basic types of system requirements
• Purpose: problem frames allow reuse of existing
generic analyses of typical problems
– Benefits: speed up the analysis and make the result more
correct and complete
Software Engineering Problem
• User has business goals in the problem domain
• System-to-be will help the user achieve these goals
• Problem domain can be imagined or physical world
System-to-be
User’s business
goals determine the
system
User
requirements
Requirement
Problem Domain
Requirements and Specification
Problem domain Software (Solution) domain
Describes
Specifi
Requirements Program (System)
Customer cation
Specifies
Analyzes Develops
Software Engineer
Problem Domain:
How Electronic Lock Works
We may need separate
1
2
3
4
descriptions/models of
5
X
Y
door vs. lock.
Door state is what the
Computer user cares about; lock is
Lock
one way of achieving it.
Voltage:
HIGH Physical domain (lock)
description; used in
LOW
specification
lock armed lock disarmed lock armed Semantic meaning
defined by user’s
goals; used in
requirements
Problem decomposition
Frame Approach:
Split the big “black
Requirement
ii
box” into several
smaller “black
boxes”, each
Domain
addressing a
B
subset of the
requirements and
representing a(b)
Subsystem
2
mini-project.
During the Software-to-be
analysis, we
Typical Software Eng. Problems
1.a) System transforms input document to output document
1. User works with computer system
(problem domain is “virtual”, not physical)
REQ-1: Map input data to IN doc
output data as said by given
rules
User System OUT doc
3. Computer system intermediates between 3.a) System observes the problem domain and displays informatio
the user and the problem domain
REQ-5: Monitor and
display information about
an object User System Problem domain
User System Problem domain 3.b) System controls the problem domain as commanded by the us
REQ-4: Interactively
control a physical 93
object/device User System Problem domain
5-dimensional Problem Space
• The five elementary problem types
represent the coordinate system of
(“Simple workpieces”)
Software
the problem space
(“Required behavior”)
Simple editing
problem
Autonomous control
to solve
• The “axis” projections represent the
degree to which the whole problem
contains a subproblem of this type
• Each subproblem can be analyzed
independently and eventually
recombined into the whole problem
• The structure of the solution should
be selected to fit the problem
structure
94
Typical System Requirements
• REQ-1: Map input data to output data as said by given
rules
• REQ-2: Allow repository (or document) editing, where
“repository” is a collection of data
• REQ-3: Autonomously control a physical object/device
• REQ-4: Interactively control a physical object/device
• REQ-5: Monitor and display information about an object
Critical insight: there are known approaches for analyzing
each of these requirement types, including the information
that should be specified for each type
Example: Problem Decomposition
REQ1: Keep door locked and auto-lock
REQ2: Lock when “LOCK” pressed
REQ3: Unlock when valid key provided
REQ4: Allow mistakes but prevent dictionary attacks
REQ5: Maintain a history log
REQ6: Adding/removing users at runtime
REQ7: Configuring device activation preferences
REQ8: Inspecting the access history
REQ9: Filing inquiries
PROBLEM DOMAIN
(5) Device
(6) Photosensor preference
s (7) Light
(3) Key
(2) Landlord
(10) Tenant
(9) Desktop computer accounts
(5) Device
(6) Photosensor preference
s (7) Light
Subsystem-2
(3) Key
REQ4
Subsystem-3 (8) Alarm bell (11) Log
of
Software-to-be accesses
(2) Landlord
(10) Tenant
REQ5, REQ7, Subsystem-4 (9) Desktop computer accounts
REQ8, REQ9
Domain properties
envisioned by the requirement
(b)
Problem
Software-to-be a Domain
b Business Goal
Problem
System
Domain
a
• [Y] – symbolic requirement phenomena
a: S ! E1
• values, and truths and states relating only values; PD ! C2
symbolize other phenomena and relationships among them
Example: Problem Decomposition
[ Case Study 1: Safe Home Access ]
• REQ1: keep door locked and auto-lock Required Behavior
• REQ2: lock when “LOCK” pressed
• REQ3: unlock when valid key provided Commanded Behavior
• REQ4: allow mistakes but prevent dictionary attacks
Environment Key:
inputs to the
system
C Causal domain
X Lexical domain
[C ] Causal phenomena
[E ] Events
[ Case Study 1: Safe Home Access — REQ1: keep door locked and auto-lock ]
Business goal for REQ1:
The lock will be armed electronically and periodically checked that it remains so until explicitly disarmed
If the user unlocks, but forgets to lock, the lock will be automatically disarmed after a specified interval
Description of the electromechanical lock (problem domain):
A low or none voltage keeps the latch extended (“armed”);
A high voltage causes mechanical retraction of the latch (“disarmed”) and remains retracted until low voltage.
Capabilities of available “sensors”:
The lock device will report current status when queried via USB protocol, using a command
Capabilities of available “actuators”:
The lock device’s latch will extend or retract, as commanded via USB protocol, using a command
Requirement:
REQ1 - keep door locked and auto-lock
Locked
“Lock” pressed /
Unlocked
entry: start autoLock timer
do: countdown
1
2
3
4
5
X
Y
Computer
Lock
System outputs
to the Description of the
environment domain’s required
behavior
Control
CS!C1 Controlled
C3 Required
Software Domain Behavior
CD!C2 C
Environment
inputs to the
system
Problem Frame
checklist helps
Sensor1 Descriptor Actuator1 Descriptor
Control Command
software behaviors
OP!E4 Operator E4
B
A Command
Control software a b behavior
C
C D
c B c
B
Operator
a: TS! {Create[i]} [E1] c: TR! {Submit[i], Cancel[i],
b: TR! {PriceQuotes, Submit[i]} [Y2] Executed[i], Expired[i]} [Y3]
Commanded Behavior
- Frame Concern Checklist
Commanded Behavior Frame Checklist Document what the user will be
able to do and how the system
Requested user commands: will help them do, or what the
List of desired user commands and their parameters user should not do and how the
Command applicability under different scenarios: system will prevent these
Description of scenarios for which each command actions
is applicable
Consequences of unacceptable commands:
What should happen if the user tries to execute a command
that is not supported or not allowed in the current scenario
[ Case Study 1: Safe Home Access — REQ2: ℓock when “LOCK” pressed
REQ3: unlock when valid key provided
REQ4: allow mistakes but prevent dictionary attacks
Requested user commands (REQ2, REQ3):
Lock, Unlock(key, door-ID)
Command applicability under different scenarios (REQ2 - REQ4):
Lock has no restrictions (always applicable)
Unlock applicable only if numOfAttemps maxNumOfAttempts
Consequences of unacceptable commands (REQ4):
When entered key does not correspond to the door-ID, increment numOfAttemps (block if > maxNumOfAttempts)
When not applicable, Unlock will be ignored
Requirement:
REQ3, REQ4, REQ5 - unlock when valid key provided but allow few mistakes
invalid-key /
signal-failure Accepting invalid-key
[numOfAttemps maxNumOfAttempts] /
Locked entry: start quit timer sound-alarm
do: countdown
timer-expired /
signal-reset,
set numOfAttemps := 0
“Lock” pressed /
valid-key /
signal-success Blocked
valid-key /
signal-success
Unlocked
Informatio Display ~
n software Real world
IS!E2 Display Y4
C
Information A Display ~
software a c Real world
C
C D
b B d
C
Display
a: TS! {Create[i]} [E1] c: TR! {Place[i], Cancel[i],
b: TR! {PriceQuotes, Place[i]} [Y2] Executed[i], Expired[i]} [Y3]
Information Visualization
- Frame Concern Checklist
Information Display Frame Checklist
Required information to observe:
Capabilities of available “sensors”
[ Case Study 1: Safe Home Access
Required information to visualize:
Visualization description
— REQ5: maintain a history log
(database is the “display”) ]
Rules for visualization of the observed information:
The transformations needed to process the raw observed
information to obtain displayable information
[ Case Study 1: Safe Home Access — REQ8: inspecting the access history ]
Information to observe for REQ8:
Database records of past accesses
Required information to visualize for REQ8:
Access information will be displayed as stored, without post-processing
Rules for visualization for REQ8:
Render the result of the query as an HTML table
Basic Frame 4: Simple Editing
ET!E1 Work
WP!Y2 pieces
X Y3
Editing Command
tool effects
US!E3 User E3
B
Tradin Command
Editing tool a g order c effects
X
Order
Trading
placing
software
rules
b Trader d
B
User
a: TS! {Create[i]} [E1] c: TR! {Place[i], Cancel[i],
b: TR! {PriceQuotes, Place[i]} [Y2] Executed[i], Expired[i]} [Y3]
Simple Editing
- Frame Concern Checklist
Simple Editing Frame Checklist
Data structures:
[ Case Study 1: Safe Home Access
Data types of elements (“workpieces”) of the document
— REQ9: filing inquiries ]
Requested commands:
List of all possible user commands and their parameters
Investment
Portfolio
Transform Software X I/O Relation
a c
Report Reporting
Generator rules
b d
Periodic
Report
X
Outputs
117
Typical System Requirements
• REQ-1: Map input data to output data as said
by given rules Transformation
(a) Software-to-be
a
Problem
b Requirement
(“Machine”) Domain
Domain properties
seen by the requirement
(b)
Software-to-be Problem
(“Machine”)
a Domain
b Requirement
119
Basic Frame 1: Required Behavior
Control
CS!C1 Controlled
C3 Required
software domain behavior
CD!C2 C
Key:
C Causal domain
B Biddable domain
X Lexical domain
[C ] Causal phenomena
Example: Execute a Trading order [E ] Events
[Y ] Symbolic requirement phenomena
Control Controlled Required
Software Domain Behavior
Broker
a Stock
b Order
handling
software exchange
C rules
120
Notation Syntax
for Shared Phenomena
• C – causal domain Causal
domain
C
• predictable causal relationships among its causal phenomena
such as physical laws or business contracts or social norms
• B – biddable domain Biddable
domain
B
• usually people: unpredictable, incoercible
• X – lexical domain Lexical
Machine
Problem
Domain
a
Control Command
software behavior
OP!E4 Operator E4
B
A Command
Control software a b behavior
C
C D
c B c
B
Operator
a: TS! {Create[i]} [E1] c: TR! {Place[i], Cancel[i],
b: TR! {PriceQuotes, Place[i]} [Y2] Executed[i], Expired[i]} [Y3]
122
Basic Frame 3: Information Display
Real
RW!C1 world
C C3
Informatio Display ~
n software Real world
IS!E2 Display Y4
C
Information A Display ~
software a c Real world
C
C D
b B d
C
Display
a: TS! {Create[i]} [E1] c: TR! {Place[i], Cancel[i],
b: TR! {PriceQuotes, Place[i]} [Y2] Executed[i], Expired[i]} [Y3]
123
Basic Frame 4: Simple Workpieces
ET!E1 Work
WP!Y2 pieces
X Y3
Editing Command
tool effects
US!E3 User E3
B
Tradin Command
Editing tool a g order c effects
X
Order
Trading
placing
software
rules
b Trader d
B
User
a: TS! {Create[i]} [E1] c: TR! {Place[i], Cancel[i],
b: TR! {PriceQuotes, Place[i]} [Y2] Executed[i], Expired[i]} [Y3]
124
Basic Frame 5: Transformation
Inputs
IN!Y1 X Y3
Transfor
m IO relation
software
TS!Y2 Outputs Y4
X
a A c
Transform software X IO relation
C D
b B d
X
Outputs
a: TS! {Create[i]} [E1] c: TR! {Place[i], Cancel[i],
b: TR! {PriceQuotes, Place[i]} [Y2] Executed[i], Expired[i]} [Y3]
125
Example: Personal Health Monitoring
BP Sensor a
c
e Monitorin
Person’s
User g
Body
Software
d HR Sensor b
127
128
129