350 rub
Journal Information-measuring and Control Systems №1 for 2012 г.
Article in number:
Approach to formalize the process of refactoring-based metrics of object-oriented code using graphs
Authors:
N. A. Zabolotko
Abstract:
As a rule, in the process of developing its structure destroyed. For solution this problem, apply the refactoring - techniques for software development, which aims to improve the quality of object-oriented (OO) structure with preservation of its functional behavior. There are many approaches to the formalization of the refactoring, the main of which can be divided into two groups. First, depending on possible ways to find code defects («bad smells») can distinguish to semantic, syntactic, and based on code metrics. The second group is a approach to provide information within the process. They can be divided into the graph, matrix, using another special notations (UML, ADL, etc.) and any of it.
We can determine following stages of refactoring: a preliminary evaluation of a software system, identifying bad smells, planning and restructuring, evaluation of the quality and correctness of the refactoring.
In the first phase primarily we must verification code compliance program for criterion of testability. Also at this stage is analyzing the program and AST transformation in a special presentation - program graph. This approach uses a modified version of it (specified types of vertices and edges). The software graph ? a typed attributed directed graph G = (V, E), where V - the set of types of vertices, E - the set of types of edges.
To identify code defects using hybrid object-oriented metrics that based on a simple metric or metric functions from them. After finding and localization of defects we get a set of possible refactorings, some of which are mutually exclusive or part of the sequence. Thus, we obtain a multicriteria problem, depending on the specific priorities for the stage of defining the objectives of this problem is solved. For solution this porblem we construct a set Opt X. Refactorings described in terms of schemes, rules, which declaratively define refactorings rules. These rules are implemented by adding a graph of the variables and the mechanism for cloning nodes.
The next step is evaluating quality and correctness of the refactoring. For assessment quality of software used metric-snapshot of the program. To evaluate each of aspects structur of program there is a group of metrics, then we construct a function of quality for all classes. These functions are calculated, based on the metric`s before and after refactoring. In the case value of the quality aspect refactoring less than before the refactoring, we should talk about the deteriorating quality and as a consequence - to roll back the program to the previous version. Also from the definition of refactoring is necessary to prove that the external liabilities of the system have not changed. Shortcomings reasonable choice is the functional integration testing.
The main feature of the proposed approach is to find refactorings and their localization. Due to these qualities, reduces capacity on computing resources compared to approaches based on the total test or complete rebuilding of code. Also, localization can reduce the risk of uncontrolled changes in other parts of program through the allocation of all classes of tightly bound.
Pages: 65-70
References
- Фаулер М.Рефакторинг: улучшение существующего кода. СПб.: Символ-Плюс. 2004. C. 430.
- Groner G., Parreiras F., Staab S. SemanticRecognitionofOntologyRefactoring //OntologiesLecture Notes in Computer Science. 2010. V. 6496. P. 273-288.
- Kataoka Y.,Ernst M.,Griswold W. G.,Notkin D. Automated Support for Program
Refactoring using Invariants //Proceedings
of the IEEE International Conference on Software Maintenance (ICSM'01). 2001. P. 384-391. - Mens T., Taentzer G., Runge O. Analysing refactoring dependencies using graph transformation. Springer-Verlag. 2007.
- Pissanetzky S. Refactoring with Relations. A new Method for Refactoring Object-Oriented Software // SciControls.com. 2006.
- Sunye G., Pollet D., LeTraon Y., Jezequel J. Refactoring UML models // Proc. UML. 2001. P.142-148.
- Hoffman B., Janssens D., Van Eetvelde N. Cloning and Expanding Graph Transformation Rules for Refactoring // Electronic Notes in Theoretical Computer Science (ENTCS). 2006. V. 152.P. 53-67.
- Gerlec C., Hericko M. Evaluating Refactoring with a Quality Index // World Academy of Science. Engineering and Technology. 2010. V. 63.P.43-56.
- Mantyla M. Developing new approaches for software design quality improvement based on subjective evaluations // ICSE. IEEE Computer Society. 2004. Р. 48-50.