Summary of the invention
The purpose of this invention is to provide a kind of automanual legacy system codes reverse engineering analysis method, feature variability analysis in the auxiliary support software product line exploitation, support the product line transformation activity of target domain, for wherein domain analysis provides more accurate, comprehensive feature variability conclusion.
Core concept of the present invention is based on legacy system codes and initial domain features tabulation, technology by feature location, obtain the contain situation of each feature in different application systems, judge the changeability (demand of feature representative all contained or part contain) of feature on the demand aspect thus.In addition, by difference analysis, obtain feature in the otherness that realizes on the level (implementation of feature, code structure etc.) to the related realization code.
The reverse engineering analysis method of feature variability in the software product line development that the present invention proposes, its flow process as shown in Figure 1.The input of this method comprises three parts:
(1) has the code that product line is transformed a plurality of Legacy Systems of potential quality.Though do not relate to the notion in field in single Legacy System performance history, software organization can judge whether it belongs in the territory according to the development goal of existing software.
(2) domain features tabulation.The domain features tabulation can be used as the general requirment dictionary in the field, so that name of the demand in unified field and description.This tabulation is to be set up by having an informal discussion, read methods such as Legacy System document by product line related personnel such as domain expert, users as the input of this method.
(3) field dictionary.This dictionary has been described the various synonyms of feature on the code rank.The reason of introducing field dictionary is: the first, and feature is described demand in the mode of text, and not necessarily meets the coding criterion of programming language; The second, because Legacy System independence on stream, code may produce inconsistent situation in names such as class, method, parameter.Therefore, the synonymicon in field is a prerequisite of carrying out feature location.On the other hand, the field dictionary can have different implementations, and this comprises: with the dictionary that the reference table form exists, and corresponding other synonym of a plurality of code levels of each feature; WordNet, it is the general synon dictionary of semantic information that comprises.
Under the situation that above input possesses fully, the concrete steps of the inventive method are as follows:
(1) conversed analysis personnel in field are at the code of leaving over of each application system, the use characteristic location technology, set up a plurality of ' features-method matrix ', this matrix is row headers with the feature list, with the column heading by name of the method in the code, matrix element is described the correlativity of feature and system realization unit.
(2) conversed analysis personnel in field integrate all ' feature-method matrix ', obtain ' feature-product matrix ' at the field, this matrix is row headers with the feature list, with the field application system is column heading, matrix element is represented the realization situation of feature in application system, and it reflects the changeability conclusion of feature on the demand aspect.
(3) conversed analysis personnel in field at each feature, carry out otherness relatively to the system's code that relates to based on ' feature-product matrix ', and result relatively is expressed as the changeability conclusion of feature on the realization aspect.
In the inventive method, ' feature-method matrix ' process of foundation in the step (1) is divided into following two steps:
(1) by the LSA(latent semantic analysis) the feature location technology, obtaining with number percent is the numerical value of feature-method degree of correlation of unit, as shown in Figure 2.In this matrix form, rower sign p feature in the representative field and set thereof feature 1, feature 2 ..., feature p}, column label represent n method set among the application system m method m1, method m2 ..., method mn}.In the left-half of each cell, enumerated the relative program numerical value of special characteristic and method.
(2) determine threshold value by field conversed analysis personnel,, represent that then this feature and this method have correlativity if feature-method degree of correlation numerical value is higher than this threshold value.In matrix shown in Figure 2, can given threshold be 80%.
(3) rearrange ' feature-method matrix ', and to be or not represent its correlativity.As shown in Figure 2, have correlativity at the right half part of cell with O representation feature and method, and X represents not exist correlativity.
In the inventive method, ' feature-product matrix ' in the step (2) as shown in Figure 3.In this matrix form, rower sign p feature in the representative field and set thereof feature 1, feature 2 ..., feature p}, column label represent individual application system or product set { product 1, product 2 .., the product q} of leaving over of existing q in the field.In the left-half of each cell, list the realization situation of feature in the application-specific product, show as the method set that has correlativity with individual features, if do not comprise the realization to this feature in the product, then use '--' expression.Therefore, can therefrom analyze and obtain feature in the changeability type on the demand aspect: if feature all has corresponding realization the (do not have and not to be empty method set) in all products, then this is characterized as the demand common feature, and the left-half of last row of Fig. 3 matrix is labeled as ' general character '; If feature is not to be realized by all products, then this is characterized as demand changeability feature, and the left-half of last row of Fig. 3 matrix is labeled as ' changeability '.
In the inventive method, the code otherness in the step (3) the relatively identifying with the aspect of realization feature variability is as follows:
(1), filters the method set in each product obtain having correlativity with it at feature 1;
(2) first product code that will have corresponding method benchmark as a comparison carries out otherness relatively with the corresponding code of remaining product, obtains the similarity degree between the code, lists at the right half part of Fig. 3 respective cells;
(3) determine compare threshold by field conversed analysis personnel;
(4) analysis of threshold code otherness comparative result based on the comparison, if at same feature, all code similarity degrees are all greater than this threshold value, then this is characterized as the realization common feature, and the right half part of last row of Fig. 3 matrix is labeled as ' general character '; If the similarity degree that has a code is less than threshold value, then this is characterized as and realizes the changeability feature, and the right half part of last row of Fig. 3 matrix is labeled as ' changeability '.
The present invention can realize the changeability identification and analysis of domain features, supports to contain the software product line transformation process of leaving over the application system code.This method combines the result of code conversed analysis with the feature identification of forward, for the domain analysis activity of software product line provides more accurate, comprehensive demand changeability knowledge.In addition, this method can access the feature variability conclusion of two levels, one is the feature variability on the demand layer, the contain situation of the demand of representation feature representative in each application system, it is two for realizing the feature variability on the level, and the difference of representation feature in different application systems realizes technology.Especially second type changeability is that the field demand event of forward can't be obtained, and it has brought benefit for follow-up product line design with implementation phase.
The good effect of this method is to provide more perfect scheme for the transformation of field product line.Because in reality, a software organization often at first develops product independently a plurality of but that have similar demands, in order to reduce cost of development, to improve the quality of products, software organization will use the notion of product line to build the field platform.In this process, existing legacy system codes is to be looked at as important product line assets, comprising the changeability of demand and realization aspect, therefore how the key that becomes is wherein excavated and utilized to these changeability knowledge.Use the present invention, can encourage and promote the product line transformation process of software organization simultaneously by the auxiliary variable analysis of field demand of automanual means.
Embodiment
Further provide the specific implementation process of the reverse engineering analysis method of feature variability in the software product line development below, Fig. 1 has provided the process flow diagram of this method.It is based on legacy system codes and initial domain features tabulation, obtain each feature containing and the realization situation in different application systems by the technology of feature location and the comparison of code otherness, judge the changeability of feature on demand aspect and realization aspect thus.
At once specific feature variability analytic activity, use this invention to comprise following specific implementation process:
(1) from domain expert or user, by having an informal discussion or reading method such as Legacy System document and obtain initial domain features tabulation.
(2) at an application product, field conversed analysis personnel use characteristic location technology (for example LSA), the synonym that is marked with the field dictionary is a matching field, obtain the degree of correlation numerical value between each method in feature and this product, set up initial ' feature-method matrix ', as shown in Figure 2.
(3) repeated execution of steps (2) is until all Legacy Systems are all disposed.
(4) relevance threshold of field conversed analysis personnel specific characteristic-method.Rearrange then ' feature-method matrix ', obtain with the feature of O or X mark and the two-value correlativity of method, as shown in Figure 3.
(5) conversed analysis personnel in field integrate all ' feature-method matrix ', set up initial ' feature-product matrix ', list the correlation technique set of feature in corresponding product, obtain the feature variability conclusion of demand aspect simultaneously, as shown in Figure 3.
(6) at a feature in ' feature-product matrix ', relative all the application product method set of field conversed analysis personal identification, with at first product is benchmark, uses code otherness compare tool (for example using the CloneMiner instrument) to obtain the similarity degree of remaining system code and reference code.
(7) repeated execution of steps (6) all disposes until all features.
(8) conversed analysis personnel in field formulate the similar threshold value of code.Analysis compares with the code similarity degree of each row feature then, obtains the changeability conclusion of feature on the realization aspect.