Please use this identifier to cite or link to this item: https://www.um.edu.mt/library/oar/handle/123456789/71720
Title: Investigating the use of genetic algorithms in automated test case generation
Authors: Gatt, Cristina (2020)
Keywords: Genetic algorithms
Computer software -- Testing
Issue Date: 2020
Citation: Gatt, C. (2020). Investigating the use of genetic algorithms in automated test case generation (Bachelor's dissertation).
Abstract: Search-Based Software Testing is the reformulation of the test case generation problem as a search problem and uses optimization techniques such as Genetic Algorithms to nd the optimal feasible solution. Genetic Algorithms (GAs), inspired by the Theory of Natural Selection, reflect the process of nature where the fi ttest individuals are more likely to reproduce and create offspring, while allowing less fit individuals to reproduce so as not to kill diversity. Due to advancements in technology, the access of features of an application from another application have become common practice using REST APIs. This study investigated the use of Genetic Algorithms in automatic test case generation for a non-trivial REST API library focusing on the effect of the fi tness function and the state of the database. In order to investigate the effect of the fitness function, two fi tness functions were developed. The first fitness function was based only on coverage. In a bid to improve the obtained results, a second fitness function was developed based on the concept of journey factors and tours as in exploratory testing to guide the GA to an optimal solution. To investigate the effect of the state of the Database (DB), the DB was reset (1) after every iteration and (2) after every test case in different experiments. The concept of Simulated Annealing was also introduced to avoid the GA getting stuck in a local optimum. The experiments were carried out using a REST API for an open-source invoicing application. In general, the GA did not surpass the results generated by the random approach in terms of coverage. On evaluating this result, it was noticed that the chosen REST API did not have a lot of interdependent calls. Nevertheless, the GA whose fitness function was influenced by an appropriate number of Journeys, provided better results than the GA whose fitness function was based only on coverage. Furthermore, when evaluating the realism of the generated test cases, the test cases outputted by the GA resembled more the test written by a human tester than those generated by the random approach. The state of the database affected the GA, with the experiments in which the DB was reset after every iteration converging much faster than the others, which lead us to conclude that for optimal results, the database should not be reset after every test case. Further work should be carried out such as experimenting with other REST APIs and finding the best approach for a GA to produce the best possible test suite as well as refi ning the implementation of the fitness functions.
Description: B.SC.(HONS)COMP.SCI.
URI: https://www.um.edu.mt/library/oar/handle/123456789/71720
Appears in Collections:Dissertations - FacICT - 2020
Dissertations - FacICTCS - 2020

Files in This Item:
File Description SizeFormat 
20BCS008 - Gatt Cristina_.pdf
  Restricted Access
1.65 MBAdobe PDFView/Open Request a copy


Items in OAR@UM are protected by copyright, with all rights reserved, unless otherwise indicated.