CN107148615A - Computer executable model reverse engineering approach and device - Google Patents
Computer executable model reverse engineering approach and device Download PDFInfo
- Publication number
- CN107148615A CN107148615A CN201580059251.XA CN201580059251A CN107148615A CN 107148615 A CN107148615 A CN 107148615A CN 201580059251 A CN201580059251 A CN 201580059251A CN 107148615 A CN107148615 A CN 107148615A
- Authority
- CN
- China
- Prior art keywords
- model
- source code
- object module
- converted
- source
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/74—Reverse engineering; Extracting design information from source code
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/427—Parsing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/75—Structural analysis for program understanding
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
A kind of executable server model reverse engineering approach of computer, the server model reverse engineering approach comprises the following steps:Receive source code;Receive the transformation rule for the source code to be converted to object module;The source code is parsed using the resolver related to the source code, by the parsing data storage with specific parenchymal structure in memory;The parsing data stored are converted into meta-model;The meta-model is converted to by object module according to the transformation rule received;The object module is received, to perform the configuration for being used for generating source code;The element of the object module is read, to confirm whether the element is used to generate the source code;The proof rule being had according to the element is verified to the model element for generating the source code;And the source code is generated according to the result.
Description
Technical field
This disclosure relates to computer executable model reverse engineering approach and device, and more particularly, to following
The executable model reverse engineering approach and device of computer:Definition structure and by the source code of program be converted to model with from
The rule of the model of dynamic generation desired type, therefore be easy to analyze and redesign program structure.
Background technology
Source code can be directly read by using family or is carried out source code visualization by using effect analysis instrument
Existing computer program is analyzed.Former approach depends primarily on the technical capability of analysis personnel, and latter side
Method is simple and mechanically visualizes the model of program as it is so that need expense that program is processed into expectation class
The data of type.In both approaches, the product generated is only reference data and can not reused.
The product reached by the reverse quantity sheet of model is broadly divided into two types.One type is designed to what is typically used
Modeling language, it is corresponding with UML (UML).Another type is by effect analysis corresponding with Change Miner
The dedicated expression scheme that instrument is used.Fig. 7 a are exemplified with unified modeling language UML structural element, and Fig. 7 b are exemplified with conduct
The Change Miner of effect analysis instrument.
In the case of previous type, although it can provide general symbol(s) is used for various SW environment and volume to generate
Cheng Yuyan model, but its bulky.In addition, though rough SW models can be made, but its symbol is provided by UML
Source code information lose.It is thus impossible to generate executable source code again using the model generated by reverse-engineering.
In the case of latter type, the product of the reverse-engineering provided by effect analysis instrument can express various source code letters
The angle of breath has high usage.However, in the latter case, the secondary simple report utilized can not be realized by merely providing
Accuse, including the product of reverse-engineering is used as model and design is performed based on the model, this causes utilization rate to reduce.In addition,
Because product shows the model of source code as it is, so it comprises many unnecessary information.
Accordingly, it is desirable to provide following device:The device can be made by reverse-engineering desired mould shapes with
Reused in design, using all information of source code, and then produce the source generation that can perform in various programming languages
Code.Use the device, it is possible to increase the convenience and its quality of SW exploitations.
Korean Patent Registration No.10-0463833 discloses component automated conversion system and method, and it, which is automatically analyzed, is
The source code of system, and convert source code into component using the analysis information in the computing system of object-oriented.
Korean Patent Registration No.10-0965706, which is disclosed, can reinsert the computer installation and code of code again
Insertion method, the code reinserts method and passes through one group of expansible and structure being performed in the step of each during developing
The code made reinserts unit to provide the reinserting and change of code unit, the arrangement of code unit and execution.
The content of the invention
Technical task
One embodiment of the disclosure provides the server model reverse engineering approach and dress that a kind of computer can perform
Put, existing source code can be converted to the model of desired type to be easy to by the server model reverse engineering approach and device
Analysis, Structure Understanding and the redesign of configuration processor.
Another embodiment of the disclosure provides the model reverse engineering approach and device that a kind of computer can perform, should
Model reverse engineering approach and device can lose all information of ground expression source code without any information in a model, and
All the elements of source code are confirmed using only model.
The another embodiment of the disclosure provides the model reverse engineering approach and device that a kind of computer can perform, should
Model reverse engineering approach and device can convert source code into the expression of abstract form abstractively to express all information, and
It is not only restricted to prepare the programming language of source code.
The another embodiment of the disclosure provides the model reverse engineering approach and device that a kind of computer can perform, should
Model reverse engineering approach and device can use model to generate the program performed with various programming language identical functions.
Technical solution
According to embodiment of the present disclosure, there is provided the model reverse engineering approach that a kind of computer can perform, this method
Comprise the following steps:(a) source code is received;(b) transformation rule for the source code to be converted to object module is received;
(c) source code is parsed using the resolver related to the source code, there will be specific parenchymal structure (material
Structure parsing data storage) is in memory;(d) the parsing data stored are converted into meta-model;And (e)
The meta-model is converted to by object module according to the transformation rule received.
According to an embodiment, this method can also comprise the following steps:(f) according to being suitable for UML
(UML) form of standard is changed to the object module after conversion again, to be stored in file.
According to an embodiment, the step (b) may comprise steps of:Receive by source transformation rule, model conversion
The transformation rule of rule, naming rule and relation rule configuration.Here, the step (e) may comprise steps of:According to institute
Transformation rule is stated to specify and change the element-specific of the source code or the element-specific of the object module.
According to an embodiment, the step (c) may comprise steps of:According to the programming language class of the source code
The source code is resolved to the data with different substantial structures by type.
According to an embodiment, the step (d) may comprise steps of:Independently of source code type and programming language
Type and the parsing data are converted into the meta-models of all elements that the source code is shown according to specific parenchymal structure.
According to an embodiment, this method can also comprise the following steps:(g) unrelated source code is foreclosed, with
Just do not changed according to the transformation rule.
According to an embodiment, this method can also comprise the following steps:(h) source for that can not be expressed with UML is received
The independent transformation rule of code information.In another embodiment, the step (h) can also comprise the following steps:For not
The source code information that can be expressed with the UML, in message lifeline, abnormal vital line, checking lifeline or code life
Message is generated at least one in line.
According to an embodiment, this method can also comprise the following steps:Verify the source code all information whether
It is included in the object module.
According to an embodiment, the step (e) may comprise steps of:(e-1) according to the transformation rule received
The meta-model is converted into source model;(e-2) receive for the source model is converted to the object module model extremely
Transformation rules;And the source model is converted to the target mould by (e-3) according to the model to transformation rules
Type.
According to an embodiment, this method can also comprise the following steps:(i) object module is received, to perform use
In the configuration of generation source code;(j) element of the object module is read, to confirm whether the element is used to generate the source
Code;(k) proof rule being had according to the element is verified to the model element for generating the source code;With
And (l) generates the source code according to the result.
According to an embodiment, the step (i) may comprise steps of:Register the element and pin of the object module
To the transformation rule of respective element, and the execution condition of the transformation rule is specified to perform the configuration.
According to embodiment of the present disclosure there is provided a kind of reverse design library part editor and reuse of model, the device includes:Memory, institute
Memory is stated to be configured to the available program storage of model reverse-engineering in the memory;And processor, the place
Reason device is configured to perform described program, wherein, the source code received is resolved to tool by the processor using resolver
There are the parsing data of specific parenchymal structure, the data after parsing are converted into meta-model, according to the transformation rule received by institute
State meta-model and be converted to object module, and use the object module generation source code after conversion.
According to an embodiment, the processor can receive source code and for the source code to be converted into target mould
The transformation rule of type, and by the parsing data storage with the specific parenchymal structure after parsing in memory.In another reality
Apply in mode, the processor, which can resolve to the source code received according to the programming language type of the source code, to be had
The data of different types of substantial structure.
According to an embodiment, the processor can be independently of source code type and programming language type by the solution
Analysis data are converted to according to specific parenchymal structure the meta-model of all elements to show the source code.In another embodiment
In, the processor can receive the independent transformation rule of the source code information for that can not be expressed with UML.
According to an embodiment, the processor can be converted to the object module according to by the source model received
The source model is converted to the object module by model to transformation rules.In another embodiment, the processor
Can receive by the source model qualified name and the object module qualified name configuration model to transformation rules.
According to an embodiment, the processor can receive the object module to perform for generating matching somebody with somebody for source code
Put, read the element of the object module to confirm whether the element is source code generation object element, according to the element
The proof rule being had is verified to the generation object module element, and generates source code according to the result.
In another embodiment, the processor can register the element and the transformation rule for respective element of the object module,
And specify the execution condition of the transformation rule to perform the configuration.
According to embodiment of the present disclosure there is provided a kind of computer-readable recording medium, in the computer-readable storage
It is stored with medium for the program for performing model reverse engineering approach, this method comprises the following steps:(a) source code is received;
(b) transformation rule for the source code to be converted to object module is received;(c) parsing related to the source code is used
Device parses the source code, by the parsing data storage with specific parenchymal structure in memory;(d) it will be stored
Parsing data are converted to meta-model;And the meta-model is converted to object module by (e) according to the transformation rule received.
Beneficial effect
Disclosed technology can have the following effects that.However, because it is not meant to that particular implementation should include
Institute is effective or only there was only these effects, so should not be understood the scope limited to this of disclosed technology.
According to an embodiment of the disclosure, the executable server model reverse engineering approach of computer and device can
Existing source code is converted into the model of desired type with the analysis of program easy to carry out, Structure Understanding and redesign.
According to another embodiment of the disclosure, the executable model reverse engineering approach of computer and device can be in moulds
Express all information of source code with there is no any information loss in type, and model is used only to confirm all interior of source code
Hold.
According to the another embodiment of the disclosure, the executable model reverse engineering approach of computer and device can be by sources
Code conversion, abstractively to express all information, and is not only restricted to prepare the programming language of source code for the expression of abstract form.
According to the another embodiment of the disclosure, the executable model reverse engineering approach of computer and device can be used
Model is performed and the programs of various programming language identical functions to generate.
Brief description of the drawings
Fig. 1 is the block diagram of the configuration of exemplary model reverse-engineering device.
Fig. 2 is the block diagram of the configuration of the model reverse engineered program actuator in diagrammatic illustration 1.
Fig. 3 is the view of configuration and the operation of the source code model converter in diagrammatic illustration 2.
Fig. 4 is to illustrate the reverse regular view received by the transformation rule receiver in Fig. 3.
Fig. 5 is the view of model in diagrammatic illustration 2 to configuration and the operation of model transformer.
Fig. 6 is regarding for the code train expression formula reverse engineering approach of source code model converter of the illustration in Fig. 2
Figure.
Fig. 7 is that the code generator in diagrammatic illustration 2 is configured and for the view for the method for generating code.
Fig. 8 is the element for illustrating the unified modeling language UML and Change Miner as effect analysis instrument.
Embodiment
The embodiment that the explanation of the disclosure illustrates only for structure or function, therefore the scope of the present disclosure should not be by
It is construed as limited to embodiment illustrated in embodiment.That is, due to can the characteristic for not departing from embodiment feelings
Implement embodiment according to several form under condition, so it should also be understood that unless expressly stated otherwise, it is otherwise described
The limitation of any details that is not limited by the foregoing description of embodiment, but should enter in appended claim limited range
Row is construed broadly as.Therefore, the various changes and modifications fallen into the scope of claim or the equivalent of such scope because
This is intended to be covered by appended claims.
In addition, the term described in the disclosure be appreciated that it is as follows:
Although the term of " first " and " second " etc. can be used for describing various assemblies, such component can not be by
It is interpreted as being limited to terms above.Terms above is used to mutually distinguish a component and another component.For example, not departing from this
In the case of disclosed interest field, first assembly can be referred to as the second component, and similarly, the second component can be claimed
For first assembly.
It will be appreciated that when an element is referred to as " being connected to " another element, the element can be connected directly
To another element, or there can also be intermediary element.On the contrary, when element is referred to as " being connected directly to " another element
When, in the absence of intermediary element.In addition, unless explicitly described as on the contrary, otherwise word " comprising " and such as " include " or " bag
Include " modification will be understood as it is implicit include stated element, but be not excluded for including any other element.Furthermore it is possible to
Similarly explain description component between relation such as " ... between ", " between directly existing ... " or " with ... it is adjacent " and
Other expression of " directly with ... adjacent ".
Clearly indicate unless the context otherwise, singulative " one ", " one " and "the" otherwise in the disclosure are intended to
Also plural form is included.It will be further understood that the term such as "comprising" or " having " is intended to refer to the spy disclosed in specification
Levy, numeral, operation, action, component, the presence of components or groups thereof, and be not intended as exclusion and there may be or can add one
Individual or more further feature, numeral, operation, action, component, the possibility of components or groups thereof.
Mark alphabetical (for example, a, b, c etc.) in each step is for the purpose of illustration, without describing the suitable of each step
Sequence.Unless context is clearly referred to, otherwise each step can change from mentioned order.I.e., it is possible to according to described phase
Each step is performed with sequentially, each step can be substantially simultaneously performed, or can perform in a reverse order each
Individual step.
The disclosure can be implemented in computer readable recording medium storing program for performing and computer-readable code, and computer can
Read record medium can include any kind of tape deck of storage computer system-readable data.Computer-readable record is situated between
The example of matter can be the medium for including implementing according to the form of carrier wave (for example, the transmission for passing through internet) ROM,
RAM, CD-ROM, tape, floppy disk, optical data storage device etc..Pass through in addition, computer readable recording medium storing program for performing can be distributed in
In the computer system of network connection together so that computer-readable code is stored and realized according to distribution scheme.
Term used in this application is only used for describing specific embodiment, and is not intended to the limitation disclosure.Unless
Defined otherwise, otherwise all terms used herein including technology or scientific terminology have general with disclosure art
The implication identical implication that logical technical staff is generally understood.Unless explicitly defined in the application, otherwise such as usually used
Term defined in dictionary is to be interpreted be with the context implication identical implication in association area, and should not be construed
For with preferable or excessively formal implication.
Fig. 1 is the block diagram of the configuration of exemplary model reverse-engineering device.
Reference picture 1, can include processor 110, non-according to the reverse design library part editor and reuse 10 of the model of embodiment of the present disclosure
Volatile memory 120, volatile memory 130, network interface 140, input unit 150 and output device 160.
The processor 210 of processor 110 can include model reverse engineered program actuator 112 and storage manager 114.Mould
Type reverse engineered program actuator 112 perform model reverse engineered program with by source code reverse-engineering perform model generation and
Transfer process.Storage manager 214 manages the non-volatile memories for being read and being write by model reverse engineered program actuator 112
Storage region in device 120 and volatile memory 130.
Nonvolatile memory 120 can be configured by solid-state disk SSD or hard disk drive DDD, and for storage model
Reverse engineered program and perform data required for the model reverse engineered program.Volatile memory 130 is used to deposit temporarily
The model reverse engineered program stored in storage nonvolatile memory 120.
Network interface 140 can include being used for the externally connected server of the reverse design library part editor and reuse 10 of model (for example, being used for
Local network LAN communication adapter) environment.
Input unit 150 can include be used for receive user input environment, for example including mouse, trace ball, touch pad,
Graphic tablet, scanner, touch-screen, keyboard or indicator device.Output device 160 can include being used to export the specific letter of user
The environment of (for example, meta-model, object module or source code) is ceased, it can be for example including monitor or touch-screen.In a reality
Apply in mode, input unit 150 and output device 160 can be connected to each other by remotely connecting.
Fig. 2 is the block diagram of the configuration of the model reverse engineered program actuator in diagrammatic illustration 1.
Reference picture 2, includes source code model according to the model reverse engineered program actuator 112 of embodiment of the present disclosure
Converter 210, model are to model transformer 220 and code generator 230.Model reverse engineered program actuator 112 is can
The device of simultaneously transformation model is generated by source code reverse-engineering, it can receive source code or source model to generate and change use
The model of form is expected at family, and specifies flexile proof rule when preparing and using transformation rule.In addition, model inversion
Store all information for the source code that be converted to programming language in a model to engineering process actuator 112.Below with reference to
Fig. 3 to Fig. 7 describes source code model converter 210, model to model transformer 220 and code generator 230.
Fig. 3 is the view of configuration and the operation of the source code model converter in diagrammatic illustration 2.
Reference picture 3, includes transformation rule receiving unit 212, solution according to the model transformer 210 of embodiment of the present disclosure
Parser 214, meta-model converting unit 216 and model conversion unit 218.When have input source code, transformation rule receiving unit
212 can receive transformation rule, and resolver 214 can be with analysis source code to store data in memory, and meta-model
Converting unit 216 can obtain the data that are stored in memory source code information is stored in the member independently of program language
In model.Model conversion unit 218 can receive transformation rule and meta-model is converted into object module, and calculating meets UML
The model of standard.Source code is the code to be converted for uml model, and it can be (for example, Java, C by a variety of programming languages
And COBOL) prepare source in one kind.
The conversion that transformation rule receiving unit 212 can receive for the source code received to be converted to object module is advised
Then.When there is naming convention in source code, transformation rule receiving unit 212 is appreciated that the agreement and received to include conversion
The transformation rule of the configuration of object module.Transformation rule receiving unit 212 can be received including the source code on being inputted
Information, the information on the object module to be changed, the information on naming convention and the conversion on the information of relation are advised
Then.Transformation rule is described below with reference to Fig. 4.
Resolver 214 can with analysis source code with by the parsing data storage with specific parenchymal structure in memory.
That is, resolver can be uploaded to the data of the substantial structure with tree format on memory with analysis source code.Resolver 214
The programming language that can be had according to source code and with different forms.Parsing be compiler or translater in a computer
By source code translation into machine language process the step of, it is the mistake analyzed the syntactic structure or grammer of each sentence
Journey.That is, it is one so that the tab character string is configured into syntactically correct analytic tree to receive the tab character string occurred in source program
Individual task.Therefore, resolver 214 can have different forms according to the species of source code, and according to the volume of source code
Cheng Yuyan species is using the data with different substantial structures come analysis source code.
The parsing data stored can be converted to meta-model by meta-model converting unit 216.Meta-model converting unit 216
The data prepared by various source codes can be converted to meta-model substantial structure.When no matter source code have what programming language
When speech all changes resolver 214, meta-model converting unit 216 enables the reverse design library part editor and reuse 10 of model to generate with phase homogenous quantities
With the uml model of form.Therefore, meta-model converting unit 216 can independently of source code and programming language species and by number
The meta-model of specific parenchymal structure is shown as according to all elements be converted to source code.
Model conversion unit 218 can will be by meta-model according to the transformation rule received by transformation rule receiving unit 212
The meta-model that converting unit 216 is changed is converted to object module.Model conversion unit 218 can be by the object module after conversion again
The form for meeting UML standards is converted to, is write on file.Model conversion unit 218 can be received for not by table
Up to the independent transformation rule of the grammer of the structure series for uml model, to be converted into uml model.Can be according to
The form of uml model stores the model changed by model conversion unit 218, and can pass through the reasonable softwares of such as IBM
The UML softwares for editing of framework (Rational Software Architect) confirm the model.Model conversion unit 218 can
To exclude the source code unrelated with the object to be changed according to transformation rule, and in be changed source generation, is specified according to transformation rule
The element-specific of code or the element-specific of object module.The element-specific of source code is to be converted among the component of source code
For the object item of object module, the element-specific of the source code can be corresponding with the bag of source code, class, attribute and operation,
And the element-specific of object module is the transformation result project of the object module after conversion, the element-specific of the object module
Can with bag, interface, class, attribute, operation, cooperate, sequence chart, class figure, code lifeline, message lifeline, checking lifeline,
Abnormal vital line correspondence.Here, unrelated source code is the element for having not designated as element-specific that can be selected by user.
For example, when the information of annotation or never call is selected as unrelated source code by user, relevant information can be abandoned.In addition,
Model conversion unit 218 can verify whether all information of source code are all included in object module.
Fig. 4 is to illustrate the reverse regular view received by the transformation rule receiver in Fig. 3.
In Fig. 4, after transformation rule can be by the information (source transformation rule) 111 on inputting source code, on conversion
Object module information (transformation rules) 112, on the model element after conversion naming convention information 113, with
And configure on the information of the relation between model element.
Source transformation rule 40 can use regular expression to specify the source to be converted for model.The source can be included just
Then expression formula, the regular expression includes qualified name, attribute, function, source category.Qualified name is to specify reverse-engineering target source
Regular expression.Only by the source code with the matching regular expressions defined in the project among the class name including bag or file
Be converted to model.When bag or class name have naming convention, model conversion unit 218 can use project to classify simultaneously source
Source is converted into model, and excludes the source code unrelated with reverse-engineering target.Attribute is indicated included by class or file
Function regular expression.Model conversion unit 218 can by only with all or spy among function included in file
The class for determining function or qualified name matching is converted to model.Write when source is not with java but with c or other Languages and text
When part name is only identified with file extension, model conversion unit 218 can set value corresponding with file extension in the project
So that certain types of source only is converted into model.
Transformation rules 420 can be with the structural information of display target model.Only ID is being used for of being given by user
Identification will be converted to the value of the element of model.Model element is the project for specifying the element of the model to be changed, the model
Element assignment bag, interface, class, attribute, operation, cooperation, sequence chart, class figure, code lifeline, message lifeline, checking life
Line and abnormal vital line.Source element is the project for specifying the element that be converted to source, and the source element can specify bag, class, attribute
And operation.When not specifying source element, the element not in source and target model may be inserted into.Version type (Stereotype) can
With with the format write according to appointed mode in model element after conversion.Upper strata element ID, which is used to specify, includes phase
Answer the upper strata element ID of element.
Naming convention 430 can indicate the letter on the naming convention for being named to the model element to be changed
Breath.Source prefix is the prefix in the source to be removed when being converted to model.Model prefix is to be included in mould when being converted to model
Prefix in type.Source prefix is the prefix in the source to be removed when being converted to model.Model prefix is the quilt when being converted to model
It is included in the prefix in model element title.Naming convention is to work as source name corresponding with model element being converted to model name
When the naming convention applied.Such as "None", " Korean ", project as " self-defined " can be specified, wherein, "None" uses source
Name is referred to as model name, and " Korean " is turned the English name in source using the Korean title-English name dictionary pre-entered
Be changed to Korean title with by the Korean title be used as model name, and it is " self-defined " prepare its be not simple English-Korea Spro
The source program to be specified in the case that language is changed.Name class indicates to work as is designated as " self-defined " in naming convention in project
In the case of determine model name when used java class information.
Even if the relation between the model element after conversion is not present in source code, but when needed, relation conversion rule
440 the relation between the model element after conversion then can be set.Type (Type) indicate such as association, it is extensive, realize and according to
Rely such relationship type.Relationship elementses ID indicates the model element ID for setting relation.
Fig. 5 is the view of model in diagrammatic illustration 2 to configuration and the operation of model transformer.
In fig 5 a, model to model transformer 220 includes model to transformation rules receiving unit 222 and model extremely
Model conversion unit 224.
In one embodiment, source code model converter 210 be able to will be inputted according to the transformation rule received
Source code be converted to the source models of UML forms.Model to model transformer 220 can receive model to transformation rules,
And source model is converted to by final goal model according to model to transformation rules.Model is describe in detail in Figure 5
To transformation rules.
More specifically, model can move to transformation rules according to model to model transformer 220 and rebuild source mould
The bag of type and the position of class.That is, model to model transformer 220 can be in the case where the class of source model bag be many by bag progress
Separation, and separated class in the case where the operation of class is a lot.In the same fashion, model is to model transformer
220 can wrap in integration in the case that the class of source model bag is seldom and integrate class in the case of seldom in the operation of class.Change sentence
Talk about, when the bag or class for needing the source model according to transformation rule in meta-model after whole merger and reorganization conversion, model to mould
Source model can be converted to object module by type converter 220 according to model to transformation rules.
Transformation rule receiving unit
Fig. 5 b are view of the exemplary model to transformation rules.
In figure 5b, model to transformation rules by source model Qualifiedname 510 and object module
Qualifiedname 520 is configured.Source model Qualifiedname 510 is the source model element of object module to be converted to
Qualified name, and all underlying model elements of the source model element indicated by the qualified name are copied to by object module
On the model element that Qualifiedname 520 is indicated.When being copied to object module, with source model Qualifiedname
510 differences are still integrated into an object module member with the identical source model elements of object module Qualifiedname 520
Element.On the contrary, replicate respectively with source model Qualifiedname 510 higher elements title identical source model element and with
The different source model element of object module Qualifiedname 520 higher elements title.Object module Qualifiedname
520 indicate that object module element thereon will be copied to by the elements indicated of source model Qualifiedname 510
Qualifiedname 520。
Fig. 6 is regarding for the code train expression formula reverse engineering approach of source code model converter of the illustration in Fig. 2
Figure.
In Fig. 6 a, source code model converter 210 can receive the transformation rule of regular expression type first to turn
Change the expression formula, and select and parse the source code to be changed with by the data storage after parsing in memory.Next,
Source code model converter 210 can obtain the data stored in memory by meta-model converter 216, by source code
Information is stored in the model independently of programming language.Model transformer 218 can receive received transformation rule, with basis
The data that transformation rule conversion is changed by meta-model converting unit 216.It is able to will be changed again according to the form for meeting UML standards
Data afterwards are changed and stored it in file.
When meta-model is converted into uml model according to transformation rule, unexpressed structure series in uml model
Grammer can be changed by receiving single transformation rule.The detailed description of transformation rule is given below.
1) familiar things:The funcall or the logical expression of combination fragment not being expressed as among the internal logic of function
Formula can generate same as such as code, checking, exception and message in the code train lifeline for being adapted for use with purpose
Information is walked, and logical code can be expressed as in document column.
2) message:The grammer of generation message can generate message in message lifeline.According to whether in the presence of with by generating
The functions of the matching regular expressions that the specific function of message is proposed determines whether to generate message in message lifeline.
3) unexpected message:Message can be generated in abnormal vital line by causing the grammer of error message.According to whether in the presence of
Determine whether to generate in abnormal vital line with the function of the matching regular expressions proposed by the specific function of generation error
Message.
4) message is verified:Cause the grammer of mistake can be with while the input parameter of such as basic input value inspection is verified
Message is generated in checking lifeline.According to whether in the presence of with by function and grammatical pattern corresponding with input value checking propose
The function of matching regular expressions come determine whether checking lifeline in generate message.
5) code message:It is not converted into operation calls, other logical sums annotation of combination fragment can give birth in code
Message is generated in life line.In operation the internal logic before being expressed as synchronization message or generation combination fragment will be called complete
Expression is in code lifeline.Just before modeling element appearance, the operation calls grammer of source code and corresponding with combining fragment
Original grammer be also expressed in code lifeline (completely expression original source code with verify model conversion match).
6) parameter declaration and initialization:Can use in the form of English word title-Hangul word title input and
And write parameter name with Korean according to the first information of the form change matched with logical expression.As for typonym,
Fundamental type according to the mapping table by mapping Source Type and types of models and producing come translation type title, and except basic
Type beyond type by type (Type) name translation to be converted to the typonym of model according to cloth set symbol, the arrangement
Symbol is according to whether being arranged and defined in logical expression.Parameter initialization means Transformational Grammar as it is.
7) power and energy:It is regular expression by syntax conversion according to pre-defined regular expression rule.Example)
Strcpy ((parameter name), meet (parameter name) left hand rule in the case of))->$ { 1 }=$ { 2 }, the grammer quilt
Be converted to right hand expression formula.Therefore, such as strcpy (a, b) grammer is converted into a=b grammers.
Fig. 6 b illustrate how to express the expression for the simple sequence series that can not be indicated as UML expression formulas in sequence chart
Formula.The generation of source code model converter 210 is for as such as code, checking, exception and the message of code train expression formula
Any lifeline in sequence chart to indicate code train expression formula, using the lifeline come draw message, and by the message
Document content be stored in expression formula.
Fig. 7 is that the code generator in diagrammatic illustration 2 is configured and for the view for the method for generating code.
In figure 7 a, code generator 230 can be tested including code generator configuration 232, model scanning instrument 234, model
Card 236 and code maker 238.Code generator 230 is the module for the source code that various programming languages are generated based on model.Generation
Code generator 230 can be generated based on the transformation rule mapped for each in model element and logical expression
Program source code.Code generator 230 can use model to generate the source code of various language.
In fig .7b, code generator configuration 232 can perform preparation transformation rule to describe desired source code
Configure (S710).First, a transformation rule project is generated to register the model element to be changed in the project, and is directed to
Each Element generation simultaneously registers transformation rule.When registering transformation rule, describe the conversion behavior of transformation rule and specify to turn
Change the execution condition of rule.When all have registered transformation rule completely for all elements, the knot for the source code to be prepared is defined
Structure.
Generation is directed to institute's preparation model after expecting preparing software model completely or while being prepared for software
Code when, it is desirable that select the transformation rule project for expectational model, and then perform source code systematic function.No
Pipe is whole model or department pattern, can generate source code.
When performing source code systematic function, model scanning instrument 234 is performed in code generator 230.Model scanning instrument
234 can continuously read element according to scheme from top to bottom from top-most element, to confirm whether coherent element is source
Code building object element.In the case of source code generation object element, model scanning instrument 234 is sent to model checking 236
Coherent element (S720).
Model checking 236 can receive source code generation object element and be held according to the proof rule for coherent element
Row checking (S730).When there is mistake after completing checking, model checking 236 can send the mistake in model scanning instrument
234, and model scanning instrument 234 can store the result.
When verifying all model elements completely and there is mistake, model scanning instrument 234 can export institute on screen
There is the result (S740) of checking.When mistake is not present as the result of checking, code maker 238 can be according to transformation rule
Generate source code (S750).
Although there is provided herein the description of the preferred embodiment of the disclosure, it will be appreciated by those skilled in the art that
It can change or change in various manners in the case of the technical principle and scope that the claim appended by not departing from is limited
Become the disclosure.
Industrial applicibility
According to the disclosure, there is provided following computer eXecute UML reverse engineering approach and device:The computer can
Perform model reverse engineering approach and device definition structure and the source code of program is converted into model with needed for automatically generating
The rule of the model of type, therefore be easy to analyze and redesign program structure.
Claims (23)
1. a kind of executable model reverse engineering approach of computer, the model reverse engineering approach comprises the following steps:
(a) source code is received;
(b) transformation rule for the source code to be converted to object module is received;
(c) source code is parsed using the resolver related to the source code, by the solution with specific parenchymal structure
Analyse data storage in memory;
(d) the parsing data stored are converted into meta-model;And
(e) meta-model is converted to by object module according to the transformation rule received.
2. according to the method described in claim 1, this method is further comprising the steps of:(f) according to being suitable for UML
The form of UML standards is changed to the object module after conversion again, to be stored in file.
3. according to the method described in claim 1, wherein, the step (b) comprises the following steps:Receive by source transformation rule,
The transformation rule of transformation rules, naming rule and relation rule configuration.
4. method according to claim 3, wherein, the step (e) comprises the following steps:According to the transformation rule come
Specify and change the element-specific of the source code or the element-specific of the object module.
5. according to the method described in claim 1, wherein, the step (c) comprises the following steps:According to the volume of the source code
The source code is resolved to the data with different substantial structures by journey language form.
6. according to the method described in claim 1, wherein, the step (d) comprises the following steps:Independently of source code type and
Programming language type and the parsing data are converted to according to specific parenchymal structure and show all elements of the source code
Meta-model.
7. according to the method described in claim 1, this method is further comprising the steps of:(g) unrelated source code is foreclosed,
So as not to be changed according to the transformation rule.
8. according to the method described in claim 1, this method is further comprising the steps of:(h) receive for that can not be expressed with UML
The independent transformation rule of source code information.
9. method according to claim 8, wherein, the step (h) is further comprising the steps of:It is described for that can not use
The source code information of UML expression, in message lifeline, abnormal vital line, checking lifeline or code lifeline extremely
Message is generated in few one.
10. method according to claim 8, wherein, the step (h) is further comprising the steps of:Checking is for that can not use
The source code information of the UML expression, in message lifeline, abnormal vital line, checking lifeline or code lifeline
At least one in generate message.
11. according to the method described in claim 1, wherein, the step (e) comprises the following steps:
(e-1) meta-model is converted to by source model according to the transformation rule received;
(e-2) receive for the source model to be converted to the model of the object module to transformation rules;And
(e-3) source model is converted to by the object module according to the model to transformation rules.
12. according to the method described in claim 1, this method is further comprising the steps of:
(i) object module is received, to perform the configuration for being used for generating source code;
(j) element of the object module is read, to confirm whether the element is used to generate the source code;
(k) proof rule being had according to the element is tested the model element for generating the source code
Card;And
(l) source code is generated according to the result.
13. method according to claim 12, wherein, the step (i) comprises the following steps:Register the object module
Element and the transformation rule for respective element, and specify the execution condition of the transformation rule to perform the configuration.
14. a kind of reverse design library part editor and reuse of model, the reverse design library part editor and reuse of the model includes:
Memory, the memory is configured to the available program storage of model reverse-engineering in the memory;And
Processor, the processor is configured to perform described program,
Wherein, the source code received is resolved to the parsing number with specific parenchymal structure by the processor using resolver
According to, the data after parsing are converted into meta-model, the meta-model is converted to by object module according to the transformation rule received,
And use the object module generation source code after conversion.
15. device according to claim 14, wherein, the processor receives source code and for the source code to be turned
The transformation rule of object module is changed to, and by the parsing data storage with the specific parenchymal structure after parsing in memory
In.
16. device according to claim 15, wherein, the processor will according to the programming language type of the source code
The source code received resolves to the data with different types of substantial structure.
17. device according to claim 15, wherein, the processor is independently of source code type and programming language type
And the parsing data are converted to according to specific parenchymal structure to the meta-model of all elements to show the source code.
18. device according to claim 15, wherein, the processor receives the source code for that can not be expressed with UML
The independent transformation rule of information.
19. device according to claim 14, wherein, the processor is according to being converted to the source model received
The source model is converted to the object module by the model of object module to transformation rules.
20. device according to claim 19, wherein, the processor is received by the qualified name of the source model and described
The model of the qualified name configuration of object module is to transformation rules.
21. device according to claim 14, wherein, the processor receives the object module to be used to generate to perform
The configuration of source code, reads the element of the object module to confirm whether the element is source code generation object element, root
The proof rule having according to the element is verified to the generation object module element, and is generated according to the result
Source code.
22. device according to claim 21, wherein, the processor registers the element of the object module and for phase
The transformation rule of element is answered, and specifies the execution condition of the transformation rule to perform the configuration.
23. it is stored with a kind of computer-readable recording medium, the computer-readable recording medium for performing the reverse work of model
Cheng Fangfa program, this method comprises the following steps:
(a) source code is received;
(b) transformation rule for the source code to be converted to object module is received;
(c) source code is parsed using the resolver related to the source code, by the solution with specific parenchymal structure
Analyse data storage in memory;
(d) the parsing data stored are converted into meta-model;And
(e) meta-model is converted to by object module according to the transformation rule received.
Applications Claiming Priority (5)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR10-2014-0167334 | 2014-11-27 | ||
KR20140167334 | 2014-11-27 | ||
KR1020150163109A KR101770292B1 (en) | 2014-11-27 | 2015-11-20 | Computer-executable model reverse engineering method and apparatus performing the same |
KR10-2015-0163109 | 2015-11-20 | ||
PCT/KR2015/012587 WO2016085213A1 (en) | 2014-11-27 | 2015-11-23 | Computer-executable model reverse engineering method and apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107148615A true CN107148615A (en) | 2017-09-08 |
Family
ID=56193028
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201580059251.XA Pending CN107148615A (en) | 2014-11-27 | 2015-11-23 | Computer executable model reverse engineering approach and device |
Country Status (4)
Country | Link |
---|---|
JP (1) | JP6479184B2 (en) |
KR (1) | KR101770292B1 (en) |
CN (1) | CN107148615A (en) |
SG (1) | SG11201704087RA (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108399081A (en) * | 2018-02-09 | 2018-08-14 | 广州市两棵树网络科技有限公司 | A kind of MyBatis reverse-engineerings generator |
CN109614091A (en) * | 2018-10-09 | 2019-04-12 | 中国平安人寿保险股份有限公司 | Code automatic generation method, device, electronic equipment and storage medium |
CN110347394A (en) * | 2019-06-11 | 2019-10-18 | 无线生活(杭州)信息科技有限公司 | Software code analysis method and device |
CN110574005A (en) * | 2017-02-01 | 2019-12-13 | 西门子工业软件有限责任公司 | Method and system for verifying software programs |
CN111309486A (en) * | 2018-08-10 | 2020-06-19 | 中科寒武纪科技股份有限公司 | Conversion method, conversion device, computer equipment and storage medium |
CN112764763A (en) * | 2020-12-31 | 2021-05-07 | 亿企赢网络科技有限公司 | Code conversion method, system, equipment and computer readable storage medium |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102132659B1 (en) * | 2018-06-21 | 2020-07-10 | 포항공과대학교 산학협력단 | Analysis method of controller for factory automation using artificial intelligence-based reverse engineering |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6038393A (en) * | 1997-09-22 | 2000-03-14 | Unisys Corp. | Software development tool to accept object modeling data from a wide variety of other vendors and filter the format into a format that is able to be stored in OMG compliant UML representation |
US20030083900A1 (en) * | 2001-10-26 | 2003-05-01 | Ismail Khriss | Template-based method and system for reverse engineering |
JP2006139472A (en) * | 2004-11-11 | 2006-06-01 | Nec Corp | Model drive development device |
US20080163184A1 (en) * | 2005-02-15 | 2008-07-03 | Codito Technologies | System for creating parallel applications |
JP2008225898A (en) * | 2007-03-13 | 2008-09-25 | Toshiba Corp | Conversion device, conversion program, and conversion method |
CN100435093C (en) * | 2004-02-24 | 2008-11-19 | 株式会社东芝 | Data converting device and program for data conversion |
US20090307654A1 (en) * | 2008-06-06 | 2009-12-10 | Hiroshi Ishikawa | System, method and computer program for generating sequence diagram |
JP2010140408A (en) * | 2008-12-15 | 2010-06-24 | Nomura Research Institute Ltd | Source code converting device |
JP4820924B1 (en) * | 2011-02-07 | 2011-11-24 | 株式会社エヌ・ティ・ティ・データ | Reverse engineering support device, reverse engineering support method and program thereof |
CN103092594A (en) * | 2011-11-07 | 2013-05-08 | 金蝶软件(中国)有限公司 | Model conversion method and device |
CN103140838A (en) * | 2010-10-27 | 2013-06-05 | 株式会社日立制作所 | Method of converting source code and source code conversion program |
CN103164230A (en) * | 2013-04-15 | 2013-06-19 | 西安电子科技大学 | Requirement modeling method based on new characteristic model and model transformation method |
JP2013171458A (en) * | 2012-02-21 | 2013-09-02 | Fuji Electric Co Ltd | Device, method and program for creating model diagram, and data structure of state event table for creating model diagram |
US20140115558A1 (en) * | 2012-10-19 | 2014-04-24 | International Business Machines Corporation | Generating and Employing Operational Abstractions of Transforms |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100463833B1 (en) | 2001-12-29 | 2004-12-29 | 한국전자통신연구원 | System for transforming source code into component automatically and method thereof |
US7409675B2 (en) | 2004-02-27 | 2008-08-05 | Microsoft Corporation | Code rewriting |
-
2015
- 2015-11-20 KR KR1020150163109A patent/KR101770292B1/en active IP Right Grant
- 2015-11-23 SG SG11201704087RA patent/SG11201704087RA/en unknown
- 2015-11-23 JP JP2017527634A patent/JP6479184B2/en active Active
- 2015-11-23 CN CN201580059251.XA patent/CN107148615A/en active Pending
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6038393A (en) * | 1997-09-22 | 2000-03-14 | Unisys Corp. | Software development tool to accept object modeling data from a wide variety of other vendors and filter the format into a format that is able to be stored in OMG compliant UML representation |
US20030083900A1 (en) * | 2001-10-26 | 2003-05-01 | Ismail Khriss | Template-based method and system for reverse engineering |
CN100435093C (en) * | 2004-02-24 | 2008-11-19 | 株式会社东芝 | Data converting device and program for data conversion |
JP2006139472A (en) * | 2004-11-11 | 2006-06-01 | Nec Corp | Model drive development device |
US20080163184A1 (en) * | 2005-02-15 | 2008-07-03 | Codito Technologies | System for creating parallel applications |
JP2008225898A (en) * | 2007-03-13 | 2008-09-25 | Toshiba Corp | Conversion device, conversion program, and conversion method |
US20090307654A1 (en) * | 2008-06-06 | 2009-12-10 | Hiroshi Ishikawa | System, method and computer program for generating sequence diagram |
JP2010140408A (en) * | 2008-12-15 | 2010-06-24 | Nomura Research Institute Ltd | Source code converting device |
CN103140838A (en) * | 2010-10-27 | 2013-06-05 | 株式会社日立制作所 | Method of converting source code and source code conversion program |
JP4820924B1 (en) * | 2011-02-07 | 2011-11-24 | 株式会社エヌ・ティ・ティ・データ | Reverse engineering support device, reverse engineering support method and program thereof |
CN103092594A (en) * | 2011-11-07 | 2013-05-08 | 金蝶软件(中国)有限公司 | Model conversion method and device |
JP2013171458A (en) * | 2012-02-21 | 2013-09-02 | Fuji Electric Co Ltd | Device, method and program for creating model diagram, and data structure of state event table for creating model diagram |
US20140115558A1 (en) * | 2012-10-19 | 2014-04-24 | International Business Machines Corporation | Generating and Employing Operational Abstractions of Transforms |
CN103164230A (en) * | 2013-04-15 | 2013-06-19 | 西安电子科技大学 | Requirement modeling method based on new characteristic model and model transformation method |
Non-Patent Citations (4)
Title |
---|
权巍 等编著: "《基于模型的软件开发方法》", 30 September 2011, 北京:国防工业出版社 * |
李世峰 等: ""一种基于模型的应用程序跨平台转换方法"", 《计算机与数字工程》 * |
樊波 等: ""基于JavaCC的Java程序模型逆向转换"", 《北京信息科技大学学报》 * |
狄国强 等编著: "《软件工程实验》", 29 February 2008, 北京:清华大学出版社;北京交通大学出版社 * |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110574005A (en) * | 2017-02-01 | 2019-12-13 | 西门子工业软件有限责任公司 | Method and system for verifying software programs |
US10929108B2 (en) | 2017-02-01 | 2021-02-23 | Siemens Industry Software Nv | Methods and systems for verifying a software program |
CN108399081A (en) * | 2018-02-09 | 2018-08-14 | 广州市两棵树网络科技有限公司 | A kind of MyBatis reverse-engineerings generator |
CN108399081B (en) * | 2018-02-09 | 2021-01-26 | 广州洋葱时尚集团有限公司 | MyBatis reverse engineering generator |
CN111309486A (en) * | 2018-08-10 | 2020-06-19 | 中科寒武纪科技股份有限公司 | Conversion method, conversion device, computer equipment and storage medium |
CN111309486B (en) * | 2018-08-10 | 2024-01-12 | 中科寒武纪科技股份有限公司 | Conversion method, conversion device, computer equipment and storage medium |
CN109614091A (en) * | 2018-10-09 | 2019-04-12 | 中国平安人寿保险股份有限公司 | Code automatic generation method, device, electronic equipment and storage medium |
CN110347394A (en) * | 2019-06-11 | 2019-10-18 | 无线生活(杭州)信息科技有限公司 | Software code analysis method and device |
CN110347394B (en) * | 2019-06-11 | 2023-03-10 | 无线生活(杭州)信息科技有限公司 | Software code analysis method and device |
CN112764763A (en) * | 2020-12-31 | 2021-05-07 | 亿企赢网络科技有限公司 | Code conversion method, system, equipment and computer readable storage medium |
CN112764763B (en) * | 2020-12-31 | 2024-01-26 | 亿企赢网络科技有限公司 | Code conversion method, system, equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
KR20160063990A (en) | 2016-06-07 |
SG11201704087RA (en) | 2017-06-29 |
KR101770292B1 (en) | 2017-08-22 |
JP2017535887A (en) | 2017-11-30 |
JP6479184B2 (en) | 2019-03-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107148615A (en) | Computer executable model reverse engineering approach and device | |
Tisi et al. | On the use of higher-order model transformations | |
CN104598240B (en) | A kind of cross-platform Simulation Model Development method and system | |
US9501596B2 (en) | Graphical design verification environment generator | |
CN107291450B (en) | Programming-friendly agile code automatic generation method | |
Panchekha et al. | Automated reasoning for web page layout | |
CN101996131A (en) | Automatic test method and automatic test platform for graphic user interface (GUI) based on x extensive makeup language (XML) packaging key word | |
CN102270128B (en) | Storehouse consistency checker | |
CN106951305B (en) | Method for generating midCore script from QVT-R language based on model conversion | |
CN103605556A (en) | Virtual test subject integrally-constructing system and method | |
Müller et al. | Towards an open source stack to create a unified data source for software analysis and visualization | |
McMinn et al. | SchemaAnalyst: Search-based test data generation for relational database schemas | |
US9652478B2 (en) | Method and apparatus for generating an electronic document schema from a relational model | |
CN103164545A (en) | Visual editing method of virtual electronic components | |
CN104298603B (en) | A kind of inspection method of the correctness of application system version structure | |
US20090070749A1 (en) | Method for translating a graphical workflow in a textual description | |
Delmas et al. | A verification and validation process for model-driven engineering | |
CN112667202B (en) | Software design method and device combining MDA and BPMN | |
CN106033338A (en) | Method and device for importing and analyzing source code based on FOG data | |
WO2016085213A1 (en) | Computer-executable model reverse engineering method and apparatus | |
Horváth et al. | Hardware-software allocation specification of ima systems for early simulation | |
Chang et al. | SysML-based requirement management to improve software development | |
Henrard et al. | Large-scale data reengineering: Return from experience | |
Ráth | Event-driven model transformations in domain-specific modeling languages | |
KR100656559B1 (en) | Program Automatic Generating Tools |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170908 |
|
RJ01 | Rejection of invention patent application after publication |