Current achievements and future prospects in the genetic ...
Software Analysis for the Web: Achievements and Prospects
-
Upload
ali-mesbah -
Category
Software
-
view
689 -
download
1
Transcript of Software Analysis for the Web: Achievements and Prospects
![Page 1: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/1.jpg)
Software Analysis for the Web:Achievements and Prospects
Ali MesbahUniversity of British Columbia http://ece.ubc.ca/~amesbah/
![Page 2: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/2.jpg)
2
Web Evolution Challenges
Achievements Prospects
![Page 3: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/3.jpg)
STATIC WEBSITESFile ServerBrowser
HTML
HTTPRequest
ResponseHTMLHTMLHTMLHTML
Internet
HTML
![Page 4: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/4.jpg)
DYNAMIC WEBSITESServerBrowser
HTML
HTTPRequest
Response
Internet
HTML
Generate HTML
![Page 5: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/5.jpg)
RESTFUL WEBSITESStateless ServerBrowser
HTML
HTTPRequest
Response
Internet
HTML
Generate HTML
“Principled design of the modern Web architecture”, Fielding and Tylor, ICSE 2000
![Page 6: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/6.jpg)
RICH INTERNET APPSServerBrowser
Flash
HTTPRequest
Response
Internet
Flash
GenerateFlash
RIA Plugin
![Page 7: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/7.jpg)
MODERN WEB APPS Stateless ServerBrowser
Async HTTPRequest
Response
Internet
JSON
GenerateJSON
DOMCSS
JS
![Page 8: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/8.jpg)
Web Apps
![Page 9: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/9.jpg)
9
“writeonce,runanywhere”
Instantaneoussoftwaredelivery
![Page 10: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/10.jpg)
Web-basedservicessuchasandhavechangedhowpeopledevelop
software
10
![Page 11: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/11.jpg)
11
Web Evolution Challenges
Achievements Prospects
![Page 12: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/12.jpg)
12
Challenges
Heterogeneous
Async Dynamic Interactions
Distributed Stateless
Event-driven
Stateless ServerBrowser
Async HTTPRequest
Response
Internet
JSON
JS, Java, PHP, Ruby,
etc
DOMCSS
JS
![Page 13: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/13.jpg)
JavaScript:theDifficultParts
1. Dynamic and weakly-typed• types can change dynamically• objects/functions can change
• First-class functions2. Event-driven3. Asynchronous callbacks4. Prototype-based
• objects inherent from objects• can be redefined at runtime
5. Constructs such as eval 6. Interactions with DOM7. Interpreted (not compiled)8. …
Make Software Analysis Challenging
13
![Page 14: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/14.jpg)
14
Web Evolution Challenges
Achievements Prospects
![Page 15: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/15.jpg)
Industrial Achievements
Mocha
Esprima Rhino
jsHint
jsLint
QunitSelenium
Istanbul
Closure Compiler
Flow
![Page 16: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/16.jpg)
Web Code Analysis• Static Analysis
• Points-to analysis (WALA)• Approximate call graphs • Data-flow analysis
• Dynamic Analysis • Code quality checking• Tracing and visualization• Unused code detection
![Page 17: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/17.jpg)
Web Code Analysis• Static Analysis
• Points-to analysis • Approximate call graphs • Data-flow analysis
• Hybrid Analysis • Taint and blended analysis • Change impact analysis • Event-flow analysis
• Dynamic Analysis • Code quality checking • Tracing and visualization • Unused code detection
![Page 18: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/18.jpg)
18
checkPrice()
XHR
updateItem()
suggestItem()
getUpdatedPrice() calculateTax()
addTaxToPrice()
Function XHR object DOM element Directed and labeled edge
Static analysis
![Page 19: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/19.jpg)
Dynamic analysis
checkPrice()
XHR
updateItem()
suggestItem()
getUpdatedPrice() calculateTax()
#item231
#price-ca.price
displaySuggesCon()
Function XHR object DOM element Directed and labeled edge
![Page 20: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/20.jpg)
Hybrid analysischeckPrice()
XHR
updateItem()
suggestItem()
getUpdatedPrice() calculateTax()
addTaxToPrice()
#item231
#price-ca.price
displaySuggesDon()
Function XHR object DOM element Directed and labeled edge
![Page 21: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/21.jpg)
Web Code Testing
• Different types of testing• Cross-Browser testing• Deterministic capture/replay • Regression testing
• Test Adequecy• Guided mutation analysis• State-based coverage • Code coverage
• Test Generation• Event-based Crawling • Feedback-directed execution• (Dynamic) symbolic execution
![Page 22: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/22.jpg)
22
State Coverage
![Page 23: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/23.jpg)
23
![Page 24: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/24.jpg)
24
Web Evolution Challenges
Achievements Prospects
![Page 25: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/25.jpg)
Cross-Language Analysis
We don’t know how to infer proper control flow graphs for web code.
Stateless ServerBrowser
Async HTTPRequest
Response
Internet
JSON
JS, Java, PHP, Ruby,
etc
DOMCSS
JS
![Page 26: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/26.jpg)
Cross-Language Program Slicing
Nguyen et al, FSE’14
![Page 27: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/27.jpg)
Cross-Language Bug Detection
Ocariza et al, ICSE’15
![Page 28: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/28.jpg)
Programmer Support in IDEs
• Code completion• Refactoring• Bug alerts• Smell detection
![Page 29: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/29.jpg)
Web Programmer Support in IDEs
• Code completion• Refactoring• Bug alerts• Smell detection
![Page 30: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/30.jpg)
Callback Hell
![Page 31: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/31.jpg)
Refactoring to Promises
![Page 32: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/32.jpg)
Test Case Maintenance
We need better: Web element locators
Repair techniques
![Page 33: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/33.jpg)
Benchmarks for Comparison
33
SIR
Defect4J
BugBench?
DroidBench
![Page 34: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/34.jpg)
Empirical Studies
Web analysis tools mainly built by reading best practices or through developer intuition and
anecdotal observation
Example: what are the most common cross-project bug patterns in web code?
![Page 35: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/35.jpg)
Mining Repositories
Largely unexplored gold mines!
![Page 36: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/36.jpg)
modules 250K
![Page 37: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/37.jpg)
repositories 3.4M
![Page 38: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/38.jpg)
developers 26K
������������
���������
��
�� ��
����������
��������
�������� �
������ �
��������
������
�������� �
������ �
�
�
�
�
�
��
MSR’13
![Page 39: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/39.jpg)
Semi-automatic Learning
![Page 40: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/40.jpg)
40
@Testpublic void testAddNote(){ get("http://localhost:8080/theorganizer/"); findElement(By.id("logon_username")). sendKeys("user"); findElement(By.id("logon_password")). sendKeys("pswd"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Welcome to The Organizer!", closeAlertAndGetItsText()); findElement(By.id("newNote")). click(); findElement(By.id("noteCreateShow_subject")).sendKeys("Running Example"); findElement(By.id("noteCreateShow_text")).sendKeys("Create a simple running example"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Note has been created.", findElement(By.id("mainContent")). getText()); findElement(By.id("logoff")).click();}
@Testpublic void testAddNote(){ get("http://localhost:8080/theorganizer/"); findElement(By.id("logon_username")). sendKeys("user"); findElement(By.id("logon_password")). sendKeys("pswd"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Welcome to The Organizer!", closeAlertAndGetItsText()); findElement(By.id("newNote")). click(); findElement(By.id("noteCreateShow_subject")).sendKeys("Running Example"); findElement(By.id("noteCreateShow_text")).sendKeys("Create a simple running example"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Note has been created.", findElement(By.id("mainContent")). getText()); findElement(By.id("logoff")).click();}
@Testpublic void testAddNote(){ get("http://localhost:8080/theorganizer/"); findElement(By.id("logon_username")). sendKeys("user"); findElement(By.id("logon_password")). sendKeys("pswd"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Welcome to The Organizer!", closeAlertAndGetItsText()); findElement(By.id("newNote")). click(); findElement(By.id("noteCreateShow_subject")).sendKeys("Running Example"); findElement(By.id("noteCreateShow_text")).sendKeys("Create a simple running example"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Note has been created.", findElement(By.id("mainContent")). getText()); findElement(By.id("logoff")).click();}
@Testpublic void testAddNote(){ get("http://localhost:8080/theorganizer/"); findElement(By.id("logon_username")). sendKeys("user"); findElement(By.id("logon_password")). sendKeys("pswd"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Welcome to The Organizer!", closeAlertAndGetItsText()); findElement(By.id("newNote")). click(); findElement(By.id("noteCreateShow_subject")).sendKeys("Running Example"); findElement(By.id("noteCreateShow_text")).sendKeys("Create a simple running example"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Note has been created.", findElement(By.id("mainContent")). getText()); findElement(By.id("logoff")).click();}
@Testpublic void testAddNote(){ get("http://localhost:8080/theorganizer/"); findElement(By.id("logon_username")). sendKeys("user"); findElement(By.id("logon_password")). sendKeys("pswd"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Welcome to The Organizer!", closeAlertAndGetItsText()); findElement(By.id("newNote")). click(); findElement(By.id("noteCreateShow_subject")).sendKeys("Running Example"); findElement(By.id("noteCreateShow_text")).sendKeys("Create a simple running example"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Note has been created.", findElement(By.id("mainContent")). getText()); findElement(By.id("logoff")).click();}
@Testpublic void testAddNote(){ get("http://localhost:8080/theorganizer/"); findElement(By.id("logon_username")). sendKeys("user"); findElement(By.id("logon_password")). sendKeys("pswd"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Welcome to The Organizer!", closeAlertAndGetItsText()); findElement(By.id("newNote")). click(); findElement(By.id("noteCreateShow_subject")).sendKeys("Running Example"); findElement(By.id("noteCreateShow_text")).sendKeys("Create a simple running example"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Note has been created.", findElement(By.id("mainContent")). getText()); findElement(By.id("logoff")).click();}
@Testpublic void testAddNote(){ get("http://localhost:8080/theorganizer/"); findElement(By.id("logon_username")). sendKeys("user"); findElement(By.id("logon_password")). sendKeys("pswd"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Welcome to The Organizer!", closeAlertAndGetItsText()); findElement(By.id("newNote")). click(); findElement(By.id("noteCreateShow_subject")).sendKeys("Running Example"); findElement(By.id("noteCreateShow_text")).sendKeys("Create a simple running example"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Note has been created.", findElement(By.id("mainContent")). getText()); findElement(By.id("logoff")).click();}
@Testpublic void testAddNote(){ get("http://localhost:8080/theorganizer/"); findElement(By.id("logon_username")). sendKeys("user"); findElement(By.id("logon_password")). sendKeys("pswd"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Welcome to The Organizer!", closeAlertAndGetItsText()); findElement(By.id("newNote")). click(); findElement(By.id("noteCreateShow_subject")).sendKeys("Running Example"); findElement(By.id("noteCreateShow_text")).sendKeys("Create a simple running example"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Note has been created.", findElement(By.id("mainContent")). getText()); findElement(By.id("logoff")).click();}
@Testpublic void testAddNote(){ get("http://localhost:8080/theorganizer/"); findElement(By.id("logon_username")). sendKeys("user"); findElement(By.id("logon_password")). sendKeys("pswd"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Welcome to The Organizer!", closeAlertAndGetItsText()); findElement(By.id("newNote")). click(); findElement(By.id("noteCreateShow_subject")).sendKeys("Running Example"); findElement(By.id("noteCreateShow_text")).sendKeys("Create a simple running example"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Note has been created.", findElement(By.id("mainContent")). getText()); findElement(By.id("logoff")).click();}
@Testpublic void testAddNote(){ get("http://localhost:8080/theorganizer/"); findElement(By.id("logon_username")). sendKeys("user"); findElement(By.id("logon_password")). sendKeys("pswd"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Welcome to The Organizer!", closeAlertAndGetItsText()); findElement(By.id("newNote")). click(); findElement(By.id("noteCreateShow_subject")).sendKeys("Running Example"); findElement(By.id("noteCreateShow_text")).sendKeys("Create a simple running example"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Note has been created.", findElement(By.id("mainContent")). getText()); findElement(By.id("logoff")).click();}
@Testpublic void testAddNote(){ get("http://localhost:8080/theorganizer/"); findElement(By.id("logon_username")). sendKeys("user"); findElement(By.id("logon_password")). sendKeys("pswd"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Welcome to The Organizer!", closeAlertAndGetItsText()); findElement(By.id("newNote")). click(); findElement(By.id("noteCreateShow_subject")).sendKeys("Running Example"); findElement(By.id("noteCreateShow_text")).sendKeys("Create a simple running example"); findElement(By. cssSelector("input type ="image"")).click(); assertEquals("Note has been created.", findElement(By.id("mainContent")). getText()); findElement(By.id("logoff")).click();}
![Page 41: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/41.jpg)
Learning AssertionsA classification problem:
• Is a web element important to be checked by an assertion?
Apply machine learning to train a classier• Features: position, size, page-rank, LinkNum, ChildNum, …
![Page 42: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/42.jpg)
FROM MONOLITHIC APPS
Stateless ServerBrowser
Async HTTPRequest
Response
Internet
JSON
GenerateJSON
DOMCSS
JS
42
![Page 43: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/43.jpg)
TO MICRO SERVICES
Micro ServicesBrowser
Restful HTTPRequest
Response
Internet
JSON
DOMCSS
JS
MicroService
MicroService
MicroService
MicroService
MicroService
MicroService
MicroService
MicroService
MicroService
MicroService
MicroService
MicroService
![Page 44: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/44.jpg)
44
On the client Even in hardware! On the server
JavaScriptiseverywhere
![Page 45: Software Analysis for the Web: Achievements and Prospects](https://reader031.fdocuments.us/reader031/viewer/2022021922/58eee8ba1a28ab7c468b45b9/html5/thumbnails/45.jpg)
45
“writeonce,runanywhere”
Instantaneoussoftwaredelivery
Anythingthatcanbewrittenasawebapp,willbewrittenasawebapp
(eventually)