Robot Automation Testing of Software Using Genetic Algorithm
Robot Automation Testing of Software Using Genetic Algorithm
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
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.
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
13 12.92 17
Application of GA 14 13.5 18
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
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.