SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Evolutionary Testing of Stateful Systems:
a Holistic Approach

Matteo Miraz                Advisor: prof. L. Baresi
Febuary 18, 2011          Coadvisor: prof. P. L. Lanzi
Motivations                                                                2




• Software systems permeate (almost) every aspect of our life
   • Software is buggy
   • In 2002 the costs related to software errors are estimated
     in 60 Billion USD




     1999: NASA Mars Climate Orbiter ($125 million)   2011: iPhone Alarm

         DEI
Motivations                                                         3




Testing is an effective technique to increase the quality of software
    Does not guarantee that the system is error-free
    Is extremely expensive, as it requires up to half of the entire
      development effort


Stringent requirements on time-to-market
limit the testing effort
• We spoke with an important software
   consultant company, with major Italian
   banks as customers…
     • The good: they save up to half of
        the entire development effort
     • The bad: they do not test anything
     • The ugly: we had to explain them
        what testing is

         DEI
Related Work                                     4




• The research community proposed several ways
  to automatically generate tests

   • Symbolic Execution
   • Search-Based Software Testing




        DEI
Symbolic Execution                                                       5




•   The program is executed with
    symbolic values as input parameters
    (instead of concrete inputs)

                                                             PC: a = 3
•   Paths are associated with a                              PC: a = 3 & log10(b) = 7
    Path Condition (PC)
     • A PC constraints symbolic
       inputs to traverse the path
     • It is created incrementally:
       at each condition a formula is
                                          PC: a = 3 & log10(b) = 7
       added to the Path Condition
                                                Constraint
                                                  solver
•   A constraint solver is used
    to find concrete inputs for PCs       toTest(3, 10 000 000)




          DEI
Search Based Software Testing: a survey                                          6




• Goal: complete branch coverage
• Paradigm “command and conquer”
    The program is analyzed
     to identify branches
    Each branch is considered
     separately from the others
                                            entry



                                      w = Math.log(b)



                                          if (a == 3)

                                           F            T

                                                            if (w == 7)

                                                            F             T

                                                                              // target



                                               exit



       DEI
Search Based Software Testing: a survey                                                                   7




Once a target has been selected
• Identify dependent branches
• Search for inputs able to reach the target
• Fitness Function:
                                             Fitness(a = 0, b = 0) =
   • Approach Level +                      1 + norm(| 0 – 3 |) = 1.003
      Normalized distance
                                                                     entry



                                                                w = Math.log(b)
   Parameters        Fitness
                                          distance: | 0 – 3 |
   a=0, b=0          1.003                                         if (a == 3)
                                         Approach Level: 1
                                                                                 T
   a=1, b=0          1.002                                          F

                                                                                     if (w == 7)
   a=3, b=0          0.999               Approach Level: 0
                                                                                     F             T
   a=4, b=0          1.001                                                                             // target

   a=3, b=10         0.005
   a=3, b=100        0.003                                              exit



          DEI
Problems of Search Based Software Testing                   8




Usage of a single guidance    Works on isolated functions
       Coarse / Misleading   Modern systems are object-oriented
 void foo(int []a) {
   int flag = 0;
   for(int i=0; i<10; i++)
     if(a[i] == 23)
       flag = 1;

     if(flag == 1) {
       // target
     }
 }




         DEI
Targeting Stateful Systems                          9




• We Target Stateful systems (e.g., Java classes)




• Feature – State Loop
   • A feature might put objects
     in “particular ” states
   • A “particular” state might




                                                        enables
     enable other features




        DEI
Our Approach: TestFul                                          10




                        An individual of the Evolutionary
                        algorithm (a Test) is a sequence of
                        constructor and method calls on the test
                        cluster (i.e., the class under test + all the
                        required dependencies)

                        We use a multi-objective EA, guided by:

                        •   The coverage of tests
                             •   Tests with a high coverage stress
                                 more deeply the class under test and
                                 put objects in more interesting states

                        •   Compactness of tests
                             •   Unnecessary long tests waste
                                 computational resources during their
                                 evaluation




      DEI
Improvements                                    11




How can we improve        How can we correctly
the efficiency?           reward tests?
• We use efficiency       • We use
  enhancement               complementary
  techniques:               coverage criteria:
  • Local Search            • Control Flow Graph
  • Seeding                 • Data Flow Graph
  • Fitness Inheritance     • Behavioral




      DEI
Local Search                                                     12




• We hybridize the evolutionary algorithm with a step of local search

   •   EA works at class level
        • Reaches complex
           state configurations

   •   Local search works on methods
        • It focuses on the easiest
           missing element
        • It adopts a simpler search
           strategy (hill climbing)

   •   Which element to improve?
        • One of the best elements
        • 5% of the population
        • 10% of the population




         DEI
Local Search                                                 13




• At each generation of the Evolutionary Algorithm,
  we pick the { 5% / 10% / best } test and we target
  the easiest branch to reach among those not
  exercised yet

                                                       target




            DEI
Local Search                                                       14




• At each generation of the Evolutionary Algorithm, we pick the { 5% /
  10% / best } test and we target the easiest branch to reach among
  those not exercised yet
• We perform a local search by using a simple algorithm (hill climbing)
   • The guidance is provided by the following fitness function:




• The result (if any) is merged in the evolutionary algorithm’s population




            DEI
Contribution of the Local Search                         15




                                    Simple Problem
                                        (Fraction)




                                   Complex Problem
                                   (Disjoint Set Fast)




       DEI
Seeding                                                                      16




• Problem:
   •   Testful starts the evolution from a population with a poor quality.
• Solution:
   •   Run an inexpensive technique (random search) for a short time,
       and use its result as initial population




         DEI
Fitness Inheritance                                                   17




• Problem:
   •   Executing tests and collecting coverage is expensive
• Solution:
   •   Evaluate the “real” fitness only on a part of the population
        • Other individuals inherit the fitness of their parents
   •   Which policy to select individuals to evaluate?
        • Uniform selection
        • Frontier selection: better tests are evaluate more often




         DEI
Improvements                                    18




How can we improve        How can we correctly
the efficiency?           reward tests?
• We use efficiency       • We use
   enhancement              complementary
   techniques:              coverage criteria:
  • Local Search            • Control Flow Graph
  • Seeding                 • Data Flow Graph
  • Fitness Inheritance     • Behavioral




      DEI
Coverage of the Control-Flow Graph                                19




Testful aims to maximize:
    The number of basic blocks executed (~ statement coverage)
    The number of branches exercised
We compared our approach against
    jAutoTest: a Java Port of Bertrand Meyer’s Random Testing Approach
    Randoop: Michael Ernst’s taboo search
    etoc: Paolo Tonella’s Evolutionary Testing of Classes
On a benchmark of classes from
                                                                   10 min
• Literature
• Known software libraries
• Independent testing benchmarks




        DEI
Coverage of the Data-Flow Graph                                             20




Fault-detection effectiveness of Statement and Branch coverage has been disputed


•   Criteria on the coverage of the Data-Flow Graph have been proposed
     • Fit well on Object-Oriented systems
     • Data dependency
          • Statements might define the value of variable (e.g., v = 10 )
          • Statements might use the value of some variables (e.g. print(v) )
               • P-Use if the use happens in a predicate (e.g. if(v == 3) )

•   TestFul leverages Data-Flow information
      Extend the fitness function with all def-use and all def-puse coverage
      Improve Local Search and solve data-dependent problems
                                                             (e.g., flag variable)
•   Tracking data-flow coverage is expensive! ()




          DEI
Coverage of the Data-Flow Graph                           21




Performed an extensive empirical evaluation between
• Java Path Finder (symbolic execution)
• Testful only guided by Control-Flow information




               The structural coverage remains high,
               in spite of the higher monitoring cost

                        TestFul outperforms JPF
               (e.g., statement coverage: 89% vs. 35%)

           The data-flow coverage increases a little,
         and its standard deviation lower significantly



         DEI
Some insights from our empirical evaluation…                 22




             «container classes are the de facto benchmark
                 for testing software with internal state»
                              [ Arcuri 2010 ]




       DEI
Some insights from our empirical evaluation…                      23




S. Mouchawrab, L. C. Briand, Y. Labiche, and M. Di Penta.
Assessing, Comparing, and Combining State Machine-Based Testing and
Structural Testing: A Series of Experiments.
IEEE Transactions on Software Engineering, 2010

         DEI
Coverage of the Behavioral Model                                      24




White-Box coverage criteria judge tests by considering the covered code
    • If we execute the code that contains an error, we’ll likely spot it!
    • What if there is a high-level problem? (e.g., a feature is missing)

Black-Box testing derives tests from the specification of the system
    • Adopts an outer perspective, is more resilient to high-level errors
    • Requires the specification of the system, often not available
    • We can both infer the behavioral model of the system, and reward
      tests according to their ability to thoroughly exercise the system




         DEI
Behavioral Coverage: Preliminary Results   25




       DEI
Conclusions and Future Work                                      26




• Contributions:
   • Search-Based Software Testing
   • Holistic Approach
   • Efficiency Enhancement Techniques
   • Complementary Coverage Criteria
   • Extensive Empirical Validation

• Most interesting research directions
   • Use more sources to seed the evolutionary algorithm
   • Consider coarse-grained tests (e.g. integration testing)
   • Consider other types of stateful systems (e.g., services)




        DEI
Thank you for the attention…
                    Questions?




    DEI

Weitere ähnliche Inhalte

Andere mochten auch

Image ratio discovery
Image ratio discoveryImage ratio discovery
Image ratio discoveryLiam McMurray
 
The role of Human Resources Management in Today's business Environment
The role of Human Resources Management in Today's business EnvironmentThe role of Human Resources Management in Today's business Environment
The role of Human Resources Management in Today's business Environmentminnoo
 
Bill 132: What You Need to Know
Bill 132: What You Need to KnowBill 132: What You Need to Know
Bill 132: What You Need to KnowRudner Law
 

Andere mochten auch (6)

Begin with Risk in Mind
Begin with Risk in MindBegin with Risk in Mind
Begin with Risk in Mind
 
Image ratio discovery
Image ratio discoveryImage ratio discovery
Image ratio discovery
 
Smart quotations
Smart quotationsSmart quotations
Smart quotations
 
The role of Human Resources Management in Today's business Environment
The role of Human Resources Management in Today's business EnvironmentThe role of Human Resources Management in Today's business Environment
The role of Human Resources Management in Today's business Environment
 
Perang hunain
Perang hunainPerang hunain
Perang hunain
 
Bill 132: What You Need to Know
Bill 132: What You Need to KnowBill 132: What You Need to Know
Bill 132: What You Need to Know
 

Ähnlich wie Evolutionary Testing of Stateful Systems: a Holistic Approach

Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)SQALab
 
Kaggle Gold Medal Case Study
Kaggle Gold Medal Case StudyKaggle Gold Medal Case Study
Kaggle Gold Medal Case StudyAlon Bochman, CFA
 
Software Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSung Kim
 
CEC'10: Improving Evolutionary Testing by Means of Efficiency Enhancement Tec...
CEC'10: Improving Evolutionary Testing by Means of Efficiency Enhancement Tec...CEC'10: Improving Evolutionary Testing by Means of Efficiency Enhancement Tec...
CEC'10: Improving Evolutionary Testing by Means of Efficiency Enhancement Tec...matteomiraz
 
Reformulating Branch Coverage as a Many-Objective Optimization Problem
Reformulating Branch Coverage as a Many-Objective Optimization ProblemReformulating Branch Coverage as a Many-Objective Optimization Problem
Reformulating Branch Coverage as a Many-Objective Optimization ProblemAnnibale Panichella
 
Real-time Face Recognition & Detection Systems 1
Real-time Face Recognition & Detection Systems 1Real-time Face Recognition & Detection Systems 1
Real-time Face Recognition & Detection Systems 1Suvadip Shome
 
Software testing strategies
Software testing strategiesSoftware testing strategies
Software testing strategiesKrishna Sujeer
 
Face recognition v1
Face recognition v1Face recognition v1
Face recognition v1San Kim
 
Enabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial IntelligenceEnabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial IntelligenceLionel Briand
 
Intro to Machine Learning by Microsoft Ventures
Intro to Machine Learning by Microsoft VenturesIntro to Machine Learning by Microsoft Ventures
Intro to Machine Learning by Microsoft Venturesmicrosoftventures
 
Huong dan cu the svm
Huong dan cu the svmHuong dan cu the svm
Huong dan cu the svmtaikhoan262
 
Building a Mongo DSL in Scala at Hot Potato
Building a Mongo DSL in Scala at Hot PotatoBuilding a Mongo DSL in Scala at Hot Potato
Building a Mongo DSL in Scala at Hot PotatoMongoDB
 
Impact Analysis of Granularity Levels on Feature Location Technique
Impact Analysis of Granularity Levels on Feature Location TechniqueImpact Analysis of Granularity Levels on Feature Location Technique
Impact Analysis of Granularity Levels on Feature Location TechniqueChakkrit (Kla) Tantithamthavorn
 
Analytics Boot Camp - Slides
Analytics Boot Camp - SlidesAnalytics Boot Camp - Slides
Analytics Boot Camp - SlidesAditya Joshi
 
Software testing & its technology
Software testing & its technologySoftware testing & its technology
Software testing & its technologyHasam Panezai
 
Testing survey by_directions
Testing survey by_directionsTesting survey by_directions
Testing survey by_directionsTao He
 

Ähnlich wie Evolutionary Testing of Stateful Systems: a Holistic Approach (20)

Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)Формальная верификация как средство тестирования (в Java)
Формальная верификация как средство тестирования (в Java)
 
Kaggle Gold Medal Case Study
Kaggle Gold Medal Case StudyKaggle Gold Medal Case Study
Kaggle Gold Medal Case Study
 
Software Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled Datasets
 
Debug me
Debug meDebug me
Debug me
 
CEC'10: Improving Evolutionary Testing by Means of Efficiency Enhancement Tec...
CEC'10: Improving Evolutionary Testing by Means of Efficiency Enhancement Tec...CEC'10: Improving Evolutionary Testing by Means of Efficiency Enhancement Tec...
CEC'10: Improving Evolutionary Testing by Means of Efficiency Enhancement Tec...
 
Reformulating Branch Coverage as a Many-Objective Optimization Problem
Reformulating Branch Coverage as a Many-Objective Optimization ProblemReformulating Branch Coverage as a Many-Objective Optimization Problem
Reformulating Branch Coverage as a Many-Objective Optimization Problem
 
Real-time Face Recognition & Detection Systems 1
Real-time Face Recognition & Detection Systems 1Real-time Face Recognition & Detection Systems 1
Real-time Face Recognition & Detection Systems 1
 
Software testing strategies
Software testing strategiesSoftware testing strategies
Software testing strategies
 
Computer Engineer Master Project
Computer Engineer Master ProjectComputer Engineer Master Project
Computer Engineer Master Project
 
Face recognition v1
Face recognition v1Face recognition v1
Face recognition v1
 
Enabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial IntelligenceEnabling Automated Software Testing with Artificial Intelligence
Enabling Automated Software Testing with Artificial Intelligence
 
Intro to Machine Learning by Microsoft Ventures
Intro to Machine Learning by Microsoft VenturesIntro to Machine Learning by Microsoft Ventures
Intro to Machine Learning by Microsoft Ventures
 
Guide
GuideGuide
Guide
 
Huong dan cu the svm
Huong dan cu the svmHuong dan cu the svm
Huong dan cu the svm
 
Building a Mongo DSL in Scala at Hot Potato
Building a Mongo DSL in Scala at Hot PotatoBuilding a Mongo DSL in Scala at Hot Potato
Building a Mongo DSL in Scala at Hot Potato
 
Impact Analysis of Granularity Levels on Feature Location Technique
Impact Analysis of Granularity Levels on Feature Location TechniqueImpact Analysis of Granularity Levels on Feature Location Technique
Impact Analysis of Granularity Levels on Feature Location Technique
 
Oops ppt
Oops pptOops ppt
Oops ppt
 
Analytics Boot Camp - Slides
Analytics Boot Camp - SlidesAnalytics Boot Camp - Slides
Analytics Boot Camp - Slides
 
Software testing & its technology
Software testing & its technologySoftware testing & its technology
Software testing & its technology
 
Testing survey by_directions
Testing survey by_directionsTesting survey by_directions
Testing survey by_directions
 

Kürzlich hochgeladen

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 

Kürzlich hochgeladen (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 

Evolutionary Testing of Stateful Systems: a Holistic Approach

  • 1. Evolutionary Testing of Stateful Systems: a Holistic Approach Matteo Miraz Advisor: prof. L. Baresi Febuary 18, 2011 Coadvisor: prof. P. L. Lanzi
  • 2. Motivations 2 • Software systems permeate (almost) every aspect of our life • Software is buggy • In 2002 the costs related to software errors are estimated in 60 Billion USD 1999: NASA Mars Climate Orbiter ($125 million) 2011: iPhone Alarm DEI
  • 3. Motivations 3 Testing is an effective technique to increase the quality of software  Does not guarantee that the system is error-free  Is extremely expensive, as it requires up to half of the entire development effort Stringent requirements on time-to-market limit the testing effort • We spoke with an important software consultant company, with major Italian banks as customers… • The good: they save up to half of the entire development effort • The bad: they do not test anything • The ugly: we had to explain them what testing is DEI
  • 4. Related Work 4 • The research community proposed several ways to automatically generate tests • Symbolic Execution • Search-Based Software Testing DEI
  • 5. Symbolic Execution 5 • The program is executed with symbolic values as input parameters (instead of concrete inputs) PC: a = 3 • Paths are associated with a PC: a = 3 & log10(b) = 7 Path Condition (PC) • A PC constraints symbolic inputs to traverse the path • It is created incrementally: at each condition a formula is PC: a = 3 & log10(b) = 7 added to the Path Condition Constraint solver • A constraint solver is used to find concrete inputs for PCs toTest(3, 10 000 000) DEI
  • 6. Search Based Software Testing: a survey 6 • Goal: complete branch coverage • Paradigm “command and conquer”  The program is analyzed to identify branches  Each branch is considered separately from the others entry w = Math.log(b) if (a == 3) F T if (w == 7) F T // target exit DEI
  • 7. Search Based Software Testing: a survey 7 Once a target has been selected • Identify dependent branches • Search for inputs able to reach the target • Fitness Function: Fitness(a = 0, b = 0) = • Approach Level + 1 + norm(| 0 – 3 |) = 1.003 Normalized distance entry w = Math.log(b) Parameters Fitness distance: | 0 – 3 | a=0, b=0 1.003 if (a == 3) Approach Level: 1 T a=1, b=0 1.002 F if (w == 7) a=3, b=0 0.999 Approach Level: 0 F T a=4, b=0 1.001 // target a=3, b=10 0.005 a=3, b=100 0.003 exit DEI
  • 8. Problems of Search Based Software Testing 8 Usage of a single guidance Works on isolated functions Coarse / Misleading Modern systems are object-oriented void foo(int []a) { int flag = 0; for(int i=0; i<10; i++) if(a[i] == 23) flag = 1; if(flag == 1) { // target } } DEI
  • 9. Targeting Stateful Systems 9 • We Target Stateful systems (e.g., Java classes) • Feature – State Loop • A feature might put objects in “particular ” states • A “particular” state might enables enable other features DEI
  • 10. Our Approach: TestFul 10 An individual of the Evolutionary algorithm (a Test) is a sequence of constructor and method calls on the test cluster (i.e., the class under test + all the required dependencies) We use a multi-objective EA, guided by: • The coverage of tests • Tests with a high coverage stress more deeply the class under test and put objects in more interesting states • Compactness of tests • Unnecessary long tests waste computational resources during their evaluation DEI
  • 11. Improvements 11 How can we improve How can we correctly the efficiency? reward tests? • We use efficiency • We use enhancement complementary techniques: coverage criteria: • Local Search • Control Flow Graph • Seeding • Data Flow Graph • Fitness Inheritance • Behavioral DEI
  • 12. Local Search 12 • We hybridize the evolutionary algorithm with a step of local search • EA works at class level • Reaches complex state configurations • Local search works on methods • It focuses on the easiest missing element • It adopts a simpler search strategy (hill climbing) • Which element to improve? • One of the best elements • 5% of the population • 10% of the population DEI
  • 13. Local Search 13 • At each generation of the Evolutionary Algorithm, we pick the { 5% / 10% / best } test and we target the easiest branch to reach among those not exercised yet target DEI
  • 14. Local Search 14 • At each generation of the Evolutionary Algorithm, we pick the { 5% / 10% / best } test and we target the easiest branch to reach among those not exercised yet • We perform a local search by using a simple algorithm (hill climbing) • The guidance is provided by the following fitness function: • The result (if any) is merged in the evolutionary algorithm’s population DEI
  • 15. Contribution of the Local Search 15 Simple Problem (Fraction) Complex Problem (Disjoint Set Fast) DEI
  • 16. Seeding 16 • Problem: • Testful starts the evolution from a population with a poor quality. • Solution: • Run an inexpensive technique (random search) for a short time, and use its result as initial population DEI
  • 17. Fitness Inheritance 17 • Problem: • Executing tests and collecting coverage is expensive • Solution: • Evaluate the “real” fitness only on a part of the population • Other individuals inherit the fitness of their parents • Which policy to select individuals to evaluate? • Uniform selection • Frontier selection: better tests are evaluate more often DEI
  • 18. Improvements 18 How can we improve How can we correctly the efficiency? reward tests? • We use efficiency • We use enhancement complementary techniques: coverage criteria: • Local Search • Control Flow Graph • Seeding • Data Flow Graph • Fitness Inheritance • Behavioral DEI
  • 19. Coverage of the Control-Flow Graph 19 Testful aims to maximize:  The number of basic blocks executed (~ statement coverage)  The number of branches exercised We compared our approach against  jAutoTest: a Java Port of Bertrand Meyer’s Random Testing Approach  Randoop: Michael Ernst’s taboo search  etoc: Paolo Tonella’s Evolutionary Testing of Classes On a benchmark of classes from 10 min • Literature • Known software libraries • Independent testing benchmarks DEI
  • 20. Coverage of the Data-Flow Graph 20 Fault-detection effectiveness of Statement and Branch coverage has been disputed • Criteria on the coverage of the Data-Flow Graph have been proposed • Fit well on Object-Oriented systems • Data dependency • Statements might define the value of variable (e.g., v = 10 ) • Statements might use the value of some variables (e.g. print(v) ) • P-Use if the use happens in a predicate (e.g. if(v == 3) ) • TestFul leverages Data-Flow information  Extend the fitness function with all def-use and all def-puse coverage  Improve Local Search and solve data-dependent problems (e.g., flag variable) • Tracking data-flow coverage is expensive! () DEI
  • 21. Coverage of the Data-Flow Graph 21 Performed an extensive empirical evaluation between • Java Path Finder (symbolic execution) • Testful only guided by Control-Flow information The structural coverage remains high, in spite of the higher monitoring cost TestFul outperforms JPF (e.g., statement coverage: 89% vs. 35%) The data-flow coverage increases a little, and its standard deviation lower significantly DEI
  • 22. Some insights from our empirical evaluation… 22 «container classes are the de facto benchmark for testing software with internal state» [ Arcuri 2010 ] DEI
  • 23. Some insights from our empirical evaluation… 23 S. Mouchawrab, L. C. Briand, Y. Labiche, and M. Di Penta. Assessing, Comparing, and Combining State Machine-Based Testing and Structural Testing: A Series of Experiments. IEEE Transactions on Software Engineering, 2010 DEI
  • 24. Coverage of the Behavioral Model 24 White-Box coverage criteria judge tests by considering the covered code • If we execute the code that contains an error, we’ll likely spot it! • What if there is a high-level problem? (e.g., a feature is missing) Black-Box testing derives tests from the specification of the system • Adopts an outer perspective, is more resilient to high-level errors • Requires the specification of the system, often not available • We can both infer the behavioral model of the system, and reward tests according to their ability to thoroughly exercise the system DEI
  • 26. Conclusions and Future Work 26 • Contributions: • Search-Based Software Testing • Holistic Approach • Efficiency Enhancement Techniques • Complementary Coverage Criteria • Extensive Empirical Validation • Most interesting research directions • Use more sources to seed the evolutionary algorithm • Consider coarse-grained tests (e.g. integration testing) • Consider other types of stateful systems (e.g., services) DEI
  • 27. Thank you for the attention… Questions? DEI