prototypes
Detail
Publication date: 1 de June, 2021J-USE (Model-driven Java code and JUnit tests generator)
Introduction
J-USE
is a model-driven Java code and JUnit test cases generator that takes as input
a domain model produced and validated with the USE (UML-based Specification Environment).
The latter allows to specify models using features found in UML class diagrams
(classes, associations, etc.), enriched with expressions in OCL (Object
Constraint Language) to specify both integrity and business constraints. J-USE
is particularly suited for developing BIS (business information systems)
applications, providing a quick prototyping framework. Generated code maps the
navigations on class diagrams allowable in OCL, therefore increasing
traceability between model and code and reversely. A seamlessness approach to
persistence, based on a pure object-oriented database, is used.
The
generated code is organized in three layers: the business layer, the
presentation layer and the persistence layer, that will be described herein.
This
layer includes a Java class for each UML class in the domain model, holding the
same name. Each generated class has one private attribute for every attribute
and for every association in the domain model. Besides, it contains public
constructors, selectors and modifiers for all attributes and associations (one
to one, one to many, many to many, association class to their members and
vice-versa) in the domain model. Object serializers and comparators are
provided as well. The syntax of the generated code follows OCL naming
conventions. Chosen Java collection types (Set/HashSet, List/ArrayList, SortedSet/TreeSet and Queue/ArrayDeque)
match closely the ones found in OCL (Set, Bag,OrderedSet and Sequence).
A public static allInstances() selector
allows retrieving all instances of this class from the object oriented
database.
This
layer includes a simple Swing interface that allows performing basic CRUD
operations on all classes of the problem domain. This layer includes the class Main_<domainModelName> that
contains the main() method.
This
layer provides a façade to interface Database for Objects (DB4O), an open
source object database engine available at http://www.db4o.comThis
façade provides basic CRUD (create, read, update and delete) capabilities,
along with cleanup and lookup ones.
This
generator produces JUnit test cases that exercise all of the generated Java
code. In other words, the generated test cases provide a 100% coverage.
The
JUSE toolkit was developed by Fernando Brito e Abreu and
has been used for teaching Software Engineering and MDD (model-driven
development) topics at the university where he serves as a teaching staff
member. J-USE includes a facade (API) that allows any Java program to interact
with the USE tool. This API has been used as a middleware component of several
research projects such as:
- the M2DM (Metamodel Driven Measurement tool), an
Eclipse plugin for Java metrics formalization and
collection - the JUSE for Android, a
model-driven Eclipse plugin for generating Android BIS
apps
URL | http://code.google.com/p/j-use/ |
---|---|
Date | 01/02/2012 |