querying the history of software projects using qwalkeko
DESCRIPTION
Presentation about QwalKeko presented at the tool demo track of ICSME2014.TRANSCRIPT
Reinout [email protected]@ReinoutStevens
Querying the History of Software Projects using
QwalKekoCoen De Roover
[email protected]@oniroi
1
Motivation
•Commit Changes•Undo Changes•Retrieve Changes•Branch & Merge
2
2
Motivation’
~6600 commits~1000 source files
3
3
Concrete Example01 public class Example {02 WebDriver driver;03 04 @BeforeTest05 public void startDriver(){06 driver = new FirefoxDriver();07 }08 09 @AfterTest10 public void stopDriver(){11 driver.quit();12 }13
14 @Test15 public void testTitle(){16 driver.get("http://www.google.com");17 WebElement element = driver.findElement(By.name("q"));18 element.sendKeys("Cheese!");19 element.submit();20 assertEquals(driver.getTitle(), "Cheese!");21 }22 }
Prevalence and Maintenance of Automated Functional Tests for Web Applications Laurent Christophe, Reinout Stevens, Coen De Roover and Wolfgang De MeuterProceedings of the 30th International Conference on Software Maintenance and Evolution (ICSMe14), Victoria (Canada)
4
4
End Result●
●
●
0.0
0.1
0.2
0.3
0.4
assertion command constant demarcator locationChange Classification
Cha
nge
Hit
Rat
io
5
5
Queried Projects
6
Project ~#Commits ~#Source Files
Atlas 2200 700
EEG 800 870
Motech 1900 1090
OpenLMIS 4000 1000
xwiki 1600 200
richfaces-qa 1500 1000
6
Necessary Steps
1) Identify modified Selenium files
2) Compute changes made to the file
3) Classify changes made to the file
7
7
QwalKeko
Version 1 Version 2
Version 3a
Version 4a
Version 3b
Version 4b
Version 5
Specify Source Code Conditionsusing Declarative Programming
Move through Graph
Reason over Changes8
transformed
https://github.com/ReinoutStevens/damp.qwalkeko
8
Architecture
9
QwalKeko
in-source-code(ast ?type ?node)(has ?prop ?node ?result)(child ?prop ?node ?child)…
in-git-info(fileinfo ?file version)(author version)(revision-number version)(date version)…
Converted Graph
Changes(change ?change left right)(change|affects-node c ?node)…
Qwalq=>q=>*q<=…
consults
navigatesChangeNodesuses
consults
9
10
Identifying Selenium Files
1 (qwalkeko* [?file ?cu]2 (qwal graph start start3 (in-source-code [current]4 (file|added ?file current)5 (file|compilationunit ?file ?cu current)6 (compilationunit|selenium ?cu))))
{:status :add, :file ".../ExperimentPage.java"} #<CompilationUnit package uk.ac.ebi.atlas.acceptance.selenium.pages;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;...>
11
start
11
Identifying all Selenium Files
1 (qwalkeko* [?file ?cu ?end]2 (qwal graph start ?end3 q=>* 4 (in-source-code [current]5 (file|added ?file current)6 (file|compilationunit ?file ?cu current)7 (compilationunit|selenium ?cu))))
{:status :add, :file ".../ExperimentPage.java"} #<CompilationUnit package uk.ac.ebi.atlas.acceptance.selenium.pages;import org.openqa.selenium.By;import org.openqa.selenium.WebDriver;...> #<Metaversion-867a3be00501e415bc081f25032b273f44713672>
12
start
?end
...
12
1 (qwalkeko* [?change ?info ?end ?type]2 (qwal graph start ?end [?left-cu ?right-cu]3 (in-source-code [curr]4 (file|selenium|edit ?info curr))5 (file|compilationunit ?info ?right-cu curr))
6 q<= ;;move backwards
7 (in-source-code [curr]8 (compilationunit|corresponding ?right-cu ?left-cu))9 (change ?change ?left-cu ?right-cu)0 (classify-change ?change ?type))))
Classify Change
13
?end
start
13
AST Changes
Beat Fluri and Harald C. Gall. Classifying Change Types for Qualifying Change Couplings. In Proceedings of the 14th International Conference on Program Comprehension, 2006.
A
B C
D E
α’
C
E D
F
B
A
D
F
Delete
Update
Move
Insert
14
14
Classify Location01 ;;driver.findElement(By.name("q"));02 (defn methodinvocation|by [?x]03 (fresh [?name]04 (ast :MethodInvocation ?x)05 (child :expression ?x ?name)06 (name|simple-string ?name "By")))07 08 09 (defn change|affects-findBy [change ?find-by]10 (all11 (change|affects-node change ?find-by)12 (methodinvocation|by ?find-by)))
15
15
FeaturesFeaturesGit Meta Data Data & Control Flow
Information*
AST Information Changes
Declarative Query Language Graph Query Language
Performance Reasoning over Multiple Changes
16
https://github.com/ReinoutStevens/damp.qwalkekohttps://github.com/ReinoutStevens/ChangeNodes
https://github.com/cderoove/damp.ekeko
[email protected]@ReinoutStevens
Prevalence and Maintenance of Automated Functional Tests for Web Applications Laurent Christophe, Reinout Stevens, Coen De Roover and Wolfgang De Meuter
Coen De Roover Laurent Christophe
17