1. Trang chủ
  2. » Thể loại khác

DSpace at VNU: Class Diagram Based Evaluation of Software Performance

6 105 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 6
Dung lượng 144,82 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

From a class diagram, we determine the parameters which are used to evaluate and build formula of the measures such as Size of Class Variables, Size of Class Methods, Size of Instance Va

Trang 1

Class Diagram Based Evaluation of Software Performance

Pham Van Huong and Nguyen Ngoc Binh University of Engineering and Technology Vietnam National University, Hanoi, Vietnam huongpv@gmail.com and nnbinh@vnu.edu.vn

ABSTRACT

The evaluation of software performance in the early stages of the software life cycle is important and it has been widely studied In the software model specification, class diagram is the important object-oriented software specification model The measures based on a class diagram have been widely studied to evaluate quality of software such as complexity, maintainability, reuse capability, etc However the software performance evaluation based on Class model has not been widely studied, especially for object-oriented design of embedded software

Therefore, in this paper we propose a new approach to directly evaluate the software performance based on class diagrams From a class diagram, we determine the parameters which are used to evaluate and build formula of the measures such as Size of Class Variables, Size of Class Methods, Size of Instance Variables, Size of Instance Methods, etc Then, we do analysis of the dependence of performance on these measures and build the performance evaluation function from class diagram Thereby we can choose the best class diagram based on this evaluation function

Keywords: Software Performance, Software Architecture Specification, Class Diagram, Measures, SPE –

Software Performance Engineering, Performance Evaluation, Performance Model

1 INTRODUCTION

Nowadays, with the strong development of software engineering, the methods and techniques specifying software architecture have been studied and widely applied The evaluating software in design time, especially in evaluating the performance has been studied by the different approaches A very good common approach is the Software Performance Engineering (SPE): based on the UML model which is added performance information to transform to the performance model from the annotated UML model [1, 15, 16 and 17] In SPE methods, designer must add the performance information to UML diagrams such as use case diagram, class diagram, activity diagram, sequence diagram, component diagram, deployment diagram, then extract information to transform into the performance model such as Queuing Network, Layered Queuing Network, Petri Net, etc and evaluate the system performance from the performance model [17, 18, 19 and 20] These studies do not analyze and evaluate the software performance directly from the UML models specifying the software architecture

In the UML diagrams, the class diagram is used to specifying the logical view of software architecture and it is used often when designing the object oriented software Therefore, structure of the class diagram and elements in the class diagram have the great influence on the performance and other software quality measures So in this paper we

focus on analyzing the dependence of performance on the elements and the structure of the class diagram We do not

aim to estimate software performance from class diagram We only aim to build the performance evaluation function

to able to compare and choose the class diagram which has the better performance

The measures, used to evaluate software quality in the design phase based on class diagrams, given in [7-14] focus

on the architecture complexity, maintenance capabilities, the reuse ability and encapsulation of software The measures are based on parameters such as the number of classes in the diagram, the number of attributes and methods

of each class, the number of relationships, type of relationship among classes, inheritance depth, the overridden methods, the inheritance methods, etc However, these studies did not analyze software performance through class diagram In the research [5], authors proposed some parameters such as the number of classes in a diagram, the number of methods, the number of attributes and data types, etc and analyzed the dependence of performance on this parameter However, the authors did not describe details and neither built the performance evaluation formula directly The approach of the research [5] is also based on SPE approach

Trang 2

After a review of previous researches, we select the suitable parameters and analyze the dependence of performance on these parameters to build the formula of measures which affect to the software performance These measures are directly derived from class diagram and are used to construct the software performance evaluation

function The rest of the paper is organized as follows: Section 2 – analyzing the dependence of software performance

on parameters in the class diagram, constructing of measures affecting to the software performance and constructing

the software performance function based on these measures; Section 3 – deployment of some experimental case

studies by steps: (1) from the same application, design two different class diagram, (2) calculate the measures and the value of the performance function from two class diagrams, (3) implement two programs that are correspond to two class diagrams, (4) run two programs and evaluate the actual performance; (5) construct the performance statistic

chart to check the correction of the performance function and actual performances; Section 4 – conclusion and future

work

CLASS DIAGRAM 2.1 Parameters

Classes are central components in the class diagram A class is a template expressing a set of objects with the same attributes and behaviors A class diagram consists of a set of packages, classes, interfaces, relationships and constraints To construct the performance evaluation function on the class diagram, firstly we derive parameters affecting to the software performance directly from the class diagram These parameters are described in Table I

Class method S Is static method, that is allocated memory when loading program Instance method O Is non-static method allocated memory when creating an object Class variable X j Is static attribute allocated memory when loading program Xj is static attribute

j in a class Instance variable Y j Is non-static attribute of an object, allocated memory when creating an object

Yj is non-static attribute j in an object

Method parameter P k Is parameter k of a method

Total of Classes A Number of classes in a class diagram Total of Class

methods

B i Number of static method in the class i

B Number of static methods in a class diagram Total of Class

variables

C i Number of static attributes in class i

C Number of static attributes in a class diagram Total of Instance

methods

D i Number of non-static methods in class i

D Number of non-static methods in a class diagram Total of Instance

variables

E i Number of non-static attributes in class i

E Number of non-static attributes in a class diagram Total of Parameters F j Number of parameters in method j

Size of reference variable

r Every reference variable has the same size This size is equal size of a pointer

Return data type t j Is return data type of method j in a class

2.2 Measures affecting to performance

Before constructing the performance evaluation function from the class diagram, in this section, we focus on the analyzing components and the structure of the class diagram to build the measures affecting to software performance These measures are shown in Table II

Trang 3

TABLE II MEASURES AFFECTING TO PERFORMANCE

Size of Class Variables

S 1 The total of the allocated memory size of static attributes in the class diagram

Size of Class Methods

S 2 The total of the allocated memory size of static methods in the class diagram

Size of Executed Class Methods

S 3 The total of the allocated memory size that will be used when executing the

static methods in the class diagram Size of Instance

Variables

S 4 The total of the allocated memory size of non-static attributes in the class

diagram Size of Instance

Methods

S 5 The total of the allocated memory size of non-static methods in the class

diagram Size of Executed

Instance Methods

S 6 The total of the allocated memory size that will be used when executing the

non-static methods in the class diagram

Size of Class Variables

This measure is calculated by a total of memory amount allocated statically for all static attributes of all classes in the diagram The static elements are allocated memory once when loading the program into memory With the notation in Table I and Table II, we construct the formula for calculating the memory size total of the static attributes

in the class diagram as the following formula:

 





(1)

Size of Class Methods

The class methods are static methods, not subject to specific, commonly called by the class name and allocated once when loading the program According to the parameters in Table I and Table II, this measure is defined as formula (2):

=   

 





(2)

Size of Executed Class Methods

This measure is the size of memory used when executing a static method When the static method is called, firstly the parameters are allocated and when the method done, it needs to save the returned results in memory Therefore, according to the parameters in Table I and Table II, this measure is defined as formula 3:

=     +  ()





 





(3)

Size of Instance Variables

This measure is the method of the object and it is only allocated memory when the object is created Therefore, from the parameters in Table I and Table II, this measure is defined as formula 4:

!=   (" )

# 





(4)

Trang 4

Instance methods are non-static method, allocated memory when creating the object and only used after creating the object Therefore, according to the parameters in Table I and Table II, this measure is defined as formula (5):

$=   

% 





(5)

Size of Executed Instance Methods

This measure is the total of memory size used when executing the instance methods It includes the allocated memory for parameters and the memory containing the returned result of the instance method According to the parameters in Table I and Table II, this measure is defined as formula (6):

&=     +  ()





% 





(6)

2.3 Performance evaluation function

To construct the performance evaluation function from the class diagram, we analyze the allocating and accessing memory in the execution of an objected oriented program When executing the program, firstly class source will be loaded into memory, the static components including class variables and class methods are also allocated memory in the load time Thus, to use the static components only need one time for allocating memory statically and once accessing memory When using the instance variables and the instance methods of the object, the object should be created When creating objects, need to perform two steps such as fetching and executing the statement that used to create an object, and dynamically allocating memory for the instance variables and instance methods of the object Therefore it needs once times for allocating and two times for accessing memory to be able to use the components of the object When executing the class method, it needs once accessing memory to point to the code memory of the method, and needs once allocating memory for the parameters of the method, and needs once accessing the memory containing returned data after executing the method Also, to call the static method should access to class code held in memory so it requires at least once allocating memory and three accessing memory to execute the static At the design level, in the class diagram, we do not care and cannot evaluate the source code of the method Before executing the instance method, we must create the object firstly, and because the instance method is called by object name, so it require at least once allocating memory and two accessing memory to be able to call the instance method After creating the object containing the instance method, the executing process of the instance method is similar to the executing of the class method So the whole executing process of the instance method requires at least two memory allocation operations and five memory access operations

In the design phase, the software performance cannot be evaluated with the absolute accurately Furthermore, the purpose of the performance evaluation function is the selecting the class diagram that will have better performance Therefore, to evaluate performance from the class diagram, we assume a memory allocation operation statically or dynamically and a memory access operation are the same and equal a time unit (mini second) And the performance is

also the execution time of the program The performance evaluation function is denoted by Fp and is calculated by the

formula (7) based on the measures from formula (1) - (6)

F p = 2*(S 1 + S 2 ) + 4*S 3 + 3*(S 4 + S 5 ) + 7*S 6 (7)

3 EXPERIMENT

In this section, we did three experiments to verify the performance evaluation function In each case study, we

build an application following two stages: designing class diagram and implementation In the design phase, an

application is designed by two different class diagrams showing two logical architecture of the software We calculate the measures by the formula (1) - (6) and the value of the performance evaluation function to select the better

architecture In the implementation phase, class diagrams are implemented into different programs These programs

are executed on the same environment to evaluate performance To avoid the influence of the implementation of a method to the performance evaluation, the source code executing the same task are similar This illustrates the same

Size of Instance Methods

Trang 5

Excution time (m5(

900 800

700 600 500

400

300 200 100

0

865

622

430.6

_ _

-404.4

1 (Performance form class digram(

2

(Actual performance)

Class Diagram 1

I1 Class Diagram 2

conformity between the comparison of performance from class diagrams and the comparison of realistic performances This aims to verify the correctness of the evaluation function and measures In the all of three case studies we conduct following the steps: (step 1) design two class diagrams of the same application, identifying parameters, measures and calculate values of the performance evaluation function from the two class diagrams; (step 2) implement two programs from two class diagrams, execute the program in 10 times and calculate the average actual performance; (step 3) draw chart to compare the results that are evaluated from the class diagrams with actual results

Figure 1 Compare the performance level model and the actual performance

Case study: Han-Nom character recognition

Nom character recognition system is researched and developed in Laboratory of Embedded System, University of Engineering and Technology, Vietnam National University, Hanoi [21, 22] This recognition system consists three major phases: pre-processing, training and recognition To verify the measures and the performance evaluation function, in this case study we focus on the recognition module

Firstly, we design Han-Nom character recognition by two different class diagram shown Figure 3 and Figure 4 Then, we evaluate performance from two class diagram by formula (1) - (7)

After designing the Han-Nom character recognition module into two different class diagrams, we implement two programs respectively Source code and algorithms in a method are almost the same in both two programs The two programs only differ in elements, type of element and organization of elements described in the two diagrams Class Then, we run each program 10 times on the same configuration and calculate the average execution time

Finally, we construct the performance chart to compare the performances calculating from class diagram and actual performances such as shown in Figure 1 In this figure, the performance value which is evaluated from model

of class diagram 1 is greater than that of class diagram 2 And the actual performance of the program 1 which implements the class diagram 1 is greater that of the program 2 Thus, the results of the evaluation function are right

4 CONCLUSION AND FUTURE WORK

In summary, this paper has the following main contributions The first we presented a new method to evaluate software performance during design phase based on the structure and components in the class diagram We have analyzed and constructed measures that are derived directly from the class diagram, evaluated the dependence of performance on these measures for building performance evaluation function The performance evaluation method in this paper is new approach compared with the SPE method because we have directly evaluated the performance from the class diagram The second formulas and the evaluation function have been checked by our experiments However, this research only focuses on the major components affecting to performance without analyzing factors affecting to software quality such as inheritance, relationships, type of relationship, interfaces and packages

Trang 6

This study is background for further researches such as optimizing software level design and checking model Based on this research, we will study software optimization methods level design such as Pareto multi-objective optimization for embedded software and optimizing software performance based on model transformation

ACKNOWLEDGMENTS

This research is partly supported NAFOSTED and also by a VNU scientific project (group A) for 2012-2013

REFERENCES

[1] Lloyd G Williams “Performance Evaluation of Software Architectures”, 1-12, (1998)

[2] Connie U Smith, Catalina M Lladó, Vittorio Cortellessa and Lloyd G Williams, “From UML models to software performance results: An SPE process based on XML interchange formats”, 1-13, (2005)

[3] Dorin B Petriu, Murray Woodside, “A Metamodel for Generating Performance Models from UML Designs”, Dept

of Systems and Computer Engineering Carleton University, Ottawa K1S 5B6, Canada, 1-11, (2003)

[4] Simonetta Balsamo Moreno Marzoll, “Efficient Performance Models in Component-Based Software Engineering”,

Di Informatica, Universit`a Ca’ Foscari di Venezia, via Torino 155, Italy, 1-10, (2006)

[5] Ahmad Alsaadi, “Applying the UML Class Diagram in the Performance Analysis”, Department of Informatics and Computers Engineering University of Damascus, Syria, 1-18,( 2005)

[6] Gail C Murphy and Ekaterina Saenko, “Predicting Memory Use from a Class Diagram using Dynamic Information”, Department of Computer Science, Vancouver B.C Canada V6T 1Z4, 1-9, (2005)

[7] Marcela Genero, Mario Piattini and Coral Calero, “Early measures for UML class diagrams”, ALARCOS Research Group Department of Computer Science University of Castilla - Ciudad Real – SPAIN, 3-10, (2001)

[8] Marcela Genero, “A Survey of Metrics for UML Class Diagrams, University of Castilla-La Mancha”, Spain Mario Piattini, JOURNAL OF O BJECT TECHNOLOGY, published by ETH Zurich, 235-243, (2005)

[9] Tong Yi, Fangjun Wu, Chengzhi Gan, “A Comparison of Metrics for UML Class Diagrams, Department of Computer Science & Engineering”, Southeast University, Nanjing, 210096, China, 126-132, (2004)

[10] Esperanza Manso, Marcela Genero , Mario Piattini, “No-Redundant Metrics for UML Class Diagram Structural Complexity”, Deparment of Computer Science, University of Valladolid - Valladolid – Spain, Department of Computer Science, University of Castilla-La Mancha - Ciudad Real – Spain, 25-30, (2007)

[11] Kim, S., Barry, “UML-based object-oriented metrics for architecture complexity analysis”, Department of computer science, Texas A&M University, 243-250, (2003)

[12] Kang, D., et al (2004), “A structural complexity measure for UML class diagrams”, International Conference on Computational Science, Krakow Poland, 431-435, (2004)

[13] Marchesi, M., “OOA metrics for the unified modeling languages, Proceedings of 2nd Euromicro Conference on Software Maintenance and Reengineering”, Palazzo degli Affari, Italy, March, 67-73, (1998)

[14] Genero, M., Olivas, J., Piattini, Romero, “Using metrics to predict OO information sy stems maintainability”, Proceedings of CAiSE, Interlaken, Switzerland, Lecture Notes in Computer Science, 388-401, (2001)

[15] D.A Menascè, H Gomaa, “On a Language Based Method for Software Performance Engineering of Client/Server Systems”, Proc of WOSP'98, Santa Fe, New Mexico, USA, 63-69, (1998)

[16] S Balsamo, P Inverardi, C Mangano, “An Approach to Performance Evaluation of Software Architectures Workshop on Software and Performance”, WOSP'98, Santa Fe, New Mexico, 12-16, (1998)

[17] V Cortellessa, R Mirandola, “Deriving a Queueing Network based Performance Model from UML Diagrams”, WOSP, 325-340, (2000)

[18] M Bernardo, P Ciancarini, “A Process Algebraic Description Language for the Performance Analysis of Software Architectures”, WOSP, 115-120, (2000)

[19] F Aquilani, S Balsamo, P Inverardi, “Performance Analysis at the software architecture design level”, Technial Report TR-SAL-32, Technical Report Saladin Project, 55-62, (2000)

[20] F Andolfi, F Aquilani, S Balsamo, P Inverardi, “Deriving Performance Models of Software Architectures from Message Sequence Charts”,ACM Press, 47-57, (2000)

[21] P.V Huong, T.M Tuan, N.N Binh, T.A Hoang, “Some Approaches to Nôm Optical Character Recognition”, VNU, Hanoi J of Science, Natural Sciences and Technology, Vol 24, No 3S, 90-99, (2008)

[22] P.V Huong, N.N Binh, T.M Tuan, N.T.N Huong, L.T Trang, V.T Nhan, T.A Hoang, “Some Methodologies of Nôm Optical Character Recognition”, Proceedings of ICT.rda'08, 309-318, (2008)

Ngày đăng: 16/12/2017, 15:36

TỪ KHÓA LIÊN QUAN