Flakiness in automated web application end-to-end testing
Kiskonen, Nelli (2020-05-26)
Flakiness in automated web application end-to-end testing
Kiskonen, Nelli
(26.05.2020)
Julkaisu on tekijänoikeussäännösten alainen. Teosta voi lukea ja tulostaa henkilökohtaista käyttöä varten. Käyttö kaupallisiin tarkoituksiin on kielletty.
suljettu
Julkaisun pysyvä osoite on:
https://urn.fi/URN:NBN:fi-fe2020061744826
https://urn.fi/URN:NBN:fi-fe2020061744826
Tiivistelmä
Automated regression tests verify that changes in the software do not introduce new errors into previously tested components. Developers rely on the results of these tests to decide whether the code changes are ready to be submitted or the system is ready for deployment. One challenge with automated tests is that they can be flaky, which means that the same test can pass and fail on different test runs even though the tested code has not changed. The goal of this thesis is to study the flakiness issue in web application end-to-end testing.
The research questions in this study are: What problems flaky tests cause? What are the main reasons for test flakiness? And how to fix flaky test cases? Flakiness issue was first examined by researching previous studies. In the second phase, end-to-end tests were implemented for a web application with Cypress testing tool. Different reasons that caused flakiness in the test cases, and their fixing strategies, are discussed in this thesis. At the end of the study, the fixing strategies were validated by running all tests 50 times in different modes. The results of this study were compared to the previous studies.
6 out of 14 issues that were described in the previous studies, also caused flakiness in this study. Additionally, three other reasons caused flakiness. The main conclusion of this work is that test flakiness is a big problem in end-to-end testing, it makes testing more complicated and increases costs. The root cause of flakiness is usually found from the test case, but flakiness can also be caused by the code of the application under test. In addition, flakiness can be related to the testing tool or be caused by external reasons, such as remote services. Automatisoidut regressiotestit varmistavat, että muutokset ohjelmistossa eivät tuo uusia virheitä aiemmin testattuihin komponentteihin. Ohjelmistokehittäjät luottavat regressiotestien tuloksiin päättääkseen, voidaanko koodimuutokset viedä eteenpäin tai onko ohjelmisto valmiina käyttöönottoon. Yksi automatisoitujen testien kanssa ilmenevä haaste on testien epädeterministisyys, mikä tarkoittaa, että sama testi voi saada eri tuloksen eri testiajoilla, vaikka testattu koodi ei ole muuttunut. Tämän työn tavoite on tutkia testien epädeterministisyyden ongelmaa web-sovelluksen päästä päähän testauksessa.
Työn tutkimuskysymykset ovat: Mitä ongelmia epädeterministiset testit aiheuttavat? Mitkä syyt aiheuttavat epädeterministisyyttä? Ja kuinka epädeterministisiä testejä voidaan korjata? Aihetta tarkasteltiin ensin käymällä läpi aikaisempia tutkielmia aiheesta. Työn toisessa osassa web-sovellukselle toteutettiin päästä päähän testejä käyttäen Cypress testaustyökalua. Työssä käydään läpi erilaisia syitä, jotka aiheuttivat epädeterministisyyttä testeissä, ja niiden korjausvaihtoehtoja. Työn lopussa korjaukset validoitiin ajamalla kaikki testit erilaisissa moodeissa. Tämän työn tuloksia verrattiin aikaisempien tutkimuksien tuloksiin.
Aikaisemmista tutkimuksista löytyi 14 syytä testien epädeterministisyydelle ja tässä työssä niistä esiintyi kuusi. Lisäksi löytyi kolme muuta epädeterministisyyden aiheuttajaa. Tämän työn johtopäätös on, että testien epädeterministisyys on iso ongelma päästä päähän testauksessa, se tekee testauksesta monimutkaisempaa ja lisää kuluja. Epädeterministisyyden syy löytyy yleensä testin koodista, mutta myös testattavan ohjelmiston koodi voi olla epädeterministisyyden aiheuttaja. Epädeterministisyys voi liittyä myös testaustyökalun toimintaan tai ulkoisiin tekijöihin, kuten kolmansien osapuolien palveluihin.
The research questions in this study are: What problems flaky tests cause? What are the main reasons for test flakiness? And how to fix flaky test cases? Flakiness issue was first examined by researching previous studies. In the second phase, end-to-end tests were implemented for a web application with Cypress testing tool. Different reasons that caused flakiness in the test cases, and their fixing strategies, are discussed in this thesis. At the end of the study, the fixing strategies were validated by running all tests 50 times in different modes. The results of this study were compared to the previous studies.
6 out of 14 issues that were described in the previous studies, also caused flakiness in this study. Additionally, three other reasons caused flakiness. The main conclusion of this work is that test flakiness is a big problem in end-to-end testing, it makes testing more complicated and increases costs. The root cause of flakiness is usually found from the test case, but flakiness can also be caused by the code of the application under test. In addition, flakiness can be related to the testing tool or be caused by external reasons, such as remote services.
Työn tutkimuskysymykset ovat: Mitä ongelmia epädeterministiset testit aiheuttavat? Mitkä syyt aiheuttavat epädeterministisyyttä? Ja kuinka epädeterministisiä testejä voidaan korjata? Aihetta tarkasteltiin ensin käymällä läpi aikaisempia tutkielmia aiheesta. Työn toisessa osassa web-sovellukselle toteutettiin päästä päähän testejä käyttäen Cypress testaustyökalua. Työssä käydään läpi erilaisia syitä, jotka aiheuttivat epädeterministisyyttä testeissä, ja niiden korjausvaihtoehtoja. Työn lopussa korjaukset validoitiin ajamalla kaikki testit erilaisissa moodeissa. Tämän työn tuloksia verrattiin aikaisempien tutkimuksien tuloksiin.
Aikaisemmista tutkimuksista löytyi 14 syytä testien epädeterministisyydelle ja tässä työssä niistä esiintyi kuusi. Lisäksi löytyi kolme muuta epädeterministisyyden aiheuttajaa. Tämän työn johtopäätös on, että testien epädeterministisyys on iso ongelma päästä päähän testauksessa, se tekee testauksesta monimutkaisempaa ja lisää kuluja. Epädeterministisyyden syy löytyy yleensä testin koodista, mutta myös testattavan ohjelmiston koodi voi olla epädeterministisyyden aiheuttaja. Epädeterministisyys voi liittyä myös testaustyökalun toimintaan tai ulkoisiin tekijöihin, kuten kolmansien osapuolien palveluihin.