dynamic analysis - scotch: improving test-to-code traceability using slicing and conceptual coupling

30
SCOTCH Improving Test-to-Code Traceability using Slicing and Conceptual Coupling Abdallah Qusef*, Gabriele Bavota *, Rocco Oliveto ! Andrea De Lucia*, David Binkley " * Software Engineering Lab, University of Salerno, Italy ! STAT Department, University of Molise, Italy " Loyola University Maryland, USA

Upload: icsm-2011

Post on 13-Jan-2015

743 views

Category:

Technology


0 download

DESCRIPTION

Paper: SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual CouplingAuthors: Abdallah Qusef, Gabriele Bavota, Rocco Oliveto, Andrea De Lucia, David BinkleySession: Research Track Session 3: Dynamic Analysis

TRANSCRIPT

Page 1: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

SCOTCH Improving Test-to-Code Traceability

using Slicing and Conceptual Coupling

Abdallah Qusef*, Gabriele Bavota*, Rocco Oliveto!

Andrea De Lucia*, David Binkley"

* Software Engineering Lab, University of Salerno, Italy! STAT Department, University of Molise, Italy

" Loyola University Maryland, USA

Page 2: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

SCOTCHSlicing and COupling based Test to Code trace Hunter

ContextTest-to-code traceability recovery

Empirical EvaluationSCOTCH vs Naming Convention vs LCBA vs DFA

Page 3: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

Test-to-code traceability recovery

context

Page 4: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

goalTestSuiteClass

Class_1TESTEDCLASS

Class_2TESTEDCLASS

Page 5: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

Test-to-code traceability

Software Comprehension

Regression Testing

Impact Analysis

Refactoring

Page 6: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

challenges

retrieve links between classes

Page 7: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

challenges

test-to-code traceability

TestSuite

Class_1

Class_2

Class_3

Class_4

calls

calls

callscalls

Page 8: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

challenges

test-to-code traceability

TestSuite

Class_1

Class_2

Class_3

Class_4

calls

calls

callscalls mockobject

helperclass

helperclass

TESTEDCLASS

Page 9: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

state of the art

Page 10: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

state of the art

Van Rompaey et al.CSMR 2009

Qusef et al.ICSM 2010

Page 11: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

state of the art

Van Rompaey et al.CSMR 2009

Qusef et al.ICSM 2010

Last Call Before Assert

Naming Convention

Page 12: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

state of the art

Van Rompaey et al.CSMR 2009

Qusef et al.ICSM 2010

Data Flow Analysis

Page 13: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

SCOTCH

Slicing and COupling based Test to Code trace Hunter

Page 14: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

TestSuiteIdentifying the last assertstatement for each method

assertTrue(--)

slicing critirion

Dynamic Slicing

sliceExtracting the classes

Class in STS

Conceptual Coupling

Class in CTS

Page 15: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

examplepublic class RemoveElementsTest extends TestCase {

public void testRemoveElement () {! ! ConnectedGraphFactory factory = ConnectedGraphFactory.newFactory();! ! ConnectedGraph graph = factory.newGraph();! ! NodeElement node1 = graph.getStartNode();! ! NodeElement node2 = graph.newNode(); ! ! ... ... ...!! ! EdgeElement edge1, edge2, edge3, edge4, edge5;! ! edge1 = graph.newEdge(node1, node2);! ! edge2 = graph.newEdge(node2, node3);

! ! ... ... ...

! ! try {! ! ! removedElement = graph.removeElement(edge2);! ! ! fail("DisconnectedGraphException expected");! ! } catch (DisconnectedGraphException e) {! ! ! assertTrue(true);! ! } }!}

Page 16: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

examplepublic class RemoveElementsTest extends TestCase {

public void testRemoveElement () {! ! ConnectedGraphFactory factory = ConnectedGraphFactory.newFactory();! ! ConnectedGraph graph = factory.newGraph();! ! NodeElement node1 = graph.getStartNode();! ! NodeElement node2 = graph.newNode(); ! ! ... ... ...!! ! EdgeElement edge1, edge2, edge3, edge4, edge5;! ! edge1 = graph.newEdge(node1, node2);! ! edge2 = graph.newEdge(node2, node3);

! ! ... ... ...

! ! try {! ! ! removedElement = graph.removeElement(edge2);! ! ! fail("DisconnectedGraphException expected");! ! } catch (DisconnectedGraphException e) {

! ! } }!}

assertTrue(true);

Page 17: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

exampleDisconnected

GraphException EdgeElement NodeElement ConnectedGraph ConnectedGraphFactory

STS - Dynamic Slicing Output

ConnectedGraph 0.60ConnectedGraphFactory 0.56

EdgeElement 0.49NodeElement 0.48

DisconnectedGraphException 0.10

t = λ* max(CCBC)

λ = 0.95

Page 18: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

exampleDisconnected

GraphException EdgeElement NodeElement ConnectedGraph ConnectedGraphFactory

STS - Dynamic Slicing Output

ConnectedGraph 0.60ConnectedGraphFactory 0.56

EdgeElement 0.49NodeElement 0.48

DisconnectedGraphException 0.10

t = 0.95 * 0.60 = 0.57

Page 19: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

exampleDisconnected

GraphException EdgeElement NodeElement ConnectedGraph ConnectedGraphFactory

STS - Dynamic Slicing Output

ConnectedGraph 0.60ConnectedGraphFactory 0.56

EdgeElement 0.49NodeElement 0.48

DisconnectedGraphException 0.10

CTS - Filtered by CCBC

ConnectedGraph

Page 20: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

empirical evaluation

Page 21: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

results

20

33

46

59

72

85

AgilePlanner ArgoUML eXVantage

F-M

easu

re

NC

Page 22: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

NC applicability

0

25

50

75

100

AgilePlanner ArgoUML eXVantage

#CUTs=1 #CUTs=1 and NC applied

Page 23: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

results

20

33

46

59

72

85

AgilePlanner ArgoUML eXVantage

F-M

easu

re

NC LCBA

Page 24: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

results

20

33

46

59

72

85

AgilePlanner ArgoUML eXVantage

F-M

easu

re

NC LCBA DFA

Page 25: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

results

20

33

46

59

72

85

AgilePlanner ArgoUML eXVantage

F-M

easu

re

NC LCBA DFA SCOTCH

Page 26: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

conclusionfuture work

Page 27: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

...conclusion...

SCOTCH: how to overcome the limitations of the state of the art techniques

Page 28: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

...conclusion...

SCOTCH outperforms the state of the art techniques

Page 29: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

...future work...

investigate about other heuristics

replicate the experiment on different datasets

Page 30: Dynamic Analysis - SCOTCH: Improving Test-to-Code Traceability using Slicing and Conceptual Coupling

Thank you!

Questions and/orcomments

Gabriele BavotaPHD studentse@sa Lab, Univeristy of [email protected]