CN103235729B - A kind of software model synchronous method changed based on code - Google Patents

A kind of software model synchronous method changed based on code Download PDF

Info

Publication number
CN103235729B
CN103235729B CN201310135857.XA CN201310135857A CN103235729B CN 103235729 B CN103235729 B CN 103235729B CN 201310135857 A CN201310135857 A CN 201310135857A CN 103235729 B CN103235729 B CN 103235729B
Authority
CN
China
Prior art keywords
code
model
change
software
software model
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.)
Active
Application number
CN201310135857.XA
Other languages
Chinese (zh)
Other versions
CN103235729A (en
Inventor
王林章
李袁奎
李宣东
陈志�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University
Original Assignee
Nanjing University
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nanjing University filed Critical Nanjing University
Priority to CN201310135857.XA priority Critical patent/CN103235729B/en
Publication of CN103235729A publication Critical patent/CN103235729A/en
Priority to PCT/CN2013/086990 priority patent/WO2014169628A1/en
Application granted granted Critical
Publication of CN103235729B publication Critical patent/CN103235729B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

A kind of software model synchronous method changed based on code that the present invention proposes, insubstantial changes by the method from vicissitudinous code, non-intrinsically safe changes, the code filters of irrelevant change is gone out, obtain the change code that software model is relevant, the relative change code of software model is mated, element in Modling model and the corresponding relation between the element in code, corresponding relation between element in the code modification information obtained, model and the element in code is translated as renewal rewards theory, produce new model, implementation model is synchronous.The present invention can be integrated in code release management system, by predefine rule, can carry out automatic or semi-automatic renewal, ensure the consistance of software model and code to software model.

Description

A kind of software model synchronous method changed based on code
Technical field
The present invention relates to and with fresh code, synchronous method is carried out to expired software model, belong to soft project, model-driven engineering interleaving techniques field.
Background technology
Model-driven engineering is major product with model, attempts the content being carried out clear and definite software development by Modling model, is the important topic of soft project development in recent years.Model modeling language represents, can describe software but higher than software, is a kind of intermediate product describing design, guiding software exploitation.
The software development flow of standard comprises demand analysis, modelling, code are write and tested and dispose these steps.Wherein the various key elements in demand analysis have not only been accepted in modelling, but also are the follow-up benchmark writing the activities such as code software test, most important in whole development process.
In software development process, model is abstract as mentality of designing and service logic, can instruct interchange between developer and the exploitation of code and the payment of software.Developer needs the implication understanding model, and then give expression to all information in model with programming language, the requirement in model and thinking all can be embodied in code, and the software finally submitted and model are consistent.When the correctness of certifying software, also be started with by the corresponding relation of it and model, the software systems that can deal with problems are often very complicated, and its model is abstract on certain level, therefore in the actual development and test of enterprise, can by proving that the correctness of model and the corresponding relation of model and software systems carry out the correctness of certifying software.
After software development completes, be not unalterable.In the use and production environment of reality, software often because many reasons, as use scenes change, user's requirement, performance optimization, error exception, is safeguarded by developer.In this maintenance process, software can constantly develop, and code can become new thing through many amendments, and model may be out in the cold.The post code of multiple version and initial code have had very large change, also cannot be corresponding with initial model, if at this moment need model to complete related work, will run into the inconsistence problems of model and code.This inconsistence problems can cause model expired, and so relevant to model a series of software development behaviors just cannot normally be carried out.
In actual development environment, often carry out by one group of developer cooperate completion code and relevant development task, code develops final molding by successive ignition.In whole performance history, code is managed by code management system, provides the several functions such as Version Control, conflict inspection, code distribution, child release management, alteration detection.Each state that each code unit (such as source code file) grows out of nothing is managed by this systematic unity, if need old version, the evolutional path of source code file, can send request to code management system.
Summary of the invention
Technical matters: the object of the invention is software model synchronous method in process code evolutionary process, with old code and old model for benchmark, by analyzing the changed content of fresh code and old code, and automatically identify the relation between old code and old model, old model modified and upgrades, obtaining the new model matched with fresh code.
Technical scheme: the software model synchronous method employing code analysis on altered project technology changed based on code of the present invention compares the difference between code, utilize code retrieval technique automatically will set up contact for software model and code, by software model the rule set that is suitable for, process code one by one to change, and automatic or semi-automatic renewal is carried out to model.
Software model of the present invention simplifies software entity, by suitable realization form or rule, its principal character described out.
Software model of the present invention the rule set that is suitable for comprise series of rules, each rule provides the element in model and the element relation in standard code, and this Codes and Standards code is pre-defined by developer.
Step 1, code analysis on altered project
From vicissitudinous code, the code filters of insubstantial change, non-intrinsically safe change, irrelevant change is gone out, obtains the change code that software model is relevant,
Described insubstantial changes and refers in continuous evolutionary process, developer may introduce the adjustment of some forms, such as blank character, null, and these change the storage content just changing code file, do not change the software action and structure that obtain according to code
Described non-intrinsically safe changes and refers under code syntax and semantic constraint, program code content changing, but remains unchanged in behavior and structure according to the software that code obtains,
Described irrelevant change refers to change and occurs in the code snippet irrelevant with model, but not in the scope that model is paid close attention to;
Step 2, model code are mated
Given software model, according to the type of model and the title of element, the change code relevant to software model to model mates, the element in Modling model and the corresponding relation between the element in code, and concrete matching process is as follows:
Step 2.1: read in software model, read in software model the rule set that is suitable for;
Step 2.2: read in the change code that software model is relevant;
Step 2.3: need corresponding element in Confirming model, the rule be suitable for according to model is one by one searched in the change code that software model is relevant, find the code snippet that may be associated with it, and provide confidence level, determine mate immediately or transfer to developer to confirm according to presetting believability threshold;
Step 2.4: the correspondence relationship information between the element in obtained model and the element in code is added in code library;
Step 3, code change process
Corresponding relation between element in the code modification information obtained, model and the element in code is translated as renewal rewards theory, and produce new model, having step is:
Step 3.1: according to software model the corresponding relation between rule, element in model and the element in code, the change code revised that are suitable for, the model element that amendment is corresponding;
Step 3.2: according to software model corresponding relation, the deleted change code between rule, element in model and the element in code that are suitable for, remove corresponding model element;
Step 3.3: according to software model corresponding relation, the newly-increased change code between rule, element in model and the element in code that are suitable for, judge whether to need to increase new element in a model newly, if so, then newly-increased new element in a model.
Insubstantial described in step 1 changes and refers to that, in continuous evolutionary process, developer may introduce the adjustment of some forms, and these changes do not change the software action and structure that obtain according to code.
Non-intrinsically safe described in step 1 changes and refers to that code content changes, but remains unchanged in behavior and structure according to the software that code obtains under syntax and semantics constraint.
Irrelevant change described in step 1 refers to change and occurs in the code snippet irrelevant with model, but not in the scope that model is paid close attention to.
Beneficial effect: in the software model synchronous method based on code change of the present invention, correlation function can be integrated in code release management system, can the difference of automatic decision code, determine how to revise model, manual intervention can be asked to developer for ambiguous situation.Particularly, method of the present invention has following beneficial effect:
(1) of the present invention based on code change software model synchronous method in, the difference of code by automatic analysis out, and can according to the rule-based filtering preset incoherent change difference, alleviate the burden of developer.
(2) in the software model synchronous method changed based on code of the present invention, model compares with code and adopts heuristic fuzzy matching, through manual confirmation, not only can ensure that correctness but also alleviate workload for uncertain situation.
(3) in the software model synchronous method changed based on code of the present invention, model can verify with code after modification, to guarantee the consistance of model and code.
(4) in the software model synchronous method changed based on code of the present invention, model compares flexibly with the definition rule of code, the complication system waiting enough adaptations different and the change of user's request.
Accompanying drawing explanation
Fig. 1 is the concrete implementing procedure schematic diagram of software model synchronous method changed based on code.
Fig. 2 is that code changes schematic diagram.
Fig. 3 is code analysis on altered project schematic flow sheet.
Fig. 4 is code schematic diagram corresponding to model.
Fig. 5 is the schematic diagram of developer's institute's figure in method.
Embodiment
First the software model synchronous method changed based on code of the present invention is needed existing software model and the software code corresponding with software model, can be managed the different editions of identical code unit by version control system in specifically implementing.The present invention resolves different software models according to rule set, can adopt code retrieval technique, in conjunction with heuristic information, sets up corresponding corresponding relation by between the element in model and the element in code.The code of different editions is compared, filters out the change of outbalance, according to software model the rule set that is suitable for, determine how to revise, delete and newly-increased model, and carry out final updated model.
The concrete implementing procedure of software model synchronous method changed based on code of the present invention as shown in Figure 1.
For a more detailed description to accompanying drawing some embodiment of the present invention below.
1, code analysis on altered project
The software model synchronous method changed based on code of the present invention is specifically implemented, and needs to analyze the code of new and old two versions, because difference is wherein exactly cause legacy software model and the inconsistent factor of new edition code.In concrete enforcement, need to understand exactly those changes should be reflected in original software model on earth.Fig. 2 is that code changes schematic diagram, there are differences between source code (Fig. 2 is left) and change code (Fig. 2 is right), in concrete enforcement, compiler can be customized, the new and old edition of process code, generate specific coded representation, the code not needing to be concerned about to filter some changes, as shown in Figure 3.These do not need the code be concerned about to change and mainly comprise the change of insubstantial code, the change of non-intrinsically safe code, irrelevant code change etc. three kinds.
(1) insubstantial code changes
Code is in continuous evolutionary process, developer may introduce the adjustment of some forms, such as blank character, null, these change the storage content no doubt changing code file, but real code can not be can be regarded as change, because all remain unchanged in behavior or in structure according to the software that code obtains, illustrate that these codes change and do not cause substantial change.When upgrading old edition model, need not consider that this type of changes completely, therefore needing in concrete enforcement, this change filtration to be gone out.
(2) non-intrinsically safe code changes
Code is all write with programming language, in accordance with certain syntax and semantics.Under this constraint, except insubstantial code changes, although also have some to change the code content of program, still remain unchanged in behavior and structure according to the software that code obtains.This is because program language in the design process, in order to easy to use, often for same implication adds multiple expression way, such as common programming language has while for circulation and combines sentence and for combination sentence these two kinds.If the while so in code may be made into for statement completely, and code not semantic change in itself.This change also can not affect the renewal of model, so also should be filtered in concrete enforcement.
(3) irrelevant code changes
Code is write according to model, and some code has directly reacted the semanteme of certain assembly in model, and some code is then to model further refinement and the adaptation to platform.If code changes occur in the code snippet irrelevant with model, although so these change the behavior or the structure that change software in itself, but it specifically changes not in the scope of model concern, therefore this class changes also needs to foreclose in concrete enforcement.
Code analysis on altered project is resolved code and the process compared, need the leading portion of manual modification compiler in the specific implementation, add self-defining processing rule, to be gone out by the code filters of insubstantial change, non-intrinsically safe change, irrelevant change from vicissitudinous code, obtain the change code that software model is relevant.
2, model code coupling
During the software model synchronous method changed based on code of the present invention is specifically implemented, certain corresponding relation is had between model and code, model is divided into the simplest assembly, as shown in Figure 4, illustrate for the activity diagram in unified modeling language, be then divided into node and limit, its interior joint is divided into a lot of subclass, limit is also divided into SNNP and unconditional two classes, and concrete implementation step is as follows:
Step 1: read in activity diagram model, reads in the rule set that model is suitable for;
Step 2: read in the change code that activity diagram model is relevant;
Step 3: determine to need the elements such as corresponding node and limit in activity diagram model, search in code according to rule one by one, find the code snippet that may be associated with it, and provide confidence level, determine mate immediately or transfer to developer to confirm according to presetting believability threshold.
Step 4: obtained corresponding informance is added in code library.
3, code changes process
After code changes and obtains, need, according to the corresponding relation between these changes and model code, to determine how to revise, delete and newly-increased model element.During the software model synchronous method changed based on code of the present invention is specifically implemented, some unascertainable situation, as match condition, amendment confirms, needs manual intervention, as shown in Figure 5.

Claims (1)

1., based on the software model synchronous method that code changes, it is characterized in that the step that the method comprises is:
Step 1, code analysis on altered project
From vicissitudinous code and the variance codes between legacy version and redaction program, the code filters of insubstantial change, non-intrinsically safe change, irrelevant change is gone out, obtains the change code that software model is relevant,
Described insubstantial changes and refers to that, in continuous evolutionary process, developer may introduce the adjustment of some forms, and these change the storage content just changing code file, do not change the software action and structure that obtain according to code,
Described non-intrinsically safe changes and refers under code syntax and semantic constraint, program code content changing, but remains unchanged in behavior and structure according to the software that code obtains,
Described irrelevant change refers to change and occurs in the code snippet irrelevant with model, but not in the scope that model is paid close attention to;
Step 2, model code are mated
Given software model, according to the type of model and the title of element, the change code relevant to software model to model mates, the element in Modling model and the corresponding relation between the element in code, and concrete matching process is as follows:
Step 2.1: read in software model, read in software model the rule set that is suitable for;
Step 2.2: read in the change code that software model is relevant;
Step 2.3: need corresponding element in Confirming model, the rule be suitable for according to model is one by one searched in the change code that software model is relevant, find the code snippet that may be associated with it, and provide confidence level, determine mate immediately or transfer to developer to confirm according to presetting believability threshold;
Step 2.4: the correspondence relationship information between the element in obtained model and the element in code is added in code library;
Step 3, code change process
Corresponding relation between element in the change code information obtained, model and the element in code is translated as renewal rewards theory, and produce new model, having step is:
Step 3.1: according to software model the corresponding relation between rule, element in model and the element in code, the change code revised that are suitable for, the model element that amendment is corresponding;
Step 3.2: according to software model corresponding relation, the deleted change code between rule, element in model and the element in code that are suitable for, remove corresponding model element;
Step 3.3: according to software model corresponding relation, the newly-increased change code between rule, element in model and the element in code that are suitable for, judge whether to need to increase new element in a model newly, if so, then newly-increased new element in a model.
CN201310135857.XA 2013-04-18 2013-04-18 A kind of software model synchronous method changed based on code Active CN103235729B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201310135857.XA CN103235729B (en) 2013-04-18 2013-04-18 A kind of software model synchronous method changed based on code
PCT/CN2013/086990 WO2014169628A1 (en) 2013-04-18 2013-11-13 Software model synchronism method based on code changing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310135857.XA CN103235729B (en) 2013-04-18 2013-04-18 A kind of software model synchronous method changed based on code

Publications (2)

Publication Number Publication Date
CN103235729A CN103235729A (en) 2013-08-07
CN103235729B true CN103235729B (en) 2016-03-16

Family

ID=48883774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310135857.XA Active CN103235729B (en) 2013-04-18 2013-04-18 A kind of software model synchronous method changed based on code

Country Status (2)

Country Link
CN (1) CN103235729B (en)
WO (1) WO2014169628A1 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103235729B (en) * 2013-04-18 2016-03-16 南京大学 A kind of software model synchronous method changed based on code
CN103793373B (en) * 2014-01-23 2017-02-01 福建工程学院 Tracking relation recovery method based on syntax
CN105159715B (en) * 2015-09-01 2018-07-20 南京大学 A kind of Python code change reminding method extracted based on the change of abstract syntax tree node
CN108334333B (en) * 2018-01-05 2021-07-23 武汉斗鱼网络科技有限公司 Method and device for updating source code base
CN111290777B (en) * 2020-01-23 2021-09-17 复旦大学 Code change sequence method oriented to software code unit and code measurement
CN112181430A (en) * 2020-09-29 2021-01-05 北京云族佳科技有限公司 Code change statistical method and device, electronic equipment and storage medium
CN113515278A (en) * 2021-06-16 2021-10-19 深圳奥哲网络科技有限公司 Low code model processing method, system, electronic device and storage medium
CN113918427B (en) * 2021-12-14 2023-03-31 阿里云计算有限公司 Data change response method and device
CN114020323B (en) * 2022-01-04 2022-05-10 阿里云计算有限公司 Model processing method, code obtaining method, device and electronic equipment
CN114036781B (en) * 2022-01-04 2022-05-06 阿里云计算有限公司 Data processing method, data display method and device and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681855A (en) * 2012-05-25 2012-09-19 南京邮电大学 Model-to-code converting method facing wireless sensor network

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6502239B2 (en) * 1998-11-12 2002-12-31 Computer Associates Think, Inc Method and apparatus for round-trip software engineering
US7856621B2 (en) * 2004-05-19 2010-12-21 International Business Machines Corporation Method for synchronization of concurrently modified interdependent semi-derived artifacts
JP2007265089A (en) * 2006-03-29 2007-10-11 Fujitsu Ltd Software maintenance support program, processing method, and device
US8196100B2 (en) * 2007-04-06 2012-06-05 International Business Machines Corporation Content management system for computer software with dynamic traceability between code and design documents
US8996349B2 (en) * 2007-10-11 2015-03-31 Microsoft Technology Licensing, Llc Synchronizing an abstract model and source code
CN103235729B (en) * 2013-04-18 2016-03-16 南京大学 A kind of software model synchronous method changed based on code

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681855A (en) * 2012-05-25 2012-09-19 南京邮电大学 Model-to-code converting method facing wireless sensor network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《基于活动图的软件回归测试用例自动生成技术研究》;叶楠;《中国优秀硕士学位论文全文数据库》;20121015;全文 *

Also Published As

Publication number Publication date
WO2014169628A1 (en) 2014-10-23
CN103235729A (en) 2013-08-07

Similar Documents

Publication Publication Date Title
CN103235729B (en) A kind of software model synchronous method changed based on code
Zhang et al. Interoperable validation for IFC building models using open standards
US20170192758A1 (en) Method and apparatus for migration of application source code
Schäfer et al. Mining framework usage changes from instantiation code
Huang et al. Confvalley: A systematic configuration validation framework for cloud services
Fierro et al. Shepherding metadata through the building lifecycle
US20200349130A1 (en) Matching metastructure for data modeling
CN104111828A (en) Automatic generation method and system of human-computer interaction interface
WO2022012327A1 (en) Code analysis method and system, and computing device
Ohrndorf et al. History-based model repair recommendations
Pease et al. Knowledge engineering for large ontologies with Sigma KEE 3.0
Schulze Analysis and removal of code clones in software product lines
Tchouanguem et al. BFO-based ontology enhancement to promote interoperability in BIM
Sanchez et al. Modelling and verifying smell-free architectures with the Archery language
Tinnes et al. Learning domain-specific edit operations from model repositories with frequent subgraph mining
EP3999917B1 (en) Method and system for generating a digital representation of asset information in a cloud computing environment
Lombardi et al. Co-evolution of Metamodel and Generators: Higher-order Templating to the Rescue.
CN114564737A (en) Method for defining upgrade maintenance authority based on configuration file and variable
Wang et al. Cmsuggester: Method change suggestion to complement multi-entity edits
Polášek et al. Automatic identification of the anti-patterns using the rule-based approach
Karthik et al. A collaborative method for code clone detection using a deep learning model
CN104881455B (en) A kind of architectural difference processing method and system based on MYSQL
Vidacic et al. Taxonomy of anomalies in business process models
CN117033460B (en) Automatic data model construction system and method based on bus matrix
US20220334807A1 (en) Method and system for generating engineering programs for an industrial domain

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant