CN103593182A - Method for reconfiguring software by using clustering mode - Google Patents
Method for reconfiguring software by using clustering mode Download PDFInfo
- Publication number
- CN103593182A CN103593182A CN201310521139.6A CN201310521139A CN103593182A CN 103593182 A CN103593182 A CN 103593182A CN 201310521139 A CN201310521139 A CN 201310521139A CN 103593182 A CN103593182 A CN 103593182A
- Authority
- CN
- China
- Prior art keywords
- software
- entity
- source code
- code information
- attribute
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The invention provides a method for reconfiguring software by using a clustering mode, and belongs to the technical field of software engineering. The method comprises the following steps of forming a grammar rule library; establishing a territory rule library; reading source code information of software; analyzing the source code information; filtering redundant information in the source code information in a territory rule; establishing a factbase comprising program entities and description of the program entities, and determining similarity between the program entities; analyzing the entities by using a clustering analysis method; clustering the program entities of which the correlation coefficient is higher than a threshold value in clusters; forming a new software module by using each cluster; and finishing software reconfiguration by re-dividing the software module. The territory rule library can be adjusted as needed, and software reconfiguration is performed again. The software reconfiguration is performed by using the clustering mode; after modules of a system are re-constructed, codes have high reusability; the relevancy of the program entities in each module is high; and the problem that codes are scattered and disordered is solved.
Description
Technical field
The invention belongs to technical field of software engineering, specifically a kind of method that adopts cluster mode to carry out software reconfiguration.
Background technology
Reconstruct is the process of program conversion, this process improvement the realization of software requirement, and keep program behavior constant.Software, in its life cycle, inevitably changes, and these variations may be the changes of user's request, also may be in order to correct the mistake of software itself.In order to reduce the maintenance cost of software, extend its serviceable life, software maintenance personnel often face the problem of software reconfiguration.But along with scale and the complexity of software systems increases, influencing each other between each functional module of system becomes more complicated.Particularly those lack the Legacy System of document, how to be reconstructed, and are current software maintenance urgent problems.
In order to address this problem, the patent No. is 200810163396.6 " the code level component assembly method based on grammer reconstruct ", it is using member as having on relatively independent function and reusable software module basis, code level component assembly method based on grammer reconstruct is disclosed in a kind of technical field of software engineering.The method is isolated abstract syntax and concrete syntax from the syntax gauge of program language, and sets up the code level member that meets described new syntax standard, then carries out Components Composition, has independently advantage of language while making software repeated usage.But this reconstruct is code level, lack the improvement to program structure.Particularly, have a large amount of core business focus based on function in system, its logical relation has dividing of power, and these core business focus may be distributed in different modules.For example, in program, needing that the stock in manufacturing is controlled to function modifies, and this part function intersperses among a plurality of modules such as material inventory administration module, finished goods inventory administration module and material supply module, according to above-mentioned patented method, the modification of code will relate to this plurality of modules, and this will increase the cost of modification and the probability of makeing mistakes undoubtedly.Just because of core business focus is crossed over a plurality of modules possibly, be both and must be convenient to revise, safeguard and upgrade, software maintenance personnel are when carrying out software reconfiguration, answer dependence and coupled characteristic between routine analyzer core business focus, simple based on grammer reconfiguration code level member, the system after reconstruct cannot obtain essence and improve.
Summary of the invention
The deficiency existing for prior art, the invention provides a kind of method that adopts cluster mode to carry out software reconfiguration.
Technical scheme of the present invention is:
Adopt cluster mode to carry out a method for software reconfiguration, comprise the following steps:
Step 1: set up syntax rule according to the programming language of software, form syntax rule storehouse;
Step 2: set up domain-planning storehouse according to different application knowledge: different applications, the same attribute of domain entities has different linked characters, according to the dependence between the attribute of domain entities, coupled characteristic, determine the rule in different application field, set up for describing the domain-planning storehouse of different application field function;
Application rule comprises: the correlation coefficient between program entity numbering, affiliated field, version number, functional description, business object, backup, the attribute having and each attribute;
Step 3: the source code information of reading software;
Step 4: source code information is resolved according to syntax rule;
Step 4.1: source code information is carried out to syntax parsing;
Step 4.2: the syntax tree of extraction source code information;
Step 4.3: the syntax tree of source code information is carried out to semanteme and resolve, obtain program entity and entity attribute in source code information;
Described program entity comprises: class, function and operation flow;
Described entity attribute comprises: bag, file, function, database and test case;
Step 5: under domain-planning, the redundant information in source code information is filtered, screen out information unnecessary in source code information;
Step 6: set up the factbase that comprises program entity and description thereof, the description of program entity comprises: the correlation coefficient between program entity numbering, interface name, core business focus, input parameter, output parameter, rreturn value, program entity supplier, version number, key word, the attribute having and each attribute;
Step 7: similarity between determine procedures entity, i.e. correlation coefficient between calculation procedure entity;
Step 8: gather clustering method and carry out entity analysis, higher than in the program entity cluster to of threshold value bunch, each bunch forms a new software module, by the software reconfiguration of having repartitioned to software module by correlation coefficient;
Step 9: can adjust domain-planning storehouse as required, return to step 5 and re-start software reconfiguration.
Beneficial effect:
(1) adopt cluster mode to carry out software reconfiguration, the target of its improvement is the core business focus based on function, and the module of system is rebuild to post code will have good reusability;
(2) after cluster analysis, the similar or degree of correlation of each module internal program entity is higher, solves code and disperses and chaotic problem, system easy to understand and maintenance;
(3) different application, the same attribute of program entity has different linked characters, can be by revising the correlation coefficient of attribute in domain-planning storehouse, the cluster result producing is like this also by difference, and this makes this patent have better versatility.
Accompanying drawing explanation
Fig. 1 is the method flow diagram that the employing cluster mode of the specific embodiment of the invention is carried out software reconfiguration;
Fig. 2 is the source code resolver structural representation of the specific embodiment of the invention;
Fig. 3 is the digraph example schematic of the specific embodiment of the invention;
Fig. 4 is the cluster example schematic of the specific embodiment of the invention.
Embodiment
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is elaborated; but protection scope of the present invention is not limited by embodiment; under the prerequisite without prejudice to technical solution of the present invention, any change that those of ordinary skills made for the present invention easily realize or change all belong to protection scope of the present invention.
The employing cluster mode of present embodiment is carried out the method for software reconfiguration, and flow process as shown in Figure 1, comprises the following steps:
Step 1: set up syntax rule according to the programming language of software, form syntax rule storehouse;
Syntax rule storehouse provides syntax rule for grammatical analysis, and then can the context-free grammar of certain programmed language be translated into by grammatical analysis to the syntax tree of this programming language;
Step 2: set up domain-planning storehouse according to different application knowledge: different applications, the same attribute of domain entities has different linked characters, according to the dependence between the attribute of domain entities, coupled characteristic, determine the rule in different application field, set up for describing the domain-planning storehouse of different application field function;
Application rule comprises: the correlation coefficient between program entity numbering, affiliated field, version number, functional description, business object, backup, the attribute having and each attribute;
Different applications, the same attribute of program entity has different linked characters, with reference to field factor, according to dependence, coupled characteristic between the entity attribute in field, object code place, the correlation coefficient of given each association attributes of native system, the attribute associated with core business focus wherein, its correlation coefficient value is higher, to guarantee that core business focus obtains higher aggregation.Domain knowledge is the description collection of this field function, and the description of each function is comprised: program entity numbering, affiliated field, version number, functional description, business object, backup, the association attributes having and correlation coefficient;
Step 3: the source code information of reading software;
Step 4: source code information is resolved according to syntax rule; In present embodiment, according to syntax rule, source code information is resolved and can be realized by the resolver shown in Fig. 2;
Step 4.1: source code information is carried out to syntax parsing;
Step 4.2: the syntax tree of extraction source code information;
Step 4.3: the syntax tree of source code information is carried out to semanteme and resolve, obtain program entity and entity attribute in source code information;
Program entity comprises: class, function and operation flow;
Entity attribute comprises: bag, file, function, database and test case;
Step 5: under domain-planning, the redundant information in source code information is filtered, screen out information unnecessary in source code information;
Step 6: set up the factbase that comprises program entity and description thereof, the description of program entity comprises: the correlation coefficient between program entity numbering, interface name, core business focus, input parameter, output parameter, rreturn value, program entity supplier, version number, key word, the attribute having and each attribute;
Factbase under domain-planning to obtaining after source code information filtering, the core business focus that is software is described collection, the description of each program entity is comprised: program entity numbering, interface name, core business focus, input parameter, output parameter, rreturn value, program entity supplier, version number, key word, the association attributes having and correlation coefficient;
Step 7: similarity between determine procedures entity, i.e. correlation coefficient between calculation procedure entity;
Between program entity, there are a plurality of association attributeses, according to formula (1), carry out similarity calculating (attribute coefficients adopting in calculating, derives from factbase), the correlation coefficient between determine procedures entity;
Wherein,
x, yrepresentation program entity,
drepresent number of attributes;
s (x, y)correlation coefficient between representation program entity x, y,
s(x k , y k )for program entity
x, y kthe correlation coefficient of individual attribute;
w(x k , y k )get 0 or 1, representation program entity
x, y kwhether individual attribute is relevant;
Step 8: gather clustering method and carry out entity analysis, higher than in the program entity cluster to of threshold value bunch, each bunch forms a new software module, by the software reconfiguration of having repartitioned to software module by correlation coefficient;
According to the program entity dependence in factbase, set up digraph, then according to the similarity result of calculation of entity, carry out cluster analysis, detailed process is as follows:
(1) set up digraph.As shown in Figure 3, suppose to exist in factbase 10 program entity (numbering: 1---10), set up digraph.The solid line with arrow in this figure, represents that 2 entities have dependence, for example, can think that entity 2 relies on entity 1;
(2) digraph cluster analysis.As shown in Figure 4, according to the similarity of entity, carry out cluster analysis, obtain 2 bunches 1,2,3}, 4,6,10}, in this figure, solid line represents to have higher similarity or the degree of correlation (correlation coefficient value is high), dotted line represents lower similarity or the degree of correlation (correlation coefficient value is low).Wherein, entity 4 and entity 10 be because jointly quoted entity 7, similar or the degree of correlation is higher; And the common child node 8 of entity 5 and entity 6 is non-core services focus, thus similarity or the degree of correlation lower;
By correlation coefficient, higher than in the program entity cluster to of threshold value bunch, each bunch forms a new software module, and these modules are offered to system maintenance personnel to complete software reconfiguration with the form of easily understanding and use;
Step 9: can adjust domain-planning storehouse as required, return to step 5 and re-start software reconfiguration;
In present embodiment, according to collect to the assay of above-mentioned software reconfiguration or suggestion, adjust the correlation coefficient of Zhong, this area, domain-planning storehouse entity association attributes, then re-start system reconfiguration.
Adopt this method can realize software reconfiguration, software systems large-scale, complexity go out automatic classifying the module of the core business focus based on function, and system architecture is manageability more.
Claims (1)
1. adopt cluster mode to carry out a method for software reconfiguration, it is characterized in that: comprise the following steps:
Step 1: set up syntax rule according to the programming language of software, form syntax rule storehouse;
Step 2: set up domain-planning storehouse according to different application knowledge: different applications, the same attribute of domain entities has different linked characters, according to the dependence between the attribute of domain entities, coupled characteristic, determine the rule in different application field, set up for describing the domain-planning storehouse of different application field function;
Application rule comprises: the correlation coefficient between program entity numbering, affiliated field, version number, functional description, business object, backup, the attribute having and each attribute;
Step 3: the source code information of reading software;
Step 4: source code information is resolved according to syntax rule;
Step 4.1: source code information is carried out to syntax parsing;
Step 4.2: the syntax tree of extraction source code information;
Step 4.3: the syntax tree of source code information is carried out to semanteme and resolve, obtain program entity and entity attribute in source code information;
Described program entity comprises: class, function and operation flow;
Described entity attribute comprises: bag, file, function, database and test case;
Step 5: under domain-planning, the redundant information in source code information is filtered, screen out information unnecessary in source code information;
Step 6: set up the factbase that comprises program entity and description thereof, the description of program entity comprises: the correlation coefficient between program entity numbering, interface name, core business focus, input parameter, output parameter, rreturn value, program entity supplier, version number, key word, the attribute having and each attribute;
Step 7: similarity between determine procedures entity, i.e. correlation coefficient between calculation procedure entity;
Step 8: gather clustering method and carry out entity analysis, higher than in the program entity cluster to of threshold value bunch, each bunch forms a new software module, by the software reconfiguration of having repartitioned to software module by correlation coefficient;
Step 9: can adjust domain-planning storehouse as required, return to step 5 and re-start software reconfiguration.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310521139.6A CN103593182A (en) | 2013-10-27 | 2013-10-27 | Method for reconfiguring software by using clustering mode |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310521139.6A CN103593182A (en) | 2013-10-27 | 2013-10-27 | Method for reconfiguring software by using clustering mode |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103593182A true CN103593182A (en) | 2014-02-19 |
Family
ID=50083342
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310521139.6A Pending CN103593182A (en) | 2013-10-27 | 2013-10-27 | Method for reconfiguring software by using clustering mode |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103593182A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106484401A (en) * | 2016-09-23 | 2017-03-08 | 东北大学 | A kind of Automated Refactoring of object-oriented software |
CN109814920A (en) * | 2019-01-24 | 2019-05-28 | 华东师范大学 | A kind of software configuration complexity decomposition apparatus |
CN109901873A (en) * | 2019-02-26 | 2019-06-18 | 北京真知科技有限公司 | Software function reconstructing method and device based on syntax tree |
CN110659063A (en) * | 2019-08-08 | 2020-01-07 | 平安科技(深圳)有限公司 | Software project reconstruction method and device, computer device and storage medium |
CN113869378A (en) * | 2021-09-13 | 2021-12-31 | 四川大学 | Software system module partitioning method based on clustering and label propagation |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1366783A (en) * | 2000-02-15 | 2002-08-28 | 皇家菲利浦电子有限公司 | Software reconfiguration of communication apparatus |
US20030056192A1 (en) * | 2001-05-24 | 2003-03-20 | Burgess Allen G. | Source code analysis system and method |
US20110061040A1 (en) * | 2009-09-06 | 2011-03-10 | Muhammad Shaheen | Association rule mining to predict co-varying software metrics |
CN102819548A (en) * | 2012-03-31 | 2012-12-12 | 常熟市支塘镇新盛技术咨询服务有限公司 | Cluster-based dynamic cycle integration selecting method |
CN103559025A (en) * | 2013-10-21 | 2014-02-05 | 沈阳建筑大学 | Software refactoring method through clustering |
-
2013
- 2013-10-27 CN CN201310521139.6A patent/CN103593182A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1366783A (en) * | 2000-02-15 | 2002-08-28 | 皇家菲利浦电子有限公司 | Software reconfiguration of communication apparatus |
US20030056192A1 (en) * | 2001-05-24 | 2003-03-20 | Burgess Allen G. | Source code analysis system and method |
US20110061040A1 (en) * | 2009-09-06 | 2011-03-10 | Muhammad Shaheen | Association rule mining to predict co-varying software metrics |
CN102819548A (en) * | 2012-03-31 | 2012-12-12 | 常熟市支塘镇新盛技术咨询服务有限公司 | Cluster-based dynamic cycle integration selecting method |
CN103559025A (en) * | 2013-10-21 | 2014-02-05 | 沈阳建筑大学 | Software refactoring method through clustering |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106484401A (en) * | 2016-09-23 | 2017-03-08 | 东北大学 | A kind of Automated Refactoring of object-oriented software |
CN106484401B (en) * | 2016-09-23 | 2019-07-23 | 东北大学 | A kind of Automated Refactoring of object-oriented software |
CN109814920A (en) * | 2019-01-24 | 2019-05-28 | 华东师范大学 | A kind of software configuration complexity decomposition apparatus |
CN109901873A (en) * | 2019-02-26 | 2019-06-18 | 北京真知科技有限公司 | Software function reconstructing method and device based on syntax tree |
CN109901873B (en) * | 2019-02-26 | 2022-05-10 | 北京真知科技有限公司 | Software function reconstruction method and device based on syntax tree |
CN110659063A (en) * | 2019-08-08 | 2020-01-07 | 平安科技(深圳)有限公司 | Software project reconstruction method and device, computer device and storage medium |
CN113869378A (en) * | 2021-09-13 | 2021-12-31 | 四川大学 | Software system module partitioning method based on clustering and label propagation |
CN113869378B (en) * | 2021-09-13 | 2023-04-07 | 四川大学 | Software system module partitioning method based on clustering and label propagation |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103559025A (en) | Software refactoring method through clustering | |
JP6163607B2 (en) | Method and apparatus for constructing event knowledge database | |
CN104133772B (en) | Automatic test data generation method | |
CN105335403B (en) | Database access method and device and database system | |
CN102426587B (en) | Method for customizing and inquiring heterogeneous BOM (Bill of Materiel) based on complex product | |
CN103593182A (en) | Method for reconfiguring software by using clustering mode | |
CN105138501A (en) | Configurable dynamic report generating method and system | |
CN105373469A (en) | Interface based software automation test method | |
CN104965735A (en) | Apparatus for generating upgrade SQL script | |
CN109446221A (en) | A kind of interactive data method for surveying based on semantic analysis | |
CN105354036A (en) | Database operation code generating method and apparatus | |
CN105373472A (en) | Database statistical accuracy-based test method and system | |
US11615076B2 (en) | Monolith database to distributed database transformation | |
CN103246704A (en) | Mapping method for describing entity and relational data based on conventional data structure | |
CN104461531A (en) | Implementing method for self-defined functions of reporting system | |
CN106294128B (en) | A kind of automated testing method and device exporting report data | |
CN103020318A (en) | Method for maintenance of database tables in database | |
CN104462361A (en) | Method and device for matching data in data table | |
CN106919697A (en) | A kind of method that data are imported multiple Hadoop components simultaneously | |
CN109992271B (en) | Layered architecture recognition method based on code vocabulary and structure dependence | |
CN103927168B (en) | A kind of method and device of object-oriented data model persistence | |
CN105653830A (en) | Data analysis method based on model driving | |
CN103886021A (en) | Database audit result translation method and system based on natural language | |
CN105719072A (en) | System and method for associating multistage assembly transactions | |
CN103678349A (en) | Method and device for filtering useless data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20140219 |