Comparing Spring REST API test frameworks : A Comparison Study

University essay from Linnéuniversitetet/Institutionen för datavetenskap och medieteknik (DM)

Abstract: This bachelor thesis presents a comparison of three Java testing frameworks - JUnit 5,TestNG and Spock - with the purpose of evaluating their suitability in testing RESTAPIs built with Spring Boot. As the demand for reliable and high-quality softwaresystems continues to grow, automated testing techniques are crucial in ensuring thecorrect functionality of applications. Our study aims to fill the knowledge gap in thecurrent literature by focusing on unit tests for Java REST APIs running on the Springframework.We developed a single Spring Boot application and applied tests written using thethree selected testing frameworks. We then compared the performance of the frame-works based on execution time, memory usage and code conciseness. Additionally,we conducted a questionnaire to gather developer preferences for the frameworks.Our findings reveal that TestNG outperforms JUnit 5 in terms of performance, whileSpock requires fewer characters, making it more concise. However, JUnit 5 remainsthe most well-known and widely used testing framework among developers. Theresults of our study provide valuable insights into the performance and developerpreferences of the selected testing frameworks.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)