WO2016085213A1 - 컴퓨터 수행 가능한 모델 역공학 방법 및 장치 - Google Patents

컴퓨터 수행 가능한 모델 역공학 방법 및 장치 Download PDF

Info

Publication number
WO2016085213A1
WO2016085213A1 PCT/KR2015/012587 KR2015012587W WO2016085213A1 WO 2016085213 A1 WO2016085213 A1 WO 2016085213A1 KR 2015012587 W KR2015012587 W KR 2015012587W WO 2016085213 A1 WO2016085213 A1 WO 2016085213A1
Authority
WO
WIPO (PCT)
Prior art keywords
model
source code
conversion rule
converting
reverse engineering
Prior art date
Application number
PCT/KR2015/012587
Other languages
English (en)
French (fr)
Inventor
김상윤
오종근
정재민
주성민
Original Assignee
주식회사 엘지씨엔에스
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
Priority claimed from KR1020150163109A external-priority patent/KR101770292B1/ko
Application filed by 주식회사 엘지씨엔에스 filed Critical 주식회사 엘지씨엔에스
Priority to JP2017527634A priority Critical patent/JP6479184B2/ja
Priority to SG11201704087RA priority patent/SG11201704087RA/en
Priority to CN201580059251.XA priority patent/CN107148615A/zh
Publication of WO2016085213A1 publication Critical patent/WO2016085213A1/ko

Links

Images

Definitions

  • the present invention relates to a computer-implementable model reverse engineering method and apparatus, and more particularly, to define a structure and rules for converting the source code of a program into a model to automatically generate a desired type of model to easily create a program structure.
  • the existing methods of analyzing the program include a method of directly reading the source code, and a method of visualizing the source code through an impact analysis tool.
  • the former tends to depend on the technical competence of the analyst, while the latter incurs costs for simply mechanically visualizing the program and processing it into the desired data.
  • the generated output is only a reference and cannot be reused.
  • the outputs expressed through model reverse engineering can be classified into two types.
  • One is a modeling language designed to be used universally, corresponding to UML (Unified Modeling Language), and the other is a dedicated expression used by impact analysis tools corresponding to ChangeMiner.
  • FIG. 7A shows the components of the universal modeling language UML
  • FIG. 7B shows Change Miner, an impact analysis tool.
  • Korean Patent No. 10-0463833 relates to a system and a method for automatically converting a component.
  • a component automatic for automatically converting a source code of a system and converting the source code into a component using the analyzed information Transformation system and method is a component automatic for automatically converting a source code of a system and converting the source code into a component using the analyzed information Transformation system and method.
  • Korean Patent No. 10-0965706 relates to a computer device capable of code rewriting and a method of code rewriting, wherein the code rewriting can be executed at various stages during development, deployment, and execution of a code unit. Provides rewrite and transformation of code units through possible sets.
  • An embodiment of the present invention is to provide a computer-implemented model reverse engineering method and apparatus that can easily convert the existing source code into a model of the desired form to facilitate analysis, structure identification and redesign of the program.
  • An embodiment of the present invention is to provide a computer-implemented model reverse engineering method and apparatus that can identify all the contents of the source code only by the model by expressing all the information in the source code in the model without missing information.
  • An embodiment of the present invention is to provide a computer-implemented model reverse engineering method and apparatus capable of abstracting and expressing all information regardless of a programming language in which source code is written by converting the source code into an abstract expression.
  • An embodiment of the present invention is to provide a computer-implemented model reverse engineering method and apparatus capable of generating a program that performs the same function in various programming languages through one model.
  • a computer-implementable model reverse engineering method may include receiving source code, receiving a conversion rule for converting the source code into a target model, parsing the source code through a parser associated with the source code. Storing parsing data having a specific data structure in a memory, converting the stored parsing data into a metamodel, and converting the metamodel into a target model according to the received conversion rule.
  • the computer-implemented model reverse engineering method may further include converting the converted target model into a form conforming to the Unified Modeling Language (UML) standard and recording the file in a file.
  • UML Unified Modeling Language
  • receiving the conversion rule may include receiving a conversion rule consisting of a source conversion rule, a model conversion rule, a naming rule, and a relationship setting rule.
  • converting the metamodel into a target model according to the received conversion rule may include converting by specifying a specific element of the source code or a specific element of the target model according to the conversion rule.
  • storing the parsing data in a memory may include parsing the data into data having a different data structure according to a programming language type of the source code.
  • converting the stored parsing data into a metamodel may include converting all elements of the source code into a metamodel representing a specific data structure regardless of the type of the source code and the programming language. have.
  • the computer-implemented model reverse engineering method may include excluding source code not of interest according to the conversion rule from the conversion target.
  • the computer-implemented model reverse engineering method may include receiving a separate conversion rule for source code information that cannot be expressed in UML.
  • a computer-implemented model reverse engineering method includes a message lifeline, an exception lifeline, a validation lifeline, or a code for source code information that the UML cannot express. code) may further comprise generating a message in at least one of the lifelines.
  • the computer-implemented model reverse engineering method may further include verifying that all information of the source code is included in the target model.
  • the converting of the metamodel into a target model according to the received conversion rule may include converting the metamodel into a source model according to the received conversion rule, and converting the source model into the target model.
  • the method may include receiving a model-to-model conversion rule to convert the source model into the target model according to the model-to-model conversion rule.
  • the computer-implemented model reverse engineering method may include receiving the target model and performing configuration for generating source code, and reading elements of the target model to determine whether the corresponding elements are source code generation target elements.
  • the method may further include performing verification of the model elements to be generated according to validity verification rules of the corresponding elements, and generating source code according to the verification result.
  • the step of performing a configuration for generating the source code is
  • Registering the elements of the target model and the conversion rule for each element may specify the execution conditions of the conversion rule to perform the environment setting.
  • the model reverse engineering apparatus includes a memory unit for storing a model reverse engineering program and a processor for executing the program, wherein the processor parses the input source code into parsing data having a specific data structure through a parser.
  • the parsed data is converted into a metamodel, the metamodel is converted into a target model according to the input conversion rule, and source code is generated using the converted target model.
  • the processor may receive a source code, a conversion rule for converting the source code into a target model, and store parsing data having a parsed specific data structure in a memory.
  • the processor may parse data having a different data structure according to a type of programming language of the source code.
  • the processor may convert a metamodel representing all elements of the source code into a specific data structure regardless of the type of the source code and the programming language. In another embodiment, the processor may receive a separate conversion rule for source code information that the UML cannot express.
  • the processor may convert the source model into a target model according to a model-to-model conversion rule for receiving a source model and converting the source model into a target model.
  • the processor may receive a model-to-model conversion rule composed of the fully qualified name of the source model and the fully qualified name of the target model.
  • the processor receives the target model and configures the environment for generating the source code, reads the elements of the target model to determine whether the corresponding elements are the source code generation elements, and generates the model elements that are the generation targets. Verification may be performed according to validity verification rules of the corresponding elements, and source code may be generated according to the verification result.
  • the processor may register the elements of the target model and the conversion rule for each element, and specify an execution condition of the conversion rule to perform environment setting.
  • a computer-readable recording medium recording a program for executing a model reverse engineering method on a computer may include a function of receiving a source code, a function of receiving a conversion rule for converting the source code into a target model, and the source. Parsing the source code through a parser associated with a code to store parsing data having a specific data structure in a memory, converting the stored parsing data into a metamodel, and converting the metamodel according to the received conversion rule. Includes the ability to convert to a model.
  • the disclosed technique can have the following effects. However, since a specific embodiment does not mean to include all of the following effects or only the following effects, it should not be understood that the scope of the disclosed technology is limited by this.
  • the computer-implementable model reverse engineering method and apparatus can convert an existing source code into a model of a desired form to facilitate analysis, structure identification, and redesign of a program.
  • the computer-implementable reverse engineering method and apparatus for a computer-implemented model can identify all contents of the source code using only the model by expressing all the information in the source code in the model.
  • the computer-implementable model reverse engineering method and apparatus may abstract and express all information regardless of a programming language in which the source code is generated by converting the source code into an abstract expression.
  • the computer-implementable model reverse engineering method and apparatus may generate a program that performs the same function in various programming languages through one model.
  • FIG. 1 is a block diagram illustrating a configuration of a model reverse engineering device.
  • FIG. 2 is a block diagram illustrating the configuration of the model reverse engineering program executor shown in FIG. 1.
  • FIG. 3 is a view for explaining the configuration and operation of the source code model converter in FIG.
  • FIG. 4 is a view for explaining a conversion rule received by the conversion rule receiver of FIG. 3.
  • FIG. 5 is a view for explaining the configuration and operation of the model-to-model converter in FIG.
  • FIG. 6 is a diagram illustrating a method of reverse engineering a code sequence expression by the source code model converter of FIG. 2.
  • FIG. 7 is a diagram illustrating a structure of a code generator and a code generation method of FIG. 2.
  • FIG. 8 is a diagram illustrating Change Miner, a component of the general modeling language UML, and an impact analysis tool.
  • first and second are intended to distinguish one component from another component, and the scope of rights should not be limited by these terms.
  • first component may be named a second component, and similarly, the second component may also be named a first component.
  • an identification code (e.g., a, b, c, etc.) is used for convenience of description, and the identification code does not describe the order of the steps, and each step clearly indicates a specific order in context. Unless stated otherwise, they may occur out of the order noted. That is, each step may occur in the same order as specified, may be performed substantially simultaneously, or may be performed in the reverse order.
  • the present invention can be embodied as computer readable code on a computer readable recording medium
  • the computer readable recording medium includes all kinds of recording devices in which data can be read by a computer system.
  • Examples of computer-readable recording media include ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like, and are also implemented in the form of a carrier wave (for example, transmission over the Internet). It also includes.
  • the computer readable recording medium can also be distributed over network coupled computer systems so that the computer readable code is stored and executed in a distributed fashion.
  • FIG. 1 is a block diagram illustrating a configuration of a model reverse engineering device.
  • the model reverse engineering apparatus 10 may include a processor 110, a nonvolatile memory 120, a volatile memory 130, a network interface 140, and an input device 150. ) And an output device 160.
  • the processor 110 may include a model reverse engineering program executor 112 and a memory manager 114.
  • the model reverse engineering program executor 112 executes a model reverse engineering program to execute a model generation and conversion procedure through source code reverse engineering.
  • Memory manager 214 manages memory regions in nonvolatile memory 120 and volatile memory 130 that are read or written by model reverse engineering program executor 112.
  • the nonvolatile memory 120 may be implemented as a solid state disk (SSD) or a hard disk drive (HDD) and used to store data necessary for executing a model reverse engineering program and a model reverse engineering program.
  • Volatile memory 130 is used to temporarily store model reverse engineering programs stored in non-volatile memory 120.
  • the network interface 140 includes an environment for connecting the model reverse engineering apparatus 10 to an external server through a network, and may include an adapter for local area network (LAN) communication, for example.
  • LAN local area network
  • the input device 150 includes an environment for receiving user input, and may include, for example, a mouse, a trackball, a touch pad, a graphic tablet, a scanner, a touch screen, a keyboard, or a pointing device.
  • the output device 160 includes an environment for outputting specific information (eg, metamodel, target model, source code, etc.) to the user, and may include, for example, a monitor or a touch screen. In one example, input device 150 and output device 160 may be connected via a remote connection.
  • FIG. 2 is a block diagram illustrating the configuration of the model reverse engineering program executor shown in FIG. 1.
  • the model reverse engineering program executor 112 includes a source code model converter 210, a model-to-model converter 220, and a code generator 230.
  • the model reverse engineering program executor 112 is a device capable of generating and converting a model through source code reverse engineering.
  • the model reverse engineering program executor 112 can generate and convert a model of a desired type by receiving a source code or a source model, and a conversion rule. You can specify a variety of validation rules in a flexible way of writing and applying.
  • the model reverse engineering program executor 112 stores all the information of the source code in the model, thereby enabling conversion to a new programming language.
  • the source code model converter 210, the model-to-model converter 220, and the code generator 230 are described in detail below with reference to FIGS. 3 to 7.
  • FIG. 3 is a view for explaining the configuration and operation of the source code model converter in FIG.
  • the source code model converter 210 includes a conversion rule receiver 212, a parser 214, a metamodel converter 216, and a model converter 218. do.
  • the conversion rule receiver 212 receives the conversion rule
  • the parser 214 parses the source code and stores the data in the memory
  • the metamodel converter 216 retrieves the data stored in the memory.
  • Source code information can be stored in a metamodel independent of the programming language.
  • the model converter 218 may receive a conversion rule, convert the metamodel into a target model, and calculate a model conforming to the UML standard.
  • Source code is the source code to be converted into UML model, and can be one of sources made in various programming languages such as Java, C, and COBOL.
  • the conversion rule receiver 212 may receive a conversion rule for converting the input source code into a target model.
  • the conversion rule receiving unit 212 may identify a corresponding rule when a naming rule exists in the source code, and may receive a conversion rule including information on the structure of the conversion target model.
  • the conversion rule receiving unit 212 may receive a conversion rule including information on input source code, information on a target model to be converted, information on a naming rule, and information on a relationship setting. The conversion rule will be described in detail later with reference to FIG. 4.
  • the parser 214 may parse source code and store parsing data having a specific data structure in a memory. In other words, parsing the source code to load data with a tree-like data structure into memory.
  • the parser 214 may vary in form depending on which programming language the source code is. Parsing is a process in which a compiler or translator translates source code into machine language on a computer, and analyzes the grammatical structure or syntax of each sentence. In other words, it takes a sequence of tokens from a native program and organizes them into parse trees according to the grammar of the language. Accordingly, the parser 214 may vary in form depending on the type of source code, and may be parsed into data having a different data structure according to the type of programming language of the source code.
  • the metamodel converter 216 may convert the stored parsing data into a metamodel.
  • the metamodel converting unit 216 may convert the data generated by various types of source codes into a single metamodel data structure.
  • the metamodel converting unit 216 may enable the model reverse engineering apparatus 10 to generate a UML model of the same quality and shape only by replacing the parser 214 regardless of a programming language. Accordingly, the metamodel converting unit 216 may convert a metamodel representing all elements of the source code into a specific data structure regardless of the type of the source code and the programming language.
  • the model converter 218 may convert the metamodel converted by the metamodel converter 216 into a target model according to the conversion rule received by the conversion rule receiver 212.
  • the model converter 218 may convert the converted target model back into a form conforming to the UML standard and record the converted target model in a file.
  • the model converter 218 may receive a separate conversion rule for a syntax of a simple expression sequence not expressed as a UML model and convert the UML model.
  • the model converted by the model converter 218 is stored in a UML model format, which can be confirmed by UML editing software such as IBM Rational Software Architect.
  • the model converter 218 may exclude source codes that are not of interest according to the conversion rule from the conversion target, and specify and convert specific elements of the source code or specific elements of the target model according to the conversion rule.
  • a specific element of the source code is a conversion target item to be converted into a target model among the source code elements and may correspond to a package, a class, an attribute, an operation, and the like of the source code.
  • Specific elements of the target model are the conversion result items of the converted target model.
  • the source code not of interest is an element not designated as a specific element of the source code, and may be selected by the user. For example, if a user selects information that is not called or commented out as source code of interest, the information associated with it may be discarded.
  • the model converter 218 may verify whether all information of the source code is included in the target model.
  • FIG. 4 is a view for explaining a conversion rule received by the conversion rule receiver of FIG. 3.
  • the conversion rule includes information on input source code (source conversion rule) 111, information on target model to be converted (model conversion rule) 112, and information on naming rules of model elements to be converted (name name). Rule) 113 and relationship setting information (relation setting rule) 114 between the model elements to be converted.
  • the source conversion rule 410 may designate a source to be converted into a model using a regular expression.
  • the source may include a QualifiedName, an attribute, a function, and a regular expression representing the source type.
  • QualifiedName is a regular expression that specifies the source of reverse engineering. Of the class names including packages or folders, only the source code that matches the regular expression defined in this item is converted to the model. If there is a naming convention in the package or class name, the model converting unit 218 may classify the source and convert the source into a model using this item, and exclude source code that is not of interest from the reverse engineering target. Attributes are regular expressions that represent attributes within a class or file.
  • the model converting unit 218 may convert all or specific attributes among the attributes belonging to the class or file matching the qualified name to the model using this item.
  • a function is a regular expression that represents a function within a class or file.
  • the model converting unit 218 may convert all or specific functions among the functions belonging to the class or the file matching the qualified name to the model using this item. If the source type is c or another language other than java, and the file name is uniquely distinguished by the file extension, the model converting unit 218 puts a value corresponding to the extension in this item and converts only a specific type of source into the model. can do.
  • the model conversion rule 420 may represent the configuration information for the target model.
  • the ID is a uniquely distinguishable value of elements to be converted into a model, and can be arbitrarily assigned by the user.
  • Model element is an item that specifies which element of the model to convert.
  • Package, Interface, Class, Attribute, Operation, Collaboration, Sequence Diagram A class diagram, a code lifeline, a message lifeline, a validation lifeline, and an exception lifeline may be specified.
  • a source element is an item that specifies which element of the source is converted into a model, and a package, a class, an attribute, an operation, and the like can be designated. If no source element is specified, elements that do not exist in the source but must exist in the target model may be inserted.
  • Stereotype is a stereotype to be assigned to the converted model element.
  • the parent element ID designates the parent element ID to which the element belongs.
  • the naming convention 430 may indicate information about a naming convention for naming the model element to be converted.
  • the source prefix is the prefix of the source you want to remove when converting to the model.
  • the model prefix is the prefix that you want to put in the model element name when converting to the model.
  • the source suffix is the suffix of the source you want to remove when converting to a model.
  • the model suffix is the suffix that you want to put in the model element name when converting to the model.
  • the naming convention is the naming convention to apply when converting the source name corresponding to the model element to the model name. You can specify items such as none, Korean, custom, etc.None writes the source name as the model name, and Korean uses the Korean-English dictionary input in advance. It converts the English name of the source into Korean name and uses it as the model name. Custom does not allow simple English-Hangul conversion.
  • the naming class represents the Java class information to be used to specify the model name when the item is specified as custom in
  • the relationship setting conversion rule 440 does not exist in the source code, but may set the relationship when the relationship between the converted model elements is required.
  • Types represent relationship types, such as associations, generalizations, implementations, and dependencies.
  • the relationship element ID indicates a model element ID for establishing a relationship.
  • FIG. 5 is a view for explaining the configuration and operation of the model-to-model converter in FIG.
  • the model-to-model converter 220 includes a model-to-model conversion rule receiver 222 and a model-to-model converter 224.
  • the source code model converter 210 may convert the input source code into a UML format source model according to the received conversion rule.
  • the model-to-model converter 220 may receive the model-to-model conversion rule and convert the source model into the final target model according to the received model-to-model conversion rule.
  • the model-to-model conversion rule is described in detail in FIG. 5B.
  • the model-to-model converter 220 may move and reconfigure locations of packages and classes of the source model according to the model-to-model conversion rule. That is, the model-to-model converter 220 may separate the package when there are many classes of the source model package, and may separate the class when there are many operations of the class. Similarly, the model-to-model converter 220 may integrate the package when there are few classes in the source model package, and may integrate the class when there are few operations of the class. In other words, when integration of the package or class of the source model converted from the metamodel is required according to the conversion rule, the model-to-model converter 220 uses the model-to-model conversion rule as the target model. I can convert it.
  • 5B is a diagram for explaining a model-to-model conversion rule.
  • the model-to-model conversion rule includes a source model qualified name 510 and a target model qualified name 520.
  • the source model qualified name (QualifiedName) 510 is the qualified name of the source model element to convert to the target model.All sub-model elements of the source model element pointed to by this item are the target model qualified name.
  • 520 is copied to the element to which the model points. Source model elements with different source model qualified names (510) but with the same target model qualified name (520) are merged into one target model element when copied to the target model, and vice versa. If the upper element name of the (QualfiedName) 510 is the same but the upper element name of the Qualified Name (QualifiedName) 520 is different, the source model element is separated and copied.
  • the target model qualified name 520 indicates the qualified name 520 of the target model element to which the element indicated by the source model qualified name 510 is copied.
  • FIG. 6 is a diagram illustrating a method of reverse engineering a code sequence expression by the source code model converter of FIG. 2.
  • the source code model converter 210 may first receive a conversion rule in the form of a regular expression for converting an expression, and may select and parse a source code to be converted and store parsed data in a memory. Then, the source code model converter 210 may load data stored in the memory and store the source code information in a model independent from the program language through the metamodel converter 216. The model converter 218 may receive the received conversion rule and convert the data converted by the metamodel converter 216 according to the conversion rule. The converted data can be converted back into a format that conforms to the UML standard and written to a file.
  • the syntax of the simple expression family not expressed in the UML model may be converted by receiving a separate conversion rule. Details of the conversion rules are as follows.
  • a synchronization message can be generated in a family lifeline and represented as a logical code in a document field.
  • message message A statement that generates a message may generate a message in a message lifeline. Whether or not to generate a message in the message lifeline is determined by arranging the specific function that generates the message into a regular expression and whether there is a function that matches the regular expression.
  • exception message A statement that raises an error may generate a message in the exception lifeline. Whether or not you want to generate a message in the exception lifeline can be determined by sorting the specific function that causes the error into a regular expression, and whether there is a function that matches the regular expression.
  • validation message A statement that generates errors while validating input parameters, such as checking required input values, can generate a message in the validation lifeline. Validation Whether or not to generate a message in the lifeline, the function and syntax pattern corresponding to the input validation are summarized into a regular expression, and it is determined whether there is a function that matches the regular expression.
  • code messages operation calls, join fragments, and other logic and comments that do not translate into message / exception / validation can generate messages in the code lifeline. All internal logic until the operation expresses the call as a synchronous message or generates a combined fragment is displayed in the code lifeline.
  • the operation call syntax of the source code, and the original syntax corresponding to the combined fragment, are also displayed in the code lifeline immediately before the modeling element appears (all the original source code is shown to verify model transformation consistency).
  • variable name is Koreanized using the dictionary information entered in the form of English word name-Korean word name and changed to match the logical expression.
  • the base type converts the type name according to the mapping table that maps the source type to the model type, and the type that is not the base type converts the type name to the type name converted to the model and depending on the array status. Convert according to the array notation defined by the logical expression. Initializing a variable means converting it literally.
  • the source code model converter 210 uses arbitrary lifelines for code series expressions, such as code, validation, exceptions, and messages, to represent code sequence expressions in sequence diagrams. You can create a lifeline, draw a message to that lifeline, and store an expression in the document content of that message.
  • FIG. 7 is a diagram illustrating a structure of a code generator and a code generation method of FIG. 2.
  • the code generator 230 includes a code generator configuration 232, a model scanner 234, a model validation 236, and a code.
  • a code maker 238 may be included.
  • the code generator 230 is a module that generates source code of various programming languages based on a model.
  • the code generator 230 may generate a program source code based on a conversion rule mapped to each of the model element and the logical expression.
  • the code generator 230 may generate source codes of various languages with one model.
  • the code generator configuration unit 232 may perform environment setting to create a conversion rule for describing a desired source code (S710). First, you can create one conversion rule project, register model elements that are targets of the project, and create and register conversion rules for each element. When registering a conversion rule, describe the conversion behavior of the conversion rule and specify the conditions for executing the conversion rule. When the conversion rule is registered for all elements, the structure of the source code to be created is defined.
  • Source code can be generated regardless of the whole model or some models.
  • a model scanner 234 is executed in the code generator 230.
  • the model scanner 234 reads the elements from the top element to the top-down method and checks whether the corresponding element is an element to be generated. have. In the case of the source code generation target element, the model scanner 234 transmits the corresponding element to the model validation unit 236 (S720).
  • the model validation unit 236 may receive an element that is a source code generation target and perform verification according to a validation rule that the corresponding element has (S730).
  • the model validity verification unit 236 may transmit a verification result to the model scanner 234 when there is an error after the verification is completed, and the model scanner 234 may store the verification result.
  • the model scanner 234 may output the entire verification result on the screen (S740). If there is no error as a result of the verification, the code maker 238 may generate the source code according to the conversion rule (S750).
  • the present invention relates to a computer-implementable model reverse engineering method and apparatus, and more particularly, to define a structure and rules for converting the source code of a program into a model to automatically generate a desired type of model to easily create a program structure.

Landscapes

  • Stored Programmes (AREA)

Abstract

컴퓨터 수행 가능한 모델 역공학 방법은 소스코드를 입력 받는 단계, 상기 소스코드를 목표모델로 변환하기 위한 변환규칙을 입력 받는 단계, 상기 소스코드와 연관된 파서를 통해 상기 소스코드를 파싱하여 특정 자료구조를 갖는 파싱 데이터를 메모리에 저장하는 단계, 상기 저장된 파싱 데이터를 메타모델로 변환하는 단계, 상기 메타모델을 상기 입력 받은 변환규칙에 따라 목표모델로 변환하는 단계, 상기 목표모델을 입력 받고 소스코드 생성을 위한 환경설정을 수행하는 단계, 상기 목표모델의 요소들을 읽어 해당 요소들이 소스코드 생성 대상 요소들인지 확인하는 단계, 상기 생성 대상인 모델 요소들을 해당 요소들이 갖고 있는 타당성 검증 규칙에 따라 검증을 수행하는 단계 및 상기 검증 결과에 따라 소스코드를 생성하는 단계를 포함한다.

Description

컴퓨터 수행 가능한 모델 역공학 방법 및 장치
본 발명은 컴퓨터 수행 가능한 모델 역공학 방법 및 장치에 관한 것으로, 보다 상세하게는, 프로그램의 소스코드를 모델로 변환하는 구조 및 규칙을 정의하여 원하는 형태의 모델을 자동으로 생성하여 프로그램의 구조를 쉽게 분석하고 재설계하는 컴퓨터 수행 가능한 모델 역공학 방법 및 장치에 관한 것이다.
기존에 사용되는 프로그램을 분석하는 방법은 사람이 직접 소스코드를 읽어서 분석하는 방법과 영향도 분석 도구를 통해서 소스코드를 시각화하는 방법이 있다. 전자는 분석하는 사람의 기술적인 역량에 좌우되는 경향이 크고, 후자는 단순히 기계적으로 프로그램의 모습을 그대로 시각화하여 원하는 형태의 데이터로 가공하기 위해서 비용이 발생한다. 위의 두 가지 방법 모두 생성된 산출물이 참고자료가 될 뿐 재사용이 불가능하다.
모델 역공학을 통해 표현하는 산출물은 크게 2가지 종류로 구분된다. 하나는 UML(Unified Modeling Language)에 해당하는 범용적으로 사용할 수 있도록 고안된 모델링 언어이고 다른 하나는 ChangeMiner에 해당하는 영향 분석 도구들이 사용하는 전용 표현 방식이다. 도 7a는 범용적인 모델링 언어 UML의 구성요소를 보여주며 도 7b는 영향분석도구인 Change Miner를 보여준다.
전자의 경우, 다양한 SW 환경과 프로그래밍 언어를 위한 모델을 생성할 수 있도록 포괄적인 표기법을 제공하나 그 양이 방대하고, 개략적인 SW 모델을 만들 수는 있지만 UML에서 표기법을 제시하지 않는 소스코드 정보는 유실된다. 이에 따라 역공학으로 생성한 모델로 다시 실행 가능한 소스코드를 생성하는 것이 불가능하다. 후자의 경우, 영향 분석 도구들이 제공하는 역공학 산출물은 소스코드의 다양한 정보를 표현할 수 있다는 점에서는 활용도가 높다. 하지만 역공학 산출물을 모델로 재사용하여 이를 기반으로 설계를 한다거나 하는 2차활용이 불가능한 단순 Report를 제공하는 것일 뿐이므로 활용도가 떨어지며, 소스코드의 모습을 그대로 보여주기 때문에 불필요한 정보를 많이 담고 있다.
따라서 역공학을 통해 원하는 모습의 모델을 만들어 이를 설계에 재사용할 수 있고, 소스코드의 모든 정보를 활용할 수 있으며 이를 통해 다양한 프로그래밍 언어로 실행 가능한 소스코드를 생성할 수 있는 장치를 만들 필요가 있다. 이를 통해 SW 개발의 편의성과 품질을 향상시킬 수 있다.
한국등록특허 제10-0463833호는 컴포넌트 자동 변환 시스템 및 방법에 관한 것으로서, 객체지향 형식의 컴퓨팅 시스템에서 시스템의 소스 코드를 자동으로 분석하고 분석한 정보를 이용하여 소스 코드를 컴포넌트로 변환시키는 컴포넌트 자동 변환 시스템 및 방법에 관한 것이다.
한국등록특허 제10-0965706호는 코드 재기입이 가능한 컴퓨터 장치 및 코드 재기입 방법에 관한 것으로서, 코드 유닛의 개발, 배치, 및 실행동안 다양한 단계에서 실시될 수 있는 코드 재기입기의 확장가능, 구성가능 세트를 통하여 코드 유닛의 재기입 및 변환을 제공한다.
본 발명의 일 실시예는 기존의 소스코드를 원하는 형태의 모델로 변환하여 프로그램의 분석, 구조 파악 및 재설계를 쉽게 할 수 있는 컴퓨터 수행 가능한 모델 역공학 방법 및 장치를 제공하고자 한다.
본 발명의 일 실시예는 소스코드에 있는 모든 정보를 유실되는 정보 없이 모델에 표현함으로써 모델만으로 소스코드의 모든 내용을 확인할 수 있는 컴퓨터 수행 가능한 모델 역공학 방법 및 장치를 제공하고자 한다.
본 발명의 일 실시예는 소스코드를 추상화된 형태의 표현식으로 변환함으로써 소스코드를 작성한 프로그램 언어에 구애 받지 않고 모든 정보를 추상화하여 표현할 수 있는 컴퓨터 수행 가능한 모델 역공학 방법 및 장치를 제공하고자 한다.
본 발명의 일 실시예는 하나의 모델을 통해 다양한 프로그래밍 언어로 같은 기능을 수행하는 프로그램을 생성할 수 있는 컴퓨터 수행 가능한 모델 역공학 방법 및 장치를 제공하고자 한다.
실시예들 중에서, 컴퓨터 수행 가능한 모델 역공학 방법은 소스코드를 입력 받는 단계, 상기 소스코드를 목표모델로 변환하기 위한 변환규칙을 입력받는 단계, 상기 소스코드와 연관된 파서를 통해 상기 소스코드를 파싱하여 특정 자료구조를 갖는 파싱 데이터를 메모리에 저장하는 단계, 상기 저장된 파싱 데이터를 메타모델로 변환하는 단계 및 상기 메타모델을 상기 입력 받은 변환규칙에 따라 목표모델로 변환하는 단계를 포함한다.
일 실시예에서, 컴퓨터 수행 가능한 모델 역공학 방법은 상기 변환된 목표모델을 UML(Unified Modeling Language) 표준에 맞는 형태로 다시 변환하여 파일에 기록하는 단계를 더 포함할 수 있다.
일 실시예에서, 상기 변환규칙을 입력받는 단계는 소스변환규칙, 모델변환규칙, 명명규칙 및 관계설정규칙으로 구성되는 변환규칙을 입력받는 단계를 포함할 수 있다. 여기에서, 상기 메타모델을 상기 입력 받은 변환규칙에 따라 목표모델로 변환하는 단계는 상기 변환규칙에 따라 소스코드의 특정 요소 또는 목표모델의 특정 요소를 지정하여 변환하는 단계를 포함할 수 있다.
일 실시예에서, 상기 파싱 데이터를 메모리에 저장하는 단계는 상기 소스코드의 프로그래밍 언어 종류에 따라 다른 자료구조를 갖는 데이터로 파싱하는 단계를 포함할 수 있다.
일 실시예에서, 상기 저장된 파싱 데이터를 메타모델로 변환하는 단계는 상기 소스코드의 종류 및 프로그램언어에 관계없이 소스코드의 모든 요소들을 특정 자료구조로 나타내 주는 메타모델로 변환하는 단계를 포함할 수 있다.
일 실시예에서, 컴퓨터 수행 가능한 모델 역공학 방법은 상기 변환규칙에 따라 관심 대상이 아닌 소스코드를 변환 대상에서 제외하는 단계를 포함할 수 있다.
일 실시예에서, 컴퓨터 수행 가능한 모델 역공학 방법은 UML로 표현될 수 없는 소스코드 정보에 대한 별도의 변환규칙을 입력 받는 단계를 포함할 수 있다. 다른 일 실시예에서, 컴퓨터 수행 가능한 모델 역공학 방법은 상기 UML이 표현할 수 없는 소스코드 정보에 대하여 메시지(message) 라이프라인, 예외처리(exception) 라이프 라인, 타당성검증(validation) 라이프라인 또는 코드(code) 라이프라인 중 적어도 하나에 메시지를 생성하는 단계를 더 포함할 수 있다.
일 실시예에서, 컴퓨터 수행 가능한 모델 역공학 방법은 상기 소스코드의 모든 정보가 상기 목표모델에 포함되어 있는지 검증하는 단계를 더 포함할 수 있다.
일 실시예에서, 상기 메타모델을 상기 입력 받은 변환규칙에 따라 목표모델로 변환하는 단계는 상기 메타모델을 상기 입력받은 변환규칙에 따라 소스모델로 변환하는 단계, 상기 소스모델을 상기 목표모델로 변환하기 위한 모델-to-모델 변환규칙을 입력 받는 단계 및 상기 모델-to-모델 변환규칙에 따라 상기 소스모델을 상기 목표모델로 변환하는 단계를 포함할 수 있다.
일 실시예에서, 컴퓨터 수행 가능한 모델 역공학 방법은 상기 목표모델을 입력 받고 소스코드 생성을 위한 환경설정을 수행하는 단계, 상기 목표모델의 요소들을 읽어 해당 요소들이 소스코드 생성 대상 요소들인지 확인하는 단계, 상기 생성 대상인 모델 요소들을 해당 요소들이 갖고 있는 타당성 검증 규칙에 따라 검증을 수행하는 단계 및 상기 검증 결과에 따라 소스코드를 생성하는 단계를 더 포함할 수 있다.
일 실시예에서, 상기 소스코드 생성을 위한 환경설정을 수행하는 단계는
상기 목표모델의 요소들 및 각 요소들 별 변환규칙을 등록하고, 변환규칙의 실행조건을 지정하여 환경설정을 수행하는 단계를 포함할 수 있다.
실시예들 중에서, 모델 역공학 장치는 모델 역공학 가능한 프로그램이 저장된 메모리부 및 상기 프로그램을 실행하는 프로세서를 포함하되, 상기 프로세서는 입력된 소스코드를 파서를 통해 특정 자료구조를 갖는 파싱 데이터로 파싱하고, 파싱된 데이터를 메타모델로 변환하고, 상기 메타모델을 입력된 변환규칙에 따라 목표모델로 변환하며, 상기 변환된 목표모델을 이용하여 소스코드를 생성한다.
일 실시예에서, 상기 프로세서는 소스코드를 입력 받고 상기 소스코드를 목표모델로 변환하기 위한 변환규칙을 입력받고, 파싱된 특정 자료구조를 갖는 파싱 데이터를 메모리에 저장할 수 있다. 다른 일 실시예에서, 상기 프로세서는 상기 소스코드의 프로그래밍 언어 종류에 따라 다른 형태의 자료구조를 갖는 데이터로 파싱할 수 있다.
일 실시예에서, 상기 프로세서는 상기 소스코드의 종류 및 프로그램언어에 관계없이 소스코드의 모든 요소들을 특정 자료구조로 나타내 주는 메타모델로 변환할 수 있다. 다른 일 실시예에서, 상기 프로세서는 UML이 표현할 수 없는 소스코드 정보에 대한 별도의 변환규칙을 입력 받을 수 있다.
일 실시예에서, 상기 프로세서는 소스모델을 입력 받아 목표모델로 변환하기 위한 모델-to-모델 변환규칙에 따라 상기 소스모델을 목표모델로 변환할 수 있다. 다른 일 실시예에서, 상기 프로세서는 소스모델의 정규화된 이름 및 목표모델의 정규화된 이름으로 구성되는 모델-to-모델변환규칙을 입력 받을 수 있다.
일 실시예에서, 상기 프로세서는 상기 목표모델을 입력 받고 소스코드 생성을 위한 환경설정을 수행하고, 상기 목표모델의 요소들을 읽어 해당 요소들이 소스코드 생성 대상 요소들인지 확인하며, 상기 생성 대상인 모델 요소들을 해당 요소들이 갖고 있는 타당성 검증 규칙에 따라 검증을 수행하고, 상기 검증 결과에 따라 소스코드를 생성할 수 있다. 다른 일 실시예에서, 상기 프로세서는 상기 목표모델의 요소들 및 각 요소들 별 변환규칙을 등록하고, 변환규칙의 실행조건을 지정하여 환경설정을 수행할 수 있다.
실시예들 중에서, 모델 역공학 방법을 컴퓨터에서 실행시키기 위한 프로그램을 기록한 컴퓨터 판독 가능한 기록매체는 소스코드를 입력 받는 기능, 상기 소스코드를 목표모델로 변환하기 위한 변환규칙을 입력 받는 기능, 상기 소스코드와 연관된 파서를 통해 상기 소스코드를 파싱하여 특정 자료구조를 갖는 파싱 데이터를 메모리에 저장하는 기능, 상기 저장된 파싱 데이터를 메타모델로 변환하는 기능 및 상기 메타모델을 상기 입력받은 변환규칙에 따라 목표모델로 변환하는 기능을 포함한다.
개시된 기술은 다음의 효과를 가질 수 있다. 다만, 특정 실시예가 다음의 효과를 전부 포함하여야 한다거나 다음의 효과만을 포함하여야 한다는 의미는 아니므로, 개시된 기술의 권리범위는 이에 의하여 제한되는 것으로 이해되어서는 아니 될 것이다.
본 발명의 일 실시예에 따른 컴퓨터 수행 가능한 모델 역공학 방법 및 장치는 기존의 소스코드를 원하는 형태의 모델로 변환하여 프로그램의 분석, 구조 파악 및 재설계를 쉽게 할 수 있다.
본 발명의 일 실시예에 따른 컴퓨터 수행 가능한 모델 역공학 방법 및 장치는 소스코드에 있는 모든 정보를 모델에 표현함으로써 모델만으로 소스코드의 모든 내용을 확인할 수 있다.
본 발명의 일 실시예에 따른 컴퓨터 수행 가능한 모델 역공학 방법 및 장치는 소스코드를 추상화된 형태의 표현식으로 변환함으로써 소스코드를 작성한 프로그램 언어에 구애 받지 않고 모든 정보를 추상화하여 표현할 수 있다.
본 발명의 일 실시예에 따른 컴퓨터 수행 가능한 모델 역공학 방법 및 장치는 하나의 모델을 통해 다양한 프로그래밍 언어로 같은 기능을 수행하는 프로그램을 생성할 수 있다.
도1은 모델 역공학 장치의 구성을 설명하는 블록도이다.
도 2는 도1에 있는 모델 역공학 프로그램 실행기의 구성을 설명하는 블록도이다.
도 3은 도 2에 있는 소스코드 모델 변환기의 구성 및 작동을 설명하는 도면이다.
도 4는 도 3에 있는 변환규칙 수신부에 의해 수신되는 변환규칙을 설명하는 도면이다.
도 5는 도 2에 있는 모델-to-모델 변환기의 구성 및 작동을 설명하는 도면이다.
도 6은 도 2에 있는 소스코드 모델 변환기에 의한 코드계열 표현식 역공학 방법을 설명하는 도면이다.
도 7은 도 2에 있는 코드 생성기의 구조와 코드 생성 방법을 나타내는 도면이다.
도 8은 범용적인 모델링 언어 UML의 구성요소와 영향분석도구인 Change Miner를 나타내는 도면이다.
본 발명에 관한 설명은 구조적 내지 기능적 설명을 위한 실시예에 불과하므로, 본 발명의 권리범위는 본문에 설명된 실시예에 의하여 제한되는 것으로 해석되어서는 아니 된다. 즉, 실시예는 다양한 변경이 가능하고 여러 가지 형태를 가질 수 있으므로 본 발명의 권리범위는 기술적 사상을 실현할 수 있는 균등물들을 포함하는 것으로 이해되어야 한다. 또한, 본 발명에서 제시된 목적 또는 효과는 특정 실시예가 이를 전부 포함하여야 한다거나 그러한 효과만을 포함하여야 한다는 의미는 아니므로, 본 발명의 권리범위는 이에 의하여 제한되는 것으로 이해되어서는 아니 될 것이다.
한편, 본 출원에서 서술되는 용어의 의미는 다음과 같이 이해되어야 할 것이다.
"제1", "제2" 등의 용어는 하나의 구성요소를 다른 구성요소로부터 구별하기 위한 것으로, 이들 용어들에 의해 권리범위가 한정되어서는 아니 된다. 예를 들어, 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다.
어떤 구성요소가 다른 구성요소에 "연결되어"있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결될 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어"있다고 언급된 때에는 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다. 한편, 구성요소들 간의 관계를 설명하는 다른 표현들, 즉 "~사이에"와 "바로 ~사이에" 또는 "~에 이웃하는"과 "~에 직접 이웃하는" 등도 마찬가지로 해석되어야 한다.
단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한 복수의 표현을 포함하는 것으로 이해되어야 하고, "포함하다"또는 "가지다" 등의 용어는 실시된 특징, 숫자, 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것이 존재함을 지정하려는 것이며, 하나 또는 그 이상의 다른 특징이나 숫자, 단계, 동작, 구성요소, 부분품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.
각 단계들에 있어 식별부호(예를 들어, a, b, c 등)는 설명의 편의를 위하여 사용되는 것으로 식별부호는 각 단계들의 순서를 설명하는 것이 아니며, 각 단계들은 문맥상 명백하게 특정 순서를 기재하지 않는 이상 명기된 순서와 다르게 일어날 수 있다. 즉, 각 단계들은 명기된 순서와 동일하게 일어날 수도 있고 실질적으로 동시에 수행될 수도 있으며 반대의 순서대로 수행될 수도 있다.
본 발명은 컴퓨터가 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현될 수 있고, 컴퓨터가 읽을 수 있는 기록 매체는 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록 장치를 포함한다. 컴퓨터가 읽을 수 있는 기록 매체의 예로는 ROM, RAM, CD-ROM, 자기 테이프, 플로피 디스크, 광 데이터 저장 장치 등이 있으며, 또한, 캐리어 웨이브(예를 들어 인터넷을 통한 전송)의 형태로 구현되는 것도 포함한다. 또한, 컴퓨터가 읽을 수 있는 기록 매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어, 분산 방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수 있다.
여기서 사용되는 모든 용어들은 다르게 정의되지 않는 한, 본 발명이 속하는 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가진다. 일반적으로 사용되는 사전에 정의되어 있는 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한 이상적이거나 과도하게 형식적인 의미를 지니는 것으로 해석될 수 없다.
도1은 모델 역공학 장치의 구성을 설명하는 블록도이다.
도1을 참조하면, 본 발명의 일 실시예에 따른 모델 역공학 장치(10)는 프로세서(110), 비휘발성 메모리(120), 휘발성 메모리(130), 네트워크 인터페이스(140), 입력장치(150) 및 출력장치(160)을 포함한다.
프로세서(110)는 프로세서(210)는 모델 역공학 프로그램 실행기(112) 및 메모리 관리자(114)를 포함할 수 있다. 모델 역공학 프로그램 실행기(112)는 모델 역공학 프로그램을 실행시켜 소스코드 역공학을 통한 모델 생성 및 변환 프로시저를 실행한다. 메모리 관리자(214)는 모델 역공학 프로그램 실행기(112)에 의하여 읽혀지거나 또는 기록되는 비휘발성 메모리(120) 및 휘발성 메모리(130)에 있는 메모리 영역들을 관리한다.
비휘발성 메모리(120)는 SSD(Solide State Disk) 또는 HDD(Hard Disk Drive)로 구현될 수 있고 모델 역공학 프로그램 및 모델 역공학 프로그램 실행에 필요한 데이터를 저장하는데 사용된다. 휘발성 메모리(130)는 비휘발성 메모리(120)에 저장된 모델 역공학 프로그램을 일시 저장하는데 사용된다.
네트워크 인터페이스(140)는 네트워크를 통해 모델 역공학 장치(10)를 외부서버와 연결하기 위한 환경을 포함하고, 예를 들어, LAN(Local Area Network) 통신을 위한 어댑터를 포함할 수 있다.
입력 장치(150)는 사용자 입력을 수신하기 위한 환경을 포함하고, 예를 들어, 마우스, 트랙볼, 터치 패드, 그래픽 태블릿, 스캐너, 터치 스크린, 키보드 또는 포인팅 장치 등을 포함할 수 있다. 출력 장치(160)는 사용자에게 특정 정보(예를 들어, 메타모델, 목표모델 또는 소스코드 등)를 출력하기 위한 환경을 포함하고, 예를 들어, 모니터 또는 터치스크린 등을 포함할 수 있다. 일 예에서, 입력 장치(150)와 출력 장치(160)는 원격 접속을 통해 접속될 수 있다.
도 2는 도1에 있는 모델 역공학 프로그램 실행기의 구성을 설명하는 블록도이다.
도 2을 참조하면, 본 발명의 일 실시예에 따른 모델 역공학 프로그램 실행기(112)는 소스코드 모델 변환기(210), 모델-to-모델 변환기(220) 및 코드 생성기(230)을 포함한다. 모델 역공학 프로그램 실행기(112)는 소스코드 역공학을 통한 모델 생성 및 변환을 할 수 있는 장치로서, 소스코드 또는 소스모델을 입력 받아 사용자가 원하는 형태의 모델을 생성 및 변환할 수 있고, 변환 규칙을 작성하여 적용함에 있어서 유연하고 다양한 검증 규칙을 지정할 수 있다. 또한, 모델 역공학 프로그램 실행기(112)는 모델에 소스코드의 모든 정보를 저장하여 이를 통해 새로운 프로그래밍 언어로의 변환을 가능하게 한다. 소스코드 모델 변환기(210), 모델-to-모델 변환기(220) 및 코드 생성기(230)는 이하 도 3 내지 도 7에서 자세히 설명한다.
도 3은 도 2에 있는 소스코드 모델 변환기의 구성 및 작동을 설명하는 도면이다.
도 3을 참조하면, 본 발명의 일 실시예에 따른 소스코드 모델 변환기(210)는 변환규칙 수신부(212), 파서(214), 메타모델 변환부(216) 및 모델 변환부(218)를 포함한다. 소스코드가 입력되면 변환규칙 수신부(212)는 변환규칙을 수신하고, 파서(214)는 소스코드를 파싱하여 데이터를 메모리에 저장하며, 메타모델 변환부(216)는 메모리에 저장된 데이터를 불러와 프로그램언어로부터 독립적인 메타모델에 소스코드의 정보를 저장할 수 있다. 모델 변환부(218)는 변환규칙을 입력 받아 메타모델을 목표모델로 변환하고 UML표준에 맞는 모델을 산출할 수 있다. 소스코드는 UML 모델로 변환하는 대상이 되는 소스코드이며, Java, C, COBOL 등 여러 가지 프로그래밍 언어로 만들어진 소스 중 하나가 될 수 있다.
변환규칙 수신부(212)는 입력 받은 소스코드를 목표모델로 변환하기 위한 변환규칙을 수신할 수 있다. 변환규칙 수신부(212)는 소스코드에 명명 규칙이 존재하는 경우 해당 규칙을 파악하고, 변환 목표모델의 구조에 관한 정보를 포함하는 변환규칙을 수신할 수 있다. 변환규칙 수신부(212)는 입력된 소스코드에 대한 정보, 변환되는 목표모델에 대한 정보, 명명규칙에 대한 정보 및 관계설정에 대한 정보를 포함하는 변환규칙을 수신할 수 있다. 변환규칙에 대해서는 이하 도 4에서 자세히 설명한다.
파서(214)는 소스코드를 파싱하여 특정 자료구조를 갖는 파싱 데이터를 메모리에 저장할 수 있다. 즉, 소스코드를 파싱(parsing)하여 트리 형태의 자료구조를 가진 데이터를 메모리에 올려주는 작업을 할 수 있다. 파서(214)는 소스코드가 어떤 프로그래밍 언어인지에 따라 그 형태가 달라질 수 있다. 파싱은 컴퓨터에서 컴파일러 또는 번역기가 원시 부호를 기계어로 번역하는 과정의 한 단계로, 각 문장의 문법적인 구성 또는 구문을 분석하는 과정이다. 즉 원시 프로그램에서 나타난 토큰(token)의 열을 받아들여 이를 그 언어의 문법에 맞게 구문 분석 트리(parse tree)로 구성해 내는 일이다. 따라서 파서(214)는 소스코드의 종류에 따라 형태가 달라질 수 있고, 소스코드의 프로그래밍 언어 종류에 따라 다른 자료구조를 갖는 데이터로 파싱할 수 있다.
메타모델 변환부(216)는 상기 저장된 파싱 데이터를 메타모델로 변환할 수 있다. 메타모델 변환부(216)는 여러 종류의 소스코드가 만들어준 데이터를 하나의 메타모델 자료구조로 변환해 주는 작업을 할 수 있다. 메타모델 변환부(216)는 소스코드가 어떤 프로그래밍 언어로 되어 있더라도 파서(214)만 교체하면 모델 역공학 장치(10)가 동일한 품질과 형태의 UML 모델을 생성할 수 있게 할 수 있다. 따라서, 메타모델 변환부(216)는 소스코드의 종류 및 프로그램언어에 관계없이 소스코드의 모든 요소들을 특정 자료구조로 나타내 주는 메타모델로 변환할 수 있다.
모델 변환부(218)는 메타모델 변환부(216)에 의해 변환된 메타모델을 변환규칙 수신부(212)에 의해 수신된 변환규칙에 따라 목표모델로 변환할 수 있다. 모델 변환부(218)는 변환된 목표모델을 UML표준에 맞는 형태로 다시 변환하여 파일에 기록할 수 있다. 모델 변환부(218)는 UML모델로 표현되지 않는 단순 표현식 계열의 구문에 대해서는 별도의 변환 규칙을 입력 받아 UML모델로 변환할 수 있다. 모델 변환부(218)를 통해 변환된 모델은 UML모델 형식으로 저장되고, 이는 IBM Rational Software Architect와 같은 UML 편집 소프트웨어를 통해 확인될 수 있다. 모델 변환부(218)는 변환규칙에 따라 관심 대상이 아닌 소스코드를 변환 대상에서 제외할 수 있고, 변환규칙에 따라 소스코드의 특정 요소 또는 목표모델의 특정 요소를 지정하여 변환할 수 있다. 소스코드의 특정 요소는 소스코드 구성요소 중 목표모델로 변환될 변환대상항목으로 소스코드의 패키지(Package), 클래스(Class), 어트리부트(Attribute), 오퍼레이션(Operation) 등에 해당할 수 있고, 목표모델의 특정요소는 변환된 목표모델의 변환결과항목으로 패키지(Package), 인터페이스(Interface), 클래스(Class), 속성(Attribute), 오퍼레이션(Operation), 콜라보레이션(Collaboration), 시퀀스 다이어그램 (Sequence Diagram), 클래스 다이어그램(Class Diagram), 코드 라이프라인(Code Lifeline), 메시지 라이프라인(Message Lifeline), 타당성검증 라이프라인 (Validation Lifeline), 예외처리 라이프라인(Exception Lifeline) 등에 해당할 수 있다. 여기서, 관심 대상이 아닌 소스코드는 소스코드의 특정 요소로 지정되지 않은 요소로, 사용자로부터 선택될 수 있다. 예를 들어, 사용자가 관심 대상이 아닌 소스코드로서 주석이나 호출되지 않는 정보를 선택하면, 이와 관련된 정보는 버려질 수 있다. 또한, 모델 변환부(218)는 소스코드의 모든 정보가 상기 목표모델에 포함되어 있는지 검증할 수 있다.
도 4는 도 3에 있는 변환규칙 수신부에 의해 수신되는 변환규칙을 설명하는 도면이다.
도 4에서 변환 규칙은 입력되는 소스코드에 대한 정보 (소스변환규칙) (111), 변환되는 목표 모델에 대한 정보(모델변환규칙)(112), 변환되는 모델요소의 명명규칙에 대한 정보(명명규칙)(113), 변환되는 모델 요소간의 관계 설정 정보(관계설정규칙)(114)로 이루어질 수 있다.
소스변환규칙(410)은 모델로 변환할 대상이 되는 소스를 정규식을 이용하여 지정할 수 있다. 소스는 정규화된 이름(QualifiedName), 속성, 함수 및 소스종류를 나타내는 정규식을 포함할 수 있다. 정규화된 이름(QualifiedName)은 역공학 대상 소스를 지정하는 정규식이다. 패키지 또는 폴더를 포함한 클래스명 중 이 항목에 정의된 정규식에 매칭되는 소스코드만 모델로 변환된다. 모델 변환부(218)는 패키지 또는 클래스 명에 명명규칙이 존재하는 경우 이 항목을 이용하여 소스를 분류하고 모델로 변환할 수 있고, 관심 대상이 아닌 소스 코드는 역공학 대상에서 제외할 수 있다. 속성은 클래스 또는 파일 내에 속한 속성을 나타내는 정규식이다. 모델 변환부(218)는 이 항목을 이용하여 정규화된 이름(QualfiedName)에 매칭되는 클래스 또는 파일에 속한 속성 중 전체 또는 특정 속성들만 모델로 변환할 수 있다. 함수는 클래스 또는 파일 내에 속한 함수를 나타내는 정규식이다. 모델 변환부(218)는 이 항목을 이용하여 정규화된 이름(QualifiedName)에 매칭되는 클래스 또는 파일에 속한 함수 중 전체 또는 특정 함수들만 모델로 변환할 수 있다. 소스종류가 java가 아닌 c나 다른 언어인 경우, 파일명이 파일의 확장자로 유일하게 구분되는 경우, 모델 변환부(218)는 이 항목에 확장자에 해당하는 값을 넣어 특정 종류의 소스만 모델로 변환할 수 있다.
모델변환규칙(420)은 목표모델에 대한 구성정보를 나타낼 수 있다. ID는 모델로 변환되는 요소를 유일하게 구분할 수 있는 값으로, 사용자가 임의로 부여할 수 있다. 모델요소는 모델의 어떤 요소로 변환할지 지정하는 항목으로 패키지(Package), 인터페이스(Interface), 클래스(Class), 속성(Attribute), 오퍼레이션(Operation), 콜라보레이션(Collaboration), 시퀀스 다이어그램 (Sequence Diagram), 클래스 다이어그램(Class Diagram), 코드 라이프라인(Code Lifeline), 메시지 라이프라인(Message Lifeline), 타당성검증 라이프라인 (Validation Lifeline), 예외처리 라이프라인(Exception Lifeline) 등이 지정될 수 있다. 소스요소는 소스의 어떤 요소를 모델로 변환할지 지정하는 항목으로 패키지(Package), 클래스(Class), 속성(Attribute), 오퍼레이션(Operation) 등이 지정될 수 있다. 소스요소를 지정하지 않으면 소스에는 존재하지 않으나 목표 모델에는 존재해야 하는 요소들이 삽입될 수 있다. 스테레오타입에는 변환된 모델 요소에 지정할 스테레오타입이 기입된다. 상위요소ID는 해당요소가 속할 상위요소ID를 지정한다.
명명규칙(430)은 변환되는 모델요소를 명명할 명명규칙에 대한 정보를 나타낼 수 있다. 소스 접두사는 모델로 변환 시 제거하고자 하는 소스의 접두사이다. 모델 접두사는 모델로 변환 시 모델 요소명에 넣고자 하는 접두사이다. 소스 접미사는 모델로 변환 시 제거하고자 하는 소스의 접미사이다. 모델 접미사는 모델로 변환 시 모델 요소명에 넣고자 하는 접미사이다. 명명규칙은 모델 요소에 해당하는 소스명을 모델명으로 변환 시 적용하고자 하는 명명규칙이다. 없음(none), 한국어(Korean), 커스텀(Custom) 등의 항목을 지정할 수 있으며, 없음(None)은 소스명을 그대로 모델명으로 쓰고, 한국어(Korean)는 미리 입력된 한글명-영문명 사전을 이용하여 소스의 영문명을 한글명으로 변환해서 모델명으로 사용하며, 커스텀(Custom)은 단순 영문-한글 변환이 아닌 경우 그에 맞는 소스프로그램을 제작하여 지정할 수 있게 한다. 명명클래스는 명명규칙에서 커스텀(Custom)으로 항목이 지정된 경우 모델명을 정할 때 사용할 Java 클래스 정보를 나타낸다.
관계설정변환규칙(440)은 소스코드에는 존재하지 않으나 변환된 모델 요소간의 관계를 설정이 필요한 경우 그 관계를 설정할 수 있다. 유형은 연관, 일반화, 구현, 의존 관계 등의 관계 유형을 나타낸다. 관계요소ID는 관계를 설정할 모델요소ID를 나타낸다.
도 5는 도 2에 있는 모델-to-모델 변환기의 구성 및 작동을 설명하는 도면이다.
도 5a에서 모델-to-모델 변환기(220)는 모델-to-모델 변환규칙 수신부(222) 및 모델-to-모델 변환부(224)을 포함한다.
일 실시예에서, 소스코드 모델 변환기(210)는 입력 받은 소스코드를 수신된 변환규칙에 따라 UML 형식의 소스모델로 변환할 수 있다. 모델-to-모델 변환기(220)는 모델-to-모델변환규칙을 수신하여 수신한 모델-to-모델변환규칙에 따라 소스모델을 최종 목표모델로 변환할 수 있다. 모델-to-모델변환규칙은 도 5b에서 자세히 설명한다.
보다 상세하게, 모델-to-모델 변환기(220)는 모델-to-모델변환규칙에 따라 소스모델의 패키지 및 클래스의 위치를 이동하고 재구성할 수 있다. 즉, 모델-to-모델 변환기(220)는 소스모델 패키지의 클래스가 많은 경우 패키지를 분리할 수 있고 클래스의 오퍼레이션이 많은 경우 클래스를 분리할 수 있다. 마찬가지로, 모델-to-모델 변환기(220)는 소스모델 패키지의 클래스가 적은 경우 패키지를 통합할 수 있고 클래스의 오퍼레이션이 적은 경우 클래스를 통합할 수 있다. 다시 말해, 변환규칙에 따라 메타모델에서 변환된 소스모델의 패키지 또는 클래스에 대한 통폐합이 필요한 경우 모델-to-모델 변환기(220)는 모델-to-모델 변환규칙을 이용하여 소스모델을 목표모델로 변환할 수 있다.
변환규칙 수신부
도 5b는 모델-to-모델변환규칙을 설명하는 도면이다.
도 5b에서 모델-to-모델변환규칙은 소스모델 정규화된 이름 (QualifiedName)(510) 및 목표모델 정규화된 이름(QualifiedName)(520)으로 구성된다. 소스모델 정규화된 이름 (QualifiedName)(510)은 목표모델로 변환하기 위한 소스모델 요소의 정규화된 이름(QualifiedName)이며, 이 항목이 가리키는 소스모델 요소의 모든 하위 모델 요소는 목표모델 정규화된 이름(QualifiedName)(520)이 가리키는 모델로 요소로 복사된다. 소스모델 정규화된 이름(QualfiedName)(510)은 다르나 목표모델 정규화된 이름(QualfiedName)(520)이 같은 소스 모델 요소들은 목표모델로 복사 시 하나의 목표모델 요소로 통합되며, 반대로 소스모델 정규화된 이름(QualfiedName)(510)의 상위 요소명은 같으나 모델요소 정규화된 이름(QualifiedName)(520)의 상위 요소명이 다른 경우 소스모델 요소는 분리되어 복사된다. 목표모델 정규화된 이름(QualifiedName)(520)은 소스모델 정규화된 이름(QualifiedName)(510)이 가리키는 요소가 복사될 목표모델 요소의 정규화된 이름(QualifiedName)(520)을 나타낸다.
도 6은 도 2에 있는 소스코드 모델 변환기에 의한 코드계열 표현식 역공학 방법을 설명하는 도면이다.
도 6a에서 소스코드 모델 변환기(210)는 먼저 표현식의 변환을 위해서 정규 표현식 형태의 변환규칙을 수신할 수 있고, 변환 대상이 되는 소스코드를 선택하고 파싱하여 파싱된 데이터를 메모리에 저장할 수 있다. 그 다음 소스코드 모델 변환기(210)는 메모리에 저장된 데이터를 불러와 메타모델 변환부(216)를 통해 프로그램언어로부터 독립적인 모델에 소스코드의 정보를 저장할 수 있다. 모델 변환부(218)는 수신된 변환규칙을 입력 받아 메타모델 변환부(216)에 의해 변환된 데이터를 변환규칙에 따라 변환할 수 있다. 변환된 데이터는 UML 표준에 맞는 형태로 다시 변환되어 파일에 기록될 수 있다.
메타모델을 변환규칙에 따라 UML 모델로 변환 할 때, UML 모델로 표현되지 않는 단순 표현식 계열의 구문은 별도의 변환규칙을 입력 받아 변환될 수 있다. 변환규칙에 대한 상세 내용은 다음과 같다.
1) 공통사항: 함수의 내부 로직 중 함수 호출 또는 결합단편으로 변환되지 않는 논리 표현식은 코드(code), 타당성검증(validation), 예외처리(exception), 메시지(message) 등 사용 목적에 적합한 코드(code) 계열 라이프라인에 동기메시지를 생성하고 문서란에 논리코드로 표현될 수 있다.
2) message 메시지: 메시지를 발생시키는 구문은 메시지(message) 라이프라인에 메시지를 생성할 수 있다. 메시지(message) 라이프라인에 메시지를 생성할지 여부는 메시지를 발생시키는 특정 함수를 정규 표현식으로 정리하고 이 정규 표현식에 부합하는 함수가 있는지 여부로 판단한다.
3) exception 메시지: 오류를 발생시키는 구문은 예외처리(exception) 라이프 라인에 메시지를 생성할 수 있다. 예외처리(exception) 라이프라인에 메시지를 생성할지 여부는 오류를 발생시키는 특정 함수를 정규 표현식으로 정리하고, 이 정규 표현식에 부합하는 함수가 있는지 여부로 판단한다.
4) validation 메시지: 필수 입력값 체크 등 입력 매개변수를 검증하면서 동시에 오류를 발생시키는 구문은 타당성검증(validation) 라이프라인에 메시지를 생성할 수 있다. 타당성검증(validation) 라이프라인에 메시지를 생성할지 여부는 입력값 검증에 해당하는 함수 및 구문 패턴을 정규 표현식으로 정리하고 이 정규 표현식에 부합하는 함수가 있는지 여부로 판단한다.
5) code 메시지: 오퍼레이션 호출, 결합단편, message/exception/ validation으로 변환되지 않는 기타 로직 및 주석은 코드(code) 라이프라인에 메시지를 생성할 수 있다. 오퍼레이션이 호출을 동기메시지로 표현하거나 결합단편을 생성하기 전까지의 내부 로직은 모두 코드(code) 라이프라인에 표시된다. 소스 코드의 오퍼레이션 호출 구문, 결합단편에 해당하는 원래 구문도 해당 모델링 요소가 등장하기 직전의 코드(code) 라이프라인에 표시된다(모델 변환 정합성을 검증하기 위하여 원 소스코드 모두 표시).
6) 변수 선언 및 초기화: 변수명은 영문단어명-한글단어명의 형태로 입력된 사전 정보를 이용하여 한글화되고 논리표현식에 맞도록 형태가 변경된다. 타입(Type)명에 대해 기본 타입은 소스타입과 모델타입을 매핑한 매핑표에 따라 타입명을 변환하고, 기본 타입이 아닌 타입은 타입명을 모델로 변환된 타입명으로 변환하고 배열여부에 따라 논리표현식에서 정의한 배열 표기법에 따라 변환한다. 변수 초기화는 구문 그대로 변환하는 것을 의미한다.
7) 함수의 변환: 기 정의된 정규 표현식 규칙에 따라 해당 정규 표현식으로 구문을 변환한다. 예) strcpy\((변수명),(변수명)\) -> ${1} = ${2} 의 왼쪽 규칙에 부합하는 경우 오른쪽의 표현식으로 구문을 변환한다. 따라서 strcpy(a,b)와 같은 구문은 a = b구문으로 변환된다.
도 6b에서는 시퀀스 다이어그램에 UML 표현식으로 나타낼 수 없는 단순 코드계열의 표현식을 표현하는 방법을 보여준다. 소스코드 모델 변환기(210)는 시퀀스 다이어그램에서 코드계열 표현식을 나타내기 위해 코드(code), 타당성검증(validation), 예외처리(exception), 메시지(message) 등 코드계열 표현식을 위한 임의의 라이프라인(lifeline)을 생성하고 해당 라이프라인(lifeline)으로 메시지를 그리고 해당 메시지의 문서 내용에 표현식을 저장할 수 있다.
도 7은 도 2에 있는 코드 생성기의 구조와 코드 생성 방법을 나타내는 도면이다.
도 7a에서 코드 생성기(Code Generator)(230)는 코드 생성기 환경설정부(Code Generator Configuration)(232), 모델 스캐너(Model Scanner) (234), 모델 타당성 검증부(Model Validation)(236) 및 코드 작성부(Code Maker)(238)을 포함할 수 있다. 코드 생성기(230)는 모델을 기반으로 다양한 프로그래밍 언어의 소스코드를 생성하는 모듈이다. 코드 생성기(230)는 모델 요소(Element)와 논리표현식 각각에 대해서 매핑된 변환규칙을 기반으로 프로그램 소스코드를 생성할 수 있다. 코드 생성기(230)는 하나의 모델로 다양한 언어의 소스코드를 생성할 수 있다.
도 7b에서 코드 생성기 환경설정부(Code Generator Configuration) (232)는 원하는 소스코드를 묘사하기 위한 변환규칙을 작성하기 위해 환경설정을 수행할 수 있다(S710). 우선 변환규칙 프로젝트를 하나 생성하고 프로젝트에 대상이 될 모델 요소(Element)들을 등록하고 각 요소(Element) 별로 변환규칙을 생성해서 등록할 수 있다. 변환규칙을 등록할 때는 변환규칙의 변환행위를 기술하고 변환규칙의 실행조건을 지정한다. 모든 요소(Element)들을 대상으로 변환규칙의 등록이 완료되면 만들고자 하는 소스코드의 구조가 정의된 것이다.
소프트웨어 모델을 작성 완료한 후나 작성 도중에 작성한 모델에 대한 코드를 생성하고 싶다면 원하는 모델에 대해서 변환 규칙 프로젝트를 선택한 후 소스코드 생성 기능을 수행하면 된다. 전체 모델 또는 일부 모델 상관없이 소스코드 생성이 가능하다.
소스코드 생성 기능을 수행하면 코드 생성기(Code Generator)(230)에서 모델 스캐너(Model Scanner)(234)가 실행된다. 모델 스캐너(Model Scanner)(234)는 최상위 요소(Element)부터 탑-다운(Top-Down) 방식으로 요소(Element)들을 읽어가면서 해당 요소(Element)가 소스코드 생성 대상 요소(Element)인지 확인할 수 있다. 소스코드 생성 대상 요소(Element)인 경우 모델 스캐너(Model Scanner)(234)는 모델 타당성 검증부(Model Validation) (236)에 해당 요소(Element)를 전송한다(S720).
모델 타당성 검증부(Model Validation)(236)는 소스코드 생성 대상인 요소(Element)를 전송 받아 해당 요소(Element)가 가지고 있는 타당성 검증 규칙(Validation Rule)에 따라 검증을 수행할 수 있다(S730). 모델 타당성 검증부(Model Validation)(236)는 검증 완료 후 오류가 있을 경우 모델 스캐너(Model Scanner)(234)에 전달하고 모델 스캐너(Model Scanner)(234)는 검증 결과를 저장할 수 있다.
모든 모델 요소(Element)들의 검증이 끝나고 오류가 있으면 모델 스캐너(Model Scanner)(234)는 화면에 전체 검증결과를 출력할 수 있다(S740). 검증 결과 오류가 없으면 코드 작성기(Code Maker)(238)가 변환규칙에 따라 소스 코드를 생성할 수 있다(S750).
상기에서는 본 출원의 바람직한 실시예를 참조하여 설명하였지만, 해당 기술 분야의 숙련된 당업자는 하기의 특허 청구의 범위에 기재된 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위 내에서 본 출원을 다양하게 수정 및 변경시킬 수 있음을 이해할 수 있을 것이다.
본 발명은 컴퓨터 수행 가능한 모델 역공학 방법 및 장치에 관한 것으로, 보다 상세하게는, 프로그램의 소스코드를 모델로 변환하는 구조 및 규칙을 정의하여 원하는 형태의 모델을 자동으로 생성하여 프로그램의 구조를 쉽게 분석하고 재설계하는 컴퓨터 수행 가능한 모델 역공학 방법 및 장치에 관한 것이다.

Claims (23)

  1. 소스코드를 입력 받는 단계;
    상기 소스코드를 목표모델로 변환하기 위한 변환규칙을 입력 받는 단계;
    상기 소스코드와 연관된 파서를 통해 상기 소스코드를 파싱하여 특정 자료구조를 갖는 파싱 데이터를 메모리에 저장하는 단계;
    상기 저장된 파싱 데이터를 메타모델로 변환하는 단계; 및
    상기 메타모델을 상기 입력 받은 변환규칙에 따라 목표모델로 변환하는 단계를 포함하는 컴퓨터 수행 가능한 모델 역공학 방법.
  2. 제1항에 있어서,
    상기 변환된 목표모델을 UML(Unified Modeling Language) 표준에 맞는 형태로 다시 변환하여 파일에 기록하는 단계를 더 포함하는 것을 특징으로 하는 컴퓨터 수행 가능한 모델 역공학 방법.
  3. 제1항에 있어서, 상기 변환규칙을 입력받는 단계는
    소스변환규칙, 모델변환규칙, 명명규칙 및 관계설정규칙으로 구성되는 변환규칙을 입력받는 단계를 포함하는 것을 특징으로 하는 컴퓨터 수행 가능한 모델 역공학 방법.
  4. 제3항에 있어서, 상기 메타모델을 상기 입력 받은 변환규칙에 따라 목표모델로 변환하는 단계는
    상기 변환규칙에 따라 소스코드의 특정 요소 또는 목표모델의 특정 요소를 지정하여 변환하는 단계를 포함하는 것을 특징으로 하는 컴퓨터 수행 가능한 모델 역공학 방법.
  5. 제1항에 있어서, 상기 파싱 데이터를 메모리에 저장하는 단계는
    상기 소스코드의 프로그래밍 언어 종류에 따라 다른 자료구조를 갖는 데이터로 파싱하는 단계를 포함하는 것을 특징으로 하는 컴퓨터 수행 가능한 모델 역공학 방법.
  6. 제1항에 있어서, 상기 저장된 파싱 데이터를 메타모델로 변환하는 단계는
    상기 소스코드의 종류 및 프로그램언어에 관계없이 소스코드의 모든 요소들을 특정 자료구조로 나타내 주는 메타모델로 변환하는 단계를 포함하는 것을 특징으로 하는 컴퓨터 수행 가능한 모델 역공학 방법.
  7. 제1항에 있어서,
    상기 변환규칙에 따라 관심 대상이 아닌 소스코드를 변환 대상에서 제외하는 단계를 포함하는 것을 특징으로 하는 컴퓨터 수행 가능한 모델 역공학 방법.
  8. 제1항에 있어서, UML로 표현될 수 없는 소스코드 정보에 대한 별도의 변환규칙을 입력 받는 단계를 포함하는 것을 특징으로 하는 컴퓨터 수행 가능한 모델 역공학 방법.
  9. 제8항에 있어서, 상기 UML이 표현할 수 없는 소스코드 정보에 대하여 메시지(message) 라이프라인, 예외처리(exception) 라이프 라인, 타당성검증(validation) 라이프라인 또는 코드(code) 라이프라인 중 적어도 하나에 메시지를 생성하는 단계를 더 포함하는 것을 특징으로 하는 컴퓨터 수행 가능한 모델 역공학 방법.
  10. 제8항에 있어서, 상기 UML이 표현할 수 없는 소스코드 정보에 대하여 메시지(message) 라이프라인, 예외처리(exception) 라이프 라인, 타당성검증(validation) 라이프라인 또는 코드(code) 라이프라인 중 적어도 하나에 메시지를 생성하는 단계를 더 포함하는 것을 특징으로 하는 컴퓨터 수행 가능한 모델 역공학 방법.
  11. 제1항에 있어서, 상기 메타모델을 상기 입력 받은 변환규칙에 따라 목표모델로 변환하는 단계는
    상기 메타모델을 상기 입력 받은 변환규칙에 따라 소스모델로 변환하는 단계;
    상기 소스모델을 목표모델로 변환하기 위한 모델-to-모델 변환규칙을 입력 받는 단계; 및
    상기 모델-to-모델 변환규칙에 따라 상기 소스모델을 상기 목표모델로 변환하는 단계를 포함하는 것을 특징으로 하는 컴퓨터 수행 가능한 모델 역공학 방법.
  12. 제1항에 있어서,
    상기 목표모델을 입력 받고 소스코드 생성을 위한 환경설정을 수행하는 단계;
    상기 목표모델의 요소들을 읽어 해당 요소들이 소스코드 생성 대상 요소들인지 확인하는 단계;
    상기 생성 대상인 모델 요소들을 해당 요소들이 갖고 있는 타당성 검증 규칙에 따라 검증을 수행하는 단계; 및
    상기 검증 결과에 따라 소스코드를 생성하는 단계를 더 포함하는 것을 특징으로 하는 컴퓨터 수행 가능한 모델 역공학 방법.
  13. 제12항에 있어서, 상기 소스코드 생성을 위한 환경설정을 수행하는 단계는
    상기 목표모델의 요소들 및 각 요소들 별 변환규칙을 등록하고, 변환규칙의 실행조건을 지정하여 환경설정을 수행하는 단계를 포함하는 것을 특징으로 하는 컴퓨터 수행 가능한 모델 역공학 방법.
  14. 모델 역공학 가능한 프로그램이 저장된 메모리부; 및
    상기 프로그램을 실행하는 프로세서를 포함하되
    상기 프로세서는
    입력된 소스코드를 파서를 통해 특정 자료구조를 갖는 파싱 데이터로 파싱하고,
    파싱된 데이터를 메타모델로 변환하고,
    상기 메타모델을 입력된 변환규칙에 따라 목표모델로 변환하며,,
    상기 변환된 목표모델을 이용하여 소스코드를 생성하는 모델 역공학 장치.
  15. 제14항에 있어서, 상기 프로세서는
    소스코드를 입력 받고 상기 소스코드를 목표모델로 변환하기 위한 변환규칙을 입력받고,
    파싱된 특정 자료구조를 갖는 파싱 데이터를 메모리에 저장하는 모델 역공학 장치.
  16. 제15항에 있어서, 상기 프로세서는
    상기 소스코드의 프로그래밍 언어 종류에 따라 다른 형태의 자료구조를 갖는 데이터로 파싱하는 것을 특징으로 하는 모델 역공학 장치.
  17. 제15항에 있어서, 상기 프로세서는
    상기 소스코드의 종류 및 프로그램언어에 관계없이 소스코드의 모든 요소들을 특정 자료구조로 나타내 주는 메타모델로 변환하는 것을 특징으로 하는 모델 역공학 장치.
  18. 제15항에 있어서, 상기 프로세서는
    UML이 표현할 수 없는 소스코드 정보에 대한 별도의 변환규칙을 입력 받는 것을 특징으로 하는 모델 역공학 장치.
  19. 제14항에 있어서, 상기 프로세서는
    소스모델을 입력 받아 목표모델로 변환하기 위한 모델-to-모델 변환규칙에 따라 상기 소스모델을 목표모델로 변환하는 것을 특징으로 하는 모델 역공학 장치.
  20. 제19항에 있어서, 상기 프로세서는
    소스모델의 정규화된 이름 및 목표모델의 정규화된 이름으로 구성되는 모델-to-모델변환규칙을 입력받는 것을 특징으로 하는 모델 역공학 장치.
  21. 제14항에 있어서, 상기 프로세서는
    상기 목표모델을 입력 받고 소스코드 생성을 위한 환경설정을 수행하고,
    상기 목표모델의 요소들을 읽어 해당 요소들이 소스코드 생성 대상 요소들인지 확인하며,
    상기 생성 대상인 모델 요소들을 해당 요소들이 갖고 있는 타당성 검증 규칙에 따라 검증을 수행하고,
    상기 검증 결과에 따라 소스코드를 생성하는 것을 특징으로 하는 모델 역공학 장치.
  22. 제21항에 있어서, 상기 프로세서는
    상기 목표모델의 요소들 및 각 요소들 별 변환규칙을 등록하고, 변환규칙의 실행조건을 지정하여 환경설정을 수행하는 것을 특징으로 하는 모델 역공학 장치.
  23. 소스코드를 입력 받는 기능;
    상기 소스코드를 목표모델로 변환하기 위한 변환규칙을 입력 받는 기능;
    상기 소스코드와 연관된 파서를 통해 상기 소스코드를 파싱하여 특정 자료구조를 갖는 파싱 데이터를 메모리에 저장하는 기능;
    상기 저장된 파싱 데이터를 메타모델로 변환하는 기능; 및
    상기 메타모델을 상기 입력받은 변환규칙에 따라 목표모델로 변환하는 기능을 포함하는 것을 특징으로 하는 모델 역공학 방법을 컴퓨터에서 실행시키기 위한 프로그램을 기록한 컴퓨터 판독 가능한 기록매체.
PCT/KR2015/012587 2014-11-27 2015-11-23 컴퓨터 수행 가능한 모델 역공학 방법 및 장치 WO2016085213A1 (ko)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2017527634A JP6479184B2 (ja) 2014-11-27 2015-11-23 コンピュータ実行可能なモデルリバースエンジニアリング方法及び装置
SG11201704087RA SG11201704087RA (en) 2014-11-27 2015-11-23 Computer-executable model reverse engineering method and apparatus
CN201580059251.XA CN107148615A (zh) 2014-11-27 2015-11-23 计算机可执行的模型逆向工程方法及装置

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
KR10-2014-0167334 2014-11-27
KR20140167334 2014-11-27
KR1020150163109A KR101770292B1 (ko) 2014-11-27 2015-11-20 컴퓨터 수행 가능한 모델 역공학 방법 및 장치
KR10-2015-0163109 2015-11-20

Publications (1)

Publication Number Publication Date
WO2016085213A1 true WO2016085213A1 (ko) 2016-06-02

Family

ID=56074678

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2015/012587 WO2016085213A1 (ko) 2014-11-27 2015-11-23 컴퓨터 수행 가능한 모델 역공학 방법 및 장치

Country Status (1)

Country Link
WO (1) WO2016085213A1 (ko)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614091A (zh) * 2018-10-09 2019-04-12 中国平安人寿保险股份有限公司 代码自动生成方法、装置、电子设备及存储介质
CN113515278A (zh) * 2021-06-16 2021-10-19 深圳奥哲网络科技有限公司 低代码模型处理方法、系统、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030083900A1 (en) * 2001-10-26 2003-05-01 Ismail Khriss Template-based method and system for reverse engineering
JP2008225898A (ja) * 2007-03-13 2008-09-25 Toshiba Corp 変換装置、変換プログラム及び変換方法
JP2012164148A (ja) * 2011-02-07 2012-08-30 Ntt Data Corp リバースエンジニアリング支援装置、リバースエンジニアリング支援方法及びそのプログラム
JP2013171458A (ja) * 2012-02-21 2013-09-02 Fuji Electric Co Ltd モデル図作成装置、モデル図作成方法、モデル図作成プログラムおよびモデル図作成用の状態イベント表のデータ構造

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030083900A1 (en) * 2001-10-26 2003-05-01 Ismail Khriss Template-based method and system for reverse engineering
JP2008225898A (ja) * 2007-03-13 2008-09-25 Toshiba Corp 変換装置、変換プログラム及び変換方法
JP2012164148A (ja) * 2011-02-07 2012-08-30 Ntt Data Corp リバースエンジニアリング支援装置、リバースエンジニアリング支援方法及びそのプログラム
JP2013171458A (ja) * 2012-02-21 2013-09-02 Fuji Electric Co Ltd モデル図作成装置、モデル図作成方法、モデル図作成プログラムおよびモデル図作成用の状態イベント表のデータ構造

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
NA, DONS JIN: "Reverse Engineering of Embedded Software based on Model-Driven Development", THESIS (MA) GRADUATE SCHOOL OF HANYANG UNIVERSITY, February 2008 (2008-02-01), pages 1 - 15 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614091A (zh) * 2018-10-09 2019-04-12 中国平安人寿保险股份有限公司 代码自动生成方法、装置、电子设备及存储介质
CN113515278A (zh) * 2021-06-16 2021-10-19 深圳奥哲网络科技有限公司 低代码模型处理方法、系统、电子设备及存储介质

Similar Documents

Publication Publication Date Title
US11429365B2 (en) Systems and methods for automated retrofitting of customized code objects
US9535664B1 (en) Computerized software development process and management environment
JP6479184B2 (ja) コンピュータ実行可能なモデルリバースエンジニアリング方法及び装置
US9122540B2 (en) Transformation of computer programs and eliminating errors
US20040158820A1 (en) System for generating an application framework and components
CN111736840A (zh) 小程序应用的编译方法、运行方法、存储介质及电子设备
CN103605556A (zh) 虚拟试验对象一体化构建系统及方法
Bergmayr et al. Generating Metamodels from Grammars by Chaining Translational and By-Example Techniques.
CN115952758A (zh) 芯片验证方法、装置、电子设备及存储介质
CN112395843A (zh) 一种基于php代码的业务处理方法、装置及设备和介质
Martinez et al. Recovering sequence diagrams from object-oriented code: An ADM approach
WO2016085213A1 (ko) 컴퓨터 수행 가능한 모델 역공학 방법 및 장치
WO2020215680A1 (zh) 自动生成pojo类的方法、装置及存储介质、计算机设备
Irwin et al. Object oriented metrics: Precision tools and configurable visualisations
WO2009116748A2 (ko) 예약된 컴포넌트 컨테이너 기반 소프트웨어 개발 방법 및 장치
CN113778897A (zh) 接口的自动测试方法、装置、设备及存储介质
JP2010140407A (ja) ソースコード検査装置
US10540157B2 (en) Systems to remove object relational mappings from a software project
CN106033338A (zh) 基于fog数据的源代码导入及解析的方法和装置
CN114115982A (zh) 代码发布方法、装置、设备及存储介质
CN114047923A (zh) 错误代码定位方法、装置、存储介质以及电子设备
CN113760291A (zh) 日志输出的方法和装置
JPH1173328A (ja) コーディング規約チェックシステム
CN114489653A (zh) 基于编译器的数据处理方法、装置以及可读存储介质
CN110737431A (zh) 软件开发方法、开发平台、终端设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15864031

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2017527634

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15864031

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 24.01.2018)

122 Ep: pct application non-entry in european phase

Ref document number: 15864031

Country of ref document: EP

Kind code of ref document: A1