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

Agnieszka Malanowska, Adrianna Małkiewicz-Błotniak

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.

Download


Paper Citation


in Harvard Style

Malanowska A. and Małkiewicz-Błotniak A. (2021). Generating Automatic Unit Tests of JavaScript Code from UML Class and Activity Diagrams. In Proceedings of the 16th International Conference on Evaluation of Novel Approaches to Software Engineering - Volume 1: ENASE, ISBN 978-989-758-508-1, pages 189-196. DOI: 10.5220/0010401401890196


in Bibtex Style

@conference{enase21,
author={Agnieszka Malanowska and Adrianna Małkiewicz-Błotniak},
title={Generating Automatic Unit Tests of JavaScript Code from UML Class and Activity Diagrams},
booktitle={Proceedings of the 16th International Conference on Evaluation of Novel Approaches to Software Engineering - Volume 1: ENASE,},
year={2021},
pages={189-196},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0010401401890196},
isbn={978-989-758-508-1},
}


in EndNote Style

TY - CONF

JO - Proceedings of the 16th International Conference on Evaluation of Novel Approaches to Software Engineering - Volume 1: ENASE,
TI - Generating Automatic Unit Tests of JavaScript Code from UML Class and Activity Diagrams
SN - 978-989-758-508-1
AU - Malanowska A.
AU - Małkiewicz-Błotniak A.
PY - 2021
SP - 189
EP - 196
DO - 10.5220/0010401401890196