OMEN: A Strategy for Testing Object-Oriented Software - PowerPoint PPT Presentation

About This Presentation
Title:

OMEN: A Strategy for Testing Object-Oriented Software

Description:

Dept. of Computer and Information Sciences. Object-Oriented ... main: 1. Stack:2. push: 3. isempty:6. pop:7. println:10. Node:4. insert:5. get:8. remove:9 ... – PowerPoint PPT presentation

Number of Views:54
Avg rating:3.0/5.0
Slides: 36
Provided by: scie240
Category:

less

Transcript and Presenter's Notes

Title: OMEN: A Strategy for Testing Object-Oriented Software


1
OMEN A Strategy for Testing Object-Oriented
Software
  • Amie L. Souter
  • Lori L. Pollock
  • ISSTA 2000

Dept. of Computer and Information Sciences
2
Object-Oriented Programming
  • Features
  • Classes, Objects, and Inheritance
  • Polymorphism and Dynamic Binding
  • Programming Style
  • Modularity many small methods
  • Objects
  • Code reuse through inheritance
  • Complex class interactions
  • Heavy use of libraries

3
Illustrating Kinds of DEF-USE Pairs
Class Stack int myStack int
top 1 public Stack(int s) myStack new
ints 2 top 0
3 public void push(int obj)
myStacktop obj 4 public int pop()
5 if(size() 0) return
error 6 int temp
myStacktop-1 7 top-- 8
return temp
9 public int size() return top
10 public int top() return
myStacktop-1 11 public boolean isEmpty()
return top 0 12 public void example()
push(10)
if(size() 5)
do_something
intra-method
traditional du analysis Weyuker85
4
Illustrating Kinds of DEF-USE Pairs
Class Stack int myStack int
top 1 public Stack(int s) myStack new
ints 2 top 0
3 public void push(int obj)
myStacktop obj 4 public int pop()
5 if(size() 0) return
error 6 int temp
myStacktop-1 7 top-- 8
return temp
9 public int size() return top
10 public int top() return
myStacktop-1 11 public boolean isEmpty()
return top 0 12 public void example()
push(10)
if(size() 5)
do_something
intra-method
traditional du analysis Weyuker85
5
Illustrating Kinds of DEF-USE Pairs
Class Stack int myStack int
top 1 public Stack(int s) myStack new
ints 2 top 0
3 public void push(int obj)
myStacktop obj 4 public int pop()
5 if(size() 0) return
error 6 int temp
myStacktop-1 7 top-- 8
return temp
9 public int size() return top
10 public int top() return
myStacktop-1 11 public boolean isEmpty()
return top 0 12 public void example()
push(10)
if(size() 5)
do_something
inter-method
interprocedural du analysis Harrold89
6
Illustrating Kinds of DEF-USE Pairs
Class Stack int myStack int
top 1 public Stack(int s) myStack new
ints 2 top 0
3 public void push(int obj)
myStacktop obj 4 public int pop()
5 if(size() 0) return
error 6 int temp
myStacktop-1 7 top-- 8
return temp
9 public int size() return top
10 public int top() return
myStacktop-1 11 public boolean isEmpty()
return top 0 12 public void example()
push(10)
if(size() 5)
do_something
inter-method
interprocedural du analysis Harrold89
7
Illustrating Kinds of DEF-USE Pairs
Class Stack int myStack int
top 1 public Stack(int s) myStack new
ints 2 top 0
3 public void push(int obj)
myStacktop obj 4 public int pop()
5 if(size() 0) return
error 6 int temp
myStacktop-1 7 top-- 8
return temp
9 public int size() return top
10 public int top() return
myStacktop-1 11 public boolean isEmpty()
return top 0 12 public void example()
push(10)
if(size() 5)
do_something
inter-method
interprocedural du analysis Harrold89
8
Illustrating Kinds of DEF-USE Pairs
Class Stack int myStack int
top 1 public Stack(int s) myStack new
ints 2 top 0
3 public void push(int obj)
myStacktop obj 4 public int pop()
5 if(size() 0) return
error 6 int temp
myStacktop-1 7 top-- 8
return temp
9 public int size() return top
10 public int top() return
myStacktop-1 11 public boolean isEmpty()
return top 0 12 public void example()
push(10)
if(size() 5)
do_something
intra-class
Intra-class du analysis Harrold Rothermel 94
9
Illustrating Kinds of DEF-USE Pairs
Class Stack int myStack int
top 1 public Stack(int s) myStack new
ints 2 top 0
3 public void push(int obj)
myStacktop obj 4 public int pop()
5 if(size() 0) return
error 6 int temp
myStacktop-1 7 top-- 8
return temp
9 public int size() return top
10 public int top() return
myStacktop-1 11 public boolean isEmpty()
return top 0 12 public void example()
push(10)
if(size() 5)
do_something
intra-class
Intra-class du analysis Harrold Rothermel 94
10
Illustrating Kinds of DEF-USE Pairs
Class Stack int myStack int
top 1 public Stack(int s) myStack new
ints 2 top 0
3 public void push(int obj)
myStacktop obj 4 public int pop()
5 if(size() 0) return
error 6 int temp
myStacktop-1 7 top-- 8
return temp
9 public int size() return top
10 public int top() return
myStacktop-1 11 public boolean isEmpty()
return top 0 12 public void example()
push(10)
if(size() 5)
do_something
intra-class
Intra-class du analysis Harrold Rothermel 94
11
DEF-USE Pairs Involving Inter-Class Interactions
Class genericStack Array myStack 1
public genericStack() myStack new Array()
2 public Object top() return
myStack.back() 3 public void push(Obj o)
myStack.pushBack(o) 4 public Object
pop() return myStack.popBack() 5
public bool isEmpty() return
myStack.isEmpty() 6 public int size()
return myStack.size()
Class Array Object myStorage int
myLength 1 public Array()
myStorage new ObjectSIZE 2
myLength 0 3
public Object back() return
myStoragemyLength-1 4 public Object popBack()
return myStorage--myLength 5 public void
pushBack(Obj o) add(o)
6 public Object front(Obj o) return
myStorage0 7 public bool isEmpty()
return (myLength 0) 8 public int
size() return myLength
9 public void add(Obj o)
myStoragemyLength o //Array has 46
other methods
Inter-class du analysis Souter Pollock99
12
DEF-USE Pairs Involving Inter-Class Interactions
Class genericStack Array myStack 1
public genericStack() myStack new Array()
2 public Object top() return
myStack.back() 3 public void push(Obj o)
myStack.pushBack(o) 4 public Object
pop() return myStack.popBack() 5
public bool isEmpty() return
myStack.isEmpty() 6 public int size()
return myStack.size()
Class Array Object myStorage int
myLength 1 public Array()
myStorage new ObjectSIZE 2
myLength 0 3
public Object back() return
myStoragemyLength-1 4 public Object popBack()
return myStorage--myLength 5 public void
pushBack(Obj o) add(o)
6 public Object front(Obj o) return
myStorage0 7 public bool isEmpty()
return (myLength 0) 8 public int
size() return myLength
9 public void add(Obj o)
myStoragemyLength o //Array has 46
other methods
Inter-class du analysis Souter Pollock99
13
DEF-USE Pairs Involving Inter-Class Interactions
Class genericStack Array myStack 1
public genericStack() myStack new Array()
2 public Object top() return
myStack.back() 3 public void push(Obj o)
myStack.pushBack(o) 4 public Object
pop() return myStack.popBack() 5
public bool isEmpty() return
myStack.isEmpty() 6 public int size()
return myStack.size()
Class Array Object myStorage int
myLength 1 public Array()
myStorage new ObjectSIZE 2
myLength 0 3
public Object back() return
myStoragemyLength-1 4 public Object popBack()
return myStorage--myLength 5 public void
pushBack(Obj o) add(o)
6 public Object front(Obj o) return
myStorage0 7 public bool isEmpty()
return (myLength 0) 8 public int
size() return myLength
9 public void add(Obj o)
myStoragemyLength o //Array has 46
other methods
Inter-class du analysis Souter Pollock99
14
DEF-USE Pairs Involving Inter-Class Interactions
Class genericStack Array myStack 1
public genericStack() myStack new Array()
2 public Object top() return
myStack.back() 3 public void push(Obj o)
myStack.pushBack(o) 4 public Object
pop() return myStack.popBack() 5
public bool isEmpty() return
myStack.isEmpty() 6 public int size()
return myStack.size()
Class Array Object myStorage int
myLength 1 public Array()
myStorage new ObjectSIZE 2
myLength 0 3
public Object back() return
myStoragemyLength-1 4 public Object popBack()
return myStorage--myLength 5 public void
pushBack(Obj o) add(o)
6 public Object front(Obj o) return
myStorage0 7 public bool isEmpty()
return (myLength 0) 8 public int
size() return myLength
9 public void add(Obj o)
myStoragemyLength o //Array has 46
other methods
Inter-class du analysis Souter Pollock99
15
DEF-USE Pairs Involving Inter-Class Interactions
Class genericStack Array myStack 1
public genericStack() myStack new Array()
2 public Object top() return
myStack.back() 3 public void push(Obj o)
myStack.pushBack(o) 4 public Object
pop() return myStack.popBack() 5
public bool isEmpty() return
myStack.isEmpty() 6 public int size()
return myStack.size()
Class Array Object myStorage int
myLength 1 public Array()
myStorage new ObjectSIZE 2
myLength 0 3
public Object back() return
myStoragemyLength-1 4 public Object popBack()
return myStorage--myLength 5 public void
pushBack(Obj o) add(o)
6 public Object front(Obj o) return
myStorage0 7 public bool isEmpty()
return (myLength 0) 8 public int
size() return myLength
9 public void add(Obj o)
myStoragemyLength o //Array has 46
other methods
Inter-class du analysis Souter Pollock99
16
Research Goals
  • To develop a new approach to testing
    object-oriented software that
  • Provides structural testing tailored to OO codes
  • association between objects and fields
  • include object creation site with def-use pair
  • handle complex class interactions
  • Program representation scales to large software
    systems
  • Provides feedback to the tester
  • Provides information on external influences of
    the testing results
  • Provides the tester with direction in how to test
    an incomplete program

17
Outline
  • Object-Oriented Program Characteristics
  • Illustration of Def-Use Pairs
  • Research Goals
  • Our Solution
  • Basic Object Manipulations
  • Annotated Points-to Escape Graph
  • OMEN Test Tuple Construction Algorithm
  • Work in Progress

18
Basic Object Manipulations
19
Basic Object Manipulations
20
Basic Object Manipulations
21
Points-to-Escape-Graph
  • Terminology
  • Nodes
  • inside
  • outside
  • load
  • return value
  • Edges
  • inside
  • outside

Node insert(Object e) Node temp new Node
(e,this) return temp
Whaley Rinard OOPSLA99
22
Extensions to the Points-to-Escape GraphAPE
Graph
1 public push( Object e) 2 if(top
null) 3 top new Node(e, null) 4 else
5 top top.insert(e) 6 Node (Object
e, Node n ) 7 data e 8 next n
23
Extensions to the Points-to-Escape GraphAPE
Graph
1 public push( Object e) 2 if(top
null) 3 top new Node(e, null) 4 else
5 top top.insert(e) 6 Node (Object
e, Node n ) 7 data e 8 next n
24
Extensions to the Points-to-Escape GraphAPE
Graph
1 public push( Object e) 2 if(top
null) 3 top new Node(e, null) 4 else
5 top top.insert(e) 6 Node (Object
e, Node n ) 7 data e 8 next n
25
OMEN - Test Tuple Construction Algorithm
  • Computes a set of testing tuples for the
    component under test,
  • based on object manipulations.
  • Input set of call graphs for component under
    test
  • Output set of testing tuples for component under
    test
  • Traverse call graph in topological order
  • Process each methods APE graph
  • For each store annotation per unmarked APE graph
    edge
  • find the associated loads occurring after the
    store
  • find object creation site associated with the
    tuple
  • depends on the type of source node of the APE
    graph
  • report feedback
  • using the escape information of the APE graph

26
Traverse the Call Graphin Topological Order
main
push
pop
Stack
isempty
println
get
remove
Node
insert
27
Traverse the Call Graphin Topological Order
main 1
push 3
pop7
Stack2
isempty6
println10
get8
remove9
Node4
insert5
28
Processing a Methods APE Graph
x,22
Integer 20
20
data9
data8
next7
20-6-29
next5
20-4
top2
next6
next4
s,18
18
top1
top3
29
Processing a Methods APE Graph
x,22
Integer 20
20
data9
data8
next7
20-6-29
next5
20-4
top2
next6
next4
s,18
18
top1
top3
30
Processing a Methods APE Graph
x,22
Integer 20
20
data9
data8
next7
20-6-29
next5
20-4
top2
next6
next4
s,18
18
top1
top3
31
Avoiding Duplicate TuplesThrough Marking
data, 4-10-7, store
data,3-7,store
T
top,3,store
next,3-8,store
next,4-10-8,store
top,2,load
2
Marked edge Non-marked edge
top,4,store
Edges are marked during interprocedural merges of
ape graph construction.
32
Processing Incomplete Components
x,22
top1
18
s,18
top2
top4
top3
Feedback value loaded is potentially changed by
method outside CUT.
33
Processing Incomplete Components
x,22
top1
s,18
top2
top4
top3
Feedback value loaded is potentially changed by
method outside CUT.
34
Processing Incomplete Components
x,22
top1
s,18
top2
top4
top3
Feedback value loaded is potentially changed by
method outside CUT.
35
Work in Progress
  • APE Graph
  • Implementation of the APE graph
  • Empirical study of the space and time
    requirements
  • Empirical characterization study of the object
    manipulations in real object-oriented codes
  • Test Tuple Construction Algorithm
  • Algorithm extensions to include coverage for
    object manipulations based on references only
  • Algorithm modifications - more sophisticated
    techniques to eliminate infeasible paths
  • Evaluation of the algorithm
Write a Comment
User Comments (0)
About PowerShow.com