LIU Li (劉 麗), ZHU Xiao-dong (朱小冬), HAO Xue-liang (郝學(xué)良)
1 Department of Teaching and Research, Mechanized Infantry Academy, Shijiazhuang 050003, China2 Maintenance Engineering Institute, Mechanical Engineering College, Shijiazhuang 050003, China
Software Maintainability Prediction with UML Class Diagram
LIU Li (劉 麗)1*, ZHU Xiao-dong (朱小冬)2, HAO Xue-liang (郝學(xué)良)2
1DepartmentofTeachingandResearch,MechanizedInfantryAcademy,Shijiazhuang050003,China2MaintenanceEngineeringInstitute,MechanicalEngineeringCollege,Shijiazhuang050003,China
Software system can be classified into many function modules from the perspective of user. Unified modeling language (UML) class diagram of each function module was extracted, and design characteristic metrics which influenced software maintainability were selected based on UML class diagram. Choosing metrics of UML class diagram as predictors, and mean maintenance time of function module was regarded as software maintainability parameter. Software maintainability models were built by using back propagation (BP) neural network and radial basis function (RBF) neural network, respectively and were simulated by MATLAB. In order to evaluate the performance of models, the training results were analyzed and compared with leave-one-out cross-validation and model performance evaluation criterion. The result indicated that RBF arithmetic was superior to BP arithmetic in predicting software maintainability.
unifiedmodelinglanguage(UML)classdiagram;softwaremaintainability;backpropagation(BP)neuralnetwork;radialbasisfunction(RBF)neuralnetwork
Software maintainability is fundamentally decided by software design. The causality between software design characteristic and maintainability pointed out the direction for software maintainability prediction,i.e., the mapping relation should be built between design characteristics and maintainability parameter. Software maintainability prediction model should be built, but many prediction models are built based on source code[1-6], which is not much helpful for software development. Therefore, it is necessary to carry out maintainability prediction research in early development stage with unified modeling language (UML) class diagram. Thus, software maintainability is improved. There are software maintainability prediction models with UML class diagram[7-13], but these models are only theoretical and have no practical foundation.
Furthermore, if software maintainability wants to be predicted, one precondition must be satisfied that software maintainability parameter need be confirmed. However, there is barely acknowledged maintainability parameter in the field of software maintainability research. Zhou and Leung[14]offered some maintainability metrics: the time of problem confirmed, the time of management delay,etc. They made maintainability parameter have practical meaning, but the relation between these parameters and software design characteristics was not built and there is no use for software development.
At present, the method of development maintainability model mostly was classified into linear method and nonlinear method. Fioravanti and Nesi[15], and Misra[16]built software maintainability model by using linear regression technology respectively. However, the relation between software prediction factors and maintainability parameter is complex and nonlinear, which limits the accuracy of model. Therefore, appropriate technique is necessary to built high performance maintainability prediction model. Now neural network has become one of key techniques of building prediction model and optimizing control to nonlinear system.
Based on the above analysis, software system can be divided into some specific function modules from user who require software maintenance. UML class diagram of every function module was extracted, and the design characteristic metrics that influence software maintainability with UML class diagram were selected, then these metrics were measured by SDMetrics; software maintainability parameter that “mean maintainability time of function module” was determined from the perspective of user according to the analysis of common maintainability parameters; taking “the system of virtual maintenance and training” as originated dataset and the course of sample data collection was introduced; the model was trained by using back propagation (BP) learning arithmetic and radial basis function (RBF) learning arithmetic of artificial neural network, respectively, and the training results were analyzed and compared with leave-one-out cross-validation and model performance evaluation criterion.
Maintenance time of software system is made up of the required time of every modification affair. Since modification affairs of software are uncertain. However, from the perspective of user, the modification of software failure or functional expansion is maintenance of one specific function to software system, and the numbers of specific function module of software system are certain. Therefore, the time corresponding to modification affairs of every function module made up of maintenance time of software system. The required time of modification affair of every function has relations with the structure and size of the function module.
Based on the above analysis, the modeling approach of software maintainability prediction is shown in Fig.1.
The maintainability prediction of software system includes the following steps: firstly, influencing factors of software maintainability are measured according to the structural characteristic of UML class diagram of every function module;then “mean maintainability time of function module” is collected; lastly maintainability prediction model of every function module is built.
Maintainability measurement model with UML class diagram is built according to ISO9 126 definition to software maintainability (see Fig.2). The first layer is software maintainability attribute; the second layer is design characteristic; the third layer is the educed metrics of UML class diagram from design characteristic and the metrics are shown in Table 1.
Fig.1 Modeling approach of maintainability prediction
Fig.2 Maintainability measurement model with UML class diagram
Table 1 The metrics of influence software maintainability
Considering the maintenance time is concerned by the users and obtained easily in maintenance record. The “Check out” time and “Check in” time are both recorded to each time maintenance process in the visual source safe (VSS) tool of software configuration management, the non-working time is eliminated from natural time through communicating with software developers, then once maintenance time is gained by multiplying the maintenance person numbers and the time difference of check out and check in together. So the mean maintenance time of every function module is selected as software maintainability parameter.
With the above analysis to the metrics of influencing software maintainability and the maintainability parameter, the maintainability prediction model is built by using BP neural network and RBF neural network respectively. The main work includes collection of sample data, training of model and evaluation of model, and the flow is shown in Fig.3.
Fig.3 Work flow of prediction model on maintainability
4.1 Collection of sample dataset
The maintainability metrics of the function module and the “mean maintainability time of function module” are shown in Table 2.
Table 2 Maintainability measurements of functon module
FunctionmoduleNCNANMNAssocNAggNDepNGenNGenHNAggHMaxDITMaxHAggMeanmaintainabilitytimeoffunctionmodule/hDatabase22418696214233318.8884Datapackage69260104010212.8309Resource3612110010107.0518Structuretree51421130020209.9971Statustree622634112211110.2253Equipment184276106210232216.8895Process3912101000006.4736Faultmodel248100000006.6766Trainingsystem3612201001006.7471Trainingcontent23344766011322220.7150Questionlibrary610142202112112.8589Affiliationmanagement18325726018112316.1934Majormanagement19326735020123516.9961Objectmanagement17396485214323413.7440Testquestion52347500000007.1670Usertemplate244683116024264321.0881Helpinformation244678144516332321.7745Importdatabase23344766011322219.7993Exportdatabase5478401620823725623.2404Preview19459466120224417.0338
4.2 Model training
Software maintainability model was built by using BP neural network and RBF neural network and was simulated by MATLAB to the collected data respectively. The main steps are as follows.
4.2.1 Classification of data
The 20 groups of data were classified into training data and testing data. The 18 groups of data were training data and the other two groups of data were testing data. The influencing factors of maintainability were regarded as input, and the mean maintenance time of function module was regarded as output.
4.2.2 Model training with BP neural network
The simulation value through training of BP neural network is compared with target value, which is shownin Fig.4.
Fig.4 The comparison simulation value with target value of training data
4.2.3 Model training with RBF neural network
The simulation value through training of RBF neural network is compared with target value, which is shown in Fig.5.
Fig.5 The comparison predictive value with real value
4.3 Validation and performance evaluation of the two models
4.3.1 Leave-one-out cross-validation
The validation of model is a very critical step. It can evaluate the quality of the model, and it is the choice principle of model. Error is always used to evaluate the performance of model, and the most simple evaluation method is cross-validation. The method of leave-one-out cross-validation (LOOCV) is selected in the paper, because almost all samples are used to train model in every round and the generalization error through evaluation is relative credible.
4.3.2 Performance evaluation criteria
In order to evaluate the performance of the two models, magnitude of relative errorεcriteria in the field of software is given.
(1)
whereyeiis the expected value, andypiis the predictive value.
4.3.3 Performance evaluation of model
Firstly, the relation model with BP neural network adopted the method of LOOCV. The validation result and the values ofεwere shown in Fig.6.
Fig.6 Validation of prediction model with BP neural network
Secondly, the relation model with RBF neural network adopted the method of LOOCV. The validation result and the value ofεwere shown in Fig.7.
Fig.7 Validation of prediction model with RBF neural network
From Figs. 6 and 7 it can be seen that the error median line’s coordinate of RBF arithmetic is more approaching to 0, and it has narrow cabinet and smaller whisker. Therefore, it can be seen that the error of RBF arithmetic is smaller from the distribution of relative error.
Software maintenance is an important phase in software lifecycle. If maintainability prediction model is built in early phase of software development, the defect of software maintainability design can be discovered and eliminated, then the maintenance effort can be reduced in future. Taking “the system of virtual maintenance and training” as originated dataset, the prediction model was trained by using BP arithmetic and RBF arithmetic, respectively. In order to evaluate the performance of models, the training results are analyzed and compared with leave-one-out cross-validation and model performance evaluation criteria. The result indicated that RBF arithmetic was superior to BP arithmetic in predicting software maintainability.
[1] Sun X Y, Chen J. Procedural Information Based Software Maintainability Metrics [J].ShandongScience, 2010, 23(4): 68-71. (in Chinese)
[2] Wang L J, Hu X X, Ning Z Y. Predicting Object-Oriented Software Maintainability Using Projection Pursuit Regression[C]. The 1st International Confernce on Information Science and Engineering, Boston, 2008: 3827-3830.
[3] Zhou Y M, Hareton Leung. Predicting Object-Oriented Software Maintainability Using Multivariate Adaptive Regression Splines[J].TheJournalofSystemsandSofware, 2007(80): 1349-1361.
[4] Fioravanti F, Nesi P. Estimation and Prediction Metrics for Adaptive Maintenance Effort of Object-Oriented Systems[C]. IEEE Transactions on Software Engineering, London, UK, 2001: 1062-1084.
[5] van Koten C, Gray A R. An Application of Bayesian Network for Predicting Object-Oriented Software Maintainability[J].InformationandSoftwareTechnology, 2006, 48(1): 59-67.
[6] Jehan Al Dallal. Object-Oriented Class Maintainability Prediction Using Internal Quality Attributes[J].InformationandSoftwareTechnology, 2013, 55(11): 2028-2048.
[7] Ye F, Zhu X D, Wang Y G. A New Software Maintainability Evaluation Model Based on Multiple Classifiers Combination[C]. International Conference on Qaulity, Reliability, Risk, Maintenance, and Safety Engineering, Chengdu, China, 2013: 321-325.
[8] Genero M, Piattini M, Calero C. Early Measures for UML Class Diagrams[J].HermesSciencePublications, 2012, 6(4): 489-515.
[9] Liu L, Zhu X D, Wang Y G. Software Maintainability Requirements Modeling Based on UML Profile[C]. Proceedings of the IEEE Prognostics and System Health Management Conference, Beijing, 2012: 528-531.
[10] Manso MaE, Genero M, Piattini M. No-redundant Metrics for UML Class Diagrams Structural Complexity[C]. Lecture Notes in Computer Science, Springer, Berlin, Germany, 2003: 127-142.
[11] Genero M, Manso E, Piattini M, Cantone G. Building UML Class Diagram Maintainability Prediction Models Based on Early Metrics[C]. The 9th International Symposium on Software Metrics (METRICS 2003), IEEE Computer Society, Austin, USA, 2003: 263-275.
[12] Kiewkanya M, Muenchaisiri P. Predicting Modifiability of UML Class and Sequence Diagrams[C]. The 26th International Conference on Software Engineering, Boston, USA, 2014: 53-57.
[13] Kiewkanya M, Jindasawat N, Muenchaisiri P. A Methodology for Constructing Maintainability Model of Object-Oriented Design[C]. The 4th International Conference on Quality Software, Brighton, UK, 2004: 206-213.
[14] Zhou Y M, Leung H. Predicting Object-Oriented Software Maintainability Using Multivariate Adaptive Regression Splines[J].TheJournalofSystemsandSoftware, 2007, 80(13): 1349-1361.
[15] Fioravanti F, Nesi P. Estimation and Prediction Metrics for Adaptive Maintenance Effort of Object-Oriented Systems[J].IEEETransactionsonSoftwareEngineering, 2001, 27(12): 1062-1084.
[16] Misra S C. Modeling Design/Coding Factors that Drive Maintainability of Software Systems[J].SoftwareQualityJournal, 2005, 13(3): 297-320.
TP302 Document code: A
1672-5220(2015)01-0157-05
Received date: 2014-08-08
*Correspondence should be addressed to LIU Li, E-mail: huaxiangwen@163.com
Journal of Donghua University(English Edition)2015年1期