Archive | 2021

Generating Automatic Unit Tests of JavaScript Code from UML Class and Activity Diagrams

 
 

Abstract


As testing phase plays a significant role in the software lifecycle, all facilitations that can speed up and automate this process seem to be very useful. One of the biggest group of approaches covers automatic test generation. In this paper, we describe our solution for fully automated unit test generation from UML class and activity diagrams. We have adapted and completely redesigned two algorithms from the literature. The first of them tests conformance of types of attributes and method return values between the class diagram and class implementation. The second one serves as a basis for testing all paths of the activity diagram. As a result, we generate tests in dynamically typed language, JavaScript, in the format required by Jest testing framework. We have implemented this approach in the extensible UML2Test tool, a plug-in to StarUML modeling environment. The tool generates complete executable unit tests from the UML model, so it can be used in conjunction with the test-driven development methodology. Usefulness of our approach and tool was successfully verified on the exemplary system for recruitment support.

Volume None
Pages 189-196
DOI 10.5220/0010401401890196
Language English
Journal None

Full Text