input output VS-Screen D-Tree DT-Panel A module tab {Q} post - - PowerPoint PPT Presentation

input
SMART_READER_LITE
LIVE PREVIEW

input output VS-Screen D-Tree DT-Panel A module tab {Q} post - - PowerPoint PPT Presentation

input output VS-Screen D-Tree DT-Panel A module tab {Q} post condition tab {P} pre condition tab draw click any definition re-draw generated decision table (DT-Panel) 12 conditions and 4


slide-1
SLIDE 1
slide-2
SLIDE 2
slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7

input

  • utput
slide-8
SLIDE 8

VS-Screen DT-Panel D-Tree

slide-9
SLIDE 9

A:module tab {Q}:post condition tab {P}:pre condition tab

slide-10
SLIDE 10

click any definition re-draw draw

slide-11
SLIDE 11

  

slide-12
SLIDE 12

generated decision table (DT-Panel)

slide-13
SLIDE 13

12 conditions and 4 actions (all conditions and actions) are extracted. Truth values are properly generated.

We confirmed that the VDTable operates correctly.

slide-14
SLIDE 14

Specification

  • n

A (4 (4) Sp Specification

  • n

B (16) Measure and compare the time taken to complete the decision table for each specification

Subj bjects

VD VDTa Table The number of combination of truth values is different Specification

  • n

C (256)

slide-15
SLIDE 15
  • subject

VDM++ specification (The number of combination of truth values)

specification A (4) specification B (16) specification C (256) A 252 405 1131 B 213 559 1292 C 169 499 1194 D 240 435 1859 E 134 557 1397 av averag age 216 498 1629 VDTab able

0.0 .012 0.0 .016 0.0 .02

slide-16
SLIDE 16

BWDM outputs test cases that based on boundary value analysis.

slide-17
SLIDE 17

input

  • utput
slide-18
SLIDE 18
  • VDM++ specification
slide-19
SLIDE 19

Test Case No. Input Data Expected Output Data No.1 intMin-1 “Undefined Action” No.2 intMin “a < 5” No.3 intMax “12 <= a” No.4 intMax+1 “Undefined Action” No.5 4 “a < 5” No.6 5 “5 < a <= 12” No.7 11 “5 < a <= 12” No.8 12 “12 <= a”

Boundary Value Analysis

Type Boundary Value if-condition boundary value VDM++ Specification

Expected Output Data

  • f outside input

values of type range

test cases

slide-20
SLIDE 20
slide-21
SLIDE 21

Ex.) When the argument of the function is an int ↓ intMin, intMax, intMin-1, intMax+1 Minimum, maximum, and outside values of Integer range In testing phase, tester corrects it to actual numbers, such as intMin:-2147483648, according to the development environment (language, bit number, etc.), and performs test.

type boundary value

slide-22
SLIDE 22
  • Ex. ) When the if-condition is “a<4”

↓ 3, 4 (3:true, 4:false) two integer values at the boundary of the inequality (three values when if-condition is modulo)

if-conditions boundary value

slide-23
SLIDE 23
slide-24
SLIDE 24

Test Case No. Input Data Expected Output Data No.1 intMin-1 “Undefined Action” No.2 intMin “a < 5” No.3 intMax “12 <= a” No.4 intMax+1 “Undefined Action” No.5 4 “a < 5” No.6 5 “5 < a <= 12” No.7 11 “5 < a <= 12” No.8 12 “12 <= a”

test cases

Boundary Value Analysis

Type Boundary Value if-condition boundary value VDM++ Specification

Expected Output Data

  • f outside input

values of type range

slide-25
SLIDE 25
  • two arguments
  • determine whether arg1 is an

even number in the first remainder expression

  • In two inequalities, it judges the

sign of arg2

slide-26
SLIDE 26
  • According to the specification,
  • arg1:7, arg2:6 boundary values

are output correctly

  • Output the input data and the

expected output data correctly as the boundary value test case

slide-27
SLIDE 27

Times

specification1 specification2 specification3 1st time 325 316 6277 2nd time 283 389 5321 3rd time 500 371 6236 4th time 291 334 5070 5th time 269 371 5700 Average 334 356 5720

slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30
slide-31
SLIDE 31
slide-32
SLIDE 32
slide-33
SLIDE 33
slide-34
SLIDE 34
slide-35
SLIDE 35

    

#access private #location in '/Users/katlab/Documents/workspace/VDMDT/data/Sample.vdmpp' at line 4:3 #name revBin2dec #type (seq of (nat) -> nat) #kind explicit function #body private revBin2dec: (seq of (nat) -> nat) revBin2dec(s) == (if (s = []) then 0 elseif (s = [0]) then 0 elseif (s = [1]) then 1 else ((hd s) + (2 * revBin2dec((tl s)))))

slide-36
SLIDE 36

… #kind explicit function #body private revBin2dec: (seq of (nat) -> nat) revBin2dec(s) == (if (s = []) then 0 elseif (s = [0]) then 0 elseif (s = [1]) then 1 else ((hd s) + (2 * revBin2dec((tl s))))) if1 (s = []) then elseif (s = [0]) then elseif (s = [1]) then 1 else1 ((hd s) + (2 * revBin2dec((tl s))))

slide-37
SLIDE 37

condition extraction pattern action extraction pattern

if “condition’’ then elseif “condition” then then “action’’ if then “action’’ elseif then “action’’ else else “action’’ if else “action’’ elseif else “action’’ else else “action’’ EOF cases “condition’’ ->

  • > “action’’ cases
  • thers “Action’’ EOF

pre “condition’’ post pre “condition’’ EOF post “condition’’ EOF

※EOF(End Of File)

slide-38
SLIDE 38

condition array

if1 (s = [ []) then elseif (s = [ [0]) then elseif (s = [ [1]) then 1 else1 ((hd s) + (2 * revBin2dec((tl s)))) index conditi tion

  • n

(s = []) 1 (s = [0]) 2 (s = [1])

internal representation data extraction rule ※EOF(End Of File)

condition extraction pattern action extraction pattern

if “condition’’ then elseif “condition” then then “action’’ if then “action’’ elseif then “action’’ else else “action’’ else else “action’’ elseif else “action’’ else else “action’’ EOF cases “condition’’ ->

  • > “action’’ cases
  • thers “action’’ EOF

pre “condition’’ post pre “condition’’ EOF post “condition’’ EOF

slide-39
SLIDE 39

if1 (s = []) then elseif (s = [0]) then elseif (s = [1]) then 1 else1 (( ((hd hd s) + (2 * revBin2de dec(( ((tl tl s)))) ))

index ac action 1 1 2

((hd s) + (2 * revBin2dec(( tl s ))))

action array internal representation data

condition extraction pattern action extraction pattern

if “condition’’ then elseif “condition” then then “action’’ if then “action’’ elseif then “action’’ else else “action’’ else else “action’’ elseif else “action’’ else else “action’’ EOF cases “condition’’ ->

  • > “action’’ cases
  • thers “action’’ EOF

pre “condition’’ post pre “condition’’ EOF post “condition’’ EOF

extraction rule ※EOF(End Of File)

slide-40
SLIDE 40

index of

  • f

conditi tion

  • n

token index of

  • f

action if1 1 elseif 2 elseif 1 else1 2

condition array

if1 (s = []) then elseif (s = [0]) then elseif (s = [1]) then 1 else1 ((hd s) + (2 * revBin2dec((tl s))))

index condition (s = []) 1 (s = [0]) 2 (s = [1]) index action 1 1 2 ((hd s) + (2 * revBin2dec(( tl s ))))

action array

CA-Table

internal representation data

slide-41
SLIDE 41
slide-42
SLIDE 42
  • 1
  • 2
  • index of
  • f

conditi tion

  • n

token index of action

if1 1 elseif 2 elseif 1 else1 2

number of condition and else and others index of condition index of action

  • 1
  • 2
slide-43
SLIDE 43

Y N N N 1

  • 2
  • index of
  • f

conditi tion

  • n

token index of action

if1 1 elseif 2 elseif 1 else1 2

number of condition and else and others index of condition index of action

X

  • 1
  • 2
slide-44
SLIDE 44

Y N N N 1

  • 2
  • index of
  • f

conditi tion

  • n

token index of action

if1 1 elseif 2 elseif 1 else1 2

number of condition and else and others index of condition index of action

X

  • 1
  • 2
slide-45
SLIDE 45

Y N N N 1

  • Y

N N 2

  • index of
  • f

conditi tion

  • n

token index of action

if1 1 elseif 2 elseif 1 else1 2

number of condition and else and others index of condition index of action

X X

  • 1
  • 2
slide-46
SLIDE 46

Y N N N 1

  • Y

N N 2

  • Y

N

index of

  • f

conditi tion

  • n

token index of action

if1 1 elseif 2 elseif 1 else1 2

number of condition and else and others index of condition index of action

X X

  • 1
  • X
  • 2
slide-47
SLIDE 47

Y N N N 1

  • Y

N N 2

  • Y

N

index of

  • f

conditi tion

  • n

token index of action

if1 1 elseif 2 elseif 1 else1 2

number of condition and else and others index of condition index of action

X X

  • 1
  • X
  • 2
  • X
slide-48
SLIDE 48

Y N N N 1

  • Y

N N 2

  • Y

N

index of

  • f

conditi tion

  • n

token index of action

if1 1 elseif 2 elseif 1 else1 2

number of condition and else and others index of condition index of action

X X

  • 1
  • X
  • 2
  • X
slide-49
SLIDE 49

Rule #1 #2 #3 #4 Condition (s = []) Y N N N (s = [0])

  • Y

N N (s = [1])

  • Y

N Action X X

  • 1
  • X
  • ((hd s) + (2 * revBin2dec((tl s))))
  • X

index dex condit dition ion (s = []) 1 (s = [0]) 2 (s = [1]) index dex action ion 1 1 2 ((hd s) + (2 * revBin2dec(( tl s ))))

slide-50
SLIDE 50
slide-51
SLIDE 51
slide-52
SLIDE 52
slide-53
SLIDE 53
slide-54
SLIDE 54

4,5,11,12 intMin-1, intMin, intMax, intMax+1

a:4,5,11,12, intMin-1, intMin, intMax, intMax+1

a<5 12<=a

a int

if-conditions

formal argument

boundary value

SampleFunc : int -> seq of char SampleFunc(a)== if(a < 5) then "a = ...2, 3, 4" else if(12 <= a) then "a = 12, 13, 14..." else "5 <= a <= 11";

argument type

VDM++ specification

input data

  • 2. Generate

boundary values

Out_of_Bounds TF FT Out_of_Bounds TF FF FF FT

boolean string

  • 3. Generate

input data.

  • 4. Judge the bool of

if-conditions and making boolean string.

  • 1. Parse VDM++

Specification

slide-55
SLIDE 55

4,5,11,12 intMin-1, intMin, intMax, intMax+1

a:4,5,11,12, intMin-1, intMin, intMax, intMax+1

a<5 12<=a

a int

formal argument

boundary value

SampleFunc : int -> seq of char SampleFunc(a)== if(a < 5) then "a = ...2, 3, 4" else if(12 <= a) then "a = 12, 13, 14..." else "5 <= a <= 11";

argument type

VDM++ specification

input data

Out_of_Bounds TF FT Out_of_Bounds TF FF FF FT

boolean string

  • 3. Generate

input data.

  • 1. Parse VDM++

Specification

  • 2. Generate

boundary values

if-conditions

  • 4. Judge the bool of

if-conditions and making boolean string.

slide-56
SLIDE 56

1.Parse VDM++ specification

a<5 12<=a

a int

if-conditional expression SampleFunc : int -> seq of char SampleFunc(a)== if(a < 5) then "a = ...2, 3, 4" else if(12 <= a) then "a = 12, 13, 14..." else "5 <= a <= 11";

argument type

formal argument

VDM++ specification

if-conditions

slide-57
SLIDE 57

4,5,11,12 intMin-1, intMin, intMax, intMax+1

a:4,5,11,12, intMin-1, intMin, intMax, intMax+1

a<5 12<=a

a int

if-conditional expression

formal argument

boundary value

SampleFunc : int -> seq of char SampleFunc(a)== if(a < 5) then "a = ...2, 3, 4" else if(12 <= a) then "a = 12, 13, 14..." else "5 <= a <= 11";

argument type

VDM++ specification

input data 2.Generate Boundary values

Out_of_Bounds TF FT Out_of_Bounds TF FF FF FT

boolean string

  • 3. Generate

input data.

  • 1. Parse VDM++

Specification

if-conditions

  • 4. Judge the bool of

if-conditions and making boolean string.

slide-58
SLIDE 58
  • 1 of it

a:4,5,11,12, intMin-1, intMin, intMax, intMax+1

a<5 12<=a

a int

if-conditional expression

formal argument

argument type

boundary value

2.Generate boundary values

if-conditions

slide-59
SLIDE 59
  • 4,5,11,12

intMin-1, intMin, intMax, intMax+1

a:4,5,11,12, intMin-1, intMin, intMax, intMax+1

a<5 12<=a

a int

if-conditional expression

formal argument

boundary value

SampleFunc : int -> seq of char SampleFunc(a)== if(a < 5) then "a = ...2, 3, 4" else if(12 <= a) then "a = 12, 13, 14..." else "5 <= a <= 11";

argument type

VDM++ specification

input data

Out_of_Bounds TF FT Out_of_Bounds TF FF FF FT

boolean string

  • 3. Generate

input data.

  • 1. Parse VDM++

Specification

  • 2. Generate

boundary values

if-conditions

  • 4. Judge the bool of

if-conditions and making boolean string.

slide-60
SLIDE 60

intMin-1 intMin intMax intMax+1 4 5 11 12

a:4,5,11,12, intMin, intMax, intMin-1, intMax+1

3.Generate input data

boundary value

input data

slide-61
SLIDE 61
  • 4,5,11,12

intMin-1, intMin, intMax, intMax+1

a:4,5,11,12, intMin-1, intMin, intMax, intMax+1

a<5 12<=a

a int

if-conditional expression

formal argument

boundary value

SampleFunc : int -> seq of char SampleFunc(a)== if(a < 5) then "a = ...2, 3, 4" else if(12 <= a) then "a = 12, 13, 14..." else "5 <= a <= 11";

argument type

VDM++ specification

input data

Out_of_Bounds TF FT Out_of_Bounds TF FF FF FT

boolean string

  • 3. Generate

input data.

  • 1. Parse VDM++

Specification

  • 2. Generate

boundary values

if-conditions

  • 4. Judge the bool of

if-conditions and making boolean string.

slide-62
SLIDE 62

12 intMin-1 intMin intMax intMax+1 4 5 11 12

Out_of_Bounds TF FT Out_of_Bounds TF FF FF FT

a<5 12<=a

Boolean String

  • Assigning input data to the if-conditional expressions to

determine a Boolean value and characterizing the result

  • f judgement as T of F

a<5 12<=a apply 12<5 12<=12 FALSE TRUE

judge boolean

“FT”

figure: Example of creating a Boolean string “FT” from input data “1, 2” and if-conditional expressions “a<5, 12<=a” boolean string

input data input data

if-conditions if-conditions

  • 4. Judge the bool of

if-conditions and making boolean string.

slide-63
SLIDE 63
slide-64
SLIDE 64
slide-65
SLIDE 65

input expected output intMin-1 -> “Undefined” intMin

  • > ”a<5”

intMax

  • > “12<=a”

intMax+1 -> “Undefined” 4 -> “a<5” 5 -> “5<=a<=11” 11 -> “5<=a<=11” 12 -> “12<=a”

test cases

Out_of_Bounds TF FT Out_of_Bounds TF FF FF FT

boolean string inp nput da data and and Boo

  • olean strin

tring

intMin-1 intMin intMax intMax+1 4 5 11 12

input data 2.Generate expected output data from input data, boolean string, and corresponding table of boolean string and action. And generate test cases.

  • #1

#2 #3 #4 Condition a < 5 T T F F Condition 12 <= a T F T F Action “a<5” T T F F Action “12 <= a” F F T F Action “5<=a<=11” F F F T Decision Table

boolean string action TT “a<5” TF “a<5” FT “12<=a” FF “5<=a<=11”

table of boolean string and action

1.Load decision table and generating table of Boolean string and action.

#1 #2 #3 #4 Condition a < 5 T T F F Condition 12 <= a T F T F Action “a<5” T T F F Action “12 <= a” F F T F Action “5<=a<=11” F F F T

boolean string action TT “a<5” TF “a<5” FT “12<=a” FF “5<=a<=11”

corresponding table of boolean strings and actions

slide-66
SLIDE 66
  • input

expected output intMin-1 -> “Undefined” intMin

  • > ”a<5”

intMax

  • > “12<=a”

intMax+1 -> “Undefined” 4 -> “a<5” 5 -> “5<=a<=11” 11 -> “5<=a<=11” 12 -> “12<=a”

test cases

Out_of_Bounds TF FT Out_of_Bounds TF FF FF FT

boolean string inp nput da data and and Boo

  • olean strin

tring

intMin-1 intMin intMax intMax+1 4 5 11 12

input data

#1 #2 #3 #4 Condition a < 5 T T F F Condition 12 <= a T F T F Action “a<5” T T F F Action “12 <= a” F F T F Action “5<=a<=11” F F F T Decision Table

boolean string action TT “a<5” TF “a<5” FT “12<=a” FF “5<=a<=11” 1.Load decision table and generating table of Boolean string and action.

corresponding table of boolean strings and actions

2.Generate expected output data from input data, boolean string, and corresponding table of boolean string and action. And generate test cases.

slide-67
SLIDE 67
  • #1

#2 #3 #4 Condition a < 5 T T F F Condition 12 <= a T F T F Action “a<5” T T F F Action “12 <= a” F F T F Action “5<=a<=11” F F F T Decision Table

boolean string action TT “a<5” TF “a<5” FT “12<=a” FF “5<=a<=11” 1.Load decision table and generating table of Boolean string and action.

corresponding table of boolean strings and actions

slide-68
SLIDE 68

#1 #2 #3 #4 Condition a < 5 T T F F Condition 12 <= a T F T F Action “a<5” T T F F Action “12 <= a” F F T F Action “5<=a<=11” F F F T Decision Table

boolean string action TT “a<5” TF “a<5” FT “12<=a” FF “5<=a<=11”

table of boolean string and action #1 #2 #3 #4 Condition a < 5 T T F F Condition 12 <= a T F T F Action “a<5” T T F F Action “12 <= a” F F T F Action “5<=a<=11” F F F T

boolean string action TT “a<5” TF “a<5” FT “12<=a” FF “5<=a<=11”

corresponding table of Boolean string and action

input expected output intMin-1 -> “Undefined” intMin

  • > ”a<5”

intMax

  • > “12<=a”

intMax+1 -> “Undefined” 4 -> “a<5” 5 -> “5<=a<=11” 11 -> “5<=a<=11” 12 -> “12<=a”

test cases

Out_of_Bounds TF FT Out_of_Bounds TF FF FF FT

boolean string inp nput da data and and Boo

  • olean strin

tring

intMin-1 intMin intMax intMax+1 4 5 11 12

input data

1.Load decision table and generating table of Boolean string and action. 2.Generate expected output data from input data, boolean string, and corresponding table of boolean string and action. And generate test cases.

slide-69
SLIDE 69

input expected output intMin-1 -> “Undefined” intMin

  • > ”a<5”

intMax

  • > “12<=a”

intMax+1 -> “Undefined” 4 -> “a<5” 5 -> “5<=a<=11” 11 -> “5<=a<=11” 12 -> “12<=a” test cases

Out_of_Bounds TF FT Out_of_Bounds TF FF FF FT

Boolean string

Boolean string action TT “a<5” TF “a<5” FT “12<=a” FF “5<=a<=11”

corresponding table of Boolean string and action

intMin-1 intMin intMax intMax+1 4 5 11 12

input data

input data and Boolean string