STM Unit-2
STM Unit-2
Transaction flow
Data Flow
Domain Testing
Unit- 2
It helps developers identify design flaws, coding errors, and system-
level issues, helping prevent potential issues with the software.
A Simple Transaction
Example: the sequence of steps in a transaction in an online information
retrieval system
1. Accept input (tentative birth)
2. Validate input (birth)
Users View of a transaction : Single step
3. Transmit acknowledgement to requester Systems view : Sequence of
4. Do input processing many
operations
5. Search file
6. Request directions from user
7. Accept input
8. Validate input
9. Process request
10.Update file
11.Transmit output :
hel
p
Y
Transmi Accept More
B C Transmit D
t Page Input Fields? To CPU
to Field
terminal
CPU- Y N N
More User wants Done
D Acce Valid ?
Pages ? Review?
pt
Confir
m Transmit Set up
Diagnostic C Review
to Terminal
Implementation of Transaction-Flow (in a
system)
Input S A S B S C S S Output
E
S : Scheduler A, B, C, D, E : Processes
Implementation of Transaction-Flow
System Control Structure (architecture of the
implementation) :
Input Outp
ut
EXECUTIVE
Fron
Queu Queu Outpu
SCHEDULER - AND / OR OPERATING SYSTEM t
t e e
DISPATCHER Modul
End
e
Proce
ss A B C D E
Queue Processor Processor Processor Processor Processor
s
Application
Processes
When A finishes with the Token, it places the TCB back on the scheduler Q.
for routing.
Implementation of Transaction-Flow
Parent
Parent
Daughter
Transaction Flows – Complications
Mergers of transactions
Junction : An ordinary junction which is similar to the Path 1
Continue
junction in a control flow graph.
Path 2
Absorption: the predator transaction absorbs
Daughter
prey transaction.
The prey gone but the predator retains its identity Predator
Predator
unit testing.
Path Selection
2. Mistakes
• Unawareness about design of a centrally administered
test DB
• Test DB design by Testers
• Using one DB for all tests (need 4 to 5)
Test Execution
e = (m+n+p+q) * (m+n-p-q)
a = m+n
a := m + n
b := p + b=p+q
q c := a +
b d := a - c=a+b
b
e := c * d
d=a-b
e=c*d
(1) In a Calculation
p - used in a predicate
Data flow Anomalies
There are nine possible two-letter combinations for d, k and u. some are
bugs, some are suspicious, and some are okay.
ud :- normal, redefinition
uk :- normal situation.
uu :- normal situation.
In addition to the two letter situations, there are six single letter
situations.
They possible anomalies are:
-k :- possibly anomalous
-d :- okay.
-u :- possibly anomalous.
k- :- not anomalous.
u- :- normal, possibly an anomaly
d- :- possibly anomalous
Data - Flow Testing
• K, D, U, A
• Processing Step
• k, d, u
Data Flow Anomaly State graph
Unforgiving Data flow state graph forgiving dataflow anomaly state graph
DFT Strategies
• All-du paths(ADUP)
• All-uses(AU) strategy
•All-p-Uses/Some –C-uses strategy
•All-c-uses/Some-p-Uses strategy
•All definition strategy
• all-predicate-uses(APU) strategy
•All-computational uses strategies
•Ordering the strategies
All-du Paths (ADUP) Strategy
Example:
For the code below, testing should ensure that both the condition
if(x > 0) and the computation x = x + 2 are tested with all possible
values
intofx x.
= 5; // Definition of x
if (x > 0) { // Use of x (predicate
use)
x = x + 2; // Definition of x
}
All-p-Uses/Some-c-Uses Strategy
Definition: This strategy ensures that all predicate uses (p-uses) are tested, and at
least one computational use (c-use) for each definition is covered.
Example:
Ensuring that the condition if(x > 0) is tested for both true and false
All-c-Uses/Some-p-Uses Strategy
Definition: Ensures that all computational uses (c-uses) are tested, while at
Example:
Example:
For x = 5; x = x + 2;, tests should ensure execution reaches both
assignments.
tested.
Example:
For if(x > 0), tests must include both cases where x > 0 and x ≤ 0.
All-Computational Uses (All-c-uses) Strategy
Example:
For x = x + 2;, tests should include values ensuring
different computational outcomes.
Ordering of strategies
Example
1. read x, y;
2. if(x>y)
3. a = x+1 Variable Defined at Used at
else X 1 2,3
4. a = y-1
Y 1 2,4
5. print a;
A 3 5
Domain Testing
What is Domain Testing?
Domain testing is a kind of software testing process during which
the software is tested by giving a minimum number of inputs
and evaluating its proper outputs and it is specific to a
particular domain.
Coincidental Correctness
Representative Outcome
If the logic mistakenly assigns A to all inputs above 50, testing with values
90 and 95 will pass, even though values like 51 or 60 also wrongly get an A.
Example:
A discount system applies a 10% discount for amounts between 1000 and
5000.
Example:
Age > 21
But testing (Age = 22, Salary = 25,000) fails, and domain testing misses this.
Domain testing assumes all errors behave the same way, but in
reality, different types of bugs behave differently and require different
test strategies.
Example:
A domain test covering valid/invalid values might catch one type but
miss the second since the bugs behave differently.
Linear Vector Space
Domain testing works well with linear numeric inputs but struggles
with nonlinear relationships.
Example:
Testing only linear points (20 mph, 40 mph, 60 mph) might miss
nonlinear behaviors between these speeds.
Loop-Free Software
Example:
If you test valid and invalid passwords once, the test passes.