SlideShare une entreprise Scribd logo
1  sur  22
Directed Test Generation for Effective Fault Localization   Shay Artzi,  Julian Dolby ,  Frank Tip,  Marco Pistoia   IBM T.J. Watson Research Center  ISSTA – July 14, 2010 – Trento, Italy
Overview ,[object Object]
Presented at [ISSTA 08] ,[object Object],[object Object],[object Object],[object Object]
Presented at [ICSE'10] ,[object Object]
Outline ,[object Object]
Enhanced Fault Localization
Directed Test Generation for Fault Localization
Evaluation
Related Work
Conclusion
Running PHP Example 1  if (isset($_REQUEST['query']) ){ 2  3  switch ($_REQUEST['query']) { 4  case "model": 5  $kf="model_id"; break; 6  case "make": 7  $kf="make_id"; break; 8  } 9  $v =_REQUEST['key']; 10  11  $sql="SELECT * FROM VEHICLES WHERE " . $kf . " = '” . $v . “'”; 12  $result=mysql_query($sql); 13  $n = mysql_numrows($result); 14  15  } else if (isset($_REQUEST['update']) ) { … }
Running Example – Success 1   if (isset($_REQUEST['query']) ){ 2   3   switch ($_REQUEST['query']) { 4  case "model": 5  $kf="model_id"; break; 6   case "make": 7   $kf="make_id"; break; 8  } 9   $v =_REQUEST['key']; 10  11   $sql="SELECT * FROM VEHICLES WHERE " . $kf . " = '” . $v . “'”; 12   $result=mysql_query($sql); 13   $n = mysql_numrows($result); 14   15  } else if (isset($_REQUEST['update']) ) { … } query -> 'make' key -> 'Ford' 'query' is set in request $kf set to 'make_id' SELECT * FROM VEHICLES WHERE make_id = 'Ford'; returns 2 result rows $n is assigned 2
Running Example – Failure 1   if (isset($_REQUEST['query']) ){ 2  3   switch ($_REQUEST['query']) { 4  case "model": 5  $kf="model_id"; break; 6  case "make": 7  $kf="make_id"; break; 8  } 9   $v =_REQUEST['key']; 10  11   $sql="SELECT * FROM VEHICLES WHERE " . $kf . " = '” . $v . “'”; 12   $result=mysql_query($sql); 13   $n = mysql_numrows($result); 14  15  } else if (isset($_REQUEST['update']) ) { … } 'query' is set in request switch falls through $kf is never assigned SELECT * FROM VEHICLES WHERE = 'Ford'; returns null due to invalid sql mysql_numrows(): supplied argument is not a valid MySQL result resource query -> 'company' key -> 'Ford'
Fault Localization ,[object Object]
Correlate executed statements with manifestations of bug ,[object Object]
Fault Localization Example ,[object Object]
But cannot isolate fault precisely statement 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 passing 1 1 1 1 1 1 1 1 failing 1 1 1 1 1 1 suspiciousness .7 .7 0 0 .7 .7 .7 .7
[object Object],[object Object]
Not captured by statistics over statements
E.g. don't handle all values from a function (new) ,[object Object]
Refine blame to kind of result
Abstract value, e.g. 0, non-zero, null, non-null, etc ,[object Object],[object Object]

Contenu connexe

Tendances

Unit Testing in SilverStripe
Unit Testing in SilverStripeUnit Testing in SilverStripe
Unit Testing in SilverStripeIngo Schommer
 
Old Oracle Versions
Old Oracle VersionsOld Oracle Versions
Old Oracle VersionsJeffrey Kemp
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to ProductionMark Baker
 
Testing Java Code Effectively - BaselOne17
Testing Java Code Effectively - BaselOne17Testing Java Code Effectively - BaselOne17
Testing Java Code Effectively - BaselOne17Andres Almiray
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Michelangelo van Dam
 
Building Maintainable Applications in Apex
Building Maintainable Applications in ApexBuilding Maintainable Applications in Apex
Building Maintainable Applications in ApexJeffrey Kemp
 
Beginning PHPUnit
Beginning PHPUnitBeginning PHPUnit
Beginning PHPUnitJace Ju
 
PhpUnit Best Practices
PhpUnit Best PracticesPhpUnit Best Practices
PhpUnit Best PracticesEdorian
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Michelangelo van Dam
 
Unit testing CourseSites Apache Filter
Unit testing CourseSites Apache FilterUnit testing CourseSites Apache Filter
Unit testing CourseSites Apache FilterWayan Wira
 
QA Lab: тестирование ПО. Яков Крамаренко: "KISS Automation"
QA Lab: тестирование ПО. Яков Крамаренко: "KISS Automation"QA Lab: тестирование ПО. Яков Крамаренко: "KISS Automation"
QA Lab: тестирование ПО. Яков Крамаренко: "KISS Automation"GeeksLab Odessa
 
PHPUnit best practices presentation
PHPUnit best practices presentationPHPUnit best practices presentation
PHPUnit best practices presentationThanh Robi
 
Test your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practiceTest your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practiceSebastian Marek
 
Getting to Grips with SilverStripe Testing
Getting to Grips with SilverStripe TestingGetting to Grips with SilverStripe Testing
Getting to Grips with SilverStripe TestingMark Rickerby
 
Advanced PHPUnit Testing
Advanced PHPUnit TestingAdvanced PHPUnit Testing
Advanced PHPUnit TestingMike Lively
 
Unit testing PHP apps with PHPUnit
Unit testing PHP apps with PHPUnitUnit testing PHP apps with PHPUnit
Unit testing PHP apps with PHPUnitMichelangelo van Dam
 
UA testing with Selenium and PHPUnit - PFCongres 2013
UA testing with Selenium and PHPUnit - PFCongres 2013UA testing with Selenium and PHPUnit - PFCongres 2013
UA testing with Selenium and PHPUnit - PFCongres 2013Michelangelo van Dam
 
Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Michelangelo van Dam
 
QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...
QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...
QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...GeeksLab Odessa
 
Test in action week 2
Test in action   week 2Test in action   week 2
Test in action week 2Yi-Huan Chan
 

Tendances (20)

Unit Testing in SilverStripe
Unit Testing in SilverStripeUnit Testing in SilverStripe
Unit Testing in SilverStripe
 
Old Oracle Versions
Old Oracle VersionsOld Oracle Versions
Old Oracle Versions
 
Deploying Straight to Production
Deploying Straight to ProductionDeploying Straight to Production
Deploying Straight to Production
 
Testing Java Code Effectively - BaselOne17
Testing Java Code Effectively - BaselOne17Testing Java Code Effectively - BaselOne17
Testing Java Code Effectively - BaselOne17
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12
 
Building Maintainable Applications in Apex
Building Maintainable Applications in ApexBuilding Maintainable Applications in Apex
Building Maintainable Applications in Apex
 
Beginning PHPUnit
Beginning PHPUnitBeginning PHPUnit
Beginning PHPUnit
 
PhpUnit Best Practices
PhpUnit Best PracticesPhpUnit Best Practices
PhpUnit Best Practices
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
 
Unit testing CourseSites Apache Filter
Unit testing CourseSites Apache FilterUnit testing CourseSites Apache Filter
Unit testing CourseSites Apache Filter
 
QA Lab: тестирование ПО. Яков Крамаренко: "KISS Automation"
QA Lab: тестирование ПО. Яков Крамаренко: "KISS Automation"QA Lab: тестирование ПО. Яков Крамаренко: "KISS Automation"
QA Lab: тестирование ПО. Яков Крамаренко: "KISS Automation"
 
PHPUnit best practices presentation
PHPUnit best practices presentationPHPUnit best practices presentation
PHPUnit best practices presentation
 
Test your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practiceTest your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practice
 
Getting to Grips with SilverStripe Testing
Getting to Grips with SilverStripe TestingGetting to Grips with SilverStripe Testing
Getting to Grips with SilverStripe Testing
 
Advanced PHPUnit Testing
Advanced PHPUnit TestingAdvanced PHPUnit Testing
Advanced PHPUnit Testing
 
Unit testing PHP apps with PHPUnit
Unit testing PHP apps with PHPUnitUnit testing PHP apps with PHPUnit
Unit testing PHP apps with PHPUnit
 
UA testing with Selenium and PHPUnit - PFCongres 2013
UA testing with Selenium and PHPUnit - PFCongres 2013UA testing with Selenium and PHPUnit - PFCongres 2013
UA testing with Selenium and PHPUnit - PFCongres 2013
 
Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013
 
QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...
QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...
QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...
 
Test in action week 2
Test in action   week 2Test in action   week 2
Test in action week 2
 

Similaire à ISSTA 2010 Presentation

Php Security3895
Php Security3895Php Security3895
Php Security3895Aung Khant
 
Quality Assurance
Quality AssuranceQuality Assurance
Quality AssuranceKiran Kumar
 
Testing with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs LifeTesting with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs LifePeter Gfader
 
TEST AUTOMATION: AKA QUALITY CONTROL
TEST AUTOMATION: AKA QUALITY CONTROLTEST AUTOMATION: AKA QUALITY CONTROL
TEST AUTOMATION: AKA QUALITY CONTROLNyarai Tinashe Gomiwa
 
TEST AUTOMATION: AKA QUALITY CONTROL
TEST AUTOMATION: AKA QUALITY CONTROLTEST AUTOMATION: AKA QUALITY CONTROL
TEST AUTOMATION: AKA QUALITY CONTROLSovTech
 
PHPunit and you
PHPunit and youPHPunit and you
PHPunit and youmarkstory
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11Michelangelo van Dam
 
utPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLutPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLSteven Feuerstein
 
Advanced SQL Injection
Advanced SQL InjectionAdvanced SQL Injection
Advanced SQL Injectionamiable_indian
 
Sql Injection Adv Owasp
Sql Injection Adv OwaspSql Injection Adv Owasp
Sql Injection Adv OwaspAung Khant
 
Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516SOAT
 
Mutation Testing: Testing your tests
Mutation Testing: Testing your testsMutation Testing: Testing your tests
Mutation Testing: Testing your testsStephen Leigh
 
Developer Tests - Things to Know
Developer Tests - Things to KnowDeveloper Tests - Things to Know
Developer Tests - Things to KnowVaidas Pilkauskas
 
We Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentWe Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentAll Things Open
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxMichelangelo van Dam
 

Similaire à ISSTA 2010 Presentation (20)

Php Security3895
Php Security3895Php Security3895
Php Security3895
 
Quality Assurance
Quality AssuranceQuality Assurance
Quality Assurance
 
Testing with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs LifeTesting with VS2010 - A Bugs Life
Testing with VS2010 - A Bugs Life
 
PHP Unit Testing
PHP Unit TestingPHP Unit Testing
PHP Unit Testing
 
Php security3895
Php security3895Php security3895
Php security3895
 
PHP Security
PHP SecurityPHP Security
PHP Security
 
TEST AUTOMATION: AKA QUALITY CONTROL
TEST AUTOMATION: AKA QUALITY CONTROLTEST AUTOMATION: AKA QUALITY CONTROL
TEST AUTOMATION: AKA QUALITY CONTROL
 
TEST AUTOMATION: AKA QUALITY CONTROL
TEST AUTOMATION: AKA QUALITY CONTROLTEST AUTOMATION: AKA QUALITY CONTROL
TEST AUTOMATION: AKA QUALITY CONTROL
 
PHPunit and you
PHPunit and youPHPunit and you
PHPunit and you
 
Abhik-Satish-dagstuhl
Abhik-Satish-dagstuhlAbhik-Satish-dagstuhl
Abhik-Satish-dagstuhl
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11
 
utPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLutPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQL
 
Advanced SQL Injection
Advanced SQL InjectionAdvanced SQL Injection
Advanced SQL Injection
 
Sql Injection Adv Owasp
Sql Injection Adv OwaspSql Injection Adv Owasp
Sql Injection Adv Owasp
 
Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516Tests unitaires mock_kesako_20130516
Tests unitaires mock_kesako_20130516
 
Mutation Testing: Testing your tests
Mutation Testing: Testing your testsMutation Testing: Testing your tests
Mutation Testing: Testing your tests
 
Developer Tests - Things to Know
Developer Tests - Things to KnowDeveloper Tests - Things to Know
Developer Tests - Things to Know
 
We Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End DevelopmentWe Are All Testers Now: The Testing Pyramid and Front-End Development
We Are All Testers Now: The Testing Pyramid and Front-End Development
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
 
Test driven development_for_php
Test driven development_for_phpTest driven development_for_php
Test driven development_for_php
 

ISSTA 2010 Presentation

  • 1. Directed Test Generation for Effective Fault Localization Shay Artzi, Julian Dolby , Frank Tip, Marco Pistoia IBM T.J. Watson Research Center ISSTA – July 14, 2010 – Trento, Italy
  • 2.
  • 3.
  • 4.
  • 5.
  • 7. Directed Test Generation for Fault Localization
  • 11. Running PHP Example 1 if (isset($_REQUEST['query']) ){ 2 3 switch ($_REQUEST['query']) { 4 case "model": 5 $kf="model_id"; break; 6 case "make": 7 $kf="make_id"; break; 8 } 9 $v =_REQUEST['key']; 10 11 $sql="SELECT * FROM VEHICLES WHERE " . $kf . " = '” . $v . “'”; 12 $result=mysql_query($sql); 13 $n = mysql_numrows($result); 14 15 } else if (isset($_REQUEST['update']) ) { … }
  • 12. Running Example – Success 1 if (isset($_REQUEST['query']) ){ 2 3 switch ($_REQUEST['query']) { 4 case "model": 5 $kf="model_id"; break; 6 case "make": 7 $kf="make_id"; break; 8 } 9 $v =_REQUEST['key']; 10 11 $sql="SELECT * FROM VEHICLES WHERE " . $kf . " = '” . $v . “'”; 12 $result=mysql_query($sql); 13 $n = mysql_numrows($result); 14 15 } else if (isset($_REQUEST['update']) ) { … } query -> 'make' key -> 'Ford' 'query' is set in request $kf set to 'make_id' SELECT * FROM VEHICLES WHERE make_id = 'Ford'; returns 2 result rows $n is assigned 2
  • 13. Running Example – Failure 1 if (isset($_REQUEST['query']) ){ 2 3 switch ($_REQUEST['query']) { 4 case "model": 5 $kf="model_id"; break; 6 case "make": 7 $kf="make_id"; break; 8 } 9 $v =_REQUEST['key']; 10 11 $sql="SELECT * FROM VEHICLES WHERE " . $kf . " = '” . $v . “'”; 12 $result=mysql_query($sql); 13 $n = mysql_numrows($result); 14 15 } else if (isset($_REQUEST['update']) ) { … } 'query' is set in request switch falls through $kf is never assigned SELECT * FROM VEHICLES WHERE = 'Ford'; returns null due to invalid sql mysql_numrows(): supplied argument is not a valid MySQL result resource query -> 'company' key -> 'Ford'
  • 14.
  • 15.
  • 16.
  • 17. But cannot isolate fault precisely statement 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 passing 1 1 1 1 1 1 1 1 failing 1 1 1 1 1 1 suspiciousness .7 .7 0 0 .7 .7 .7 .7
  • 18.
  • 19. Not captured by statistics over statements
  • 20.
  • 21. Refine blame to kind of result
  • 22.
  • 23. Refine blame to specific control flow outcome
  • 24. if statement s become (s, true) or (s, false)
  • 25. switch statement s becomes (s, case number taken )
  • 26.
  • 27. Return of null result on sql error not checked statement 1 (3,2) (3,0) 6 7 9 11 (12,obj) (12,null) 13 passing 1 1 1 1 1 1 1 1 failing 1 1 1 1 1 1 suspiciousness .7 0 1 0 0 .7 .7 0 1 .7
  • 28.
  • 29.
  • 30. Direct choices to aid fault localization
  • 31.
  • 32.
  • 33.
  • 35.
  • 36. Note second path will yield successful run
  • 37. Example Generated Execution 1 1 if (isset($_REQUEST['query']) ){ 2 3 switch ($_REQUEST['query']) { 4 case "model": 5 $kf="model_id"; break; 6 case "make": 7 $kf="make_id"; break; 8 } 9 $v =_REQUEST['key']; 10 11 $sql="SELECT * FROM VEHICLES WHERE " . $kf . " = '” . $v . “'”; 12 $result=mysql_query($sql); 13 $n = mysql_numrows($result); 14 15 } else if (isset($_REQUEST['update']) ) { … }
  • 38. Example Generated Execution 2 1 if (isset($_REQUEST['query']) ){ 2 3 switch ($_REQUEST['query']) { 4 case "model": 5 $kf="model_id"; break; 6 case "make": 7 $kf="make_id"; break; 8 } 9 $v =_REQUEST['key']; 10 11 $sql="SELECT * FROM VEHICLES WHERE " . $kf . " = '” . $v . “'”; 12 $result=mysql_query($sql); 13 $n = mysql_numrows($result); 14 15 } else if (isset($_REQUEST['update']) ) { … }
  • 39. Example Generated Execution 3 1 if (isset($_REQUEST['query']) ){ 2 3 switch ($_REQUEST['query']) { 4 case "model": 5 $kf="model_id"; break; 6 case "make": 7 $kf="make_id"; break; 8 } 9 $v =_REQUEST['key']; 10 11 $sql="SELECT * FROM VEHICLES WHERE " . $kf . " = '” . $v . “'”; 12 $result=mysql_query($sql); 13 $n = mysql_numrows($result); 14 15 } else if (isset($_REQUEST['update']) ) { … }
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 46.
  • 47.
  • 48. PCS : Directed test generation using path-constraint similarity
  • 49.
  • 50. measure % of well-localized faults
  • 51.
  • 52.
  • 53.
  • 54.
  • 55. Reduce time and number of tests by > 85%
  • 56. Enhancements needed to fault localization

Notes de l'éditeur

  1. non-conditional statements are handled the same as before conditional statements are assigned the maximum of the suspiciousness of each of their branches