Using REST APIs as the communication channel in the web has continuously increased. Testing and verifying that these APIs work correctly is essential. Automatic test generation tools can quickly generate more tests compared to tests written by a developer or tester, but it is not clear if such tools actually give tangible value to software development.
To mitigate this issue, an automatic test generator is implemented. The generator automatically creates runnable REST API Robot Tests from the Swagger API descriptions. A case study is introduced where it is evaluated if the automatically generated REST API tests could have found real defects.
The results indicate that the generated tests are not very effective to find real defects in the case study, although the code coverage is increased. The defect detection percentage is 4\% and the false negative percentage 87,5\%. Especially problematic is the high false negative rate, as developers tend easily to ignore tools that create unreliable tests.
REST rajapintojen käyttö on yleistynyt web pohjaisissa sovelluksissa. Näiden rajapintojen testaaminen ja oikeellisuuden varmistaminen ovat keskeinen osa ohjelmistokehitystä. Automaattinen testien generointi on tapa tuottaa nopeasti testejä, mutta on epäselvää, auttavatko nämä testit löytämään oikeita bugeja.
Tätä kysymystä tutkitaan tekemällä automaattinen testigeneraattori. Tämä generaattori luo Robot Test REST rajapinta testejä Swagger-kuvauksista. Kyseisiä testejä ja ja niiden tehokkuutta arvioidaan tapaustutkimus projektia vasten. Tämän avulla pyritään selvittämään, löytävätkö generoidut testit oikeita bugeja.
Tulokset viittavaat siihen, että generoidut testit eivät ole kovin tehokkaita löytämään oikeita bugeja tapaustutkimusprojektissa, vaikka koodin testikattavuus nousee. Olemassa olevista bugeista havaittiin vain 4\%, ja virheellisiä havaintoja oli 87,5\% löydöksistä. Erityisen ongelmallista on suuri virheellisten havaintojen määrä, sillä sellaisia työkaluja, jotka tuottavat epäluotettavia testejä, ei yleisesti suosita käytettävän.