Search Algorithm in Software Testing and Debugging



Similar documents
SEARCH-BASED SOFTWARE TEST DATA GENERATION USING EVOLUTIONARY COMPUTATION

Practical Applications of Evolutionary Computation to Financial Engineering

Coverage Criteria for Search Based Automatic Unit Testing of Java Programs

BMOA: Binary Magnetic Optimization Algorithm

Two Flavors in Automated Software Repair: Rigid Repair and Plastic Repair

Automated Repair of Binary and Assembly Programs for Cooperating Embedded Devices

Optimised Realistic Test Input Generation

A hybrid Approach of Genetic Algorithm and Particle Swarm Technique to Software Test Case Generation

Projects - Neural and Evolutionary Computing

CS MidTerm Exam 4/1/2004 Name: KEY. Page Max Score Total 139

AN APPROACH FOR SOFTWARE TEST CASE SELECTION USING HYBRID PSO

International Journal of Software and Web Sciences (IJSWS)

Multi-Objective Genetic Test Generation for Systems-on-Chip Hardware Verification

International Journal of Emerging Technologies in Computational and Applied Sciences (IJETCAS)

Search Based Software Engineering: A Comprehensive Analysis and Review of Trends Techniques and Applications

A Hybrid Model of Particle Swarm Optimization (PSO) and Artificial Bee Colony (ABC) Algorithm for Test Case Optimization

Fuzzy Cognitive Map for Software Testing Using Artificial Intelligence Techniques

A New Software Data-Flow Testing Approach via Ant Colony Algorithms

Software Framework for Vehicle Routing Problem with Hybrid Metaheuristic Algorithms

How Can Metaheuristics Help Software Engineers

Designing Better Fitness Functions for Automated Program Repair

The Use of Cuckoo Search in Estimating the Parameters of Software Reliability Growth Models

CLOUD DATABASE ROUTE SCHEDULING USING COMBANATION OF PARTICLE SWARM OPTIMIZATION AND GENETIC ALGORITHM

Search Based Software Engineering: Techniques, Taxonomy, Tutorial

Search Based Software Engineering and Software Defect Prediction

Proposed Software Testing Using Intelligent techniques (Intelligent Water Drop (IWD) and Ant Colony Optimization Algorithm (ACO))

Static Program Transformations for Efficient Software Model Checking

Computational intelligence in intrusion detection systems

A Binary Model on the Basis of Imperialist Competitive Algorithm in Order to Solve the Problem of Knapsack 1-0

Ant Colony Optimization and Constraint Programming

Optimization and Ranking in Web Service Composition using Performance Index

MULTI-OBJECTIVE OPTIMIZATION USING PARALLEL COMPUTATIONS

Applying Particle Swarm Optimization to Software Testing

How To Improve Autotest

STUDY OF PROJECT SCHEDULING AND RESOURCE ALLOCATION USING ANT COLONY OPTIMIZATION 1

Toward Improving Graftability on Automated Program Repair

Empirically Identifying the Best Genetic Algorithm for Covering Array Generation

Web Service Selection using Particle Swarm Optimization and Genetic Algorithms

Dynamic Task Scheduling with Load Balancing using Hybrid Particle Swarm Optimization

A Survey on Search-Based Software Design

A New Multi-objective Evolutionary Optimisation Algorithm: The Two-Archive Algorithm

AUTOMATED UNIT TEST GENERATION DURING SOFTWARE DEVELOPMENT A Controlled Experiment and Think-aloud Observations

International Journal of Advanced Research in Electrical, Electronics and Instrumentation Engineering

Evolutionary Detection of Rules for Text Categorization. Application to Spam Filtering

An ACO Approach to Solve a Variant of TSP

Dynamic Generation of Test Cases with Metaheuristics

Data Mining Practical Machine Learning Tools and Techniques

Regression Testing Based on Comparing Fault Detection by multi criteria before prioritization and after prioritization

Requirements Selection: Knowledge based optimization techniques for solving the Next Release Problem

Keywords revenue management, yield management, genetic algorithm, airline reservation

INTERNATIONAL JOURNAL OF COMPUTER ENGINEERING & TECHNOLOGY (IJCET)

Research Article Service Composition Optimization Using Differential Evolution and Opposition-based Learning

Random Testing: The Best Coverage Technique - An Empirical Proof

Introduction To Genetic Algorithms

Keywords: real options, optimization of adaptive systems, Genetic Algorithms, Monte Carlo simulation.

Master's projects at ITMO University. Daniil Chivilikhin PhD ITMO University

Branch-and-Price Approach to the Vehicle Routing Problem with Time Windows

SCHEDULING AND INSPECTION PLANNING IN SOFTWARE DEVELOPMENT PROJECTS USING MULTI-OBJECTIVE HYPER-HEURISTIC EVOLUTIONARY ALGORITHM

An evolutionary learning spam filter system

Hybrid Algorithm using the advantage of ACO and Cuckoo Search for Job Scheduling

A HYBRID GENETIC ALGORITHM FOR THE MAXIMUM LIKELIHOOD ESTIMATION OF MODELS WITH MULTIPLE EQUILIBRIA: A FIRST REPORT

Practical Human Resource Allocation in Software Projects Using Genetic Algorithm

HYBRID GENETIC ALGORITHMS FOR SCHEDULING ADVERTISEMENTS ON A WEB PAGE

EA and ACO Algorithms Applied to Optimizing Location of Controllers in Wireless Networks

GA as a Data Optimization Tool for Predictive Analytics

A Genetic Algorithm Approach for Solving a Flexible Job Shop Scheduling Problem

The Bees Algorithm A Novel Tool for Complex Optimisation Problems

Genetic Algorithm Based Test Data Generator

An Efficient Approach for Task Scheduling Based on Multi-Objective Genetic Algorithm in Cloud Computing Environment

Optimising Patient Transportation in Hospitals

SOFTWARE TESTING STRATEGY APPROACH ON SOURCE CODE APPLYING CONDITIONAL COVERAGE METHOD

Flexible Neural Trees Ensemble for Stock Index Modeling

Background knowledge-enrichment for bottom clauses improving.

An Evolutionary Algorithm in Grid Scheduling by multiobjective Optimization using variants of NSGA

Transcription:

Search Algorithm in Software Testing and Debugging Hsueh-Chien Cheng Dec 8, 2010

Search Algorithm Search algorithm is a well-studied field in AI Computer chess Hill climbing A search... Evolutionary Algorithm

Evolutaionary Algorithm Evolutionary Algorithms (EAs) Most are population-based. Evolve the population by iteratively creating new solutions with the operator and retaining better solutions in the population. Genetic Algorithm (GA), Particle Swarm Optimization (PSO),... a lot of variants. Frequently applied to solve software engineering problems (Harman et al., 2009).

Search Algorithms and Software Engineering Applying search algorithms to solve software engineering problems has gained a lot of attention recently. Figure: Figure adapted from Figure 1 in Harman et al. (2009)

Software Engineering Problems as Optimization Problem In the following we focus on two specific problems with one selected recent work: 1. Software testing (Harman and McMinn, 2010) 2. Software debugging (Forrest et al., 2009) The problems are mapped into optimization problems and solved by search algorithms.

Testing as Optimization Problems The objective is branch coverage (Harman and McMinn, 2010). Generate the test case which hits the target branch. The quality of a solution is measured by combining the two: 1. Approach level: the distance from the target branch in the CFG 2. Branch distance: the difference of the variable in the predicate The problem is to minimize the sum of the two measurements after proper normalization.

Example: Branch Coverage Target branch Approachlevel = 1 Branch distance = 10 -k Figure: Figure adapted from Figure 1 in Harman and McMinn (2010)

Debugging as Optimization Problems The objective is the generation of a bug-free patch of the original program (Forrest et al., 2009). The quality of a solution is measured by the number of total test cases passed. Including positive and negative test cases. The problem is to maximize the number of test cases passed.

Global and Local Search There are a large number of search algorithms developed, which one is the best? It is problem dependent. (No-free-lunch theorem, Wolpert and Macready (2002)) Which one better suits the problem, global or local search? It depends on the fitness landscape of the problem.

Fitness Landscape Local search works best with a smooth landscape. But it get trapped in local optima when the landscape is multi-modal. In this case, global search may perform better. A landscape with large plateau is very hard for all searching algorithms. But plotting the shape of fitness landscape is as hard as solving the problem. Solution quality Solution

Search Space Reduction Real problems are hard with large search space. Therefore we need to reduce the search space to enable efficient search. Search space reduction is almost, if not always, necessary for practical problems.

Example: Game-tree Search Alpha-beta pruning with limited depth search. 1. Pruning Ignore the branch which contains no answer. 2. Restriction on the search space Search stops at a predefined depth and uses some heuristic to access the solution quality.

Harman and McMinn (2010) Compare the performance of local, global, and hybrid search in testing problem. Local search is the most efficient one for most branches. Global search works for some specific branches where local search fails. Hybrid covers the most branches. The algorithms under test are 1. Hill climbing as local search 2. Genetic Algorithm (GA) as global search 3. A combination of the above two as hybrid search, Memetic algorithm

Harman and McMinn (2010) Figure: Figure adapted from Figure 9 in Harman and McMinn (2010)

Harman and McMinn (2010) Observations: 1. High coverage of random testing - most branches are easy to cover. 2. 85 branches are never covered - there are extremely hard branches. Comparing the difference in performance of local and global search, those branches that are either too easy or too hard are not included. Now there are 37 branches left.

Harman and McMinn (2010) Theoretically, if a branch has the Royal Road property, GA can perform well. 8 of the 37 branches have this property. Figure: Figure adapted from Table 2 in Harman and McMinn (2010)

Harman and McMinn (2010) For the other 29 branches, GA usually has a lower success rate or a longer execution time if the success rate are 100% for both GA and hill climbing. Figure: Figure adapted from Figure 11 in Harman and McMinn (2010)

Harman and McMinn (2010) Figure: Figure adapted from Table 5 in Harman and McMinn (2010)

Harman and McMinn (2010) Hybrid algorithm offers the best coverage: Figure: Figure adapted from Figure 12 in Harman and McMinn (2010)

Harman and McMinn (2010) The efficiency of hybrid algorithm 1. Compared with GA for Royal Road branches Out-performed by GA, in both success rate and #evaluations. 2. Compared with BEST (hill climbing, GA) for non-royal Road branches Comparable in both success rate and #evaluations.

Harman and McMinn (2010) Categorize the branch and use the right algorithm 1. Easy branch: random search 2. Royal Road branch: GA 3. Non-Royal Road branch: hill climbing If we care only about coverage: hybrid Future direction Automatic identification of royal road properties Adaptiveness of hybrid algorithm Multiobjective formulation of the problem (e.g. oracle cost) Better objective function (Arcuri, 2010)

Forrest et al. (2009) Quick review of Forrest et al. (2009) in 30 seconds: Manipulate the AST using genetic programming (similar to GA) Reduce the search space with assumption on the possible patch of the bug The first automated software repairing algorithm that works on real problems

Future Direction 1. Improve search efficiency Adaptiveness, fitness function 2. Relieve restriction on the search space Capability of patching more bugs 3. Better formulation of the problem Multiobjective optimization

Bibliography I Arcuri, A. (2010). It does matter how you normalise the branch distance in search based software testing. In Proceedings of the Third International Conference on Software Testing, Verification and Validation, pages 205 214. Forrest, S., Nguyen, T., Weimer, W., and Le Goues, C. (2009). A genetic programming approach to automated software repair. In Proceedings of the 11th annual conference on Genetic and evolutionary computation, pages 947 954. Harman, M., Mansouri, S., and Zhang, Y. (2009). Search based software engineering: A comprehensive analysis and review of trends techniques and applications. Technical report. Harman, M. and McMinn, P. (2010). A theoretical and empirical study of search-based testing: Local, global, and hybrid search. IEEE Transactions on Software Engineering, 36(2):226 247.

Bibliography II Wolpert, D. and Macready, W. (2002). No free lunch theorems for optimization. IEEE Transactions on Evolutionary Computation, 1(1):67 82.

Royal Road for testing With a set a values S, if a predicate tests for the presence of properties exhibited by nonintersecting subset of S, the predicate has Royal Road property. Back