Available online at www.sciencedirect.com Available online at www.sciencedirect.com
ScienceDirect ScienceDirect
Procediaonline Computer 00 (2019) 000–000 Available at Science www.sciencedirect.com Procedia Computer Science 00 (2019) 000–000
ScienceDirect
www.elsevier.com/locate/procedia www.elsevier.com/locate/procedia
Procedia Computer Science 150 (2019) 743–750
13th International Symposium “Intelligent Systems” (INTELS’18) 13th International Symposium “Intelligent Systems” (INTELS’18)
Analysis of the AnyWalker Software Architecture Using Analysis of the AnyWalker Software Architecture Using the UML Refactoring Tool the UML Refactoring Tool
O. Deryuginaa,a,*, E. Nikulchevaa, I. Ryadchikovbb, S. Sechenevbb, E. Shmalkocc O. Deryugina *, E. Nikulchev , I. Ryadchikov , S. Sechenev , E. Shmalko a
MIREA – Russian Technological University, Institute of Integrated Security and Special Instrument Engineering, 119454 Prospect Vernadskogo 78, Moscow, MIREA – Russian Technological University, Institute of Integrated SecurityRussia and Special Instrument Engineering, b 119454 Prospect 78, Moscow, Russia Kuban State University, 350040Vernadskogo Stavropolskaya Street 149, Krasnodar, Russia c University, 350040 Stavropolskaya 149, Krasnodar, Russia Moscow, Russia Federal ResearchbKuban CenterState “Computer science and control” of RAS,Street 119333 Vavylova Street,44/2, c Federal Research Center “Computer science and control” of RAS, 119333 Vavylova Street,44/2, Moscow, Russia a
Abstract Abstract Refactoring (restructuring of a system, which keeps its functionality invariant) of the software can be aimed at the optimization Refactoring (restructuring of a system, maintainability which keeps itsand functionality invariant)Model of therefactoring software can at thenot optimization of such characteristics as modifiability, understandability. canbe be aimed conducted only at the of such characteristics modifiability, Model are refactoring canusing be conducted not only at the code level, but also atasthe model level.maintainability According to and the understandability. MDA approach models described the Unified Modelling code level,(UML). but alsoUML at the model level. are According the MDA approach models UML are described using Unifiedtool, Modelling Language class diagrams used to to specify software architecture. Refactoring is the a software which Language (UML). UML classanalysis diagrams arerefactoring. used to specify software architecture. Refactoring is a software tool,diagram which provides UML class diagram and This article proposes resultsUML of AnyWalker project UML class provides UML diagram analysis and refactoring usingclass the UML Refactoring tool.refactoring. This article proposes results of AnyWalker project UML class diagram refactoring using the UML Refactoring tool. © 2019 The Author(s). Published by Elsevier B.V. © 2019 The Authors. Published by Elsevier B.V. © 2019 The Author(s). Published bythe Elsevier B.V. This is an an open access article license (https://creativecommons.org/licenses/by-nc-nd/4.0/) (https://creativecommons.org/licenses/by-nc-nd/4.0/) This is open access article under under the CC CC BY-NC-ND BY-NC-ND license This is an open access article under the CC BY-NC-ND license Peer-review under responsibility of the scientific committee of the 13th Peer-review under responsibility of the scientific committee of the (https://creativecommons.org/licenses/by-nc-nd/4.0/) 13th International International Symposium Symposium “Intelligent “IntelligentSystems” Systems”(INTELS’18) (INTELS’18). Peer-review under responsibility of the scientific committee of the 13th International Symposium “Intelligent Systems” (INTELS’18) Keywords: UML Refactoring; AnyWalker; refactoring; software architecture; clas diagram; model refactoring; MDA. Keywords: UML Refactoring; AnyWalker; refactoring; software architecture; clas diagram; model refactoring; MDA.
1. Introduction 1. Introduction Refactoring – is the restructuring of a system, which keeps its functionality invariant. Refactoring of the software is the restructuring of a characteristics system, which as keeps its functionality invariant.and Refactoring of the software canRefactoring be aimed at–the optimization of such modifiability, maintainability understandability. can be aimed at the optimization of such characteristics as modifiability, maintainability and understandability.
* Corresponding author. * Corresponding E-mail address:author.
[email protected] E-mail address:
[email protected] 1877-0509 © 2019 The Author(s). Published by Elsevier B.V. 1877-0509 © 2019 The article Author(s). by Elsevier license B.V. (https://creativecommons.org/licenses/by-nc-nd/4.0/) This is an open access underPublished the CC BY-NC-ND This is an open access article under CC BY-NC-ND license (https://creativecommons.org/licenses/by-nc-nd/4.0/) Peer-review under responsibility of the scientific committee of the 13th International Symposium “Intelligent Systems” (INTELS’18) Peer-review under responsibility of the scientific committee of the 13th International Symposium “Intelligent Systems” (INTELS’18)
1877-0509 © 2019 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license (https://creativecommons.org/licenses/by-nc-nd/4.0/) Peer-review under responsibility of the scientific committee of the 13th International Symposium “Intelligent Systems” (INTELS’18). 10.1016/j.procs.2019.02.005
744 2
O. Deryugina et al. / Procedia Computer Science 150 (2019) 743–750 O. Deryugina et al. / Procedia Computer Science 00 (2019) 000–000
Refactoring can be conducted at the source code level as well as at the model level. Model refactoring can be conducted on the architecture design stage and on the stage of the source code development and maintenance. According to the MDA approach [1] models are described using the Unified Modelling Language (UML) [2]. UML class diagrams are used to specify software architecture. Nowadays many researchers have investigated different means of UML class diagram transformation and analysis. First of all, special software quality metrics have been developed, some of them can be applied to the UML class diagrams: CBO [3], DIT [3], NOC [3], NOM [3], DAC [4], DAC’ [3], SIZE 2 [4], DSC [5], etc. Secondly, many articles have been written about using SBSE (Search Based Software Engineering) [6] methods of the UML class diagram refactoring [7-11]. For, example in [11] authors propose Darwin tool, which uses GA [12] to find such a set of transformations (design patterns), which optimize fitness function value. However, it is possible to use another approach, according to which refactoring system proposes a list of transformations, which decrease/increase fitness function value. So, the main goal is not to optimize fitness function value, but to support architecture design process in the form of an advisory system. The UML Refactoring tool [5,13] implements this approach. Then the problem of the UML class diagram refactoring can be formulated as follows: Assume that there is a UML class diagram d, a set of semantically equivalent transformations T, and a fitness function f(d). Then it is required to find such a set of pairs {t,E}, that: d’=t(d,E), Δf(d’)<0, where E is a subset of the diagram elements (classes, interfaces, relations), d’ is a diagram, attained as a result of the initial diagram d transformation. 2. AnyWalker ultra-mobile chassis AnyWalker [14] is an ultra-mobile chassis for service robots, which is able: to move on a difficult terrain; to open doors, push buttons, carry some payload; to work within the narrow spaces of vestibules and sewers; to maneuver in weightlessness conditions with the help of the flywheels; to overcome obstacles, exceeding the chassis size. AnyWalker chassis with the body diameter from 40 cm to 1.5 is able to move within any kind of environment, even if it is not adapted for humans, in cross-country. AnyWalker stabilisation system itself can be integrated into other service robots, anti-accident stabilization systems for transport, construction objects for earthquake prevention, devices for reducing the pitching of small ships, the object positioning systems, devices for people with disabilities (powered exoskeleton, 3D mobile wheelchair). Open architecture of the software and hardware robotic platform allows to build specific solutions for robotic systems based on AnyWalker chassis. AnyWalker serves as an educational learning platform for mechanics, programming, robotics, cybernetics and control science in hobby groups, schools, universities and enterprises. The official site of the AnyWalker project is www.anywalker.ru. 3. The UML Refactoring tool All The UML Refactoring tool provides UML class diagram analysis and transformation. The analysis of UML class diagrams includes object-oriented metrics calculation (classes count, interfaces count, relations count, Average DIT, Average CBO, Average NOC, Average NOM, Average NLM, Average DAC, DAC’, SIZE2, DSC) and searching for the transformations, which decrease/increase value of the fitness function. The list of transformations available includes Strategy, Façade and Interface Insertion.
O. Deryugina et al. / Procedia Computer Science 150 (2019) 743–750 O. Deryugina et al. / Procedia Computer Science 00 (2019) 000–000
745 3
The process of the refactoring using the UML Refactoring tool can be described as follows: Step1. Object-oriented architecture of the software system is described as a UML class diagram. Step 2. UML class diagram is exported to the XMI format [15]. Step 3. UML Refactoring tool takes UML class diagram in the XMI format as input. Step 4. Object oriented metrics for the diagram are calculated. Step 5. Fitness function for the refactoring is chosen. Step 6. Fitness function minimization/maximization is chosen. Step 7. A list of transformations, which decrease/increase fitness function value, is proposed. Step 8. One of the transformations is applied, if required. Go to step 4. The official site of the UML Refactoring project is www.uml-refactoring.ru. Main functional blocks of the UML Refactoring tool are shown in Fig. 1.
Fig. 1. Functional blocks of the UML Refactoring tool
The algorithm CDTA (Class Diagram Transformation Analysis) of searching for a set of pairs {t,E}, which decrease/increase fitness function value can be described as follows:
1. 2. 3. 4. 1. 2. 3. 4. 5. 6.
for each tϵT L = search(t,d,f) //seach for pairs {t,E} Q.add(L) //add pairs {t,E} to the result list return Q
The function search(t,d,f) can be described as follows:
L1 = analyze(t,d) //search for pairs for each eϵL1 d’ = refactor(e,t,d) //apply transformation t to the diagram d if (f(d’) < f(d)) //or if (f(d’) > f (d) L2.add(t,e) //add transformation to the list return L2
4. The analysis of the AnyWalker software architecture using the UML Refactoring tool UML class diagram of the AnyWalker software is shown in Fig. 2.
746 4
O. Deryugina et al. / Procedia Computer Science 150 (2019) 743–750 O. Deryugina et al. / Procedia Computer Science 00 (2019) 000–000
Fig. 2. The UML class diagram of the AnyWalker software architecture
The result of the initial analysis of the class diagram using the UML Refactoring tool is shown in Fig. 3.
Fig. 3. The result of the initial analysis of the AnyWalker software architecture using the UML Refactoring tool
O. Deryugina et al. / Procedia Computer Science 150 (2019) 743–750 O. Deryugina et al. / Procedia Computer Science 00 (2019) 000–000
747 5
Metrics calculated by the UML Refactoring tool for the AnyWalker software architecture are shown in Table 1. Table 1. Metrics calculated for the AnyWalker UML class diagram using the UML Refactoring tool. Metric number
Metric title
Value
1
Classes count
6.0
2
Interfaces count
0.0
3
Relations count
6.0
4
Avg. DIT
0.0
5
Avg. CBO
2.0
6
Avg. NOC
0.0
7
Avg. NOM
7.333
8
Avg. NLM
0.0
9
Avg. DAC
0.0
10
DAC’
0.0
11
SIZE2
11.0
12
DSC
7.18
4.1. Coupling minimization refactoring Let us choose the coupling minimization as the aim of the refactoring. The coupling characteristic affects the complexity of the software testing, debugging and maintenance. One of the possible metrics, which evaluates the coupling level, is the Average CBO (Coupling Between Objects) metric. The UML Refactoring tool has proposed the transformation shown in Table 2 with the Average CBO given as the fitness function of the refactoring. Table 2. Transformations proposed for the AnyWalker UML class diagram using the UML Refactoring tool with the Average CBO given as the fitness function. Transformation number 1
Transformation title
Parameters
Δf(d)
Interface Transformation
Class: Servo
-0.167
As a result of the transformation the value of the Average CBO metric has decreased from 2 to 1.833. The UML class diagram attained as a result of the transformation is shown in Fig. 4. 4.2. Class size minimization refactoring Now, let us choose the class size minimization as the aim of the refactoring. The class size characteristic affects the software testing, debugging and maintenance difficulty. One of the possible metrics, which evaluate the class size level, is the Average NOM (Number of Methods) metric. The UML Refactoring tool has proposed the transformation shown in table 3 with the Average NOM given as the fitness function of the refactoring.
O. Deryugina et al. / Procedia Computer Science 150 (2019) 743–750 O. Deryugina et al. / Procedia Computer Science 00 (2019) 000–000
748 6
Table 3. Transformations proposed for the AnyWalker UML class diagram using the UML Refactoring tool with the DSC given as the fitness function. Transformation number 1
Transformation title
Parameters
Δf(d)
Facade Transformation
Inner Classes: Servo, Driver
-1.047
As a result of the transformation the value of the Average NOM metric has decreased from 7.333 to 6.286. The UML class diagram attained as a result of the transformation is shown in Fig. 5.
Fig. 4. UML class diagram attained as a result of the coupling minimization refactoring
O. Deryugina al. / Procedia Computer Science 150 (2019) 743–750 O. Deryugina et al. et / Procedia Computer Science 00 (2019) 000–000
7497
Fig. 5. UML class diagram attained as a result of the class size minimization refactoring
5. Conclusion UML Refactoring tool has been successfully applied to analyze and refactor UML class diagram describing the AnyWalker project software architecture. The study showed, that application of the Façade and Interface Insertion transformations will improves the values of Average CBO and Average NOM metrics, which affect software modifiability, testing and debug ability, and maintenance. The further research should investigate more transformations, which can be applied during the refactoring. This work was used in the project № 8.2321.2017 of the state task of the Ministry of Science and Education of the Russian Federation for the AnyWalker [16] architecture analysis.
O. Deryugina et al. / Procedia Computer Science 150 (2019) 743–750 O. Deryugina et al. / Procedia Computer Science 00 (2019) 000–000
750 8
Acknowledgements The work results were used within framework of the state task of the Russian Ministry of Education and Science, project No. 8.2321.2017 “Development and adaptation of control systems for compensation of dynamic deflecting effects on mobile objects in a state of dynamic equilibrium”. References [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]
OMG Model Driven Architecture (http://www.omg.org/mda). OMG Unified Modelling Language UML. Version 2.5 (http://www.omg.org/spec/UML/2.5). Chidamber S., Shyam R., and Kemerer C. A metrics suite for object oriented design. IEEE Transactions on software engineering. 1994; 20(6):476–493. Li W., and Henry S.. Maintenance metrics for the object oriented paradigm. Software Metrics Symposium, 1993. Proceedings., First International. IEEE, 1993. p. 52–60. Nikulchev E., Deryugina O. Model and Criteria for the Automated Refactoring of the UML Class Diagrams. International Journal of Advanced Computer Science and Applications. 2016;7(12):76–79. Harman M., Mansouri S. A., Zhang Y. Search-based software engineering: Trends, techniques and applications. ACM Computing Surveys (CSUR), 2012; 45(1). p. 11. Räihä O. A survey on search-based software design. Computer Science Review, 2010; 4(4):203–249. Amoui M., Mirarab S., Ansari S. and Lucas C. A genetic algorithm approach to design evolution using design pattern transformation. International Journal of Information Technology and Intelligent Computing, 2006; 1(2):235–245. Bowman M., Briand L. C., Labiche Y. Solving the class responsibility assignment problem in object-oriented analysis with multi-objective genetic algorithms. IEEE Transactions on Software Engineering, 2010; 36(6):817-837. Simons C. L., Smith J., White P. Interactive ant colony optimization (iACO) for early lifecycle software design. Swarm Intelligence, 2014; 8(2):139–157. Vathsavayi S. et al. Tool support for software architecture design with genetic algorithms. Software Engineering Advances (ICSEA), 2010. P. 359-366. Goldberg D. E., Holland J. H. Genetic algorithms and machine learning. Machine learning. 1988; 3(2):95–99. UML Refactoring project (http://www.uml-refactoring.ru). AnyWalker project (http://anywalker.ru). XML Metadata Interchange (XMI) Specification. Version 2.4.2 (http://www.omg.org/spec/XMI/2.4.2) Ryadchikov I. et al. Development of robotic mobile platform with the universal chassis system. IOP Conference Series: Materials Science and Engineering, IOP Publishing. 1 (312); 2018. P. 012021.