0% found this document useful (0 votes)
44 views

Robot Automation Testing of Software Using Genetic Algorithm

The document discusses using genetic algorithms to generate test data for automated robot testing of software. It proposes a method using a genetic algorithm to optimize test data for robot testing. A robot framework is implemented where data generated by the genetic algorithm is received and then used as a request body to test fitness values and generate necessary test data sets for the robot testing. Recently, population-based metaheuristic search techniques like evolutionary testing have been utilized for software testing due to advantages over traditional testing methods.

Uploaded by

VKB Library iisu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Robot Automation Testing of Software Using Genetic Algorithm

The document discusses using genetic algorithms to generate test data for automated robot testing of software. It proposes a method using a genetic algorithm to optimize test data for robot testing. A robot framework is implemented where data generated by the genetic algorithm is received and then used as a request body to test fitness values and generate necessary test data sets for the robot testing. Recently, population-based metaheuristic search techniques like evolutionary testing have been utilized for software testing due to advantages over traditional testing methods.

Uploaded by

VKB Library iisu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Proc.

of the International Conference on Electrical, Computer, Communications and Mechatronics Engineering (ICECCME 2023)
19-21 July 2023, Tenerife, Canary Islands, Spain
2023 3rd International Conference on Electrical, Computer, Communications and Mechatronics Engineering (ICECCME) | 979-8-3503-2297-2/23/$31.00 ©2023 IEEE | DOI: 10.1109/ICECCME57830.2023.10253052

Robot Automation Testing of Software Using Genetic


Algorithm.
Vinod Yadav Raphael Kwaku Botchway Roman Senkerik Zuzana Oplatkova Kominkova
Faculty of Applied Informatics Faculty of Applied Informatics Faculty of Applied Informatics Faculty of Applied Informatics
Tomas Bata University in Zlin Tomas Bata University in Zlin Tomas Bata University in Zlin Tomas Bata University in Zlin
Zlin, Czech Republic Zlin, Czech Republic Zlin, Czech Republic Zlin, Czech Republic
[email protected] [email protected] [email protected] [email protected]

Abstract—The demand for excellent software has significantly using genetic algorithms [3]. In the field of software
increased in recent years, bringing the importance of testing- engineering, the development of automation has been gradual
related challenges into the limelight. When generating test data for when it comes to the verification and validation of software
software testing, the test data must be able to unearth potential through dynamic testing. The creation of test data automatically
software defects, while the test adequacy criterion guarantees the is mostly a human process. Software testing is still the key
quality of test cases. However, optimizing test data during method for increasing consumer confidence in the product. Any
software testing can improve software reliability. Recently, software system's testing procedure is laborious, expensive, and
population-based metaheuristic search techniques (e.g., time-consuming. A developing field of study that allows for the
evolutionary testing) have been utilized in software testing. In this
cross-pollination of concepts from two different areas is the use
study, we propose and implement a method that utilizes a genetic
algorithm to optimize test data for robot testing. Due to its
of artificial intelligence (A.I.) methods in software engineering
advantages over traditional testing methods, several businesses (S.E.). Software testing using artificial inelegance was the
have recently started using robot-automated testing systems for subject of research by many scientists, who looked at how A.I.
various applications. We implement a Robot Framework (R.F.) may be used effectively for tasks linked to S.E. that are
where we receive the data generated by a genetic algorithm. intrinsically knowledge-intensive and human-centered. Due to
Furthermore, this generated data then acts as a request body for these problems, it is necessary to examine if search algorithms,
R.F. to test the fitness values and use the generated data as our such as heuristic metaheuristics, are appropriate [4].
necessary data sets.

Keywords—Genetic Algorithm, Machine Learning, Robot A. Related Work


Testing, Robot Framework, Software Testing, Software Reliability
The authors of [8] suggested a system for software testing
I. INTRODUCTION where various types of genetic algorithm (G.A.) types are
studied. Various algorithms have been tested using various
To ensure the dependability of each software, software tools, and the results of these tests have been examined. While
testing is regarded as a crucial task that must be carried out. these techniques are based on evolutionary testing, their cost
Problems in the program can be found through this testing functions vary considerably. After executing them on various
procedure, and the software's comprises evaluation can be tools, observations are made regarding how these cost functions
facilitated. Although more test cases make the testing process behave. This research focuses on genetic algorithm-driven
more expensive, keeping software reliability while reducing the automated testing, and we would like to implement a Robot
number of test cases is still a significant difficulty in software Framework (R.F.) [2] where we receive the data generated by a
testing. This study focuses on automated testing that is powered genetic algorithm. This generated data then acts as a request
by genetic algorithm (G.A.) [9] and robot-automated testing body for R.F. to test the fitness values and use the generated data
(RAT)[1]. The demand for excellent software has significantly as our necessary data sets.
increased in recent years, equally bringing the significance of
testing-related challenges into the limelight. To reduce expenses B. Robot Framework (R.F.)
and improve the overall effectiveness of the testing process, it is A free online automation testing framework called (R.F.) is
essential to evaluate how prone to errors software is [2]. used for test-driven development acquisition, testing, and
Creating test data is one of the most crucial phases of structural acquisition. For writing test cases, it leverages a variety of tests,
testing. A series of statements on which test data is applied, an including data-driven, keyword, and behavior tests. For writing
input, and the resulting output comprises a test data set. Static test cases, it employs a variety of tests, including keyword,
data must be provided, or the program must run with every behavior, and data-driven tests. Through its external libraries,
possible combination of input from the program input domain to R.F. provides automation and database tests. It is regarded as a
locate the test data. One of the hardest problems that the testers general-purpose, open-source automation platform distributed
must solve is the generation of data. This study mainly focuses under Apache License 2.0 (including libraries and ecosystem
on studies that generate test data and test cases for robot testing tools). R.F. automates robotic process automation and tests

979-8-3503-2297-2/23/$31.00 ©2023 IEEE

Authorized licensed use limited to: ISRO - Vikram Sarabhai Space Centre. Downloaded on January 04,2024 at 10:50:44 UTC from IEEE Xplore. Restrictions apply.
(RPA). Many industry-leading companies use it to create their pool. These pairs will match to be able to have new candidate
software since it is dynamically supported. Since R.F. is open solutions, which is known as a chromosomal meeting.
and extendable, it may be combined with any other tool to create Following the selection of their chromosomal mates, these
reliable and flexible automation systems. Since it is open source, partners switch a segment of their string in accordance with a
there are no additional fees for license or usage. It includes some cross-over site, which is known as gene swapping.
third-party libraries for databases, collections, JSON, strings,
and more. It contains tools intended for use with the R.F. After In genetic algorithms, mutation is rare but considered a very
starting an action, we can launch any form of SQL query in our important subject. In a chromosome, mutation refers to the
database library to check the outcomes. Operating systems are erroneous bit flipping from 0 to 1 or 1 to 0. Fig. 1 illustrates the
irrelevant to RF-based applications. JPython (JVM) and Iron genetic algorithm's whole workflow.
Python (.Net) are used by R.F., with Python as the primary
framework. The prerequisite libraries for robot automation and
database testing must first be installed, following which we must
add them to the robot's setting components and start the database
connection. We would be able to write the necessary SQL
queries in test cases after the database was connected, and we
would then be able to create scripts for the testing. Using the
robot architecture and sample SQL queries, Algorithm1
demonstrates database connectivity.

C. Genetic Algorithm(GA)
For a variety of optimization issues, genetic algorithms are
the heuristic search methods that are employed. The biological
evolution process and the "survival of the fittest" tenet of
Darwin's theory are mimicked by genetic algorithms [10]. A
population of INDIVIDUALS is made to evolve through
successive generations, allowing the greatest traits of each
generation to be passed on to the following one as a result of the
genetic algorithms. Most of the time, they are excellent, but
occasionally they might need to be improved. However, they do,
generally speaking, raise the calibers of our searches. Fig. 1 Fig. 1. Entire process of genetic algorithm.
displays the block diagram for the genetic algorithm's
fundamental process. It is necessary to produce the initial II. METHODOLOGY DEPLOYED
population of individual solutions or chromosomes during the
initializing phase. Genetic algorithms start in this way. The term Before we begin the robot automation software testing, the test
"chromosome" refers to a collection of input variable values case requirements must be made. The two main tools covered in
derived from the input domain. The quantity and range of the this study are the R.F. and the G.A. Due to its advantages over
input values affect the chromosome's shape and length. traditional testing methods, several businesses have recently
Calculating each chromosome's fitness value is part of the started using robot-automated testing systems for various
evaluation process. Each chromosome's fitness is evaluated with applications. This study segment lists five test automation tools
the overall ideal solution. It gauges how near a chromosome is for test automation Unit tests, SoapUI, Selenium, R.F., and
to the general ideal state. Compared to the chromosome with a PowerMock that other researchers have recently used.
lower fitness value, the one with a higher fitness value is closer Beginning with no prior knowledge, the selection is effectively
to the global optimum [7]. random. As more points are sampled over time, the decision
becomes more knowledgeable. In a G.A., the population serves
as the memory, and different operators are applied to the
There are several key operations in G.A. (see Fig. 1): individuals based on their fitness to choose the next point in the
Selection, Crossover, and Mutation. The selection operation is search space to sample [5]. The program input domain is divided
performed as follows. A few chromosomes from the current using structural, functional, and fault-based testing
population are replicated based on how well-fit they are. methodologies based on predetermined standards. Structural
According to the fundamental tenet of natural selection, testing, often known as white-box testing, is based solely on the
"chromosomes with high fitness survive while those with low source code. Functional testing, or "black-box testing," is
fitness die out." As a result, the next generation inherits only the
different since it depends on input parameters and results. The
best traits from the one before them. A pool of chromosomes
that can mate to produce offspring is the result of selection. input domain is divided into sections by fault-based software
Crossover is activated once a mating pool has been established. testing based on the test data's capacity to identify flaws. Test
In essence, two chromosomes exchange genetic material at data that satisfies test criteria are manually or automatically
random. There is a crossover site that controls this exchange. chosen after establishing subdomains. Using random ways to
Two chromosomes were randomly selected from the mating generate test data is simple and less expensive. Until the test

Authorized licensed use limited to: ISRO - Vikram Sarabhai Space Centre. Downloaded on January 04,2024 at 10:50:44 UTC from IEEE Xplore. Restrictions apply.
criteria are satisfied, test data are created randomly. Generating TABLE I. DISPLAYS AVERAGE AND MAXIMUM FITNESS VALUES ACROSS
GENERATIONS.
test data with a higher likelihood of exposing more flaws is not
guaranteed. However, it is also possible that impossible Generation Average Fitness Maximum Fitness
execution routes will not be found. Additionally, test data can be Value values
produced using symbolic execution. As representations of Initial 3.02 6
software pathways, this method generates algebraic expressions.
Regarding input variables and path execution circumstances, 1 3.96 7
symbolic expressions of program output variables are derived.
Nevertheless, there are restrictions. Infinite execution routes 2 4.88 8
could result from loops, for example. Symbolic execution is
more efficient, even if it is more expensive than random 3 5.66 10
generation. [6]. In this instance, the inputs for a single P
4 6.48 10
execution, or a single set of test data, are represented by a binary
string, also known as a binary individual [5]. The entire process
5 7.24 12
of creating test data is described in Fig. 2.
6 8.08 12
Generating Test Data with Genetic Algorithm
7 8.82 15

8 9.62 15
Methodology For Computing
9 10.3 16

ML Approach 10 10.98 16

11 11.72 17

Bio-Inspired Optimization 12 12.38 17

13 12.92 17

Application of GA 14 13.5 18

Fig. 2. Description of the entire data-generating process. 15 14.02 18

A. Testing Techniques for Genetic Algorithm Data 50 26.22 30


Generation
100 30.74 32
We are selecting two parent test cases for our practice
portion of the assignment from the current population, where the
150 31.82 32
likelihood of selection increases with fitness. Selection is
performed "with replacement," which means that the same test 200 31.92 32
case pair may be chosen to become a parent more than once.
Crossover the couple at a randomly selected location using the
crossover probability to create two offspring or child cases.
Create two identical test cases for each parent case if there is no Table 1 shows data for up to 200 generations, starting with
crossover. The two offspring cases should be altered with a an initial population with an average fitness value and
mutation probability of Pm, and the new population should then continuing through 200 generations with average and maximum
contain the resulting pair of test cases. Random members of the fitness values. Additionally, multiple types of data, such as
new population may be eliminated. Substitute the new test cases binary, integer, and hex data, can be produced according to our
for those currently being run [8]. There are two main values: needs using a genetic algorithm.
average and maximum fitness values, as indicated in Table 1.
With a population size of 50 and the number of generations is
200, genetic data is being generated. B. Implementation of G.A. for Data Generation
The Genetic Algorithm has been implemented in Java, and
testing is done using an R.F. The first of our four distinct
endpoints transmit the starting population for as many
generations as we will use a G.A. to generate data. After
receiving this generated data, we will request a post to evaluate
each population's fitness value. Additionally, we have three

Authorized licensed use limited to: ISRO - Vikram Sarabhai Space Centre. Downloaded on January 04,2024 at 10:50:44 UTC from IEEE Xplore. Restrictions apply.
separate endpoints. At the first endpoint, we will submit a
request of type post along with population numbers and Average and Maximum Fitness
generational breakdown. The new population's average and
maximum fitness values will also be obtained as the response to Values
the first endpoint. The new population, test case 1 and with a 35
better fitness value than the initial population, will be sent to the

Average and maximum fitness values


second endpoint as part of the request body from the first end- 30
point. The third and final endpoint, test case 2, which has the 25
most outstanding value ever, will proceed similarly. The data
20
that we just described is displayed in Fig. 3.
15
10
5
Generated Data from GA 0
35
Average and Maximum fitness values

30
Generations from initial 0 200
25
20
Average fitness values Maximum fitness values
15
10 Fig. 4. Average and maximum fitness values based on generations.
5
III. DISCUSSION AND CONCLUSION
0
In this article, we examined how evolutionary methods, like
G.A.s, aided robot automation testing of software. Fig. 4
displays the findings and how robot automation testing using
G.A. becomes effective even as the number of test cases
increases. Random testing methods lose efficiency as code
Populattion Generations complexity increases since data points do not depend on one
another over time. G.A. is reused to generate test cases
automatically, which helps to improve the effectiveness and
Fig. 3. Presented data generated by G.A.
turnaround time of robot automation testing of software. It is
possible to use evolutionary test case creation, which is more
The variance in average fitness values over the generation is
effective and affordable than random testing tools. Furthermore,
seen in Fig. 3. Every generation, the average fitness levels
we can use the data generated by the G.A. to satisfy our needs
increase. in the R.F. fully. Additionally, we can replace static data with
dynamically generated data using a G.A. since we can produce
C. Analysis of Fitness Values Over Generation
as many datasets as per our requirements.
Fig. 4 depicts the variation in fitness values over the generation.
The fitness values have been slightly raised with each
generation. Even though it has been slightly increased in each
test case, for illustration purposes, let us describe test case 1 and
generation 1. We generated a data set using G.A., tested
generation one in case 1, and compared it to generation 1 and
tested case 2 data. As a result, the fitness values have grown.
Similarly, we tested the identical data in case 3 of the same
generation, and the fitness value was somewhat higher. And we
continued with it from generation 1 to 100 for each of the three
scenarios, always obtaining a higher value.

Authorized licensed use limited to: ISRO - Vikram Sarabhai Space Centre. Downloaded on January 04,2024 at 10:50:44 UTC from IEEE Xplore. Restrictions apply.
Fig. 5. Reports detailing the status of each test case produced by R.F.

IV. ACKNOWLEDGMENT
This work was supported by the Internal Grant Agency of [4] P. R. Srivastava,& T. H. Kim, (2009). Application of genetic algorithm
the Tomas Bata University in Zlin, under the project number in software testing. International Journal of software Engineering and its
Applications, 3(4), 87-96.
IGA/CebiaTech/2023/004. The resources of A.I. Lab further
[5] A.Pachauri, & G. Srivastava, (2013). Automated test data generation for
supported the work at the Faculty of Applied Informatics, branch testing using genetic algorithm: An improved approach using
Tomas Bata University in Zlin (ailab.fai.utb.cz). branch ordering, memory and elitism. Journal of Systems and Software,
86(5), 1191-1208.
[6] D. S.Rodrigues, M. E.Delamaro, C. G. Corrêa, & F. L. Nunes, (2018).
Using genetic algorithms in test data generation: a critical systematic
REFERENCES mapping. ACM Computing Surveys (CSUR), 51(2), 1-23.
[1] V.Yadav, R. K.Botchway, R.Senkcrik, & Z. O. Kominkova, (2021, [7] R. Malhotra, & M. Garg (2011). An adequacy based test data generation
December). Ro-bot Testing from a machine learning perspective. In 2021 technique using genetic algorithms. Journal of information processing
International Conference on Electrical, Computer and Energy systems, 7(2), 363-384.
Technologies (ICECET) (pp. 1-4). IEEE.
[8] A.Sharma, Patani, R., & Aggarwal, A. (2016). Software testing using
[2] V.Yadav, R. K.Botchway, R.Senkerik, & Z. K. Oplatkova, (2021, genetic algorithms. International Journal of Computer Science &
December). Robotic Automation of Software Testing From a Machine Engineering Survey, 7(2), 21-33.
Learning Viewpoint. In Mendel (Vol. 27, No. 2, pp. 68-73).
[9] J. H.Holland, (1992). Adaptation in natural and artificial systems: an
[3] A.Surendran, & P. Samuel, (2017). Evolution or revolution: the critical introductory analysis with applications to biology, control, and artificial
need in genetic algorithm based testing. Artificial Intelligence Review, intelligence. MIT press.
48(3), 349-395.
[10] S. Mirjalili (2019). Genetic algorithm. In Evolutionary algorithms and
neural networks (pp. 43-55). Springer, Cham.

Authorized licensed use limited to: ISRO - Vikram Sarabhai Space Centre. Downloaded on January 04,2024 at 10:50:44 UTC from IEEE Xplore. Restrictions apply.

You might also like