UML Generator - Use Case and Class Diagram
UML Generator - Use Case and Class Diagram
7182
Abstract— This research mainly is focused on There could be different ways of representing the same
automation of Unified Modeling Language (UML) semantic.
diagrams from the analyzed requirement text using Concepts that were not explicitly expressed in a written
Natural Language Processing (NLP). The looks and source are often very difficult to model. Usually, expert
styles of software engineering have been completely domain knowledge is needed to identify the hidden
changed in the recent times. Presently, software classes.
engineering follows the rules of Object Oriented design
patterns. All phases of software engineering are Design phase is the most important among the other phases
deviating from the conventions and new paradigms are because blueprint of a system helps developers to avoid all
more popular these days. Same is the case with Software the misunderstanding regarding the software by involving
analysis process which uses Unified Modeling Language the users. Requirement engineers analyze requirements
to map and model the user requirements. Analysis is the manually to come out with highly precise UML diagrams
key process of building modern information system for their systems. By modeling a system, most important
applications and base for the robust and vigorous aspect is to capture the dynamic behaviors. Static behaviors
software application’s design and development. are not sufficient to build models for a system rather using
Nowadays everybody needs a quick and reliable service. dynamic behaviors. Use case diagram shows dynamic
It was necessary to have some sort of quick, accurate aspects of a system with both internal and external
and intelligent software for generating UML based interactions. They describe the events of a system and their
documentations to save time and budget of both the user flows. However, the use cases never describe how they are
and system analyst [1]. implemented. When it comes to class diagrams its other
way around. The class diagrams can be defined as static
Keywords— UML Diagrams, Use Case Diagram, Class diagrams and they represent the static view of a system. A
Diagram, Natural Language Processing, Artificial class diagram contains classes of the system, their attributes,
Intelligence, Machine Learning, Software Design Phase operations and constraints imposed on the system. They can
be directly mapped with the object-oriented languages as
I. INTRODUCTION well. Therefore, to provide a dynamic and a static view of
the scenario, UML Generator generates use case and class
The automation of UML Diagrams using natural diagrams by analyzing the input text. This research will be
language processing is a highly challenging task due to the contributing towards filling the gap between gathered user
following reasons [2]. requirements and the phase of the implementation by
Natural language is arguable. Thus, detailed and error- sorting out the problems mentioned above[3].
free analysis is very difficult.
According to the norms and conventions, before drawing
the UML diagrams the system analyst has to do a lot of
work by analyzing the business logics and figuring out the
Manuscript received on 12th November, 2016. Recommended by Dr. user requirements. Out of the tools, the author considered
T.M.H.A.Usoof on 4th May, 2017. This paper is an extended version of the the absence of a software which provides services by
paper, "UML Generator An Automated System for Model Driven manually drawing UML diagrams more efficiently except
Development" presented on ICTer2016 Conference. Rational Rose and Smart Draw and there is no doubt that
these are reasonably good software but with many
Chamitha Narawita is a BEng(Hons) student at University of Westminster disadvantages. First, analysis is needed to investigate the
and following Master of Computer Science (MSC) at University of requirements and then draw the models separately. Hence,
Colombo. Currently working as a Software Engineer at Calcey
there is wastage of so much time when using current
Technologies. (e-mail: [email protected])
available tools to create UML models for the required
Kaneeka Vidanage is an M Phil candidate in semantic web from
University of Colombo and a lecturer at Informatics Institute of
scenario. Nowadays, everybody needs a quick and reliable
Technologies.. (e-mail: [email protected])
service. Moreover, the time spent on analyzing systems and
poor quality of human analysis shows the need of
automated support.
accuracy levels and performances, Logistics classifier has Maybe, sometimes, either, etc. indicates the Extend
been used to train the use case model. relationships. [8]
Divided to, either by, is a type of etc. indicates the use
case and class Generalizations. [9]
In, to, by, etc. indicated the class Associations.
Must, have, first, has to, etc. indicates the Aggregation.
[8]
As an option, depends on, do not have, etc. indicates
Composition.
Fig. 4 shows the structure of the XML file that has been
Fig. 3 Relationship recognition algorithm used to define the rules.
Let us assume there is a paragraph that consists of three
sentences. Using Natural Language Processing sentence
Root element of the XML file is defined as Rules. Within
tokenization happens and then C# algorithm will combine
the root element, can define any number of Rule elements
the sentence 1 and sentence 2 as shown in the figure. Then
with the name and the type of the rule whether it belongs to
it will send to the Weka relationship recognition model and
class diagram (Class) or use case (UseCase) diagram.
will output the voted values for each relationship type.
Using Condition elements, it defines specific terms inside
Same process will happen between sentence 1 and sentence
the Value attribute.
3 as well. Now there are two maximum values have been
selected and the highest voted value will be the relationship D. Diagram Generation
type between two sentences. The output of this system is a visual studio modeling
diagram project that consists of generated use case and class
As earlier mentioned Weka models have been used to diagram using selected actors, classes, use cases, attributes,
recognize the relationships between use cases and classes. use case relationships and class relationships.
In the Weka models, the author has defined some specific
words to identify the relationship types. There are many CASE tools to draw the UML diagrams.
StarUML and Rational Rose are some of famous tools
Must, should, required to, etc. indicates the Include currently using in the industry. UML Generator is an
relationships integrated solution for the Visual Studio (VS). To integrate
To gather the requirements the author has used online As shown in figure 6 and 7 respondents have responded to
questionnaires and interviews. the questions that asked regarding best diagrams to capture
the static and behavioral behaviors of a system (researcher
does not mention that the proposed system is going to
generate use case and class diagrams). According to the
which generates by the system should have higher level of 1. The user starts the web application by entering the URL
accuracy. of the website. After finish loading, the UML Generator
web application user has to enter the requirement text
III. HIGH LEVEL ARCHITECTURE inside the text area.
2. Entered text scenario will send to the NLP module and
then text tokenization will happen. Then extracts part-
of-speech (POS) tagging and UML Generator identifies
actors for the use case diagram and classes for the class
diagram using nouns of the POS tag vales. XML rule
based approach removes the unwanted words from the
identified nouns list and will output further accurate
results to the user.
Use cases were identified using the word chunking
technique in NLP. Usually to be an usecase there should
be a verb and a noun. Word chunking recognizes verb
phrases, noun phrases and prepositional phrases.
Therefore, use cases were created using consecutive
verb phrases with a noun phrases.
Technologies Tools
VI. TESTING
Currently author has tested the system with more than
twenty (20) scenarios and it has an accuracy level of around
70%. This value has been calculated according to the passed
test case results for all the scenarios.
Failed
Passed 30%
70% Passed
Failed
Blocked
Not Run
Paused
VII. EVALUATION
Detailed discussions of the evaluation results are:
Users will doubt the findings of the system. By adding a
testing module to the UML Generator will enhance the
accuracy level of the system.
Few evaluators have mentioned that Visual Studio is not
a suitable tool to generate the diagrams. The diagram
generation is a separate module from other functionalities
in UML Generator. Therefore, in future it will be easy to
replace the diagram generation module with any
diagramming tool. However, author’s enduring idea is to
introduce this application as a plugin to the Microsoft
Visual Studio.
Can extend the system by adding several other diagram
types as plugins to the UML Generator. Then users can
select the desirable diagram types, which are needed most.
User experience needs to be enhanced by improving user Fig. 14 Drawn diagrams by an evaluator
interfaces, accuracy and performances of the system.
Need to reduce the user involvement with the generation
of UML diagrams. Currently before producing the
diagrams, user can remove attributes, actors, classes, use
case relationships and class relationships. By identifying
highly accurate results, the system does not need to get
user inputs, can directly generate the diagrams.
Developers will forget UML by using the UML
Generator. However, they will get used to do designing
before the implementations because UML Generator
gives a quick understanding about the both static and
dynamic features of the scenario.
dynamic view of a scenario by generating class diagram and A new algorithm to identify the actors and classes
use case diagram. It will help the users of the system to get directly using Natural Language Processing without
a quick overview regarding the system that going to giving chance to select. This will reduce the user
develop. involvement in the system.
When writing the literature review it has found that earlier
D) Web Application
researchers were not used intelligence with this type of
research. Therefore, author has selected a different A help menu in website to guide the user throughout the
approach with some intelligence to identify associations for whole process.
the use case and class diagrams and to rate the use cases that Improve the usability and user experience.
identified using natural language processing. Moreover, Add more diagram types as plugins to the UML
author has developed his own algorithms to extract the use Generator.
cases using natural language processing word chunking.
The system has completed most of the functional ACKNOWLEDGMENT
requirements mentioned in the system requirement Authors of this paper acknowledge the support of all the
specification. Recognizing multiplicities functionality for people who provided their research papers, and those who
the classes is a highly important task when considering made these papers available on the web.
generating a class diagram. However, due to time limitation
with the undergraduate research, the author has kept it as a
future enhancement because it needs higher level of REFERENCES
intelligence and higher level of accuracy with the Weka [1] I. S. Bajwa, M. I. Siddique and M. A. Choudhary, "Rule based
models. Production Systems for Automatic Code Generation in Java," 2006
1st International Conference on Digital Information Management,
With the concern of evaluation and testing carried out, Bangalore, 2007, pp. 300-305.
system shows capability of generating use case and class [2] Joshi, s. (2012), Textual Requirement Analysis for UML Diagram
diagram according to the input scenario. With the use of Extraction, 3rd ed. [ebook] Prof. Dr. S. D. Joshi, p.1 Available at:
algorithms, which was produced by the author, the system http://www.ijctee.org/files/VOLUME2ISSUE3/IJCTEE_0612_12.p
df.
in question will be producing adequate results in a [3] Bhagat, S., Kapadni, P., Kapadnis, N., Patil, D. and Baheti, M. (2012),
reasonable time. However, ultimate results can prove that Class Diagram Extraction Using NLP, 1st ed. [ebook] International
the algorithm is a success and could adapt many different Journal of electronics, Communication & Soft Computing Science &
business scenarios. Then it is straightforward to attest that Engineering, p.1 Available at:
http://www.ijecscse.org/papers/SpecialIssue/comp2/190.pdf .
system is almost a good product. By writing business [4] Webopedia.com, (2015), What is rule-based system? A Webopedia
decisions in words, the system has conspicuous ability to Definition, [online] Available at:
identify those by analyzing style of writing of the user. http://www.webopedia.com/TERM/R/rule_based_system.html.
In conclusion, in the area of automation of UML diagrams [5] Moldovan, D. and Surdeanu, M. (2003), On the Role of Information
Retrieval andInformation Extraction in Question AnsweringSystems,
author has done a deeper analysis and improvements. With 1st ed. [ebook] Dallas: pringer-Verlag Berlin.
more fine-tuning this research could ultimately lead to a [6] Bajwa, I. and Hyder, I. (2007), UCD-generator - a LESSA
commercial product that could be widely used. application for use case design, 2007 International Conference on
Information and Emerging Technologies, [online] 1(1), pp.1-3,
Available at:
IX. FUTURE WORK http://www.researchgate.net/publication/4290733_UCD-generator_
_a_LESSA_application_for_use_case_design.
This is an undergraduate research and the scope was [7] Harmain H.M and Gaizauskas R., (2012), Natural Language
selected according to the given time period. Technology Processing and ObjectOriented Analysis, 1st ed. [ebook] UK:
changes every day and therefore opens up the window of Department of Computer Science University of Sheeld, p.1.
Available at:
opportunity for continuous improvement (including new http://www.dcs.shef.ac.uk/intranet/research/public/resmes/CS9808.
features) for this application in the future to make it even pdf.
better. [8] P. More, Generating UML Diagrams from Natural Language
Specifications, 1st ed. Pune: International Journal of Applied
A) Weka Module Information Systems, 2012, p. 1.
This system has identified use case and class [9] D. Deeptimahanti and R. Sanyal, Semi-automatic Generation of UML
relationships using classification. Using regression also Models from Natural Language Requirements, 1st ed. Association
could be a good approach. for Computing Machinery, 2011.