SlideShare a Scribd company logo
1 of 15
Improving Evolutionary Testing by Means of
Efficiency Enhancement Techniques

Matteo Miraz, Pier Luca Lanzi, and Luciano Baresi
(presented by Daniele Loiacono)

Politecnico di Milano, Italy
2
Table of Contents

1. TestFul: an Evolutionary Test Approach for Java
2. Improving the Approach
   1. Seeding
   2. Hybridization
   3. Fitness Inheritance
3. Conclusions and Future Work




        DEI
Testful                                                              3




• Leverages Search-Based Techniques to generate Tests
   • We are not alone:
       • Search Based Software Engineering is a vibrant community!

• Targets stateful systems (e.g., Java classes)
   • A sequence of operations
     is required to exercise
     the features of a class




                                                                         enables
          DEI
Test Representation                           4




• A test is a sequence of operations
   • Assign a primitive value to a variable
      • char_0 = „c‟
   • Create an object
      • cut_1 = new CUT(char_0)
   • Invoke a method on an object
      • char_1 = cut_1.fooBar(int_1)


• Working on variables
   • Includes all the parameters‟ types
   • Enables polymorphism
      • Calculate compatibilities among types


          DEI
Our Evolutionary Testing Approach                                    5




Goal: Find tests that put objects in interesting states
• We use a NSGA-II Evolutionary Algorithm, guided by:
    Number of statements and branches covered
       • Tests with a high branch 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
• Recombination:
   • variable-length one-point crossover, replacement mutation




                crossover                    mutation



        DEI
Need for Efficiency Enhancement Techniques                                   6




•   Testful achieves good results
     • generates good tests for complex classes (GECCO ‟09 poster)

•   It requires huge computational requirements, because:

     • It starts the evolution from a population with a poor quality.
         • Most of the initial tests do not exercise any feature
         • The most difficult elements in the class are not exercised


     • It does not provide any guidance to exercise uncovered elements
         • The fitness function only counts the number of branch exercised


     • The fitness function is expensive
         • It requires to execute a test to measure its branch coverage




          DEI
Seeding                                                                      7




• 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
                      Branch Coverage with a Random Search




         DEI
Seeding                         8




             Simple Problem
                 (Fraction)




            Complex Problem
             (Red-Black Tree)




      DEI
Hybridization                                                 9




• Problem:
   • Testful does not provide any guidance to exercise uncovered
     branches
• Solution:
   •   Hybridize the evolutionary search
       with a local search
        • It focuses on the easiest
            branch not yet executed
            (works at method level)
        • 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
Hybridization                         10




                 Simple Problem
                     (Fraction)




                Complex Problem
                (Disjoint Set Fast)




       DEI
Fitness Inheritance                                                     11




• Problem:
   •   The fitness function is expensive
• Solution:
   •   Use Fitness Inheritance
        • 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
        • Fronteer selection: evaluate more often individuals on the frontier


• How to evaluate the improvements?
   •   Number of generation evaluated w.r.t. elapsed time
   •   Number of branch covered
        • (to evaluate the impact of a noisier fitness function)



         DEI
Fitness Inheritance: # of generations   12




             Complex Problem
               (Stack Array)




             More complex Problem
                (Red-Black Tree)




       DEI
Fitness Inheritance: branch executed                      13




                                         Simple Problem
                                             (Fraction)




                    Computationally-intensive Problem
                             (Disjoint Set Fast)




       DEI
Conclusions and Future Work                                    14




• Efficiency enhancement techniques allow Testful to reach better
  results using less computational resources
   • The improvement is even higher if the three efficiency
      enhancement techniques are combined
• We plan to leverage even more on the Seeding technique
   • To test newer versions of a class
   • To test similar classes of a class



        DEI
Improving Evolutionary Testing by Means of
Efficiency Enhancement Techniques

 M. Miraz, P. L. Lanzi, L. Baresi
 {miraz,lanzi,baresi}@elet.polimi.it



 http://code.google.com/p/testful/

More Related Content

Viewers also liked

Lives Saved Analyses for Child Survival Projects: Basic How-To Use LiST - Deb...
Lives Saved Analyses for Child Survival Projects: Basic How-To Use LiST - Deb...Lives Saved Analyses for Child Survival Projects: Basic How-To Use LiST - Deb...
Lives Saved Analyses for Child Survival Projects: Basic How-To Use LiST - Deb...jehill3
 
Long tail (session 2)
Long tail (session 2)Long tail (session 2)
Long tail (session 2)rtannir
 
Partnership Defined Quality: Acting it Out!
Partnership Defined Quality: Acting it Out!Partnership Defined Quality: Acting it Out!
Partnership Defined Quality: Acting it Out!jehill3
 
Tuberculosis and PSI
Tuberculosis and PSITuberculosis and PSI
Tuberculosis and PSIjehill3
 
Maternal and Child Health Integrated Program – MCHIP
Maternal and Child Health Integrated Program – MCHIPMaternal and Child Health Integrated Program – MCHIP
Maternal and Child Health Integrated Program – MCHIPjehill3
 
The Current Condition of Mental Health in Afghanistan: Integrating Mental Hea...
The Current Condition of Mental Health in Afghanistan: Integrating Mental Hea...The Current Condition of Mental Health in Afghanistan: Integrating Mental Hea...
The Current Condition of Mental Health in Afghanistan: Integrating Mental Hea...jehill3
 
Maternal and Child Anemia- Why, what works, what needs more work?
Maternal and Child Anemia- Why, what works, what needs more work?Maternal and Child Anemia- Why, what works, what needs more work?
Maternal and Child Anemia- Why, what works, what needs more work?jehill3
 
Conceptual Frameworks: Health Systems and the Community
Conceptual Frameworks: Health Systems and the CommunityConceptual Frameworks: Health Systems and the Community
Conceptual Frameworks: Health Systems and the Communityjehill3
 
Operations research luna
Operations research lunaOperations research luna
Operations research lunajehill3
 

Viewers also liked (12)

Lives Saved Analyses for Child Survival Projects: Basic How-To Use LiST - Deb...
Lives Saved Analyses for Child Survival Projects: Basic How-To Use LiST - Deb...Lives Saved Analyses for Child Survival Projects: Basic How-To Use LiST - Deb...
Lives Saved Analyses for Child Survival Projects: Basic How-To Use LiST - Deb...
 
skill 7
skill 7skill 7
skill 7
 
Long tail (session 2)
Long tail (session 2)Long tail (session 2)
Long tail (session 2)
 
Death of jesus
Death of jesusDeath of jesus
Death of jesus
 
Partnership Defined Quality: Acting it Out!
Partnership Defined Quality: Acting it Out!Partnership Defined Quality: Acting it Out!
Partnership Defined Quality: Acting it Out!
 
Tuberculosis and PSI
Tuberculosis and PSITuberculosis and PSI
Tuberculosis and PSI
 
Maternal and Child Health Integrated Program – MCHIP
Maternal and Child Health Integrated Program – MCHIPMaternal and Child Health Integrated Program – MCHIP
Maternal and Child Health Integrated Program – MCHIP
 
The Current Condition of Mental Health in Afghanistan: Integrating Mental Hea...
The Current Condition of Mental Health in Afghanistan: Integrating Mental Hea...The Current Condition of Mental Health in Afghanistan: Integrating Mental Hea...
The Current Condition of Mental Health in Afghanistan: Integrating Mental Hea...
 
Maternal and Child Anemia- Why, what works, what needs more work?
Maternal and Child Anemia- Why, what works, what needs more work?Maternal and Child Anemia- Why, what works, what needs more work?
Maternal and Child Anemia- Why, what works, what needs more work?
 
Conceptual Frameworks: Health Systems and the Community
Conceptual Frameworks: Health Systems and the CommunityConceptual Frameworks: Health Systems and the Community
Conceptual Frameworks: Health Systems and the Community
 
Operations research luna
Operations research lunaOperations research luna
Operations research luna
 
Winter In Finland
Winter In FinlandWinter In Finland
Winter In Finland
 

Similar to CEC'10: Improving Evolutionary Testing by Means of Efficiency Enhancement Techniques

History Class - For software testers
History Class - For software testersHistory Class - For software testers
History Class - For software testersJoris Meerts
 
Machine Learning Made Simple: Differential evolution
Machine Learning Made Simple: Differential evolutionMachine Learning Made Simple: Differential evolution
Machine Learning Made Simple: Differential evolutionDevansh16
 
Avoiding test hell
Avoiding test hellAvoiding test hell
Avoiding test hellYun Ki Lee
 
Why advanced population initialization techniques perform poorly in high dime...
Why advanced population initialization techniques perform poorly in high dime...Why advanced population initialization techniques perform poorly in high dime...
Why advanced population initialization techniques perform poorly in high dime...Borhan Kazimipour
 
Technological Problem Solving Seminar
Technological Problem Solving SeminarTechnological Problem Solving Seminar
Technological Problem Solving SeminarDavid Morrison-Love
 
Presentation of master thesis
Presentation of master thesisPresentation of master thesis
Presentation of master thesisSeoung-Ho Choi
 
Tester Challenges in Agile ?
Tester Challenges in Agile ?Tester Challenges in Agile ?
Tester Challenges in Agile ?alind tiwari
 
Regularization in deep learning
Regularization in deep learningRegularization in deep learning
Regularization in deep learningKien Le
 
Susan epstein at ibm csig speaker series
Susan epstein at ibm csig speaker seriesSusan epstein at ibm csig speaker series
Susan epstein at ibm csig speaker seriesdiannepatricia
 
Evaluating Semantic Search Systems to Identify Future Directions of Research
Evaluating Semantic Search Systems to Identify Future Directions of ResearchEvaluating Semantic Search Systems to Identify Future Directions of Research
Evaluating Semantic Search Systems to Identify Future Directions of ResearchStuart Wrigley
 
Principles of effort estimation
Principles of effort estimationPrinciples of effort estimation
Principles of effort estimationCS, NcState
 
Recommendation engine Using Genetic Algorithm
Recommendation engine Using Genetic AlgorithmRecommendation engine Using Genetic Algorithm
Recommendation engine Using Genetic AlgorithmVaibhav Varshney
 
Asking Clarifying Questions in Open-Domain Information-Seeking Conversations
Asking Clarifying Questions in Open-Domain Information-Seeking ConversationsAsking Clarifying Questions in Open-Domain Information-Seeking Conversations
Asking Clarifying Questions in Open-Domain Information-Seeking ConversationsMohammad Aliannejadi
 
Comparing Incremental Learning Strategies for Convolutional Neural Networks
Comparing Incremental Learning Strategies for Convolutional Neural NetworksComparing Incremental Learning Strategies for Convolutional Neural Networks
Comparing Incremental Learning Strategies for Convolutional Neural NetworksVincenzo Lomonaco
 
Algebra team. 9.5.12
Algebra team. 9.5.12Algebra team. 9.5.12
Algebra team. 9.5.12Mona Toncheff
 

Similar to CEC'10: Improving Evolutionary Testing by Means of Efficiency Enhancement Techniques (20)

History Class - For software testers
History Class - For software testersHistory Class - For software testers
History Class - For software testers
 
Machine Learning Made Simple: Differential evolution
Machine Learning Made Simple: Differential evolutionMachine Learning Made Simple: Differential evolution
Machine Learning Made Simple: Differential evolution
 
Avoiding test hell
Avoiding test hellAvoiding test hell
Avoiding test hell
 
Why advanced population initialization techniques perform poorly in high dime...
Why advanced population initialization techniques perform poorly in high dime...Why advanced population initialization techniques perform poorly in high dime...
Why advanced population initialization techniques perform poorly in high dime...
 
Technological Problem Solving Seminar
Technological Problem Solving SeminarTechnological Problem Solving Seminar
Technological Problem Solving Seminar
 
Developing Moving and Handling training
Developing Moving and Handling trainingDeveloping Moving and Handling training
Developing Moving and Handling training
 
Presentation of master thesis
Presentation of master thesisPresentation of master thesis
Presentation of master thesis
 
Tester Challenges in Agile ?
Tester Challenges in Agile ?Tester Challenges in Agile ?
Tester Challenges in Agile ?
 
Agile process
Agile processAgile process
Agile process
 
Regularization in deep learning
Regularization in deep learningRegularization in deep learning
Regularization in deep learning
 
Susan epstein at ibm csig speaker series
Susan epstein at ibm csig speaker seriesSusan epstein at ibm csig speaker series
Susan epstein at ibm csig speaker series
 
Evaluating Semantic Search Systems to Identify Future Directions of Research
Evaluating Semantic Search Systems to Identify Future Directions of ResearchEvaluating Semantic Search Systems to Identify Future Directions of Research
Evaluating Semantic Search Systems to Identify Future Directions of Research
 
Principles of effort estimation
Principles of effort estimationPrinciples of effort estimation
Principles of effort estimation
 
Recommendation engine Using Genetic Algorithm
Recommendation engine Using Genetic AlgorithmRecommendation engine Using Genetic Algorithm
Recommendation engine Using Genetic Algorithm
 
Slides 2015 for contact 3
Slides 2015 for contact 3Slides 2015 for contact 3
Slides 2015 for contact 3
 
Asking Clarifying Questions in Open-Domain Information-Seeking Conversations
Asking Clarifying Questions in Open-Domain Information-Seeking ConversationsAsking Clarifying Questions in Open-Domain Information-Seeking Conversations
Asking Clarifying Questions in Open-Domain Information-Seeking Conversations
 
Etm551 lecture05
Etm551 lecture05Etm551 lecture05
Etm551 lecture05
 
Comparing Incremental Learning Strategies for Convolutional Neural Networks
Comparing Incremental Learning Strategies for Convolutional Neural NetworksComparing Incremental Learning Strategies for Convolutional Neural Networks
Comparing Incremental Learning Strategies for Convolutional Neural Networks
 
4.6 Evaluation
4.6 Evaluation4.6 Evaluation
4.6 Evaluation
 
Algebra team. 9.5.12
Algebra team. 9.5.12Algebra team. 9.5.12
Algebra team. 9.5.12
 

Recently uploaded

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 

Recently uploaded (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 

CEC'10: Improving Evolutionary Testing by Means of Efficiency Enhancement Techniques

  • 1. Improving Evolutionary Testing by Means of Efficiency Enhancement Techniques Matteo Miraz, Pier Luca Lanzi, and Luciano Baresi (presented by Daniele Loiacono) Politecnico di Milano, Italy
  • 2. 2 Table of Contents 1. TestFul: an Evolutionary Test Approach for Java 2. Improving the Approach 1. Seeding 2. Hybridization 3. Fitness Inheritance 3. Conclusions and Future Work DEI
  • 3. Testful 3 • Leverages Search-Based Techniques to generate Tests • We are not alone: • Search Based Software Engineering is a vibrant community! • Targets stateful systems (e.g., Java classes) • A sequence of operations is required to exercise the features of a class enables DEI
  • 4. Test Representation 4 • A test is a sequence of operations • Assign a primitive value to a variable • char_0 = „c‟ • Create an object • cut_1 = new CUT(char_0) • Invoke a method on an object • char_1 = cut_1.fooBar(int_1) • Working on variables • Includes all the parameters‟ types • Enables polymorphism • Calculate compatibilities among types DEI
  • 5. Our Evolutionary Testing Approach 5 Goal: Find tests that put objects in interesting states • We use a NSGA-II Evolutionary Algorithm, guided by:  Number of statements and branches covered • Tests with a high branch 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 • Recombination: • variable-length one-point crossover, replacement mutation crossover mutation DEI
  • 6. Need for Efficiency Enhancement Techniques 6 • Testful achieves good results • generates good tests for complex classes (GECCO ‟09 poster) • It requires huge computational requirements, because: • It starts the evolution from a population with a poor quality. • Most of the initial tests do not exercise any feature • The most difficult elements in the class are not exercised • It does not provide any guidance to exercise uncovered elements • The fitness function only counts the number of branch exercised • The fitness function is expensive • It requires to execute a test to measure its branch coverage DEI
  • 7. Seeding 7 • 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 Branch Coverage with a Random Search DEI
  • 8. Seeding 8 Simple Problem (Fraction) Complex Problem (Red-Black Tree) DEI
  • 9. Hybridization 9 • Problem: • Testful does not provide any guidance to exercise uncovered branches • Solution: • Hybridize the evolutionary search with a local search • It focuses on the easiest branch not yet executed (works at method level) • 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
  • 10. Hybridization 10 Simple Problem (Fraction) Complex Problem (Disjoint Set Fast) DEI
  • 11. Fitness Inheritance 11 • Problem: • The fitness function is expensive • Solution: • Use Fitness Inheritance • 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 • Fronteer selection: evaluate more often individuals on the frontier • How to evaluate the improvements? • Number of generation evaluated w.r.t. elapsed time • Number of branch covered • (to evaluate the impact of a noisier fitness function) DEI
  • 12. Fitness Inheritance: # of generations 12 Complex Problem (Stack Array) More complex Problem (Red-Black Tree) DEI
  • 13. Fitness Inheritance: branch executed 13 Simple Problem (Fraction) Computationally-intensive Problem (Disjoint Set Fast) DEI
  • 14. Conclusions and Future Work 14 • Efficiency enhancement techniques allow Testful to reach better results using less computational resources • The improvement is even higher if the three efficiency enhancement techniques are combined • We plan to leverage even more on the Seeding technique • To test newer versions of a class • To test similar classes of a class DEI
  • 15. Improving Evolutionary Testing by Means of Efficiency Enhancement Techniques M. Miraz, P. L. Lanzi, L. Baresi {miraz,lanzi,baresi}@elet.polimi.it http://code.google.com/p/testful/