Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
11/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
Generation of test case
templates using the
Boolean representation
of software modelChristinaChristina DorotskaDorotska
Freiberg University of Mining and Freiberg University of Mining and Technology Technology
Institute of Computer Science, Institute of Computer Science, Freiberg (Sachs.), GermanyFreiberg (Sachs.), Germany
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
22/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
Outline
• Introduction
• UML
• Describing of a test template by a set of values
• Boolean respresentation of UML modell
• Coding of model elements
• Coding of test templates
• Example
• Experimental results
• Conclusion
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
33/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
Introduction
• Main goal
Automatically generation of test templates for the software
SoftwareUML - model
GETECA
Boolean
model
Boolean
testcases
external
testcases
• Describing of the software with UML
• Creation of Boolean software model
• Calculation of Boolean testcases
• Transformation into the text form
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
44/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
Describing of software with UML diagrams
Personal Customer
- creditCard# : Long Integer
Customer
- name : String- address : String
+ creditRating()
Order
- dateRecived : Date- isPrepaid : Boolean- number : String- price : Money
+ dispatch()+ close()
1n
Corporate Customer
- contactName : String- creditRating : String- creditLimit : Double
+ remind(order : Order, date : Date) : Boolean+ billForMonth(month : Date)
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
55/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
Describing of software with UML diagrams
dispatch( )
: Corporate Customer
: Order
billForMonth(Date)
creditRating( )
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
66/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
postconditionspreconditions
…………………………
wrongcorrect…wrongcorrectcorrect…wrongwrong#3
correct
…
correct
wrong
wrong
value
#n-1
…
…
…
…
…
…
……………………
correctcorrectcorrectwrong…wrongwrong#2
wrongwrongwrongwrong…wrongwrong#1
wrongwrongcorrectwrong…correctwrong#j
correctcorrectcorrectcorrect…correctcorrect#2i
value
#n
value
#i+1
value
#i
value
#i-1…
value
#2
value
#1
test
template
Test template respresentation by a set of values
value
#n-1…
value
#n
value
#i+1
value
#i
value
#i-1…
value
#2
value
#1
test
template
?
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
77/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
����correct…correctcorrectcorrect…correctcorrect#n+1
�wrong…wrongwrongwrong…correctcorrect#n
…………………………
�correct…correctcorrectcorrect…wrongcorrect#2
�wrong…wrongcorrectcorrect…correctwrong#1
test
result
value
#n+m
…value
#n+2
value
#n+1
value
#n
…value
#2
value
#1
test
template
Test template respresentation by a set of values
?
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
88/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
Coding of model elements
Attribut 1 #cp1#a1
Attribut 2 #cp2#a2
...
Attribut s #cps#as
Operation 1 #ck1#o1
Operation 2 #ck2#o2
...
Operation m #ckm#om
Parameter 1 #ci1#oj1#p1
Parameter 2 #ci2#oj2#p2
...
Parameter l #cil#ojs#pl
Class 1 #c1
Class 2 #c2
…
Class n #cn
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
99/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
Code patterns for model elements
x1
1
x2
2
…
...
xn
#n
-
#n+1
-
#n+2
bits to code the numberof the element
Code pattern for parameter
xn+1 xn+2
#n+3 #n+4
xn+3 xn+4
bit for thepreconditionvalue
bit for thepostconditionvalue
bit for thepreconditionfeature
bit for thepostconditionfeature
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
1010/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
Possible kinds of parameter and its coding
inout-parameter1-1-
out-parameter1-00
in-parameter001-
Note
Bit for the
postcondition
feature
Bit for the
postcondition
value
Bit for the
precondition
feature
Bit for the
precondition
value
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
1111/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
Coding of a test template
precondition
part
code of
the operation
parameter
part
postcondition
part
Dependency vector
Dependency vector for the function billForMonth
parameter part
parameter
month
operation
billForMonth
attribute
creditLimit
attribute
adress
attribute
name
001-000011100001110-010110-10010-0001
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
1212/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
Test templates for the function billForMonth
001-000011100001110-010110-10010-0001
0010000011100001110101011011001010001
0011000011100001110001011011001010001
0011000011100001110101011001001010001
0011000011100001110101011011001000001
parameter
month
operation
billForMonth
attribute
creditLimit
attribute
adress
attribute
name
0011000011100001110101011011001010001
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
1313/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
Interpreted list of test templates
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
1414/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
Experimental results
3111787
3110756
3113785
4623654
4623603
250601382
156571481
generation time (ms)# test templates# model elements#
6th International Workshop on Boolean Problems 6th International Workshop on Boolean Problems
September 23September 23--24, 2004 Freiberg24, 2004 Freiberg
1515/15/15
Generation of test case Generation of test case templatestemplates usingusing thethe
BooleanBoolean representationrepresentation of of softwaresoftware modelmodel
• Automatically generation of test cases using a UML
model and ist representation in Boolean form ispossible
• To generate the test templates was used the
dependency vector of the function
• All values, which influence the test result werecovered in a dependency vector with a dash
• To create a test case all dashes should bereplaced with one or zero
Conclusion