effective black box testing with genetic algorithms
play

Effective Black-Box Testing with Genetic Algorithms Mark Last and - PowerPoint PPT Presentation

Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Effective Black-Box Testing with Genetic Algorithms Mark Last and Shay Eyal Department of Information Systems Engineering Ben-Gurion University of the Negev, Beer-Sheva,


  1. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Effective Black-Box Testing with Genetic Algorithms Mark Last and Shay Eyal Department of Information Systems Engineering Ben-Gurion University of the Negev, Beer-Sheva, Israel Abraham Kandel National Institute for Systems Test and Productivity (NISTP) University of South Florida, Tampa, FL, USA IBM Verification Conference 2005

  2. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Agenda • What is NISTP? • Black-Box Testing: State-of-the-Art • Research Goal and Objectives • Overview of Genetic Algorithms (GA) – Fuzzy-Based Age Extension of Genetic Algorithms (FAexGA) • GA-Based Test Case Generation • Initial Case Studies • Summary and Discussion 2

  3. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms National Institute for Systems Test and Productivity Funding Source: SPAWAR - US Space and Naval Warfare Systems Command (Grant No. N00039-01-1-2248). WWW: http://nistp.csee.usf.edu/ The Institute's mission is to engage in innovative research and to provide direct support to government agencies (and their development agents) which will enable them to substantially reduce cost and improve the development schedule and reliability of large-scale systems • University of South Florida, Tampa, FL, USA – College of Engineering: PI - Prof. Abraham Kandel (Executive Director) – College of Business Administration: CO-PI - Prof. Alan R. Hevner • Subcontractors – Arizona State University: PI - Dr. Wei-Tek Tsai – Drexel University: PI - Dr. Rosina Weber – QTSI: PI - Chick Garcia – Ben Gurion University: PI - Dr. Mark Last – Echelon: PIs - Dr. Jay Bayne, Dr. Norm Brown 3

  4. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Functional (Black-Box) Testing • Based on software specification only O • Compares the observed outputs to I u expected outputs n t • Needs an “oracle” for a tested system p p • Exhaustive (combinatorial) testing is u u computationally infeasible for large- t t s s scale software systems • BB Test generation methods – Random Testing (within / without the All BB testing methods operational profile) – Special value testing cover only a tiny – Boundary value testing portion of possible – Equivalence classes software inputs! – Decision tables – Input-Output Analysis 4

  5. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Effective Black-Box Test Cases • Test case – A particular choice of input data to be used in testing a program • An effective set of test cases – A test set that has a high probability of detecting faults presenting in a computer program • Testers’ Objectives – Generate good test cases • A good test case is one that has a high probability of detecting an as- yet undiscovered error • Several test cases causing the same bug may show a pattern that might lead to the real cause of the bug – Prioritize test cases • The dominant criterion: rate of fault detection – how quickly a test case detect faults during the testing process 5

  6. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Research Goal and Objectives • Goal – Develop novel methodology for generation of effective black-box test cases with genetic algorithms • Basic Idea – Eliminate "bad" test cases that are unlikely to expose any error, while increasing the number of "good" test cases that have a high probability of producing an erroneous output • Objectives – Define a general framework for evolving an effective set of test cases with a genetic algorithm – Enhance the proposed GA-based methodology by the novel Fuzzy- Based Age Extension of Genetic Algorithms (FAexGA) – Evaluate the effectiveness and the efficiency of the proposed approach using synthetic and real computer programs 6

  7. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Overview of Genetic Algorithms (GA) “ Genetic algorithm is a computerized “ Genetic algorithm is a computerized simulation of Darwin's theories” ” simulation of Darwin's theories Holland J. H. Holland J. H. • Search and optimization method developed by mimicking the evolutionary principles and chromosomal processing in natural genetics • Application Areas – Optimization: numerical, combinatorial (job-shop scheduling). – Machine learning tasks: classification, prediction (weights for neural networks). – Economics: bidding strategies. 7

  8. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms GA Working Principle Initialize Initialize Select individuals for mating Selection Selection population population Mate individuals Crossover Crossover Moving to Moving to the next the next Mutate offspring Mutation Mutation generation… … generation Insert into Insert into Insert offspring into population population population No Yes Answer Stop criteria satisfied ? 8

  9. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms General GA Settings • Solution encoding (binary, real, tree…). • Initialization – How to create an initial population of potential solutions? • Genetic operators – Selection method (ranking, roulette wheel…). – Crossover-operator (one-point, uniform…). – Mutation-operator (inversion, flip…). • Evaluation function – Rate the candidate solutions quality • Parameter values – N - population size – P c - crossover probability – P m - mutation probability – N gen – number of generations 9

  10. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Crossover and Mutation Single-Point Bit-flip Mutation Crossover 100 101 100000011101000 100111100011100 000 001 100110011101000 110 111 100001100011100 ? 011 010 10

  11. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Premature Convergence of GAs � “Poor parameter setting might make exploitation /exploration relationship (EER) disproportionate, produce lack of diversity and lead to Premature Convergence ” F. Herrera � Parameters: population size, crossover probability, etc. � Exploration – overall search in the solution space � Exploitation – localized search in the promising regions discovered so far in that space 11

  12. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Fuzzy-Based Age Extension of Genetic Algorithms (FAexGA) (Last and Eyal, 2005) • Goal – Find an optimal policy for controlling the Exploration/Exploitation relationship in GA based on the age attribute. • Age = number of generations Example: Example: If A is Old Old and B is and B is Old Old then then If A is crossover probability is Low Low crossover probability is Where A and B are two chromosomes chosen for crossover Where A and B are two chromosomes chosen for crossover 12

  13. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms FAexGA Method • Adapt the crossover probability ( Pc ) with Fuzzy Logic Controller (FLC): Knowledge Base Knowledge Base Fuzzification Inference Defuzzification Fuzzification Inference Defuzzification interface System interface interface System interface State Control Variables Parameters GA GA • Crossover probability • Lifetime, Age. 13

  14. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Fuzzification of Age • Age ∈ [Young, Middle-age, Old] Membership Function Middle-age Old Young 1 Young: 0-30% Middle-age: 20-80% Old: 70-100% Relative Age 0.2 0.3 0.7 0.8 0.5 1 (= age/avg. lifetime) Lifetime = number of generations a chromosome stays alive 14

  15. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Fuzzification of Crossover Probability P C • Pc ∈ [Low, Medium, High] Membership Function Medium High Low 1 Low: 0-20% Medium: 15-85% High: 80-100% Pc 0.15 0.2 0.8 0.85 0.5 1 • Defuzzification method: Center of Gravity 15

  16. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Fuzzy-Based Age Extension of GA Random Increase Age Random Increase Age Evaluate P(t) Evaluate P(t) Initialize P(t) Initialize P(t) Selection Selection Assign Pc Assign Pc Moving to Moving to the next Call Fuzzy Logic Controller the next Crossover Crossover generation… … generation Mutation Mutation Evaluate P(t) Evaluate P(t) Remove Individuals Remove Individuals P(t) = population on generation t. with age > lifetime with age > lifetime Answer Answer Answer Stop criteria satisfied ? 16

  17. Dr. Mark Last (BGU) Effective Black-Box Testing with Genetic Algorithms Fuzzy Rule Base • Age ∈ [Young, Middle-age, Old] • Crossover Probability Pc ∈ [Low, Medium, High] Parent I “ Young ” “ middle-age ” “ Old ” Parent II “ Young ” Low Medium Low “ middle-age ” Medium High Medium “ Old ” Low Medium Low • Inference method: MAX-MIN 17

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend