dynamic analysis - scotch: improving test-to-code traceability using slicing and conceptual coupling
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 AnalysisTRANSCRIPT
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
SCOTCHSlicing and COupling based Test to Code trace Hunter
ContextTest-to-code traceability recovery
Empirical EvaluationSCOTCH vs Naming Convention vs LCBA vs DFA
Test-to-code traceability recovery
context
goalTestSuiteClass
Class_1TESTEDCLASS
Class_2TESTEDCLASS
Test-to-code traceability
Software Comprehension
Regression Testing
Impact Analysis
Refactoring
challenges
retrieve links between classes
challenges
test-to-code traceability
TestSuite
Class_1
Class_2
Class_3
Class_4
calls
calls
callscalls
challenges
test-to-code traceability
TestSuite
Class_1
Class_2
Class_3
Class_4
calls
calls
callscalls mockobject
helperclass
helperclass
TESTEDCLASS
state of the art
state of the art
Van Rompaey et al.CSMR 2009
Qusef et al.ICSM 2010
state of the art
Van Rompaey et al.CSMR 2009
Qusef et al.ICSM 2010
Last Call Before Assert
Naming Convention
state of the art
Van Rompaey et al.CSMR 2009
Qusef et al.ICSM 2010
Data Flow Analysis
SCOTCH
Slicing and COupling based Test to Code trace Hunter
TestSuiteIdentifying the last assertstatement for each method
assertTrue(--)
slicing critirion
Dynamic Slicing
sliceExtracting the classes
Class in STS
Conceptual Coupling
Class in CTS
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);! ! } }!}
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);
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
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
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
empirical evaluation
results
20
33
46
59
72
85
AgilePlanner ArgoUML eXVantage
F-M
easu
re
NC
NC applicability
0
25
50
75
100
AgilePlanner ArgoUML eXVantage
#CUTs=1 #CUTs=1 and NC applied
results
20
33
46
59
72
85
AgilePlanner ArgoUML eXVantage
F-M
easu
re
NC LCBA
results
20
33
46
59
72
85
AgilePlanner ArgoUML eXVantage
F-M
easu
re
NC LCBA DFA
results
20
33
46
59
72
85
AgilePlanner ArgoUML eXVantage
F-M
easu
re
NC LCBA DFA SCOTCH
conclusionfuture work
...conclusion...
SCOTCH: how to overcome the limitations of the state of the art techniques
...conclusion...
SCOTCH outperforms the state of the art techniques
...future work...
investigate about other heuristics
replicate the experiment on different datasets
Thank you!
Questions and/orcomments
Gabriele BavotaPHD studentse@sa Lab, Univeristy of [email protected]