using non redundant mutation operators and test suite
play

Using Non-Redundant Mutation Operators and Test Suite Prioritization - PowerPoint PPT Presentation

Using Non-Redundant Mutation Operators and Test Suite Prioritization to Achieve Efficient and Scalable Mutation Analysis Ren Just 1 , 2 & Gregory M. Kapfhammer 3 & Franz Schweiggert 2 1 University of Washington, USA 2 Ulm University,


  1. Using Non-Redundant Mutation Operators and Test Suite Prioritization to Achieve Efficient and Scalable Mutation Analysis René Just 1 , 2 & Gregory M. Kapfhammer 3 & Franz Schweiggert 2 1 University of Washington, USA 2 Ulm University, Germany 3 Allegheny College, USA 23rd International Symposium on Software Reliability Engineering November 28, 2012

  2. Introduction Reduction Characteristics Prioritization Conclusion Mutation Analysis Background Mutation analysis assesses the quality of a test suite with artificial faults (mutants)

  3. Introduction Reduction Characteristics Prioritization Conclusion Mutation Analysis Background Mutation analysis assesses the quality of a test suite with artificial faults (mutants) Program Test suite

  4. Introduction Reduction Characteristics Prioritization Conclusion Mutation Analysis Background Mutation analysis assesses the quality of a test suite with artificial faults (mutants) Program Test suite Generate mutants Mutants

  5. Introduction Reduction Characteristics Prioritization Conclusion Mutation Analysis Background Mutation analysis assesses public int max(int a, int b){ int max = a; the quality of a test suite if (b>a){ with artificial faults (mutants) max=b; } return max; } Original Program Test suite Generate mutants Mutants

  6. Introduction Reduction Characteristics Prioritization Conclusion Mutation Analysis Background Mutation analysis assesses public int max(int a, int b){ int max = a; the quality of a test suite if (b>a){ with artificial faults (mutants) max=b; } return max; } Original Program Test suite Generate mutants Mutants

  7. Introduction Reduction Characteristics Prioritization Conclusion Mutation Analysis Background Mutation analysis assesses public int max(int a, int b){ int max = a; the quality of a test suite if (b>a){ with artificial faults (mutants) max=b; } return max; } Original Program Test suite public int max(int a, int b){ int max = a; Generate Contains a small if (b>=a){ mutants syntactic change max=b; } return max; Mutants } Mutant

  8. Introduction Reduction Characteristics Prioritization Conclusion Mutation Analysis Background Mutation analysis assesses public int max(int a, int b){ int max = a; the quality of a test suite if (b>a){ with artificial faults (mutants) max=b; } return max; } Original Program Test suite public int max(int a, int b){ int max = a; Generate Execute Contains a small if (b>=a){ mutants mutants syntactic change max=b; } return max; Mutation Mutants } score Mutant

  9. Introduction Reduction Characteristics Prioritization Conclusion Mutation Analysis is Expensive public int max(int a, int b){ int max = a; if (b>a){ max=b; } return max; } Original

  10. Introduction Reduction Characteristics Prioritization Conclusion Mutation Analysis is Expensive public int max(int a, int b){ if (b < a) int max = a; if (b <= a) if (b>a){ if (b >= a) max=b; if (b != a) } if (b == a) return max; } Original

  11. Introduction Reduction Characteristics Prioritization Conclusion Mutation Analysis is Expensive public int max(int a, int b){ if (b < a) int max = a; if (b <= a) if (b>a){ if (b >= a) max=b; if (b != a) } if (b == a) return max; } Original Many mutants can be generated for large programs

  12. Introduction Reduction Characteristics Prioritization Conclusion Mutation Analysis is Expensive public int max(int a, int b){ if (b < a) int max = a; if (b <= a) if (b>a){ if (b >= a) max=b; if (b != a) } if (b == a) return max; } Original Large programs include Many mutants can be comprehensive test suites generated for large programs

  13. Introduction Reduction Characteristics Prioritization Conclusion Mutation Analysis is Expensive public int max(int a, int b){ if (b < a) int max = a; if (b <= a) if (b>a){ if (b >= a) max=b; if (b != a) } if (b == a) return max; } Original Large programs include Many mutants can be comprehensive test suites generated for large programs Executing the entire test suite for all mutants in large programs is prohibitive!

  14. Introduction Reduction Characteristics Prioritization Conclusion Overview: Efficient Mutation Analysis Execute fewer mutants fewer times

  15. Introduction Reduction Characteristics Prioritization Conclusion Overview: Efficient Mutation Analysis Execute fewer mutants fewer times Mutant reduction Generate Execute fewer mutants fewer mutants

  16. Introduction Reduction Characteristics Prioritization Conclusion Overview: Efficient Mutation Analysis Execute fewer mutants fewer times Test suite Mutant prioritization reduction Reordering Generate Execute Test suite and splitting fewer mutants fewer mutants characteristics

  17. Introduction Reduction Characteristics Prioritization Conclusion Overview: Efficient Mutation Analysis Execute fewer mutants fewer times Test suite Mutant prioritization reduction Reordering Generate Execute Test suite and splitting fewer mutants fewer mutants characteristics 27% 29% Empirical evaluation of 10 open-source projects with 560,000 mutants

  18. Introduction Reduction Characteristics Prioritization Conclusion Reduction of Mutants Execute fewer mutants fewer times Mutant reduction Generate Execute fewer mutants fewer mutants 27% Empirical evaluation of 10 open-source projects with 560,000 mutants

  19. Introduction Reduction Characteristics Prioritization Conclusion Reduce Number of Generated Mutants Mutation operators may introduce redundancy: Redundant mutants are subsumed by other mutants a + b �→ a - b (replace binary operator) a + b �→ a + (-b) (insert unary operator) Use only non-redundant mutation operators Avoid the generation of such subsumed mutants

  20. Introduction Reduction Characteristics Prioritization Conclusion Reduce Number of Generated Mutants Mutation operators may introduce redundancy: Redundant mutants are subsumed by other mutants a + b �→ a - b (replace binary operator) a + b �→ a + (-b) (insert unary operator) Use only non-redundant mutation operators Avoid the generation of such subsumed mutants Number of generated mutants reduced by 27%

  21. Introduction Reduction Characteristics Prioritization Conclusion Reduce Number of Generated Mutants Mutation operators may introduce redundancy: Redundant mutants are subsumed by other mutants a + b �→ a - b (replace binary operator) a + b �→ a + (-b) (insert unary operator) Use only non-redundant mutation operators Avoid the generation of such subsumed mutants Number of generated More than 410,000 gen- erated mutants remaining mutants reduced by 27%

  22. Introduction Reduction Characteristics Prioritization Conclusion Reduce Number of Generated Mutants Mutation operators may introduce redundancy: Redundant mutants are subsumed by other mutants a + b �→ a - b (replace binary operator) a + b �→ a + (-b) (insert unary operator) Use only non-redundant mutation operators Avoid the generation of such subsumed mutants Number of generated More than 410,000 gen- erated mutants remaining mutants reduced by 27% Executing all non-redundant mutants is still prohibitive!

  23. Introduction Reduction Characteristics Prioritization Conclusion Reduce Number of Executed Mutants Exploit necessary conditions: Mutants not covered (reached) cannot be detected Determine covered mutants for the test suite Only execute the covered mutants

  24. Introduction Reduction Characteristics Prioritization Conclusion Reduce Number of Executed Mutants Exploit necessary conditions: Mutants not covered (reached) cannot be detected Determine covered mutants for the test suite Only execute the covered mutants Total reduction of executed mutants of more than 50%

  25. Introduction Reduction Characteristics Prioritization Conclusion Reduce Number of Executed Mutants Exploit necessary conditions: Mutants not covered (reached) cannot be detected Determine covered mutants for the test suite Only execute the covered mutants Mutation analysis runtime Total reduction of executed still up to 13 hours mutants of more than 50%

  26. Introduction Reduction Characteristics Prioritization Conclusion Reduce Number of Executed Mutants Exploit necessary conditions: Mutants not covered (reached) cannot be detected Determine covered mutants for the test suite Only execute the covered mutants Mutation analysis runtime Total reduction of executed still up to 13 hours mutants of more than 50% Further optimizations beyond the reduction of mutants are necessary!

  27. Introduction Reduction Characteristics Prioritization Conclusion Optimized Workflow for Mutation Analysis Execute fewer mutants fewer times Test suite prioritization Reordering Test suite and splitting characteristics 29% Empirical evaluation of 10 open-source projects with 560,000 mutants

  28. Introduction Reduction Characteristics Prioritization Conclusion Motivating Example for Reordering Mutants: 1, 2, 3, 4, 5

  29. Introduction Reduction Characteristics Prioritization Conclusion Motivating Example for Reordering Mutants: Test case t 1 : Test case t 2 : Test case t 3 : 1, 2, 3, 4, 5 5 seconds 2 seconds 1 second

Recommend


More recommend