Wednesday , April 24 2024

Using Software Metrics for Automatic Software Design Improvement

Zsuzsanna Marian
Babeş-Bolyai University
1, M. Kogălniceanu Street, Cluj-Napoca, 400084, Romania

Gabriela Czibula
Babeş-Bolyai University
1, M. Kogălniceanu Street, Cluj-Napoca, 400084, Romania

István Gergely Czibula
Babeş-Bolyai University
1, M. Kogălniceanu Street, Cluj-Napoca, 400084, Romania

Abstract: In this paper we are approaching the problem of improving the quality of a software system design, an important issue during the evolution of object oriented software systems. Starting from the fact that software metrics are essential in measuring the software quality, we introduce a metric based high dimensional representation of the elements of a software system (application classes and methods from the application classes) and we define a distance semi-metric between the elements of the software system. An experimental validation of the distance semi-metric on two case studies is provided. The obtained results illustrate that the distance function introduced in this paper can be successfully used for improving the internal structure of software systems, highlighting this way the potential of our proposal.

Keywords: Software Metric, Software Design, Refactoring.

>>Full text

CITE THIS PAPER AS: Zsuzsanna MARIAN, Gabriela CZIBULA, Istvan Gergely CZIBULA, Using Software Metrics for Automatic Software Design Improvement, Studies in Informatics and Control, ISSN 1220-1766, vol. 21 (3), pp. 249-258, 2012. https://doi.org/10.24846/v21i3y201203

1. Introduction

It is well-known that maintenance and evolution represent important stages in the lifecycle of any software system (about 66% from the total cost of the software systems development). Even if a software product efficiently performs all its specified functions, it is very important to evaluate the software quality. The software product may be hard to understand and difficult to modify and this leads to excessive costs in software maintenance, and these costs are not trivial. Consequently, improving the quality of a software system design is the most important issue during the evolution of object oriented software systems.

Nowadays is essential to produce software with proper quality levels, low content of residual errors, flexible, portable and with high reliability figures [22]. Those targets imply the use of new techniques and models, new metrics and the contribution of software engineering tools [1]. Engineers and analysts frequently need to evaluate the performance of software or a portion of it, such as software modules in the early stages of design or just at the end of the development stage. It is a need to know how complex the design is or if one design is more complex than another [7].

Aims and relevance of our approach

Software metrics [13] are widely used to measure the software quality. In this direction, many tools have been already developed to computing metrics for quality assessment. Many researches have been conducted in order to highlight that software metrics alone are not enough to characterize software quality [19]. To solve this problem, most of advanced validated quality models aggregate software metrics, by computing averages (simple or weighted average) of metrics.

Most of the existing software metrics are computed individually, for each software component, and not for the entire software system [19]. We are studying in this paper how multiple software metrics defined for the components of the software system (in our approach application classes and methods from the application classes) can be used in order to improve the quality of a software system.

Instead of aggregating different software metrics, as in most existing approaches, we are proposing, for each element of a software system, a high dimensional representation, a vector consisting of several relevant software metrics and properties of the element. We are focusing on improving the quality of the software system design, and this should be reflected in the high dimensional representation of the elements from the software system.

In this paper we are considering an element from the software system as being an application class from the system or a method from an application class. Further extensions may increase the granularity level of our approach, also considering the attributes from the application classes, the modules or the software components.

When considering a metric based high dimensional representation of an element from the software system, we have started from the intuition that it would be useful in the following directions.

  1. First, to define a distance semi-metric function between the elements of the software system. This distance function may be used for:
  • Identifying the refactorings [10] that would improve the internal structure of the software system, without altering its external behaviour. An automatic and scalable approach for refactorings identification would be very useful in assisting software developers in their daily work of maintaining software systems. The distance semi-metric function may be adapted in order to identify aspect oriented [3] refactorings, also.
  • Identifying places in an existing software system where design patterns [11] should be introduced in order to increase the clarity of the system and to facilitate its further evolution.
  1. The second direction that can be approached is to use data mining techniques [15] in order to discover relevant patterns and rules in the software system, i.e. high dimensional representation of its elements.

Mining the system would be useful in identifying parts of it that are inappropriately defined.

All the above enumerated activities may be important steps in improving the quality of a software system’s design and are directions that we want to further research. We are starting our research with investigating the first direction. More exactly, we are focusing in this paper on highlighting how the metric based multi dimensional representation of an element within the software system can be used for improving the internal structure of the software system, by suggesting the appropriate refactorings.

The contributions of this paper are: (i) definition of a metric based high dimensional representation for the elements within a software system, using several software metrics that were adapted to our goal, (ii) definition of a distance semi-metric between the elements of the software system, (iii) experimental validation of the distance semi-metric on two case studies.

The rest of the paper is structured as follows. Section 2 presents an overview on software metrics, also indicating approaches existing in the literature that use software metrics for improving the quality of software systems. Our approach in defining a distance semi-metric between the elements of the software system, based on a high dimensional representation of the constituting elements is introduced in Section 3. Section 4 provides an experimental validation on two case studies of the distance semi-metric function previously defined. An analysis of our approach is given in Section 5. Section 6 presents the conclusion of the paper and outlines directions to improve our approach.

References:

  1. ASAM, R., N. DRENKARD, H. MAIER, Qualitatsprufung von Software-produkten, Siemens AG Verlag, Berlin, 1986.
  2. ASM: (ObjectWeb: Open Source Middleware) http://asm.objectweb.org/.
  3. BABAMIR, S. M., Active Program Analysis using Rule-based Modification and Aspectation, Studies in Informatics and Control, vol.20 (4), 2011, pp. 381-392.
  4. BROWN, J. R., M. LIPOW, The Quantitative Measurement of Software Safety and Reliability, Technical Report TRW Report No. SDP-1776, TRW Software Series, 1973.
  5. CHIDAMBER, S. R., C. F. KEMERER, Towards a Metrics Suite for Object-oriented Design, Conference Proceedings on Object Oriented Programming Systems, Languages, and Applications, 1991, pp. 197-211.
  6. CHIDAMBER, S. R., C. F. KEMERER, A Metrics Suite for Object Oriented Design, IEEE Transactions on Software Engineering, no. 20, 1994, pp. 476-493.
  7. CURTIS, B., S. B. SHEPPARD, P. MILLIMAN, M. A. BORST, T. LOVE, Measuring the Psychological Complexity of Software Maintenance Tasks with the Halstead and McCabe Metrics, IEEE Transactions on Software. Engineering, no. 5, 1979, pp. 96-104.
  8. CZIBULA, I., G. SERBAN, Improving Systems Design using a Clustering Approach, International Journal of Computer Science and Network Security, no. 6, 2006, pp. 40-49
  9. DEMARCO, T., Structured Analysis and System Specification, Software pioneers: contributions to software engineering, 2002, pp. 529-560
  10. FOWLER, M., Refactoring: Improving the Design of Existing Code, Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1999.
  11. GAMMA, E., R. HELM, R. JOHNSON, J. VLISSIDES, Design Patterns: Abstraction and Reuse of Object-oriented Design, 2002, pp. 701-717.
  12. GAMMA, E., (JHotDraw Project) http://sourceforge.net/projects/jhotdraw.
  13. GRADY, R. B., Practical Software Metrics for Project Management and Process Improvement, Prentice Hall Press, 1992.
  14. GZARA, M., A. ESSABRI, Balanced Explore-Exploit Clustering based Distributed Evolutionary Algorithm for Multi-objective Optimisation, Studies in Informatics and Control, no. 20, 2011, pp. 97-106.
  15. HAN, J., Data Mining: Concepts and Techniques, Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 2005.
  16. HENRY, S., D. KAFURA, Software Structure Metrics based on Information Flow, IEEE Transactions on Software Engineering, no. 7, 1981, pp. 510-518.
  17. LI, W., S. HENRY, Object Oriented Metrics which Predict Maintainability, Journal of Systems and Software, no. 23, 1993, pp. 111-122.
  18. MAISIKELI, S.G., Aspect Mining using Self-Organizing Maps with Method Level Dynamic Software Metrics as Input Vectors, PhD thesis, Nova Southeastern University, 2009.
  19. MORDAL-MANET, K., J. LAVAL, S. DUCASSE, N. ANQUETIL, F. BALMAS, F. BELLINGARD, L. BOUHIER, P. VAILLERGUES, T. J. MCCABE, An Empirical Model for Continuous and Weighted Metric Aggregation, Proceedings of CSMR ’11, Washington, DC, USA, IEEE Computer Society, 2011, pp. 141-150.
  20. PRESSMAN, S., Software Engineering: A Practitioner’s Approach, McGraw-Hill Education, 2005.
  21. ROCA, J. L., An Entropy-based Method for Computing Software Structural Complexity, Microelectronics and Reliability, no. 36, 1996, pp. 609-620.
  22. ROCA, J. L., A New Entropy based Method for Computing Software Structural Complexity, Technical Report ARN-PI-2002-8, Autoridad Regulatoria Nuclear, Buenos Aires, 2002.
  23. RUBEY, R. J., R. D. HARTWICK, Quantitative Measurement of Program Quality, Proceedings of ACM ’68, New York, NY, USA, ACM, 1968, pp. 671-677.
  24. SENG, O., J. STAMMEL, D. BURKHART, Search-based Determination of Refactorings for Improving the Class Structure of Object-oriented Systems, Proceedings of GECCO ’06, New York, ACM Press, 2006, pp. 1909-1916.
  25. SIMON, F., F. STEINBRUCKNER, C. LEWERENTZ, Metrics based Refactoring, Proceedings of CSMR ’01, Washington, DC, USA, IEEE Computer Society, 2001, pp. 30-38.