search based software engineering
play

Search Based Software Engineering Justyna Petke C entre for R - PowerPoint PPT Presentation

Search Based Software Engineering Justyna Petke C entre for R esearch in E volution, S earch and T esting University College London CREST Outline Search Based Software Engineering Combinatorial Interaction Testing Genetic Improvement CREST


  1. Growth Trends CREST Search Based Software Engineering Justyna Petke

  2. Polynomial rise in publications CREST Search Based Software Engineering Justyna Petke

  3. Percentage of Paper Number on SBSE CREST Search Based Software Engineering Justyna Petke

  4. S B S T CREST Search Based Software Engineering Justyna Petke

  5. Structural CREST Search Based Software Engineering Justyna Petke

  6. Structural find tests to cover branches, statements & dataflow, etc. CREST Search Based Software Engineering Justyna Petke

  7. CIT CREST Search Based Software Engineering Justyna Petke

  8. Augment CREST Search Based Software Engineering Justyna Petke

  9. Augment find new tests from old tests CREST Search Based Software Engineering Justyna Petke

  10. Regression CREST Search Based Software Engineering Justyna Petke

  11. Regression find good subsets and orders of tests CREST Search Based Software Engineering Justyna Petke

  12. SPLs CREST Search Based Software Engineering Justyna Petke

  13. Mutation CREST Search Based Software Engineering Justyna Petke

  14. State based CREST Search Based Software Engineering Justyna Petke

  15. Model based CREST Search Based Software Engineering Justyna Petke

  16. Black box CREST Search Based Software Engineering Justyna Petke

  17. Just some of the many Agent Oriented Aspect Oriented Assertion Generation SBSE applications Bug Fixing Component Oriented Design Effort Estimation Heap Optimisation Model Checking Predictive Modelling Probe distribution Program Analysis Program Comprehension Program Transformation Project Management Protocol Optimisation QoS Refactoring Regression Testing Requirements Reverse Engineering SOA Software Maintenance and Evolution Test Generation UIO generation CREST Search Based Software Engineering 56 Justyna Petke

  18. Author statistics more than 1250 authors more than 1150 papers more than 390 institutions more than 50 countries source: SBSE repository, July 2013. CREST Search Based Software Engineering Justyna Petke

  19. SBSE Key Ingredients The choice of the representation of the problem The definition of the fitness function CREST Search Based Software Engineering Justyna Petke

  20. Overall Architecture of SBSE Approach CREST Search Based Software Engineering Justyna Petke

  21. Search Based Algorithms Used CREST Search Based Software Engineering Justyna Petke

  22. Random Search CREST Search Based Software Engineering Justyna Petke

  23. Random Solution Score -3 CREST Search Based Software Engineering Justyna Petke

  24. Random Search CREST Search Based Software Engineering Justyna Petke

  25. Hill Climbing Select a starting solution s ∈ Solutions Repeat Select s ′ ∈ Neighborhood(s) such that fitness(s ′ ) > fitness(s) according to ascent strategy s ← s ′
 Until fitness(s) ≥ fitness(s ′ ), ∀ s ′ ∈ Neighbourhood(s) CREST Search Based Software Engineering Justyna Petke

  26. Hill Climbing Score -2 CREST Search Based Software Engineering Justyna Petke

  27. Hill Climbing Score -1 CREST Search Based Software Engineering Justyna Petke

  28. Hill Climbing Select a starting solution s ∈ Solutions Repeat Select s ′ ∈ Neighborhood(s) such that fitness(s ′ ) > fitness(s) according to ascent strategy s ← s ′
 Until fitness(s) ≥ fitness(s ′ ), ∀ s ′ ∈ Neighbourhood(s) Will the algorithm always find an optimal solution ? CREST Search Based Software Engineering Justyna Petke

  29. Hill Climbing CREST Search Based Software Engineering Justyna Petke

  30. Simulated Annealing CREST Search Based Software Engineering Justyna Petke

  31. Simulated Annealing Select a starting solution s ∈ Solutions Select an initial temperature t > 0 Repeat iterations ← 0 Repeat Select s ′ ∈ Neighbourhood(s) at random δ ← fitness(s) − fitness(s ′ ) 
 If δ < 0 Then s ← s ′ Else Generate random number r, 0 ≤ r < 1 If r < e^( − δ /t) Then s ← s ′ iterations ← iterations + 1 Until iterations = num solutions 
 Decrease t according to cooling schedule Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  32. Genetic Algorithm CREST Search Based Software Engineering Justyna Petke

  33. Genetic Algorithm Randomly generate or seed initial population P Repeat Evaluate fitness of each individual in P Select parents from P according to selection mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  34. Case Study CREST Search Based Software Engineering Justyna Petke

  35. 
 Test Case Prioritisation Given: a test suite, T, the set of permutations of T, PT, and a function from PT to real numbers, f : P T → R Problem: to find T ′ ∈ PT such that ( ∀ T ′′ )(T ′′ ∈ PT) (T ′′ not equals T ′ ) [ f(T ′ ) ≥ f(T ′′ ) ] CREST Search Based Software Engineering Justyna Petke

  36. 
 Test Case Prioritisation in Regression Testing Given: a test suite, T, fault detection history for each test case Problem: find T’ that maximises fault detection rate CREST Search Based Software Engineering Justyna Petke

  37. SBSE Key Ingredients The choice of the representation of the problem The definition of the fitness function CREST Search Based Software Engineering Justyna Petke

  38. Test Case Prioritisation in Regression Testing Representation t1 t3 t6 t2 t5 t4 Neighbouring Solution t1 t3 t2 t6 t5 t4 CREST Search Based Software Engineering Justyna Petke

  39. Test Case Prioritisation in Regression Testing Fitness Function Average Percentage of Faults Detected (APFD) metric * higher APFD implies earlier fault detection * Sebastian G. Elbaum, Alexey G. Malishevsky, and Gregg Rothermel. Prioritizing test cases for regression testing. In International Symposium on Software Testing and Analysis, pages 102–112. ACM Press, 2000. CREST Search Based Software Engineering Justyna Petke

  40. Overall Architecture of SBSE Approach CREST Search Based Software Engineering Justyna Petke

  41. Test Case Prioritisation in Regression Testing Search Algorithm CREST Search Based Software Engineering Justyna Petke

  42. Test Case Prioritisation in Regression Testing Genetic Algorithm CREST Search Based Software Engineering Justyna Petke

  43. Test Case Prioritisation in Regression Testing Genetic Algorithm Randomly generate or seed initial population P Repeat Evaluate fitness of each individual in P Select parents from P according to selection mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  44. Test Case Prioritisation in Regression Testing Genetic Algorithm Randomly generate or seed initial population P Repeat t1 t3 t6 t2 t5 t4 Evaluate fitness of each individual in P Select parents from P according to selection mechanism Recombine parents to form new offspring t2 t5 t1 t3 t6 t4 Construct new population P ′ from parents and offspring t1 t3 t2 t6 t5 t4 Mutate P ′ P ← P ′ t6 t4 t3 t5 t1 t2 Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  45. Test Case Prioritisation in Regression Testing Genetic Algorithm Evaluate fitness of each individual in P Repeat t1 t3 t6 t2 t5 t4 Evaluate fitness of each individual in P APFD=68% Select parents from P according to selection mechanism Recombine parents to form new offspring APFD=55% t2 t5 t1 t3 t6 t4 Construct new population P ′ from parents and offspring t1 t3 t2 t6 t5 t4 APFD=72% Mutate P ′ P ← P ′ APFD=78% t6 t4 t3 t5 t1 t2 Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  46. Test Case Prioritisation in Regression Testing Genetic Algorithm Select parents from P according to selection mechanism Repeat Evaluate fitness of each individual in P t1 t3 t6 t2 t5 t4 t2 t5 t1 t3 t6 t4 Select parents from P according to selection mechanism APFD=68% APFD=55% Recombine parents to form new offspring Construct new population P ′ from parents and offspring Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  47. Test Case Prioritisation in Regression Testing Genetic Algorithm Select parents from P according to selection mechanism Repeat Evaluate fitness of each individual in P Select parents from P according to selection mechanism t1 t3 t6 t2 t5 t4 Recombine parents to form new offspring Construct new population P ′ from parents and APFD=68% offspring Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  48. Test Case Prioritisation in Regression Testing Genetic Algorithm Select parents from P according to selection mechanism Repeat Evaluate fitness of each individual in P t6 t4 t3 t5 t1 t2 t1 t3 t2 t6 t5 t4 Select parents from P according to selection mechanism APFD=78% APFD=72% Recombine parents to form new offspring Construct new population P ′ from parents and offspring Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  49. Test Case Prioritisation in Regression Testing Genetic Algorithm Select parents from P according to selection mechanism Repeat Evaluate fitness of each individual in P Select parents from P according to selection mechanism t6 t4 t3 t5 t1 t2 Recombine parents to form new offspring Construct new population P ′ from parents and APFD=78% offspring Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  50. Test Case Prioritisation in Regression Testing Genetic Algorithm Select parents from P according to selection mechanism Repeat Evaluate fitness of each individual in P t1 t3 t6 t2 t5 t4 t6 t4 t3 t5 t1 t2 Select parents from P according to selection mechanism APFD=78% Recombine parents to form new offspring APFD=68% Construct new population P ′ from parents and 2-way tournament selection offspring Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  51. Test Case Prioritisation in Regression Testing Genetic Algorithm Recombine parents to form new offspring Repeat Evaluate fitness of each individual in P Select parents from P according to selection mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  52. Test Case Prioritisation in Regression Testing Genetic Algorithm Crossover * Evaluate fitness of each individual in P Select parents from P according to selection mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring P ′ * Giulio Antoniol, Massimiliano Di Penta, and Mark Harman. Search-based techniques applied to optimization of project planning for a massive maintenance project. In 21st IEEE International Conference on Software Maintenance, pages 240–249, Los Alamitos, California, USA, 2005. IEEE Computer Society Press. CREST Search Based Software Engineering Justyna Petke

  53. Test Case Prioritisation in Regression Testing Genetic Algorithm Recombine parents to form new offspring Repeat Evaluate fitness of each individual in P Select parents from P according to selection t1 t3 t6 t2 t5 t4 mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring t6 t4 t3 t5 t1 t2 Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  54. Test Case Prioritisation in Regression Testing Genetic Algorithm Recombine parents to form new offspring Repeat Evaluate fitness of each individual in P Select parents from P according to selection t1 t3 t6 t2 t5 t4 t1 t3 t6 mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring t6 t4 t3 t5 t1 t2 t6 t4 t3 Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  55. Test Case Prioritisation in Regression Testing Genetic Algorithm Recombine parents to form new offspring Repeat Evaluate fitness of each individual in P Select parents from P according to selection t1 t3 t6 t2 t5 t4 t1 t3 t6 t4 t5 t2 mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring t6 t4 t3 t5 t1 t2 t6 t4 t3 Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  56. Test Case Prioritisation in Regression Testing Genetic Algorithm Recombine parents to form new offspring Repeat Evaluate fitness of each individual in P Select parents from P according to selection t1 t3 t6 t2 t5 t4 t1 t3 t6 t4 t5 t2 mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring t6 t4 t3 t5 t1 t2 t6 t4 t3 t1 t2 t5 Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  57. Test Case Prioritisation in Regression Testing Genetic Algorithm Construct new population P ′ from parents & offspring Evaluate fitness of each individual in P Select parents from P according to selection t1 t3 t6 t2 t5 t4 t1 t3 t6 t4 t5 t2 mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring t6 t4 t3 t5 t1 t2 t6 t4 t3 t1 t2 t5 Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  58. Test Case Prioritisation in Regression Testing Genetic Algorithm Mutate P ′ from parents & offspring Evaluate fitness of each individual in P Select parents from P according to selection t1 t3 t6 t2 t5 t4 t1 t3 t6 t4 t5 t2 mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring t6 t4 t3 t5 t1 t2 t6 t4 t3 t1 t2 t5 Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  59. Test Case Prioritisation in Regression Testing Genetic Algorithm Mutate P ′ from parents & offspring Evaluate fitness of each individual in P Select parents from P according to selection t1 t3 t6 t2 t5 t4 t1 t3 t6 t4 t5 t2 mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring t6 t4 t3 t5 t1 t2 t6 t4 t3 t1 t2 t5 Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  60. Test Case Prioritisation in Regression Testing Genetic Algorithm Mutate P ′ from parents & offspring Evaluate fitness of each individual in P Select parents from P according to selection t1 t3 t6 t5 t2 t4 t3 t1 t6 t4 t5 t2 mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring t6 t3 t4 t5 t1 t2 t6 t4 t1 t3 t2 t5 Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

  61. Test Case Prioritisation in Regression Testing Genetic Algorithm P ← P ′ from parents & offspring Evaluate fitness of each individual in P t1 t3 t6 t5 t2 t4 t3 t1 t6 t4 t5 t2 Select parents from P according to selection mechanism Recombine parents to form new offspring Construct new population P ′ from parents and offspring t6 t3 t4 t5 t1 t2 t6 t4 t1 t3 t2 t5 Mutate P ′ P ← P ′ Until Stopping Condition Reached CREST Search Based Software Engineering Justyna Petke

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