Automatiska tester med Postman i IBM Cloud
Eronen, Valtteri (2019)
Eronen, Valtteri
2019
All rights reserved. This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-2019060114010
https://urn.fi/URN:NBN:fi:amk-2019060114010
Tiivistelmä
Examensarbetet redovisar för hur man kan skapa automation i form av automatiska tester för integrationer som är byggda med IBM:s egna utvecklade mjukvara App Connect Studio, hur man skapar Postman-samlingar och kör dem med kommandotolken och hur man konfigurerar de automatiska testerna till en delivery pipeline som är en del av en automatiserad verktygskedja. Verktygskedjan byggs upp i IBM Cloud med produkten IBM Cloud DevOps. Grund principen för att ha en delivery pipeline och automatiska tester är för att spara tid då man inte behöver utföra manuella tester varje gång det sker en ändring i integrationerna. Istället skulle verktygskedjan aktiveras och exekvera testerna på alla integrationerna varje gång det sker en ändring i versionhanteraren. Alla tester som skapats är regressionstester och varje enskilda integration har sin egen Postman samling med specifika tester just för denna enskilda integration. Postman-samlingarnas grundtanke är att samla ihop ett antal HTTP-anrop som kommunicerar med en REST API där varje integration fungerar som en slutpunkt som går att anropa i API:n. Själva regressionstesternas funktionalitet är i grund och botten det att man med ett HTTP-anrop skickar ett meddelande till API:n som pekar på integrationen som sedan efter prosseseringen skickar responsen tillbaka till API:n. Nästa HTTP-anrop i samlingen tar upp responsen av integrationen och utför regressionstesterna som sedan visas upp som lyckade eller misslyckade i loggarna i IBM Cloud. I examensarbetets teoretiska del ges det en översikt på olika nivåer av test som kan utföras. Det redovisas centrala skillnader mellan enhetstester, integrationstester och E2E-tester och när det lönar sig att använda dem. I den teoretiska delen redovisas också metoder för hur man kan skapa mjukvarutester beroende på hurdan mjukvaran är som bör testas. Metoderna som presenteras i examensarbetet är den s.k. ”Big Bang” metoden, ”Top-to-Bottom” och ”Bottom-to-Top. The thesis presents how to create automation in the form of automatic tests for integra-tions built with IBM's own developed software App Connect Studio, how to create Postman collections and run them with the command prompt and how to configure the automatic tests for a delivery pipeline that is part of an automated toolchain. The tool-chain is built in IBM Cloud with the product IBM Cloud DevOps. The basic principle of having a delivery pipeline and automatic tests is to save time when you do not have to perform manual tests every time there is a change in the integrations. Instead, the tool-chain would be activated and execute the tests on all the integrations every time there is a change in the version control. All tests created are regression tests and each individual integration has its own Postman collection with specific tests for just this one integration. The basic idea of the Postman collections is to collect several HTTP requests that com-municate with a REST API where each integration acts as an endpoint that can be called in the API. The functionality of the regression tests themselves is basically that with an HTTP request a message is sent to the API, which points to the integration which then after the processing sends the response back to the API. The next HTTP call in the collec-tion addresses the response of the integration and performs the regression tests that then appear as successful or unsuccessful in the logs in IBM Cloud. In the thesis's theoretical part, an overview is given at different levels of tests that can be performed. Central dif-ferences between unit tests, integration tests and E2E tests and when it’s useful to use them. The theoretical part also describes methods for how to develop software tests, de-pending on what the software is that is going to be tested. The methods presented in the thesis work are the so-called "Big Bang", "Top-to-Bottom" and "Bottom-to-Top methods.