{"title":"Test Data Generation for Dynamic Unit Test in Java Language using Genetic Algorithm","authors":"Zhela Jalal Rashid, M. F. Adak","doi":"10.1109/UBMK52708.2021.9558953","DOIUrl":null,"url":null,"abstract":"Random test data generators are among the most widely used tools to generate input data for the tests. However, the data types and parameters have to be manually tailored into the tools and need to be updated manually once the source code or the test cases are changed. It is a costly process and takes a lot of time and effort to generate and update these data. Various test data generator tools are available, such as random test data generators, symbolic evaluators, and function minimization methods. In recent years some more advanced heuristic search techniques have been applied to software testing. In this study, we propose a model which automates the test data generation process. It significantly reduces the time required to generate the input data. At the same time, the data generated by our model outperforms the data generated randomly in terms of the accuracy and sensibility of the input data. It is based on the most widely used heuristic algorithm, the genetic algorithm (GA). We run the model on a sample class with six independent public methods of the different method signature, return type, and several arguments. It takes 5 seconds to generate ten possible inputs for each method with a mean, standard deviation of 0.15 and best candidate fitness average of 8.82, and means fitness of 9.79.","PeriodicalId":106516,"journal":{"name":"2021 6th International Conference on Computer Science and Engineering (UBMK)","volume":"21 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-09-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2021 6th International Conference on Computer Science and Engineering (UBMK)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/UBMK52708.2021.9558953","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2
Abstract
Random test data generators are among the most widely used tools to generate input data for the tests. However, the data types and parameters have to be manually tailored into the tools and need to be updated manually once the source code or the test cases are changed. It is a costly process and takes a lot of time and effort to generate and update these data. Various test data generator tools are available, such as random test data generators, symbolic evaluators, and function minimization methods. In recent years some more advanced heuristic search techniques have been applied to software testing. In this study, we propose a model which automates the test data generation process. It significantly reduces the time required to generate the input data. At the same time, the data generated by our model outperforms the data generated randomly in terms of the accuracy and sensibility of the input data. It is based on the most widely used heuristic algorithm, the genetic algorithm (GA). We run the model on a sample class with six independent public methods of the different method signature, return type, and several arguments. It takes 5 seconds to generate ten possible inputs for each method with a mean, standard deviation of 0.15 and best candidate fitness average of 8.82, and means fitness of 9.79.