WO2013080842A1 - Source code conversion method and computer-readable storage medium - Google Patents

Source code conversion method and computer-readable storage medium Download PDF

Info

Publication number
WO2013080842A1
WO2013080842A1 PCT/JP2012/080077 JP2012080077W WO2013080842A1 WO 2013080842 A1 WO2013080842 A1 WO 2013080842A1 JP 2012080077 W JP2012080077 W JP 2012080077W WO 2013080842 A1 WO2013080842 A1 WO 2013080842A1
Authority
WO
WIPO (PCT)
Prior art keywords
conversion
source code
model
inspection
conversion rule
Prior art date
Application number
PCT/JP2012/080077
Other languages
French (fr)
Japanese (ja)
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
Application filed by 株式会社日立製作所 filed Critical 株式会社日立製作所
Publication of WO2013080842A1 publication Critical patent/WO2013080842A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3624Software debugging by performing operations on the source code, e.g. via a compiler

Definitions

  • the present invention relates to a source code conversion method and a source code conversion program, and in particular, in a software model check, in order to reduce the cost of writing a check code in an input language of a model checker, a software source is utilized by utilizing a computer.
  • the present invention relates to a method for converting a code into an inspection code.
  • the model checking technology should be possessed by the software by describing the behavior of the software in the input language of a specific model checker and exhaustively checking the possible states of the software by executing the specific model checker. This is a technique for determining whether or not a property is satisfied (see Non-Patent Document 1, for example). According to the method disclosed in Non-Patent Document 1, the behavior of software is described in an input language called Promela, and input to a model checker called SPIN, thereby performing inspection.
  • Model checking technology is a promising technology for ensuring the quality of software that is becoming increasingly complex and large-scale, but since the possible states of software are comprehensively examined, the state that should be inspected for large-scale software A phenomenon called state explosion occurs in which the number becomes a huge amount. Due to this state explosion, the phenomenon that the time calculation amount necessary for processing becomes practically unacceptable, and the phenomenon that the space calculation amount necessary for processing exceeds the storage area installed in the computer used for processing, At least one of them may be caused and the above-described inspection may not be completed.
  • Abstraction includes, for example, simplification of branch conditions for selective execution statements.
  • the abstraction may cause a situation where an originally nonexistent execution path occurs or a situation where an existing execution path disappears. For this reason, there may be a difference between the property of the software indicated by the inspection result for the inspection code and the property of the original software. Therefore, it is desirable to apply the abstraction after considering the level of abstraction in view of the property to be inspected for the software.
  • FIG. 35 shows an example of a source code conversion apparatus disclosed in Patent Document 1.
  • the source code is converted into an inspection code written in an input language of a specific model checker using a translation map (steps 910 to 940).
  • an inspection code is inspected by the specific model checker separately from the conversion using an environment model defined by a user (Steps 975 and 950 to 970). .
  • model-driven development is one of the software development technologies.
  • Model-driven development is a technology for advancing software development by describing software design information as a model and refining the model by a conversion operation.
  • the format of the model and the meaning of the model are defined by a meta model described using MOF (see, for example, Non-Patent Document 2), and the conversion rule that refines the model uses QVT. Described (for example, see Non-Patent Document 3), description and verification of constraints on consistency and soundness of model using OCL (for example, see Non-Patent Document 4), and source code from model using MOFM2T Is generated (see, for example, Non-Patent Document 5).
  • model in model checking technology and the “model” in model-driven development are concepts that are independent of each other, and generally have no commonality in terms of data structure and meaning.
  • a translation map that is a map from the language of the source code to the language of the model checker and the language of the model checker are described. At least one of the specified environmental models must be modified. Therefore, after a change for a certain purpose 1 (for example, a change in the method of abstraction), a change for a different purpose 2 (for example, a design change) is performed. When changes are made for purpose 2 and new purpose 3 (for example, a change in model checker), the changes made for purpose 2 that were originally performed cannot be reused. Changes that simultaneously satisfy must be implemented.
  • a certain purpose 1 for example, a change in the method of abstraction
  • a change for a different purpose 2 for example, a design change
  • new purpose 3 for example, a change in model checker
  • the present invention provides a source code conversion method and a source code conversion program that can flexibly change an abstract description and that can efficiently reuse the abstract description based on the problems of the prior art. With the goal.
  • a source code executed by a source code conversion device that converts a software source code into an inspection code described in an input language of a verification tool using a plurality of different conversion rules.
  • the plurality of different conversion rules are obtained by dividing a series of processes for converting and abstracting the source code into the inspection code, and dividing the plurality of different conversion rules,
  • a first conversion rule for converting the source code into an intermediate format that is independent of a specific programming language a second conversion rule for abstracting the converted intermediate format; and the converted intermediate format as the inspection code.
  • the step of receiving the input of at least one second conversion rule, the step of receiving the input of at least one third conversion rule, and the input first conversion rule Converting the source code into the intermediate format, abstracting the converted intermediate format using the input second conversion rule, and using the input third conversion rule, Converting the converted intermediate form into the inspection code, wherein the intermediate form is in addition to the physical element that is an element equivalent to the source code or the element of the inspection code, A logical element that is an element generated in the step of abstracting the format can be expressed.
  • the source code to be inspected is converted into the inspection code described in the input language of the model checker using a plurality of different conversion rules.
  • the plurality of different conversion rules are obtained by converting a source code to be inspected into an inspection code described in an input language of a model checker, and dividing a series of abstraction processes into fine granularities. By using in combination, conversion from the source code to the inspection code is realized.
  • each of a series of processes for converting a source code to be inspected into an inspection code is divided into fine granularities is referred to as a “conversion rule”.
  • This series of processing includes abstraction processing.
  • the source code conversion apparatus realized by the present invention has an interface for selecting or inputting a plurality of different conversion rules when a source code is converted into an inspection code.
  • the conversion rule is input by one of a selection from a plurality of conversion rules stored in advance in the source code conversion apparatus and a description by the user.
  • the conversion rule includes an implementation-generalization conversion rule for converting source code into a format (generalization model) having generalized program information that does not depend on the description language of the source code, It is classified into an abstraction conversion rule that abstracts a generalized model and a generalization-check conversion rule that converts a generalized model into a description language of a model checker.
  • the plurality of different conversion rules include a first conversion rule for converting the source code into an intermediate format that does not depend on a specific programming language, and a second conversion rule for executing an abstraction process on the intermediate format. And a third conversion rule for converting the intermediate format into the inspection code.
  • the conversion from the source code to the inspection code includes a step of converting the source code to a generalized model by an implementation-generalization conversion rule, a step of abstracting the generalization model by an abstraction conversion rule, and a generalization-inspection conversion This is realized by executing three steps of converting the generalized model into an inspection code according to a rule.
  • the conversion from the source code to the inspection code is performed by inputting one or more of each of the first, second, and third conversion rules, and the software source code using the first conversion rule.
  • Converting to a format, abstracting software expressed in the intermediate format using the second conversion rule, and describing the intermediate format in the input language of the verification tool using the third conversion rule This is realized by continuously executing the three steps of converting into the verification code.
  • the information (model) internally held in a series of processes for converting the source code to be inspected into the inspection code is defined by the meta model.
  • the model is classified into an implementation model having information corresponding to the source code to be inspected, the generalization model described above, and an inspection model having information corresponding to the description language of the model checker.
  • the implementation model is defined by its meta model, the meta / implementation model, the generalization model is defined by its meta model, the meta / generalization model, and the inspection model is defined by its meta model, the meta / inspection model .
  • Each of the above-described metamodels has a definition of a data structure and information on constraints between elements included in the data.
  • the generalization model includes two types of elements, a physical element having an equivalent element corresponding to an element of the mounting model or the inspection model, and a logical element used in the process of abstraction conversion. included.
  • a logical element is an element inheriting the characteristics of a physical element that can have attribute information and a reference to a related physical element.
  • Each physical element has a corresponding logical element. For example, by describing as a conversion rule, giving additional attribute information by replacing a physical element with a corresponding logical element, replacing with a new logical element, and replacing a logical element with a different physical element
  • the abstract description can be reused at each stage.
  • the source code conversion apparatus 1000 executes a conversion process combining a plurality of conversion rules 0002 on the source code 0001, thereby adapting the source code 0001 to the existing model checking apparatus. Converted to the inspection code 0005. That is, (a) “conversion” is divided into fine granularities and packaged as a combination of a plurality of “conversion rules” 0002, thereby realizing flexible conversion. (B) The user (inspector) inputs the source code 0001 to be inspected, selects the “conversion rule” 0002 corresponding to the target source code and the inspection level, and obtains the desired inspection code 0005.
  • the abstraction change by the user can be easily performed by selecting or inputting a plurality of different conversion rules 0002. Realized.
  • the user can change the abstraction level by selecting a plurality of different conversion rules 0002 according to the domain information, the property to be inspected, and the information on the inspection level (influence on the property due to abstraction). And can be easily realized by an operation to be input to the source code conversion apparatus 1000.
  • the present invention includes a procedure for converting the source code 0001 to be inspected into the inspection code 0005 described in the input language of the model checker using a plurality of different conversion rules 0002.
  • the plurality of different conversion rules are classified into an implementation-generalization conversion rule, an abstraction conversion rule, and a generalization-check conversion rule, and conversion using these conversion rules is executed in stages.
  • the implementation model, the generalization model, and the inspection model are each defined in the meta model, and by adding restrictions, it is possible to verify that the conversion result by the conversion rule is not illegal.
  • a series of processes for converting the source code to be inspected while abstracting it into the inspection code is realized by combining fine-grained conversion rules.
  • a method for realizing such a series of processes It is possible to prevent an increase in the verification cost of the conversion rule caused by.
  • FIG. 3A is a diagram illustrating a configuration example of a source code conversion system including the source code conversion apparatus according to the first embodiment.
  • a source code conversion apparatus 1000 applied to an embodiment of the present invention is an apparatus that converts a source code 0001 to be inspected into an inspection code 0005, and includes an input unit 1100, a conversion processing unit 1200, an output unit 1300, and a storage. Unit 1400 and control unit 1500.
  • Reference numeral 2000 denotes a model inspection tool, and reference numeral 3000 denotes an inspection result.
  • the input unit 1100 receives input of the source code 0001 and the conversion rule 0002.
  • the storage unit 1400 stores a conversion rule 0002, a meta model 0003, and a writing rule 0004.
  • the meta model 0003 is data for defining a model format internally held in a series of processes for converting the source code 001 into the inspection code 0005 by the conversion processing unit 1200. As described above, the meta model 0003 holds the definition of the data structure and information on the constraints between the elements included in the data.
  • the elements included in the data include physical elements and logical elements. Information regarding the physical elements is referred to as a physical element definition 0031, and information regarding the logical elements is referred to as a logical element definition 0032.
  • the conversion processing unit 1200 converts the source code 0001 to be inspected into the inspection code 0005 based on the conversion rule 0002.
  • the output unit 1300 outputs the inspection code 0005 based on the writing rule 0004.
  • the control unit 1500 is a processor that executes various processes for controlling the entire process of the source code conversion apparatus 1000.
  • FIG. 3B shows a configuration example of the source code conversion apparatus 1000.
  • the input unit 1100 includes a source code input unit 1101 and a conversion rule input unit 1102.
  • the conversion processing unit 1200 includes a model construction unit 1201, an implementation-generalized model conversion unit 1202, an abstract model conversion unit 1203, and a generalization-check model conversion unit 1204.
  • the output unit 1300 includes an inspection code writing unit 1301.
  • the storage unit 1400 includes a conversion rule database 1401, a metamodel database 1402, and a writing rule database 1403.
  • the source code conversion apparatus 1000 is implemented as a program that operates on, for example, a single computer or a plurality of computers connected via a network.
  • the source code 0001 and the conversion rule set 0002 are input by, for example, a method of reading from a storage device on a computer or a method of directly inputting from an input device connected to the computer.
  • the inspection code 0005 is output by, for example, a method of writing to a storage device on a computer and a method of displaying on a display device of a computer.
  • the input unit 1100 receives data input by the user and executes a process of supplying the input data to the conversion processing unit 1200.
  • the input unit 1100 receives information related to the source code 0001 and a plurality of conversion rules divided into fine granularities, that is, information related to the “conversion rule set” 0002, and supplies the information to the conversion processing unit 1200.
  • the input unit 1100 may receive an instruction regarding driving and control of the conversion processing unit and driving and control of the output unit by the user.
  • the conversion processing unit 1200 is supplied with information on the source code 0001 and information on the conversion rule set 0002 to be applied to the source code 0001 from the input unit 1100. Also, the conversion processing unit 1200 executes processing for converting the source code 0001 using the conversion rule set 0002 and supplies information of the conversion result to the output unit 1300.
  • the information related to the conversion rule set 0002 supplied from the input unit 1100 includes only identification information indicating the conversion rule 0002 stored in the storage unit 1400. The identification information may be taken out from the storage unit 1400 and used for conversion.
  • the conversion processing unit 1200 includes a model construction unit 1201, an implementation-generalized model conversion unit 1202, an abstract model conversion unit 1203, and a generalization-check model conversion unit 1204.
  • the conversion processing unit 1200 converts the source code information 1001 into the inspection model 1008 by model conversion using the meta model 0003 (see FIG. 3A) and the conversion rule 0002.
  • the meta / implementation model 1002, the meta / generalization model 1003, and the meta / inspection model 1004 are described in, for example, the MOF described in Non-Patent Document 2.
  • the implementation-generalization conversion rule 1005, the abstraction conversion rule 1006, and the generalization-inspection conversion rule 1007 are described, and the model is converted.
  • the conversion may be another model conversion method already exemplified, or a plurality of methods may be mixed.
  • the implementation-generalization model conversion unit 1202, the abstraction model conversion unit 1203, and the generalization-check model conversion unit 1204 may be executed by the same part without being independent of each other.
  • the meta / implementation model 1002, the meta / generalization model 1003, and the meta / inspection model 1004 are individually meta-models of the implementation model 1205, the generalization model 1206, and the inspection model 1008.
  • the mounting model 1205, the generalization model 1206, and the inspection model 1008 may be defined by a single meta model without preparing.
  • the meta / implementation model 1002, the meta / generalization model 1003, and the meta / inspection model 1004 are in the form of an implementation model 1205, a generalization model 1206, and an inspection model 1008, respectively, by a plurality of methods.
  • constraints may be defined.
  • each meta model includes the constraint conditions described in the OCL described in Non-Patent Document 4 in addition to the definition by the MOF, and satisfies the constraint conditions when model conversion is executed. There can be a way to perform the verification.
  • the model construction unit 1201 receives the source code information 1001 from the source code input unit 1101 and converts it into the mounting model 1205.
  • the format of the mounting model 1205 is defined by a meta / implementation model 1002 that is the meta model.
  • the implementation model 1205 preferably has sufficient information necessary for mutual conversion with the source code information 1001 in order to obtain the effects of the present invention to the maximum. However, in some embodiments, an inspection code is output. There may be omission and addition of information to the extent that it does not miss its purpose.
  • the model construction unit 1201 may be implemented in a manner inseparable from the source code input unit 1101 and the process may proceed in a form in which the source code information 1001 does not occur.
  • the mounting-generalization model conversion unit 1202 converts the mounting model 1205 into the generalization model 1206 using the mounting-generalization conversion rule 1005, the meta / mounting model 1002, and the meta / generalization model 1003.
  • the generalization model 1206 has a data structure that can represent structures and processes in a plurality of programming languages. For example, in the generalization model 1206, the If statement and the Switch statement in the source code 0001 are not distinguished and are expressed as selective execution statements. In some embodiments, only the implementation-generalization conversion rule 1005 may be used when converting the implementation model 1205 to the generalization model 1206.
  • the implementation-generalization conversion rule 1005 when the implementation-generalization conversion rule 1005 includes a plurality of conversion rules, the plurality of conversion rules are integrated into one conversion rule, and the conversion from the implementation model 1205 to the generalization model 1206 is performed. There can be a method to use. In an embodiment, when the implementation-generalization conversion rule 1005 includes a plurality of conversion rules, a procedure for executing the conversion from the implementation model 1205 to the generalization model 1206 by repeating the conversion process a plurality of times is provided. possible.
  • the abstract model conversion unit 1203 abstracts the general model 1206 using the abstract conversion rule 1006 and the meta / generalization model 1003.
  • only the abstraction conversion rule 1006 may be used.
  • the abstraction conversion rule 1006 includes a plurality of conversion rules
  • the abstract conversion rule 1006 includes a plurality of conversion rules
  • the generalization-inspection model conversion unit 1204 converts the generalization model 1206 into an inspection model 1008 using the generalization-inspection conversion rule 1007, the meta / generalization model 1003, and the meta / inspection model 1004.
  • the inspection code 0005 is in the Promela format
  • an element expressed as a selective executable statement in the generalization model is expressed as an If statement in the inspection model.
  • the generalization model 1206 is converted into the inspection model 1008, only the generalization-inspection conversion rule 1007 may be used.
  • the generalization-check conversion rule 1007 includes a plurality of conversion rules, the conversion rules are integrated into one conversion rule, and the conversion from the generalization model 1206 to the check model 1008 is performed.
  • the generalization-inspection conversion rule 1007 includes a plurality of conversion rules
  • the output unit 1300 outputs the inspection code 0005 using the information of the conversion result supplied from the conversion processing unit 1200.
  • information such as grammar information of the description language of the model checker may be supplied from the storage unit 1400 when the inspection code 0005 is output.
  • the inspection code writing unit 1301 converts the inspection model 1008 into the inspection code 0005 using the meta / inspection model 1004 and the inspection code writing rule 1009 acquired from the writing rule database 1403 of the storage unit 1400.
  • the inspection code writing rule 1009 is described by the method described in Non-Patent Document 5, and the conversion from the inspection model 1008 to the inspection code 0005 is executed.
  • the present invention is not limited to this, and any method for converting the inspection model 1008 into a description format of a model checker used for inspection may be used.
  • the inspection code 0005 is described in the Promela language, which is the SPIN input language.
  • each of the conversion rule database 1401, the metamodel database 1402, and the writing rule database 1403 is an arbitrary data storage method realized on a computer, such as a relational database or a hierarchical database. Realized.
  • the conversion rule database 1401, the metamodel database 1402, and the write-out rule database 1403 do not have to be implemented by the same method, and may be implemented by different methods. Further, each of the conversion rule database 1401, the metamodel database 1402, and the writing rule database 1403 does not need to be realized by a single method.
  • a part of information to be held is stored in the relational database.
  • a part of information to be held may be realized by a combination of different methods, such as being incorporated into a computer program for realizing the invention.
  • the storage unit 1400 supplies information necessary for the input unit 1100, the conversion processing unit 1200, and the output unit 1300 to execute the respective processes.
  • the storage unit 1400 stores information on conversion rules, information on metamodels, and information on grammar of a model checker description language.
  • the conversion rule database 1401 holds conversion rules together with metadata as described above.
  • the metadata is for selecting a conversion rule, and there may be a method having different information for the implementation-generalization conversion rule 1005, the abstraction conversion rule 1006, and the generalization-inspection conversion rule 1007. .
  • the metadata of the implementation-generalization conversion rule 1005 can be, for example, the type of description language of the conversion source code.
  • the metadata of the abstraction conversion rule 1006 includes, for example, a name that simply represents the abstraction in a straightforward manner, a brief description, an abstraction type such as “data abstraction”, “processing abstraction”, and a natural language ( For example, there may be an effect of reducing the number of states by abstraction expressed in alphabets or numerical values, an influence on properties by abstraction expressed in natural language (for example, alphabets or numerical values), and a software domain to which the abstraction can be applied.
  • the metadata of the generalization-inspection conversion rule 1007 may have a name indicating a model checker used for inspection, for example.
  • the source code conversion procedure in this embodiment includes a source code input step S101, a conversion rule input step S102, a conversion rule application step S103, and an inspection code output step S104.
  • This source code conversion procedure is executed mainly by the control unit 1500.
  • the source code input unit 1101 reads the source code 0001 into the source code conversion device 1000 and converts it into the source code information 1001.
  • the source code input unit 1101 receives the source code 0001 to be inspected input from the user, and converts it into source code information 1001.
  • the source code 0001 is described in, for example, a programming language C disclosed in JIS X3010-1993.
  • the source code information 1001 is held, for example, in the form of an abstract syntax tree.
  • the format of the source code information 1001 is not limited to the abstract syntax tree, but may be any format that holds information required for the inspection of the source code 0001 such as structure and logic.
  • the conversion rule input unit 1102 reads a conversion rule set 0002, which is a plurality of conversion rules divided into fine granularities, into the source code conversion apparatus 1000.
  • a conversion rule set 0002 which is a plurality of conversion rules divided into fine granularities.
  • this conversion rule input step S102 at least one of a correspondence relationship between the model element before conversion and the model element after conversion, and an operation applied to the element of the model before conversion by conversion is defined.
  • the process of reading the conversion rule set 0002 into the source code conversion apparatus 1000 need not be executed by a single operation by the user, and may be executed by repeated operations.
  • the source code input step S101 and the conversion rule input step S102 are not necessarily completed in this order, and the source code 0001 is input before the source code information 1001 is generated by the source code input unit 1101.
  • the source code 0001 may be input before the conversion rule input unit 1102 requests the source code information 1001 for the conversion rule input process. Therefore, the processing may proceed in the order in which the processing of the source code input step S101 and the processing of the conversion rule input step S102 are mixed.
  • the source code input unit 1101 receives the source code 0001, then the conversion rule input unit 1102 receives the conversion rule set 0002, and then the source code input unit 1101 transfers the source code 0001 to the source code information 1001. There can be a procedure to convert.
  • the conversion rule input unit 1102 receives the conversion rule set 0002 input from the user.
  • a method for receiving the conversion rule set 0002 from the user for example, there may be the following method.
  • the conversion rule input unit 1102 receives a conversion rule input manually by a user as part of the conversion rule set 0002.
  • the conversion rule set 0002 may be input by a conversion rule (description) 0010 described by the user. Also, the input unit 1100 acquires the conversion rule list 0015 from the storage unit 1400, presents the acquired conversion rule list 0015 to the user in the form of a list or the like, and the conversion rule is displayed from the presented list to the user. May select the conversion rule set 0002.
  • the user inputs (describes) the conversion rule search condition 0011 to the conversion rule input unit 1102 of the input unit 1100 before the input of the conversion rule, and then the conversion rule input unit 1102 A conversion rule that matches the search condition is acquired from the conversion rule database 1401 of the storage unit 1400 and presented to the user as a conversion rule list 0015. Subsequently, the user selects one or more conversion rules included in the presented conversion rule list 0015.
  • the conversion rule input unit 1102 accepts one or more conversion rules selected by the user as a part of the conversion rule set 0002.
  • the user inputs the conversion rule search condition 0011 to the conversion rule input unit 1102 before the conversion rule input, and then the conversion rule input unit. 1102 may acquire a conversion rule that matches the search condition from the conversion rule database 1401 and accept it as a part of the conversion rule set 0002.
  • the conversion rule input unit 1102 extracts and generates the conversion rule search condition 0012 from the input source code 0001, and further, the search condition Is obtained from the conversion rule database 1401 and accepted as a part of the conversion rule set 0002.
  • Examples of the conversion rule search condition factor in the second conversion rule input method example, the third conversion rule input method example, and the fourth conversion rule input method example are the conversion rule database described later. At 1401, there may be information stored as metadata for the conversion rule.
  • the conversion rule input unit 1102 accepts the conversion rule by processing the conversion rule input by some method.
  • the conversion rule database 1401 holds the conversion rule in a state in which the variable name or the like in the source code 0001 is parameterized, for example, by a method by explicit input of the user, There may be a method of including the parameter embedded with the information of the source code 0001 in the conversion rule set 0002.
  • the conversion rule input method for the processing source is the same as the case of using the input conversion rule without processing, such as the first conversion rule input method described above. There can be a method.
  • the method by which the conversion rule input unit 1102 receives the conversion rule set 0002 is not limited to these conversion rule input methods, and any method that receives a set of conversion rules used by the conversion processing unit 1200 may be used.
  • the conversion rule set 0002 may be received by one or more combinations of input methods.
  • the model construction unit 1201 converts the source code information 1001 into the mounting model 1205, and then the mounting-generalization model conversion unit 1202 generalizes the mounting model 1205.
  • the abstract model conversion unit 1203 abstracts the generalized model 1206 (S1032), and then the generalization-check model conversion unit 1204 converts the generalized model 1206 to the check model 1008. (S1033).
  • the conversion rule input step S102 and the conversion rule application step S103 do not necessarily have to be completed in this order, and the implementation-generalization conversion rule 1005 is input before the processing of the implementation-generalization model conversion unit 1202.
  • the abstraction conversion rule 1006 may be input before the process of the abstraction model conversion unit 1203, and the generalization-check conversion rule 1007 may be input before the process of the generalization-check model conversion unit.
  • the inspection code writing unit 1301 writes the inspection model 1008 as the inspection code 0005.
  • the designation of the writing destination of the inspection code 0005 does not necessarily have to be after the conversion rule applying step S103, and may be any earlier than the writing of the inspection code 0005. For example, there may be a procedure in which the designation of the writing destination of the inspection code 0005 is performed in parallel with the source code input step S101.
  • the “implementation model” 1205 is changed to the “generalization model” 1206 in an intermediate format which is a format independent of a specific programming language. Convert.
  • the first conversion rule ““ if statement ” ⁇ conditional branch”, ““ switch statement ” ⁇ conditional branch”, ““ while statement ” ⁇ “ repeat ””, and ““ for statement ” ⁇
  • At least four different conversion rules “Repeat” are selected.
  • Conversion for abstraction is performed on the generalization model 1206. That is, the generalization model of the intermediate format is used by using at least one of a plurality of different second conversion rules 1006-1 to 1006-n. An abstraction process is executed for 1206. In the example of FIG. 7, at least two different conversion rules of “data reading ⁇ random input” and “data abstraction” are selected as the second conversion rule.
  • the generalization model 1206 is converted into an “inspection model” 1008 to generate a code (output)
  • the generalized model 1206 in the intermediate format is converted into the inspection model 1008 having information necessary for generating the inspection code.
  • the third conversion rule there are at least two different conversion rules corresponding to the first conversion rule: ““ conditional branch ” ⁇ “ if ”sentence” and ““ repeat ” ⁇ “ do ”sentence”. Is selected.
  • implementation model 1205, the generalization model 1206, and the inspection model 1008 each have a data structure and semantics defined by a “meta model” that defines a syntax.
  • the user determines the inspection level (degree of abstraction), and as a conversion rule for achieving the determined inspection level, for example, an instruction and a series of processing related to reading of external data Are selected as the second conversion rule 1006 by using the conversion rule input method described above, and the rule for converting a specific data type to a higher abstract type.
  • the inspection level degree of abstraction
  • a conversion rule for achieving the determined inspection level for example, an instruction and a series of processing related to reading of external data
  • the rule for converting a specific data type to a higher abstract type for example, when the grammar of the input language of the model checker has “do sentence” as a notation of repetition processing, the user sets “repetition” to “do sentence”.
  • the rule to be converted to “” is selected as the third conversion rule 1007 using the conversion rule input method described above.
  • conversion rules those that can be used repeatedly, such as general-purpose rules that can be applied across a plurality of software, are stored in a database.
  • the conversion rules stored in the database have domain information and information on inspection level (influence on inspection by abstraction) as meta information used as a judgment material for search and rule selection by the user.
  • model abstraction 8A and 8B show examples of model abstraction, respectively.
  • the model abstraction can reduce the number of states.
  • abstraction can affect the properties of the model. For example, the detected defect (counterexample) does not exist in the original system, and the defect present in the original system cannot be found.
  • a sound abstraction that does not affect properties tends to have a small effect on the number of states.
  • FIG. 9 shows a part of an example of the meta / implementation model 1002
  • FIG. 10 shows a part of an example of the meta / generalization model 1003
  • FIG. 11 shows a part of an example of the meta / inspection model 1004.
  • the meta / implementation model 1002, the meta / generalization model 1003, and the meta / inspection model 1004 in the present embodiment are shown using the notation disclosed in Non-Patent Document 2. For example, in FIG.
  • the IfStatement class C101 is shown to inherit the Statement class C102 by the relationship R101, and the relationship R102 shows that the Expression class C103 is owned as the attribute condition, and the relationship R103 shows that the attribute body It is shown that the set of Statement class C102 is owned, and the relationship R104 shows that the set of Statement class C102 is owned as attribute elseBody.
  • the IntegerConstant class C104 is shown to possess an attribute value that is an integer value, and the relationship R105 indicates that the Expression class C103 is inherited.
  • the VariableReference class C105 is shown to inherit the Expression class C103 by the relationship R106, and the relationship R107 indicates that the VariableDeclaration class C106 is referred to.
  • Each element of the meta / implementation model 1002 and each element of the meta / inspection model 1004 include an element corresponding to the language element of the implementation programming language and the language element of the inspection language.
  • the implementation programming language is C language
  • the inspection language is Promela language. Therefore, the meta / implementation model 1002 includes elements corresponding to C language elements, and the meta / inspection model 1004. Includes elements associated with language elements of the Promela language.
  • the IfStatement class C101 in FIG. 9 represents an If statement in C language
  • the IntegerConstant class C104 represents an integer type constant value in C language.
  • the meta / generalization model 1003 shown in FIG. 10 is an element that is semantically associated with an element included in the meta / implementation model 1002 or an element that is semantically associated with an element included in the meta / inspection model 1004.
  • a physical element is included.
  • the physical element is expressed as an element that inherits the PhysicalElement class C201 transitively in FIG.
  • the Statement class C203 and the SelectionStatement class C204 are examples of physical elements.
  • Each physical element does not have to have a one-to-one correspondence with an element included in the meta / implementation model 1002 or an element included in the meta / inspection model 1004. It only needs to be able to express the element.
  • a C language If statement expressed as an IfStatement class C101 in the meta / implementation model 1002 is expressed by a combination of the SelectionStatement class C204 and the SelectionItem class C205 in the meta / generalization model 1003.
  • the meta / generalization model 1003 includes, in addition to the physical elements described above, logical elements that allow the elements associated with the conversion rules to be changed according to the nature of the source code, the purpose of the conversion, and the constraint conditions.
  • the logical element is expressed as an element that transitively inherits the LogicalElement class C202 in FIG.
  • the LogicalElement class C202 owns a set of Attilibute class C206.
  • the Attribute class C206 has a function of adding attribute information to classes and methods.
  • a certain conversion rule can add additional attribute information to the converted logical element by converting a certain physical element into a logical element.
  • the added attribute information can be used by different conversion rules.
  • the LogicalElement class C202 owns a set of RelatedElement class C207 that can refer to an arbitrary physical element. This allows a transformation rule to add a relationship to an arbitrary element to the logical element along with the name of that association, and other transformation rules can utilize the association.
  • a logical element is defined for each physical element, for example, a Logical_Statement class C208 for a Statement class C203.
  • the conversion rule can convert an arbitrary physical element into a logical element obtained by adding information or a relation to the physical element.
  • all logical elements inherit some physical element, after a certain physical element is converted to a logical element in a certain conversion rule, it is conscious that it is a logical element in a different conversion rule. It can also be handled as a physical element.
  • the following conversion rules using logical elements can include the following methods (1) to (3).
  • a physical element of a generalization model that matches a certain pattern is converted into a logical element having a certain structure (or a combination of a logical element and a physical element).
  • a logical element (or a combination of a logical element and a physical element) that matches a certain pattern is converted into a logical element (or a combination of a logical element and a physical element) having a different structure.
  • a logical element (or a combination of a logical element and a physical element) that matches a certain pattern is converted into a physical element.
  • the generalization model 1206 may be converted into the inspection model 1008 after the logical elements are completely converted into physical elements on the generalization model 1206.
  • the generalization model 1206 including a logical element may be directly converted into the inspection model 1008 using a conversion rule that can convert the logical element of the generalization model 1206 into the element of the inspection model 1008.
  • the logical elements in the first to fifth conversion examples to be described later of the present embodiment express the random number generation method and the non-deterministic value selection method. Any element exceeding the range that can be directly expressed may be expressed. Examples of concepts expressed by logical elements include, for example, abstraction of exchanges with external environments such as hardware operations, abstraction of data structures and modules, and the like.
  • each meta model is not limited to those shown in FIGS. 9 to 11 and may be in any format capable of expressing a program to be converted.
  • the logical elements in the generalization model 1206 are not limited to this, and the elements indicating the types of logical elements, logical elements, and other elements (physical elements or logical elements) necessary for describing the conversion rules Any notation that can express the element indicating the relationship may be used.
  • the logical element may define a structure in advance for a specific frequent element. As an example of the definition of such a logical element, there may be a definition of a new class that has a maximum value and a minimum value as attributes, and that logically indicates random number generation and inherits the LogicalElement class C202 transitively. . Details of the logic element indicating the random number generation will be described with reference to FIG.
  • FIG. 12 is an explanatory diagram of an example of the C language source code 0001.
  • a random value from 1 to 50 is generated by adding 1 to the remainder of dividing the return value of the function rand () that generates a random integer value by 50. Is done.
  • the function do_something () is executed with the random value generated in line 001 as an argument.
  • FIG. 13 is an explanatory diagram of an example of the inspection code 0005 in the Promela language.
  • an integer type variable val is defined.
  • the value of the variable val is selected from integers from 1 to 50.
  • the function do_something () is executed with the value of the variable val selected in line 002 as an argument.
  • FIG. 14 is an example of an implementation model 1205 of the source code 0001 shown in FIG.
  • variable val 14 is expressed using the definition by the meta / implementation model 1002 shown in FIG. For example, in the line 001 of the source code 0001 shown in FIG. 12, since the variable val is declared as an int type, the declaration has “val” as the attribute name in the implementation model 1205 shown in FIG. It is expressed as a VariableDeclaration element O0101 having “int” as the type.
  • variable val in the line 002 of the source code 0001 shown in FIG. 12 is expressed by connecting the VariableDeclaration element O0101 and the VariableReference element O0102 via the link L0101 having the declaration as a label.
  • FIG. 14 implements the implementation-generalization conversion rule 1005 (first conversion rule 1005-1 shown in FIG. 7) that converts “for statement” and “while statement” into “repetition”.
  • the result of conversion to the generalized model 1206 is shown in FIG.
  • FIG. 15 is an explanatory diagram of the generalized model 1206 abstracted from the source code 0001 shown in FIG. Since the source code 0001 shown in FIG. 12 does not include “for statement” and “while statement”, the conversion is not executed, and the generalization model 1206 shown in FIG. 15 is substantially the same as the implementation model 1205 shown in FIG. Are the same.
  • FIG. 15 is converted by the abstraction conversion rule 1006 (second conversion rule 1006-1 shown in FIG. 7) shown in FIG. 6 which abstracts the random number generation processing and converts it into logical elements.
  • the generalized model 1206 is shown in FIG. FIG. 16 shows the abstraction result of the generalization model 1206 shown in FIG.
  • the BinaryOperation element O0401 shown in FIG. 15 and the element set owned by the BinaryOperation element O0401 transitively are an Attribute element O0702 indicating the minimum value 1 and an Attribute element O0703 indicating the maximum value 50. Is converted into a logical element (Logical_Expression element O0701) that means a random number generation expression that owns.
  • the abstracted generalization model 1206 shown in FIG. 16 is converted into the inspection model 1008 by the generalization-inspection conversion rule 1007 (third conversion rule 1007-1 shown in FIG. 7) shown in FIG.
  • Shown in FIG. 17 is an explanatory diagram of the inspection model 1008 converted from the abstracted generalized model 1206 shown in FIG.
  • the combination of the Logical_Expression element O0701 which is the logical element shown in FIG. 16, the Attribute element O0702 representing the minimum value, and the Attribute element O0703 representing the maximum value represents a select statement that performs nondeterministic value substitution in the Promela language. It is converted into a combination of a SelectStatement element O0801, an IntegerConstant element O0802 meaning a minimum value, and an IntegerConstant element 0O803 meaning a maximum value.
  • the IntegerConstant element O0802 is connected to the SelectStatement element O0801 via a link L0801 having min as a label.
  • the IntegerConstant element O0803 is connected to the SelectStatement element O0801 via a link L0802 having max as a label.
  • FIG. 18 a second example of conversion from the C language source code 0001 shown in FIG. 18 into the inspection code 0005 in the Promela language shown in FIG. 13 and the C language source code 0001 shown in FIG. 19 are shown in FIG.
  • a third conversion example for conversion to the inspection code 0005 in the Promela language will be described with reference to FIGS. 18 and 19 are diagrams for explaining an example of C language source code 0001.
  • FIGS. 18 and 19 are diagrams for explaining an example of C language source code 0001.
  • the source code 0001 shown in FIGS. 18 and 19 is the same as the source code 0001 shown in FIG. 12 in that it is a program that executes a certain function do_something () with an arbitrary value from 1 to 50 as an argument. However, the source code 0001 shown in FIGS. 12, 18 and 19 is different in the method of generating random numbers.
  • the system function time () that returns the current time is set as a pseudo random number generation function, and 1 is added to the remainder obtained by dividing the return value of the random number generation function by 50. A random value of is generated.
  • a random value of 1 to 50 is generated by adding 1 to the remainder of dividing the return value of the random number generation function my_rand () uniquely defined in lines 101 to 107 by 50. Is done.
  • the random number generation function my_rand () defined in the lines 101 to 107 receives the maximum value (50) and the minimum value (1) of the range of random numbers generated by itself as arguments, and the random number generation function my_rand ( ) Is obtained by subtracting the minimum value from the maximum value and adding 1 as the division value, and adding the minimum value to the remainder of dividing the return value of the function rand () that generates a random integer value by the division value.
  • the program indicated by the source code 0001 shown in FIG. 18 and FIG. 19 is represented by the mounting model 1205 shown in FIG. 20 and FIG.
  • the implementation model 1205 shown in FIGS. 20 and 21 is converted into the generalization model 1206 shown in FIGS. 22 and 23 by the same implementation-generalization conversion rule 1005 as in the first conversion example.
  • the abstraction conversion rule 1006 used for the abstraction is obtained by converting the abstraction conversion rule 1006 used in the first conversion example so that the function time () is treated as a random number generation function like the function rand (). . That is, according to this abstraction conversion rule 1006, the BinaryOperation element O0501 of the generalization model 1206 shown in FIG. 22 and the element set that the BinaryOperation element O0501 has transitively are assigned to the logical element (Logical_Expression element O0701) shown in FIG. Converted.
  • the generalization model 1206 shown in FIG. 23 is abstracted by the abstraction conversion rule 1006 and converted into the generalization model 1206 shown in FIG.
  • the abstraction conversion rule 1006 used for the abstraction is the same as the abstraction conversion rule 1006 used in the first conversion example, with the function my_rand (), the first argument as the minimum value, the second argument as the maximum value, and a random number. It has been changed to handle it as a function that occurs. That is, according to this abstraction conversion rule 1006, the FunctionCall element O0601 of the generalization model 1206 shown in FIG. 23 and the element set that the FunctionCall element O0601 transitively possesses are logical elements (Logical_Expression elements O0701) shown in FIG. Converted.
  • the generalization model 1206 shown in FIG. 16 is converted into the inspection model 1207 shown in FIG. 17 by the same conversion rule as the generalization-inspection conversion rule 1007 used in the first conversion example.
  • a test code 0005 in language is output.
  • the abstraction conversion rule 1006 is changed to convert the different source code 0001 shown in FIGS. 12, 18 and 19 to the same inspection code 0005 shown in FIG. To do.
  • an element that meets a predetermined condition is converted into a logical element in the process of abstracting the generalization model 1206 using the abstraction conversion rule 1006.
  • the administrator does not change all the conversion rules 1005 to 1007.
  • the abstraction conversion rule 1006 By simply changing the abstraction conversion rule 1006, the source code 0001 can be changed and the same inspection code 0005 as before the change can be output.
  • the fourth conversion example is a conversion example from the source code 0001 shown in FIG. 12 to the inspection code 0005 shown in FIG. 24 different from the inspection code 0005 shown in FIG.
  • the inspection code 0005 shown in FIG. 24 will be described.
  • a select statement is used as shown in the line 002.
  • the select statement is a syntax added in SPIN version 6 or later, which is the inspection tool disclosed in Non-Patent Document 1, and if the inspection tool is a SPIN version 5 or earlier, the select statement cannot be used. Therefore, when the inspection tool is a version 5 or earlier SPIN, as shown in the line 101 to the line 116 in FIG. 24, by defining a syntax expressing non-deterministic execution in the inspection code 0005, it is equivalent to the select statement. It is necessary to express a simple process.
  • the source code 0001 shown in FIG. 12 is expressed by the mounting model 1205 shown in FIG. 15 is the same as the first conversion example, up to conversion to the generalization model 1206 shown in FIG. 15, abstracting the generalization model 1206, and converting it into the generalization model 1206 shown in FIG.
  • a generalization-inspection conversion rule 1007 for converting the generalization model 1206 shown in FIG. 16 into an inspection model 1008 is different from the first conversion example.
  • the generalization model 1206 shown in FIG. 16 is converted into an inspection model 1008 shown in FIG.
  • the logical_expression element O0701 of the abstracted generalization model 1206 shown in FIG. 16 the attribute element O0702 indicating the minimum value, and the attribute element O0703 indicating the maximum value are included.
  • the combination is converted into a combination of elements O0901 to 0904 of the inspection model 1008 shown in FIG.
  • an InlineFunctionCall element O0905 of the inspection model 1008 illustrated in FIG. 25 includes an InlineFunctionDeclaration element O0901 referred to by a link L0901 having a declaration label, and a VariableReference element O0902 referred to by a link L0902 having an argument label indicating an argument.
  • An IntegerConstant element O0903 referred to by a link L0903 having an argument label, and an IntegerConstant element O0904 referred to by a link L0904 having an argument label are owned in this order.
  • a VariableReference element O0902 defines a variable to which a value is assigned.
  • the IntegerConstant element O0903 is the minimum value.
  • the IntegerConstant element O0904 is the maximum value.
  • inspection code 0005 shown in FIG. 24 can be acquired from the inspection model 1008 shown in FIG.
  • the generalization-inspection conversion rule 1007 in the conversion rules used in the second conversion example is changed to the generalization-inspection conversion rule 1007 used in the fourth conversion example, the source code 0001 shown in FIG. It is also possible to convert into the inspection code 0005 shown.
  • the generalization-check conversion rule 1007 in the conversion rules used in the third conversion example is changed to the generalization-check conversion rule 1007 used in the fourth conversion example, the source shown in FIG. It is also possible to convert the code 0001 into the inspection code 0005 shown in FIG.
  • the do_something1 () function is executed when the remainder obtained by dividing the return value of the rand () function that generates a random number by 2 is 0, and when the remainder is other than 0,
  • the do_something2 () function is executed.
  • the source code 0001 illustrated in FIG. 26 indicates a program in which the do_something1 () function or the do_something2 () function is selected at random and the selected function is executed.
  • the source code 0001 shown in FIG. 26 is expressed by a mounting model 1205 shown in FIG. Also, the mounting model 1205 shown in FIG. 28 is converted into a generalization model 1206 shown in FIG. 29 by the mounting-generalization conversion rule 1005.
  • the generalization model 1206 shown in FIG. 29 is abstracted by the same abstraction conversion rule 1006 as in the first conversion example, and converted into the generalization model 1206 shown in FIG.
  • the BinaryOperation element O1101, FunctionCall element O1102, and FunctionDeclaration element shown in FIG. 29 corresponding to the call of the rand function and the calculation of the remainder obtained by dividing the return value of the rand function by 2 in the generalization model 1206 shown in FIG.
  • a combination of O1103 and IntegerConstant element 1104 is converted into a combination of Logical_Expression element O1201, Attribute element O1202, and Attribute element O1203 in generalization model 1206 shown in FIG.
  • the generalization model 1206 shown in FIG. 30 is converted into the generalization model 1206 shown in FIG. 31 by an abstraction conversion rule 1006 different from the abstraction conversion rule 1006 used for conversion to the generalization model 1206 shown in FIG. Is done.
  • the abstract conversion rule 1006 converts a selective executable statement in which a random value is substituted into a variable used in a conditional expression into a non-deterministic selective executable statement.
  • the above-mentioned selective executable statement is converted into a logical element indicating a selective executable statement in which one of the two options is randomly selected.
  • the SelectionStatement element O1204 of the generalization model 1206 shown in FIG. 30 is converted into the Logical_SelectionStatement element O1301 of the generalization model 1206 shown in FIG. The reason for this will be described below.
  • the VariableReference element O1206 of the generalization model 1206 shown in FIG. 30 represents a variable to which the Logical_Expression element O1201 whose name attribute value is “random value generation” is substituted.
  • the VariableReference element O1206 is transitively connected to the SelectionItem element O1205 through the link L1201, and the SelectionItem element O1205 is owned by the SelectionStatement element O1204. For this reason, since the SelectionStatement element O1204 matches a selection execution statement in which a random number value is substituted into a variable used in the conditional expression, the SelectionStatement element O1204 is converted into a Logical_SelectionStatement element O1301 that is a logical element expressing a nondeterministic selective execution statement. .
  • an element that is transitively connected by the link L1201 having the condition label from the SelectionItem element O1205 in the generalization model 1206 shown in FIG. 30 generates a random number in order to select the do_something1 () function or the do_something2 () function. This is an element for determining whether or not the remainder obtained by dividing the generated random number by 2 is 0.
  • the Logical_SelectionStatement element O1301 expressing a nondeterministic selective execution statement is defined, the above-described elements of the generalization model 1206 shown in FIG. 30 are not necessary. For this reason, these elements are deleted.
  • the Abstraction process is executed a plurality of times, and the SectionStatement element O1204 including the Logical_Expression element O1201 that is the logical element converted by the first abstraction process is the second abstraction process. It is converted into a Logical_SelectionStatement element O1301 which is an element.
  • the abstraction process is executed a plurality of times, and a logical element converted in one abstraction process is further converted into a logical element in another abstraction process.
  • the inspection code can be output, and it is possible to prevent the explosion of the state where the number of states to be inspected becomes a huge amount.
  • the changed conversion example is the same as the first to fourth conversion examples. If only the conversion rule corresponding to the random number generation method is changed, the changed source code 0001 can be converted into the desired inspection code 0005 without converting other conversion rules.
  • a change in the level of abstraction by a user can be easily realized by an operation for inputting the conversion rules. . That is, since the user can select a plurality of fine-grained conversion rules through the input interface, the user can easily select and change the level of abstraction as shown in FIGS. 8A and 8B according to the situation. Is possible.
  • the source code conversion method includes a procedure for converting a source code to be inspected into an inspection code described in an input language of a model checker using a plurality of conversion rules
  • the conversion rule includes an implementation-generalization conversion rule and Are classified into abstract conversion rules and generalization-check conversion rules, and conversion is performed in stages. Accordingly, when following the design change of the source code to be inspected, only the conversion rule related to the change among the plurality of conversion rules may be changed, and the change can be minimized.
  • the implementation model, the generalization model, and the inspection model are each defined in the meta model, and by adding constraints, it is possible to verify that the conversion result by the conversion rule is not illegal. Accordingly, it is possible to prevent an increase in the verification cost of the conversion rule, which is caused by realizing a series of processes for converting the source code to be inspected while abstracting it into the inspection code by combining the fine-grained conversion rules.
  • a conversion rule can be shared by converting to a logical element in the generalization model and then converting to a check model.
  • the interface for inputting a plurality of conversion rules divided into fine granularities is owned, the input source code and the conversion rule set used for conversion are stored, and the source code is converted into the conversion rule. Since conversion can be performed by exchanging a part of the set, it is possible to reduce the trouble of repeatedly converting the same source code, such as when generating a plurality of inspection codes having different abstractions.
  • FIG. 1 A source code conversion apparatus and conversion processing method according to the third embodiment of the present invention will be described with reference to FIG.
  • the present embodiment there is a step of verifying the mounting model generated in the process of obtaining the inspection code from the source code, the generalization model, and the inspection model based on the constraint condition.
  • the precondition of the specific conversion rule may not be satisfied by application of another conversion rule in the conversion target model.
  • the model of the conversion result may be in an invalid state.
  • the conversion result model may be in an invalid state.
  • the step of inputting the source code 0001 of the software and the first conversion for converting the mounting model 1205 having the source code information 1001 into an intermediate format (generalization model 1206) that is a format independent of a specific programming language.
  • the sufficiency verification based on the first constraint condition 0300, the second constraint condition 0301, and the third constraint condition 0302 of the model at each stage is performed by, for example, a meta model using MOF disclosed in Non-Patent Document 2. Or by describing constraints on the model defined by the meta model by OCL disclosed in Non-Patent Document 4.
  • the meta model and the constraint conditions by using the meta model and the constraint conditions, it is possible to guarantee the validity of the conversion due to the collision between the conversion rules or the failure of the conversion rule.
  • a model in a format defined by the meta model is generated. Further, a constraint condition can be added, and the validity of the generated model can be verified with the constraint conditions 0300 to 00302.
  • a program for realizing the input unit 1100, the conversion processing unit 1200, the output unit 1300, and the like executed by the control unit 1500 of the source code conversion apparatus 1000 of the present invention is a removable medium (CD-ROM, flash memory). Or provided to the source code conversion apparatus 1000 via a network and stored in an auxiliary storage device (not shown) which is a non-temporary storage medium. For this reason, the source code conversion apparatus 1000 may include an interface for reading a removable medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The purpose of the present invention is to provide a source code conversion method and a source code conversion program that make it possible to flexibly change an abstracted description, and that also enable an abstracted description to be reused efficiently. A method for converting a source code using a source code conversion device that converts a software source code to an inspection code described in accordance with a plurality of different conversion rules using a verification tool input language, being characterized in that the plurality of different conversion rules finely divide a series of processes for converting and abstracting an inspection-target source code to an inspection code, and an intermediate form into which the source code is converted can express a physical element, which is an element equivalent to either a source code or a inspection code element, as well as a logical element, which is an element created in the software abstracting step.

Description

ソースコード変換方法及び計算機読み取り可能な記憶媒体Source code conversion method and computer-readable storage medium 参照による取り込みImport by reference
 本出願は、平成23年(2011年)12月1日に出願された日本特許出願特願2011-263765の優先権を主張し、その内容を参照することにより、本出願に取り込む。 This application claims the priority of Japanese Patent Application No. 2011-263765 filed on December 1, 2011, and is incorporated herein by reference.
 本発明は、ソースコード変換方法及びソースコード変換プログラムに係り、特に、ソフトウェアのモデル検査において、モデルチェッカの入力言語で検査コードを記述するコストを低減させるために、計算機を活用してソフトウェアのソースコードを検査コードに変換する方法に関する。 The present invention relates to a source code conversion method and a source code conversion program, and in particular, in a software model check, in order to reduce the cost of writing a check code in an input language of a model checker, a software source is utilized by utilizing a computer. The present invention relates to a method for converting a code into an inspection code.
 近年、ソフトウェアシステムが一般社会に浸透し、ソフトウェアに求められる信頼性が非常に高くなってきている一方で、ソフトウェアは複雑化及び大規模化の一途をたどっており、手作業での確認、及びテストによる品質確保が非常に困難になってきている。 In recent years, software systems have spread to the general public and the reliability required for software has become very high. On the other hand, software has become increasingly complex and large-scale. Quality assurance through testing has become very difficult.
 モデル検査技術は、ソフトウェアの振舞いを特定のモデルチェッカの入力言語で記述し、特定のモデルチェッカを実行することで、前記ソフトウェアの取り得る状態を網羅的に検査することによって、前記ソフトウェアの持つべき性質が満たされているかどうかを判定する技術である(例えば非特許文献1参照)。非特許文献1に開示される方法によると、ソフトウェアの振る舞いを、Promelaと呼ばれる入力言語で記述し、SPINと呼ばれるモデルチェッカに入力することで、検査を実施する。 The model checking technology should be possessed by the software by describing the behavior of the software in the input language of a specific model checker and exhaustively checking the possible states of the software by executing the specific model checker. This is a technique for determining whether or not a property is satisfied (see Non-Patent Document 1, for example). According to the method disclosed in Non-Patent Document 1, the behavior of software is described in an input language called Promela, and input to a model checker called SPIN, thereby performing inspection.
 モデル検査技術は複雑化及び大規模化の一途をたどるソフトウェアの品質確保に有望な技術であるが、ソフトウェアの取り得る状態が網羅的に検査されるため、規模の大きなソフトウェアでは、検査すべき状態数が膨大な分量となる状態爆発と呼ばれる現象が起きる。この状態爆発によって、処理に必要な時間計算量が現実的に許容不可能な大きさとなる現象、及び、処理に必要な空間計算量が処理に用いる計算機に搭載された記憶領域を超える現象の、少なくとも一方が引き起こされ、上述した検査が完了しない場合があり得る。 Model checking technology is a promising technology for ensuring the quality of software that is becoming increasingly complex and large-scale, but since the possible states of software are comprehensively examined, the state that should be inspected for large-scale software A phenomenon called state explosion occurs in which the number becomes a huge amount. Due to this state explosion, the phenomenon that the time calculation amount necessary for processing becomes practically unacceptable, and the phenomenon that the space calculation amount necessary for processing exceeds the storage area installed in the computer used for processing, At least one of them may be caused and the above-described inspection may not be completed.
 状態爆発に対応するために、抽象化と呼ばれる処理がソースコード又は検査コードに対して実行され、状態数を検査可能な範囲まで削減することがある。抽象化は、例えば、選択的実行文の分岐条件の簡略化がある。抽象化によって、本来存在しない実行パスが生じる事態、又は存在する実行パスが消滅する事態が引き起こされる場合がある。このため、検査コードに対する検査結果によって示されるソフトウェアの性質と本来のソフトウェアの性質とに差異が生まれることがあり得る。したがって、ソフトウェアに対して検査すべき性質を鑑みて抽象化の水準が検討された上で、抽象化が適用されることが望ましい。 In order to cope with the state explosion, a process called abstraction may be performed on the source code or the inspection code, and the number of states may be reduced to an inspectable range. Abstraction includes, for example, simplification of branch conditions for selective execution statements. The abstraction may cause a situation where an originally nonexistent execution path occurs or a situation where an existing execution path disappears. For this reason, there may be a difference between the property of the software indicated by the inspection result for the inspection code and the property of the original software. Therefore, it is desirable to apply the abstraction after considering the level of abstraction in view of the property to be inspected for the software.
 さらに、モデル検査技術においては、検査対象のソフトウェアが特定モデルチェッカの入力言語で記述される労力が大きいことが実用上の問題となることがあり得る。図35に、特許文献1に開示されたソースコード変換装置の一例を示す。特許文献1に開示される方法によると、ソースコードは、特定のモデルチェッカの入力言語で書かれた検査コードへ、翻訳マップを用いて変換される(ステップ910~940)。特許文献1に開示される方法によると、検査コードは、利用者によって定義された環境モデルを用いて、前記変換とは別に前記特定のモデルチェッカによって検査される(ステップ975、ステップ950~970)。 Furthermore, in the model checking technique, it can be a practical problem that the software to be checked is described in an input language of a specific model checker. FIG. 35 shows an example of a source code conversion apparatus disclosed in Patent Document 1. According to the method disclosed in Patent Document 1, the source code is converted into an inspection code written in an input language of a specific model checker using a translation map (steps 910 to 940). According to the method disclosed in Patent Document 1, an inspection code is inspected by the specific model checker separately from the conversion using an environment model defined by a user ( Steps 975 and 950 to 970). .
 また、ソフトウェアの開発技術の一つとして、モデル駆動型開発がある。モデル駆動型開発は、ソフトウェアの設計情報がモデルとして記述され、そのモデルが変換操作により詳細化されることによって、ソフトウェア開発を進める技術である。例えば、モデル駆動型開発において、モデルのフォーマット及びモデルの意味はMOFを用いて記述されたメタモデルにより規定され(例えば、非特許文献2参照)、モデルを詳細化する変換ルールがQVTを用いて記述され(例えば、非特許文献3参照)、OCLを用いてモデルの整合性及び健全性に関する制約の記述並びに検証が行われ(例えば、非特許文献4参照)、MOFM2Tを用いてモデルからソースコードが生成される(例えば非特許文献5参照)。 Also, model-driven development is one of the software development technologies. Model-driven development is a technology for advancing software development by describing software design information as a model and refining the model by a conversion operation. For example, in model-driven development, the format of the model and the meaning of the model are defined by a meta model described using MOF (see, for example, Non-Patent Document 2), and the conversion rule that refines the model uses QVT. Described (for example, see Non-Patent Document 3), description and verification of constraints on consistency and soundness of model using OCL (for example, see Non-Patent Document 4), and source code from model using MOFM2T Is generated (see, for example, Non-Patent Document 5).
 なお、モデル検査技術における「モデル」と、モデル駆動型開発における「モデル」は、互いに独立した概念であり、一般にデータ構造及び意味などに関する共通性はない。 Note that the “model” in model checking technology and the “model” in model-driven development are concepts that are independent of each other, and generally have no commonality in terms of data structure and meaning.
特開2000-181750号公報JP 2000-181750 A
 モデル検査によるソフトウェアの信頼性が有効に確保されるためには、ソースコードからモデルチェッカの入力言語で記述された検査コードを自動生成するなどの方法により、検査コードを得るための労力を低減させること、並びに、モデルチェッカによる網羅的な検査が現実的な時間計算量及び空間計算量で終了するようにソフトウェアの仕様及び設計を抽象化することが必要となる。 In order to ensure the reliability of the software by model checking effectively, the labor to obtain the check code is reduced by the method of automatically generating the check code written in the input language of the model checker from the source code. In addition, it is necessary to abstract the specification and design of the software so that the exhaustive inspection by the model checker is completed with a realistic amount of time and space.
 特許文献1に開示される方法によると、抽象化の方法を指定する記述の再利用性が低いという課題が存在する。また、特許文献1に開示される方法によると、モデル検査に必要な抽象化の手段である、翻訳マップ及び環境モデルは、ソースプログラムの改訂など、新しいタイプの命令がソースコード内に導入された場合に限定されている。しかし、現実の検査においては、(1)新しいタイプの命令の導入に限らない、ソフトウェアの設計変更、(2)対象ソフトウェアの抽象化方法の変更、及び(3)異なるモデルチェッカによる検査への対応の3種類の変更があり得る。 According to the method disclosed in Patent Document 1, there is a problem that the reusability of the description specifying the abstraction method is low. In addition, according to the method disclosed in Patent Document 1, a translation map and an environment model, which are abstraction means necessary for model checking, are introduced into the source code in a new type of instruction such as a revision of the source program. Limited to cases. However, in actual inspection, (1) not limited to the introduction of a new type of instruction, software design change, (2) target software abstraction method change, and (3) inspection by different model checkers There are three types of changes:
 (1)の例としては、ソフトウェアの構造変更による、環境モデルとの対応付けの変更、及び、複数の命令をまたがる、手続きの変更があり得る。ソフトウェアは改訂ごとに構造変更が伴うことが多く、この種類の変更が頻繁に加わる。 As examples of (1), there may be a change in association with an environmental model due to a change in the structure of the software, and a change in procedure across multiple instructions. Software often involves structural changes with each revision, and this type of change is frequently added.
 また、(2)の例としては、乱数等を関数の定数又は非決定的な値への置き換え、及び処理の簡略がある。現実的なソフトウェアのモデル検査では状態爆発が容易に生じるため、検査項目に応じた抽象化、及び、検査水準自体の調整が必要となる。 Also, as an example of (2), there are replacement of random numbers with function constants or non-deterministic values, and simplification of processing. In realistic software model checking, a state explosion easily occurs, so abstraction according to the checking items and adjustment of the checking level itself are required.
 (3)の例としては、異なる検査が可能なモデルチェッカへの変更、及び、もっと単純に、モデルチェッカのバージョン変更への対応があり得る。モデルチェッカはそれぞれに特長が存在するため、効果的な検査の為にはモデルチェッカの複数対応が望ましい。 (3) As an example, there can be a change to a model checker capable of different inspections, and more simply a change to a model checker version change. Since each model checker has features, it is desirable to have multiple model checkers for effective inspection.
 特許文献1に開示される方法によると、上述した3種類の変更のいずれに対応する場合にも、ソースコードの言語からモデルチェッカの言語へのマップである翻訳マップと、モデルチェッカの言語で記述された環境モデルとの、少なくとも一方を修正しなければならない。そのため、ある目的1(例えば、抽象化の方法の変更)の為の変更後に、異なる目的2(例えば、設計変更)の為の変更が実施され、これらの変更前の翻訳マップ及び環境モデルに対し目的2及び新たな目的3(例えば、モデルチェッカの変更)の為の変更が実施される場合、最初に実施された目的2の為の変更を再利用できず、新たに目的2と目的3とを同時に満たす変更が実施されなければならない。 According to the method disclosed in Patent Document 1, in any of the above-described three types of changes, a translation map that is a map from the language of the source code to the language of the model checker and the language of the model checker are described. At least one of the specified environmental models must be modified. Therefore, after a change for a certain purpose 1 (for example, a change in the method of abstraction), a change for a different purpose 2 (for example, a design change) is performed. When changes are made for purpose 2 and new purpose 3 (for example, a change in model checker), the changes made for purpose 2 that were originally performed cannot be reused. Changes that simultaneously satisfy must be implemented.
 本発明は、従来の技術の課題を踏まえ、抽象化記述の変更を柔軟に実施でき、さらに、抽象化記述を効率的に再利用可能な、ソースコード変換方法及びソースコード変換プログラムを提供することを目的とする。 The present invention provides a source code conversion method and a source code conversion program that can flexibly change an abstract description and that can efficiently reuse the abstract description based on the problems of the prior art. With the goal.
 本発明の代表的な一例を示せば、ソフトウェアのソースコードを、異なる複数の変換ルールを用いて、検証ツールの入力言語で記述された検査コードに変換するソースコード変換装置で実行されるソースコード変換方法であって、前記異なる複数の変換ルールは、前記ソースコードを前記検査コードへ変換し抽象化する一連の処理を、細粒度に分割したものであり、前記異なる複数の変換ルールは、前記ソースコードを特定のプログラミング言語に依存しない形式である中間形式へ変換する第1変換ルールと、前記変換された中間形式を抽象化する第2変換ルールと、前記変換された中間形式を前記検査コードに変換する第3変換ルールと、を含み、前記方法は、前記ソースコードを入力するステップと、少なくとも一つの前記第1変換ルールの入力を受け付けるステップと、少なくとも一つの前記第2変換ルールの入力を受け付けるステップと、少なくとも一つの前記第3変換ルールの入力を受け付けるステップと、前記入力された第1変換ルールを用いて、前記ソースコードを前記中間形式へ変換するステップと、前記入力された第2変換ルールを用いて、前記変換された中間形式を抽象化するステップと、前記入力された第3変換ルールを用いて、前記変換された中間形式を前記検査コードへ変換するステップと、を含み、前記中間形式は、前記ソースコード又は前記検査コードの要素と等価な要素である物理要素の他に、前記変換された中間形式を抽象化するステップで生成される要素である論理要素を表現可能であることを特徴とする。 To show a typical example of the present invention, a source code executed by a source code conversion device that converts a software source code into an inspection code described in an input language of a verification tool using a plurality of different conversion rules. In the conversion method, the plurality of different conversion rules are obtained by dividing a series of processes for converting and abstracting the source code into the inspection code, and dividing the plurality of different conversion rules, A first conversion rule for converting the source code into an intermediate format that is independent of a specific programming language; a second conversion rule for abstracting the converted intermediate format; and the converted intermediate format as the inspection code. A third conversion rule for converting to: the method comprising: inputting the source code; and at least one first conversion rule. Using the input of the first conversion rule, the step of receiving the input of at least one second conversion rule, the step of receiving the input of at least one third conversion rule, and the input first conversion rule, Converting the source code into the intermediate format, abstracting the converted intermediate format using the input second conversion rule, and using the input third conversion rule, Converting the converted intermediate form into the inspection code, wherein the intermediate form is in addition to the physical element that is an element equivalent to the source code or the element of the inspection code, A logical element that is an element generated in the step of abstracting the format can be expressed.
 本願において開示される発明のうち代表的なものによって得られる効果を簡潔に説明すれば、下記の通りである。すなわち、抽象化記述の変更が柔軟に実施でき、さらに、抽象化記述を効率的に再利用可能な、ソースコード変換方法及びソースコード変換プログラムを提供できる。 The following is a brief description of the effects obtained by the representative inventions disclosed in the present application. That is, it is possible to provide a source code conversion method and a source code conversion program that can change the abstract description flexibly and that can efficiently reuse the abstract description.
本発明の基本概念を説明するための図である。It is a figure for demonstrating the basic concept of this invention. 本発明のソースコード変換処理における、変換ルールの入力インタフェースについて説明する図である。It is a figure explaining the input interface of the conversion rule in the source code conversion process of this invention. 本発明の第1の実施例になるソースコード変換システムの構成例を示す図である。It is a figure which shows the structural example of the source code conversion system which becomes 1st Example of this invention. 図3Aの変換システムにおけるソースコード変換装置の構成例を示す図である。It is a figure which shows the structural example of the source code converter in the conversion system of FIG. 3A. 本発明の第1の実施例の処理フローの例を示す図である。It is a figure which shows the example of the processing flow of 1st Example of this invention. ソースコード変換装置に対する入力操作の一例を示す図である。It is a figure which shows an example of input operation with respect to a source code converter. ソースコード変換装置に対する入力操作の他の例を示す図である。It is a figure which shows the other example of input operation with respect to a source code converter. ソースコード変換装置の動作を説明する図である。It is a figure explaining operation | movement of a source code converter. ソースコード変換の手順をより詳細に説明する図である。It is a figure explaining the procedure of source code conversion in detail. モデルの抽象化の一例を示す図である。It is a figure which shows an example of the abstraction of a model. モデルの抽象化の一例を示す図である。It is a figure which shows an example of the abstraction of a model. 本発明の第1の実施例におけるメタ・実装モデルの一例を示す図である。It is a figure which shows an example of the meta and mounting model in 1st Example of this invention. 本発明の第1の実施例におけるメタ・汎化モデルの一例を示す図である。It is a figure which shows an example of the meta generalization model in 1st Example of this invention. 本発明の第1の実施例におけるメタ・検証モデルの一例を示す図である。It is a figure which shows an example of the meta and verification model in 1st Example of this invention. 本発明の第1の実施例の第1の変換例におけるソースコードを示す図である。It is a figure which shows the source code in the 1st conversion example of the 1st Example of this invention. 本発明の第1の実施例の第1の変換例における検査コードを示す図である。It is a figure which shows the test | inspection code in the 1st conversion example of 1st Example of this invention. 本発明の第1の実施例の第1の変換例における実装モデルを示す図である。It is a figure which shows the mounting model in the 1st conversion example of 1st Example of this invention. 本発明の第1の実施例の第1の変換例における最初の汎化モデルを示す図である。It is a figure which shows the first generalization model in the 1st conversion example of 1st Example of this invention. 本発明の第1の実施例の第1の変換例における二番目の汎化モデルを示す図である。It is a figure which shows the 2nd generalization model in the 1st conversion example of 1st Example of this invention. 本発明の第1の実施例の第1の変換例における検査モデルを示す図である。It is a figure which shows the test | inspection model in the 1st conversion example of 1st Example of this invention. 本発明の第1の実施例の第2の変換例におけるソースコードを示す図である。It is a figure which shows the source code in the 2nd conversion example of the 1st Example of this invention. 本発明の第1の実施例の第3の変換例におけるソースコードを示す図である。It is a figure which shows the source code in the 3rd conversion example of the 1st Example of this invention. 本発明の第1の実施例の第2の変換例における実装モデルを示す図である。It is a figure which shows the mounting model in the 2nd conversion example of 1st Example of this invention. 本発明の第1の実施例の第3の変換例における実装モデルを示す図である。It is a figure which shows the mounting model in the 3rd conversion example of 1st Example of this invention. 本発明の第1の実施例の第2の変換例における最初の汎化モデルを示す図である。It is a figure which shows the first generalization model in the 2nd conversion example of the 1st Example of this invention. 本発明の第1の実施例の第3の変換例における最初の汎化モデルを示す図である。It is a figure which shows the first generalization model in the 3rd conversion example of 1st Example of this invention. 本発明の第1の実施例の第4の変換例における検査コードを示す図である。It is a figure which shows the test | inspection code in the 4th conversion example of 1st Example of this invention. 本発明の第1の実施例の第4の変換例における検査モデルを示す図である。It is a figure which shows the test | inspection model in the 4th conversion example of 1st Example of this invention. 本発明の第1の実施例の第5の変換例におけるソースコードを示す図である。It is a figure which shows the source code in the 5th conversion example of the 1st Example of this invention. 本発明の第1の実施例の第5の変換例における検査コードを示す図である。It is a figure which shows the test | inspection code in the 5th conversion example of 1st Example of this invention. 本発明の第1の実施例の第5の変換例における実装モデルを示す図である。It is a figure which shows the mounting model in the 5th conversion example of 1st Example of this invention. 本発明の第1の実施例の第5の変換例における最初の汎化モデルを示す図である。It is a figure which shows the first generalization model in the 5th conversion example of 1st Example of this invention. 本発明の第1の実施例の第5の変換例における二番目の汎化モデルを示す図である。It is a figure which shows the 2nd generalization model in the 5th conversion example of 1st Example of this invention. 本発明の第1の実施例の第5の変換例における三番目の汎化モデルを示す図である。It is a figure which shows the 3rd generalization model in the 5th conversion example of 1st Example of this invention. 本発明の第1の実施例の第5の変換例における検査モデルを示す図である。It is a figure which shows the test | inspection model in the 5th conversion example of 1st Example of this invention. 本発明の第2の実施例のソースコード変換装置の処理フローの例を示す図である。It is a figure which shows the example of the processing flow of the source code conversion apparatus of 2nd Example of this invention. 本発明の第3の実施例における、変換の妥当性の検証の手順を詳細に説明する図である。It is a figure explaining the procedure of verification of the validity of conversion in the 3rd Example of this invention in detail. 従来例のソースコード変換装置の一例を示す図である。It is a figure which shows an example of the source code conversion apparatus of a prior art example.
 本発明では、異なる複数の変換ルールを用いて検査対象のソースコードがモデルチェッカの入力言語で記述された検査コードへ変換される。前記異なる複数の変換ルールは、検査対象のソースコードをモデルチェッカの入力言語で記述された検査コードへ変換し、抽象化する一連の処理を細粒度に分割したものであり、複数の変換ルールを組み合わせて用いることにより、前記ソースコードから前記検査コードへの変換が実現される。 In the present invention, the source code to be inspected is converted into the inspection code described in the input language of the model checker using a plurality of different conversion rules. The plurality of different conversion rules are obtained by converting a source code to be inspected into an inspection code described in an input language of a model checker, and dividing a series of abstraction processes into fine granularities. By using in combination, conversion from the source code to the inspection code is realized.
 本発明において、検査対象のソースコードを検査コードへ変換する一連の処理が細粒度に分割されたそれぞれを「変換ルール」と呼ぶ。この一連の処理は抽象化の処理も含む。本発明により実現されるソースコード変換装置は、ソースコードを検査コードへ変換する場合、異なる複数の変換ルールが利用者によって選択又は入力されるためのインタフェースを有する。前記変換ルールは、事前にソースコード変換装置内部に蓄積された複数の変換ルールの中からの選択と、利用者による記述と、のいずれかの手段により入力される。 In the present invention, each of a series of processes for converting a source code to be inspected into an inspection code is divided into fine granularities is referred to as a “conversion rule”. This series of processing includes abstraction processing. The source code conversion apparatus realized by the present invention has an interface for selecting or inputting a plurality of different conversion rules when a source code is converted into an inspection code. The conversion rule is input by one of a selection from a plurality of conversion rules stored in advance in the source code conversion apparatus and a description by the user.
 また、本発明において、変換ルールは、ソースコードを、前記ソースコードの記述言語に依存しない、汎化されたプログラム情報を持つ形式(汎化モデル)へ変換する実装-汎化変換ルールと、汎化モデルを抽象化する抽象化変換ルールと、汎化モデルをモデルチェッカの記述言語へ変換する汎化-検査変換ルールに分類される。換言すると、異なる複数の変換ルールは、ソースコードを特定のプログラミング言語に依存しない形式である中間形式へ変換する第1変換ルールと、前記中間形式に対して抽象化処理を実行する第2変換ルールと、前記中間形式から前記検査コードに変換する第3変換ルールとに分類される。ソースコードから検査コードへの変換は、実装-汎化変換ルールによりソースコードを汎化モデルへ変換するステップと、抽象化変換ルールにより前記汎化モデルを抽象化するステップと、汎化-検査変換ルールにより、前記汎化モデルを検査コードへ変換するステップと、の3つのステップが続けて実行されることによって実現される。換言すると、ソースコードから検査コードへの変換は、前記第1、第2、第3の変換ルールを各々1つ以上入力するステップと、前記第1変換ルールを用いてソフトウェアのソースコードを前記中間形式へ変換するステップと、前記第2変換ルールを用いて前記中間形式で表現されたソフトウェアを抽象化するステップと、前記第3変換ルールを用いて前記中間形式を検証ツールの入力言語で記述された検証用コードに変換するステップの3つのステップが続けて実行されることによって実現される。 In the present invention, the conversion rule includes an implementation-generalization conversion rule for converting source code into a format (generalization model) having generalized program information that does not depend on the description language of the source code, It is classified into an abstraction conversion rule that abstracts a generalized model and a generalization-check conversion rule that converts a generalized model into a description language of a model checker. In other words, the plurality of different conversion rules include a first conversion rule for converting the source code into an intermediate format that does not depend on a specific programming language, and a second conversion rule for executing an abstraction process on the intermediate format. And a third conversion rule for converting the intermediate format into the inspection code. The conversion from the source code to the inspection code includes a step of converting the source code to a generalized model by an implementation-generalization conversion rule, a step of abstracting the generalization model by an abstraction conversion rule, and a generalization-inspection conversion This is realized by executing three steps of converting the generalized model into an inspection code according to a rule. In other words, the conversion from the source code to the inspection code is performed by inputting one or more of each of the first, second, and third conversion rules, and the software source code using the first conversion rule. Converting to a format, abstracting software expressed in the intermediate format using the second conversion rule, and describing the intermediate format in the input language of the verification tool using the third conversion rule This is realized by continuously executing the three steps of converting into the verification code.
 また、本発明において、検査対象のソースコードを検査コードへ変換する一連の処理で内部的に保持される情報(モデル)は、その形式をメタモデルにより定義される。前記モデルは、検査対象のソースコードに対応する情報をもつ実装モデルと、前述の汎化モデルと、モデルチェッカの記述言語に対応する情報をもつ検査モデルと、に分類される。実装モデルはそのメタモデルであるメタ・実装モデルにより定義され、汎化モデルはそのメタモデルであるメタ・汎化モデルにより定義され、検査モデルはそのメタモデルであるメタ・検査モデルにより定義される。前述のそれぞれのメタモデルは、データ構造の定義と、データに含まれる要素間の制約に関する情報とを保有する。 Further, in the present invention, the information (model) internally held in a series of processes for converting the source code to be inspected into the inspection code is defined by the meta model. The model is classified into an implementation model having information corresponding to the source code to be inspected, the generalization model described above, and an inspection model having information corresponding to the description language of the model checker. The implementation model is defined by its meta model, the meta / implementation model, the generalization model is defined by its meta model, the meta / generalization model, and the inspection model is defined by its meta model, the meta / inspection model . Each of the above-described metamodels has a definition of a data structure and information on constraints between elements included in the data.
 また、本発明において、汎化モデルには、実装モデルもしくは検査モデルの要素に対応する等価な要素が存在する物理要素と、抽象化の変換の過程で用いる論理要素との、2種類の要素が含まれる。論理要素は、属性情報と、関連する物理要素への参照を持つことができる、物理要素の特性を継承した要素である。物理要素それぞれには、対応した論理要素が存在する。例えば、物理要素を、対応した論理要素に置き換えることで追加の属性情報を与えること、新たな論理要素へ置き換えること、及び、論理要素を異なる物理要素へ置き換えることを、変換ルールとして記述することにより、抽象化記述を段階ごとに再利用可能とすることができる。 In the present invention, the generalization model includes two types of elements, a physical element having an equivalent element corresponding to an element of the mounting model or the inspection model, and a logical element used in the process of abstraction conversion. included. A logical element is an element inheriting the characteristics of a physical element that can have attribute information and a reference to a related physical element. Each physical element has a corresponding logical element. For example, by describing as a conversion rule, giving additional attribute information by replacing a physical element with a corresponding logical element, replacing with a new logical element, and replacing a logical element with a different physical element The abstract description can be reused at each stage.
 以下、図面を参照して本発明の実施形態について詳しく説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
 まず、図1、図2を参照しながら本発明の基本概念を説明する。本発明では、図1に示すように、ソースコード0001に対して、ソースコード変換装置1000が複数の変換ルール0002を組み合わせた変換処理を実行することによって、ソースコード0001を既存モデル検査装置に適合した検査コード0005へ変換する。すなわち、(a)「変換」を細粒度に分割し、複数の「変換ルール」0002の組み合わせとしてパッケージ化することで、柔軟な変換を実現する。(b)利用者(検査者)は、検査対象のソースコード0001を入力し、対象のソースコードと検査水準に応じた「変換ルール」0002を選択して、所望の検査コード0005を得る。 First, the basic concept of the present invention will be described with reference to FIGS. In the present invention, as shown in FIG. 1, the source code conversion apparatus 1000 executes a conversion process combining a plurality of conversion rules 0002 on the source code 0001, thereby adapting the source code 0001 to the existing model checking apparatus. Converted to the inspection code 0005. That is, (a) “conversion” is divided into fine granularities and packaged as a combination of a plurality of “conversion rules” 0002, thereby realizing flexible conversion. (B) The user (inspector) inputs the source code 0001 to be inspected, selects the “conversion rule” 0002 corresponding to the target source code and the inspection level, and obtains the desired inspection code 0005.
 本発明における、「変換ルール」の例を挙げると次の通りである。
(a)単純な構文変換
「C言語の条件分岐 (If文・Switch文)」を、「検査コードの条件分岐(If 文)」に変換
「C言語の繰り返し文(for文・while文・…)」を、「検査コードの繰り返し(Do文)」に変換
(b)外部環境のモデル化
「データ読込み」を、「ランダム入力」へ置き換え
(c)抽象化
「繰り返しの除去」
「条件の簡略化」
Examples of the “conversion rule” in the present invention are as follows.
(A) Convert simple syntax conversion "C language conditional branch (If statement / Switch statement)" into "check code conditional branch (If statement)""C language repetition statement (for statement, while statement, ... ) ”Is converted to“ Repeated inspection code (Do statement) ”(b) Modeling of external environment“ Read data ”is replaced with“ Random input ”(c) Abstraction“ Repeat removal ”
"Simplification of conditions"
 図2により、本発明のソースコード変換処理における変換ルールの入力インタフェースについて、説明する。 The conversion rule input interface in the source code conversion processing of the present invention will be described with reference to FIG.
 本発明によれば、細粒度に分割された複数の変換ルール0002を入力するインタフェースを所有するので、利用者による抽象化の変更は、複数の異なる変換ルール0002を選択又は入力する操作により容易に実現される。すなわち、利用者による抽象化の水準の変更は、ドメイン情報、検査したい性質、及び検査水準の情報(抽象化による性質への影響)に応じて、利用者が複数の異なる変換ルール0002を選択して呼び出し、ソースコード変換装置1000へ入力する操作により容易に実現される。 According to the present invention, since the interface for inputting a plurality of conversion rules 0002 divided into fine granularities is owned, the abstraction change by the user can be easily performed by selecting or inputting a plurality of different conversion rules 0002. Realized. In other words, the user can change the abstraction level by selecting a plurality of different conversion rules 0002 according to the domain information, the property to be inspected, and the information on the inspection level (influence on the property due to abstraction). And can be easily realized by an operation to be input to the source code conversion apparatus 1000.
 本発明によれば、異なる複数の変換ルール0002を用いて検査対象のソースコード0001をモデルチェッカの入力言語で記述された検査コード0005へ変換する手順を含んでいる。前記異なる複数の変換ルールは、実装-汎化変換ルールと、抽象化変換ルールと、汎化-検査変換ルールとに分類され、これらの変換ルールを用いた変換は段階的に実行される。検査対象のソースコードの設計変更に追従する際には、変更に関連する変換ルールのみを変更すればよく、変更が最小限にとどめられる。加えて、実装モデルと、汎化モデルと、検査モデルとをそれぞれメタモデルで定義し、制約を加えることにより、変換ルールによる変換結果が不正でないことが検証可能となる。これによって、本実施形態では、検査対象のソースコードを検査コードへ抽象化しながら変換する一連の処理は、細粒度の変換ルールを組み合わせることで実現されるが、このような一連の処理の実現方法によって生じる変換ルールの検証コストの増大を防ぐことができる。 The present invention includes a procedure for converting the source code 0001 to be inspected into the inspection code 0005 described in the input language of the model checker using a plurality of different conversion rules 0002. The plurality of different conversion rules are classified into an implementation-generalization conversion rule, an abstraction conversion rule, and a generalization-check conversion rule, and conversion using these conversion rules is executed in stages. When following the design change of the source code to be inspected, only the conversion rule related to the change needs to be changed, and the change is minimized. In addition, the implementation model, the generalization model, and the inspection model are each defined in the meta model, and by adding restrictions, it is possible to verify that the conversion result by the conversion rule is not illegal. Thus, in this embodiment, a series of processes for converting the source code to be inspected while abstracting it into the inspection code is realized by combining fine-grained conversion rules. A method for realizing such a series of processes It is possible to prevent an increase in the verification cost of the conversion rule caused by.
 また、異なる検査ツールにて検査するために、前記検査ツールの形式で出力する際には、メタ・検査モデルと、汎化-検査変換ルールのみを作成すればよく、作成部分が最小限にとどめられる。 In addition, in order to inspect with different inspection tools, when outputting in the format of the inspection tool, only the meta / inspection model and the generalization-inspection conversion rule need be created, and the creation part is minimized. It is done.
 (第1の実施例)
 次に、本発明の第1の実施例となるソースコード変換装置及び変換処理方法を、図3Aから図32を参照しながら説明する。
(First embodiment)
Next, a source code conversion apparatus and conversion processing method according to the first embodiment of the present invention will be described with reference to FIGS. 3A to 32.
 図3Aは、第1の実施例となるソースコード変換装置を含むソースコード変換システムの構成例を示す図である。本発明の実施形態に適用されるソースコード変換装置1000は、検査対象のソースコード0001を検査コード0005に変換する装置であり、入力部1100と、変換処理部1200と、出力部1300と、記憶部1400と、制御部1500とを備える。2000はモデル検査ツール、3000は検査結果を示す。 FIG. 3A is a diagram illustrating a configuration example of a source code conversion system including the source code conversion apparatus according to the first embodiment. A source code conversion apparatus 1000 applied to an embodiment of the present invention is an apparatus that converts a source code 0001 to be inspected into an inspection code 0005, and includes an input unit 1100, a conversion processing unit 1200, an output unit 1300, and a storage. Unit 1400 and control unit 1500. Reference numeral 2000 denotes a model inspection tool, and reference numeral 3000 denotes an inspection result.
 入力部1100は、ソースコード0001及び変換ルール0002の入力を受け付ける。記憶部1400には、変換ルール0002、メタモデル0003、及び書出しルール0004が格納される。メタモデル0003は、変換処理部1200によるソースコード001を検査コード0005へ変換する一連の処理で内部的に保持されるモデルの形式を定義するためのデータである。メタモデル0003は、上述したように、データ構造の定義と、データに含まれる要素間の制約に関する情報とを保有する。なお、データに含まれる要素は物理要素及び論理要素を含み、物理要素に関する情報を物理要素定義0031といい、論理要素に関する情報を論理要素定義0032という。 The input unit 1100 receives input of the source code 0001 and the conversion rule 0002. The storage unit 1400 stores a conversion rule 0002, a meta model 0003, and a writing rule 0004. The meta model 0003 is data for defining a model format internally held in a series of processes for converting the source code 001 into the inspection code 0005 by the conversion processing unit 1200. As described above, the meta model 0003 holds the definition of the data structure and information on the constraints between the elements included in the data. The elements included in the data include physical elements and logical elements. Information regarding the physical elements is referred to as a physical element definition 0031, and information regarding the logical elements is referred to as a logical element definition 0032.
 変換処理部1200は、検査対象のソースコード0001を変換ルール0002に基づいて検査コード0005に変換する。出力部1300は書出しルール0004に基づいて検査コード0005を出力する。制御部1500は、ソースコード変換装置1000の全体の処理を制御するための各種処理を実行するプロセッサである。 The conversion processing unit 1200 converts the source code 0001 to be inspected into the inspection code 0005 based on the conversion rule 0002. The output unit 1300 outputs the inspection code 0005 based on the writing rule 0004. The control unit 1500 is a processor that executes various processes for controlling the entire process of the source code conversion apparatus 1000.
 図3Bに、ソースコード変換装置1000の構成例を示す。入力部1100は、ソースコード入力部1101、及び変換ルール入力部1102を有する。変換処理部1200は、モデル構築部1201、実装-汎化モデル変換部1202、抽象化モデル変換部1203、及び、汎化-検査モデル変換部1204を有する。出力部1300は、検査コード書出し部1301を有する。記憶部1400は、変換ルールデータベース1401、メタモデルデータベース1402、及び、書出しルールデータベース1403を有する。 FIG. 3B shows a configuration example of the source code conversion apparatus 1000. The input unit 1100 includes a source code input unit 1101 and a conversion rule input unit 1102. The conversion processing unit 1200 includes a model construction unit 1201, an implementation-generalized model conversion unit 1202, an abstract model conversion unit 1203, and a generalization-check model conversion unit 1204. The output unit 1300 includes an inspection code writing unit 1301. The storage unit 1400 includes a conversion rule database 1401, a metamodel database 1402, and a writing rule database 1403.
 ソースコード変換装置1000は、例えば、1台のコンピュータ、又は、ネットワークを介して接続された複数のコンピュータ上で動作するプログラムとして実装される。ソースコード0001と変換ルール集合0002とは、例えば、コンピュータ上の記憶装置から読込む方法、及びコンピュータに接続された入力デバイスから直接入力される方法等により入力される。また、検査コード0005は、例えば、コンピュータ上の記憶装置に書出す方法、及びコンピュータのディスプレイ装置に表示する方法により出力される。 The source code conversion apparatus 1000 is implemented as a program that operates on, for example, a single computer or a plurality of computers connected via a network. The source code 0001 and the conversion rule set 0002 are input by, for example, a method of reading from a storage device on a computer or a method of directly inputting from an input device connected to the computer. The inspection code 0005 is output by, for example, a method of writing to a storage device on a computer and a method of displaying on a display device of a computer.
 入力部1100は、ユーザによって入力されるデータを受付け、入力されたデータを変換処理部1200へ供給する処理を実行する。入力部1100は、ソースコード0001に関する情報と、細粒度に分割された複数の変換ルール、すなわち「変換ルール集合」0002に関する情報とを受け付け、変換処理部1200へ供給する。ある実施形態においては、入力部1100は、ユーザによる、変換処理部の駆動及び制御、並びに出力部の駆動及び制御に関する指示を受け付けてもよい。 The input unit 1100 receives data input by the user and executes a process of supplying the input data to the conversion processing unit 1200. The input unit 1100 receives information related to the source code 0001 and a plurality of conversion rules divided into fine granularities, that is, information related to the “conversion rule set” 0002, and supplies the information to the conversion processing unit 1200. In an embodiment, the input unit 1100 may receive an instruction regarding driving and control of the conversion processing unit and driving and control of the output unit by the user.
 変換処理部1200には、入力部1100から、ソースコード0001の情報と、ソースコード0001に適用すべき変換ルール集合0002の情報とが供給される。また、変換処理部1200は、変換ルール集合0002を用いてソースコード0001を変換する処理を実行し、変換結果の情報を出力部1300に供給する。ある実施形態においては、入力部1100から供給される変換ルール集合0002に関する情報には、記憶部1400に格納された変換ルール0002を指し示す識別情報のみが含まれ、変換ルール集合0002の実体を、前記識別情報を用いて記憶部1400から取り出し、変換に用いてもよい。 The conversion processing unit 1200 is supplied with information on the source code 0001 and information on the conversion rule set 0002 to be applied to the source code 0001 from the input unit 1100. Also, the conversion processing unit 1200 executes processing for converting the source code 0001 using the conversion rule set 0002 and supplies information of the conversion result to the output unit 1300. In an embodiment, the information related to the conversion rule set 0002 supplied from the input unit 1100 includes only identification information indicating the conversion rule 0002 stored in the storage unit 1400. The identification information may be taken out from the storage unit 1400 and used for conversion.
 図6を用いて、変換処理部1200及び出力部1300の詳細について説明する。 Details of the conversion processing unit 1200 and the output unit 1300 will be described with reference to FIG.
 変換処理部1200は、モデル構築部1201と、実装-汎化モデル変換部1202と、抽象化モデル変換部1203と、汎化-検査モデル変換部1204とを有する。 The conversion processing unit 1200 includes a model construction unit 1201, an implementation-generalized model conversion unit 1202, an abstract model conversion unit 1203, and a generalization-check model conversion unit 1204.
 本実施形態において、変換処理部1200は、メタモデル0003(図3A参照)及び変換ルール0002を用いたモデル変換により、ソースコード情報1001を、検査モデル1008へ変換する。メタ・実装モデル1002と、メタ・汎化モデル1003と、メタ・検査モデル1004とは、例えば、非特許文献2に記載のMOFにて記述する。また、例えば、非特許文献3に記載されているQVTにて、実装-汎化変換ルール1005と、抽象化変換ルール1006と、汎化-検査変換ルール1007とを記述し、モデルを変換する。前記変換は、既に例示した方法の他のモデル変換方法でもよく、また、複数の方法を混在させてもよい。 In this embodiment, the conversion processing unit 1200 converts the source code information 1001 into the inspection model 1008 by model conversion using the meta model 0003 (see FIG. 3A) and the conversion rule 0002. The meta / implementation model 1002, the meta / generalization model 1003, and the meta / inspection model 1004 are described in, for example, the MOF described in Non-Patent Document 2. Also, for example, in the QVT described in Non-Patent Document 3, the implementation-generalization conversion rule 1005, the abstraction conversion rule 1006, and the generalization-inspection conversion rule 1007 are described, and the model is converted. The conversion may be another model conversion method already exemplified, or a plurality of methods may be mixed.
 また、ある実施形態においては、実装-汎化モデル変換部1202と、抽象化モデル変換部1203と、汎化-検査モデル変換部1204とをそれぞれ独立させず、同一の部位によって実行されてもよく、さらに、実装モデル1205と、汎化モデル1206と、検査モデル1008と、のそれぞれのメタモデルとして、メタ・実装モデル1002と、メタ・汎化モデル1003と、メタ・検査モデル1004とを個別に用意せず、単一のメタモデルにより、実装モデル1205と、汎化モデル1206と、検査モデル1008とを定義してもよい。また、ある実施例においては、メタ・実装モデル1002、メタ・汎化モデル1003、及びメタ・検査モデル1004は、複数の方式により、それぞれ実装モデル1205、汎化モデル1206、及び検査モデル1008の形式及び制約を定義してもよい。例えば、それぞれのメタモデルは、前記MOFによる定義のほかに、非特許文献4に記載されているOCLにて記載された制約条件を含み、モデルの変換が実行された際に、制約条件を満たしているかどうかの検証を実行する方法があり得る。 In some embodiments, the implementation-generalization model conversion unit 1202, the abstraction model conversion unit 1203, and the generalization-check model conversion unit 1204 may be executed by the same part without being independent of each other. Further, the meta / implementation model 1002, the meta / generalization model 1003, and the meta / inspection model 1004 are individually meta-models of the implementation model 1205, the generalization model 1206, and the inspection model 1008. The mounting model 1205, the generalization model 1206, and the inspection model 1008 may be defined by a single meta model without preparing. Further, in an embodiment, the meta / implementation model 1002, the meta / generalization model 1003, and the meta / inspection model 1004 are in the form of an implementation model 1205, a generalization model 1206, and an inspection model 1008, respectively, by a plurality of methods. And constraints may be defined. For example, each meta model includes the constraint conditions described in the OCL described in Non-Patent Document 4 in addition to the definition by the MOF, and satisfies the constraint conditions when model conversion is executed. There can be a way to perform the verification.
 モデル構築部1201は、ソースコード入力部1101からソースコード情報1001を受け取り、実装モデル1205へ変換する。実装モデル1205の形式は、そのメタモデルであるメタ・実装モデル1002により、定義される。実装モデル1205は、本発明の効果を最大限に得るためには、ソースコード情報1001と相互に変換するのに必要十分な情報を持つことが望ましいが、ある実施形態によっては、検査コードを出力するという目的を逸しない程度にて、情報の省略及び追加があってもよい。 The model construction unit 1201 receives the source code information 1001 from the source code input unit 1101 and converts it into the mounting model 1205. The format of the mounting model 1205 is defined by a meta / implementation model 1002 that is the meta model. The implementation model 1205 preferably has sufficient information necessary for mutual conversion with the source code information 1001 in order to obtain the effects of the present invention to the maximum. However, in some embodiments, an inspection code is output. There may be omission and addition of information to the extent that it does not miss its purpose.
 ある実施形態においては、モデル構築部1201は、ソースコード入力部1101と不可分な様態で実装され、ソースコード情報1001が生じない形態で処理が進んでもよい。 In an embodiment, the model construction unit 1201 may be implemented in a manner inseparable from the source code input unit 1101 and the process may proceed in a form in which the source code information 1001 does not occur.
 実装-汎化モデル変換部1202は、実装-汎化変換ルール1005と、メタ・実装モデル1002と、メタ・汎化モデル1003とを用いて、実装モデル1205を汎化モデル1206へ変換する。汎化モデル1206は、複数のプログラミング言語における構造及び処理を表現可能なデータ構造をもつ。例えば、汎化モデル1206中では、ソースコード0001におけるIf文とSwitch文とが区別されず、選択的実行文として表現される。ある実施形態においては、実装モデル1205を汎化モデル1206へ変換する際、実装-汎化変換ルール1005のみを用いることもあり得る。また、ある実施形態において、実装-汎化変換ルール1005が複数の変換ルールを含む場合には、複数の変換ルールを統合して一つの変換ルールとし、実装モデル1205から汎化モデル1206への変換に利用する方法があり得る。また、ある実施形態において、実装-汎化変換ルール1005が複数の変換ルールを含む場合には、変換処理を複数回繰り返すことで、実装モデル1205から汎化モデル1206への変換を実行する手順があり得る。 The mounting-generalization model conversion unit 1202 converts the mounting model 1205 into the generalization model 1206 using the mounting-generalization conversion rule 1005, the meta / mounting model 1002, and the meta / generalization model 1003. The generalization model 1206 has a data structure that can represent structures and processes in a plurality of programming languages. For example, in the generalization model 1206, the If statement and the Switch statement in the source code 0001 are not distinguished and are expressed as selective execution statements. In some embodiments, only the implementation-generalization conversion rule 1005 may be used when converting the implementation model 1205 to the generalization model 1206. In an embodiment, when the implementation-generalization conversion rule 1005 includes a plurality of conversion rules, the plurality of conversion rules are integrated into one conversion rule, and the conversion from the implementation model 1205 to the generalization model 1206 is performed. There can be a method to use. In an embodiment, when the implementation-generalization conversion rule 1005 includes a plurality of conversion rules, a procedure for executing the conversion from the implementation model 1205 to the generalization model 1206 by repeating the conversion process a plurality of times is provided. possible.
 抽象化モデル変換部1203は、抽象化変換ルール1006と、メタ・汎化モデル1003とを用いて、汎化モデル1206を抽象化する。抽象化の例としては、選択文における条件式を、恒真、もしくは恒偽、又は非決定的な選択で置き換える方法があり得る。ある実施形態においては、汎化モデル1206を抽象化する際、抽象化変換ルール1006のみを用いることもあり得る。また、ある実施形態において、抽象化変換ルール1006が複数の変換ルールを含む場合には、複数の変換ルールを統合して一つの変換ルールとし、汎化モデル1206の抽象化に用いる方法があり得る。また、ある実施形態において、抽象化変換ルール1006が複数の変換ルールを含む場合には、変換処理を複数回繰り返すことで、汎化モデル1206の変換を実行する手順があり得る。 The abstract model conversion unit 1203 abstracts the general model 1206 using the abstract conversion rule 1006 and the meta / generalization model 1003. As an example of abstraction, there may be a method of replacing a conditional expression in a selection statement with a true, false, or non-deterministic selection. In an embodiment, when abstracting the generalization model 1206, only the abstraction conversion rule 1006 may be used. Further, in an embodiment, when the abstraction conversion rule 1006 includes a plurality of conversion rules, there may be a method of integrating a plurality of conversion rules into one conversion rule and using it for abstracting the generalization model 1206. . Further, in an embodiment, when the abstract conversion rule 1006 includes a plurality of conversion rules, there may be a procedure for executing the conversion of the generalized model 1206 by repeating the conversion process a plurality of times.
 汎化-検査モデル変換部1204は、汎化-検査変換ルール1007と、メタ・汎化モデル1003と、メタ・検査モデル1004とを用いて、汎化モデル1206を、検査モデル1008へ変換する。例えば、検査コード0005がPromela形式である場合、汎化モデルにおいて選択的実行文として表現された要素は、検査モデルにおいてはIf文として表現される。ある実施形態においては、汎化モデル1206を、検査モデル1008へ変換する際、汎化-検査変換ルール1007のみを用いることもあり得る。また、ある実施形態において、汎化-検査変換ルール1007が複数の変換ルールを含む場合には、複数の変換ルールを統合して一つの変換ルールとし、汎化モデル1206から検査モデル1008への変換に利用する方法があり得る。また、ある実施形態において、汎化-検査変換ルール1007が複数の変換ルールを含む場合には、変換処理を複数回繰り返すことで、汎化モデル1206から検査モデル1008への変換を実行する手順があり得る。 The generalization-inspection model conversion unit 1204 converts the generalization model 1206 into an inspection model 1008 using the generalization-inspection conversion rule 1007, the meta / generalization model 1003, and the meta / inspection model 1004. For example, when the inspection code 0005 is in the Promela format, an element expressed as a selective executable statement in the generalization model is expressed as an If statement in the inspection model. In an embodiment, when the generalization model 1206 is converted into the inspection model 1008, only the generalization-inspection conversion rule 1007 may be used. In an embodiment, when the generalization-check conversion rule 1007 includes a plurality of conversion rules, the conversion rules are integrated into one conversion rule, and the conversion from the generalization model 1206 to the check model 1008 is performed. There can be a method to use. Further, in a certain embodiment, when the generalization-inspection conversion rule 1007 includes a plurality of conversion rules, a procedure for executing conversion from the generalization model 1206 to the inspection model 1008 by repeating the conversion processing a plurality of times. possible.
 出力部1300は、変換処理部1200より供給された変換結果の情報を用いて、検査コード0005を出力する。ある実施形態においては、検査コード0005の出力に際して、例えばモデルチェッカの記述言語の文法情報などの情報が記憶部1400から供給されてもよい。 The output unit 1300 outputs the inspection code 0005 using the information of the conversion result supplied from the conversion processing unit 1200. In an embodiment, information such as grammar information of the description language of the model checker may be supplied from the storage unit 1400 when the inspection code 0005 is output.
 検査コード書出し部1301は、メタ・検査モデル1004と、記憶部1400の書出しルールデータベース1403から取得した検査コード書出しルール1009とを用いて、検査モデル1008を検査コード0005へ変換する。例えば、非特許文献5に記載される方法で検査コード書出しルール1009が記述され、検査モデル1008から検査コード0005への変換が実行される。ある実施例においては、これに限らず、検査モデル1008を検査に利用するモデルチェッカの記述形式へ変換する任意の方法でもよい。検査コード0005は、例えば、モデルチェッカとしてSPINを用いる場合には、SPINの入力言語であるPromela言語により記述される。 The inspection code writing unit 1301 converts the inspection model 1008 into the inspection code 0005 using the meta / inspection model 1004 and the inspection code writing rule 1009 acquired from the writing rule database 1403 of the storage unit 1400. For example, the inspection code writing rule 1009 is described by the method described in Non-Patent Document 5, and the conversion from the inspection model 1008 to the inspection code 0005 is executed. In an embodiment, the present invention is not limited to this, and any method for converting the inspection model 1008 into a description format of a model checker used for inspection may be used. For example, when SPIN is used as a model checker, the inspection code 0005 is described in the Promela language, which is the SPIN input language.
 記憶部1400において、変換ルールデータベース1401、メタモデルデータベース1402、及び書出しルールデータベース1403のそれぞれは、例えば、関係データベース、又は、階層型データベースなどの、コンピュータ上にて実現される任意のデータ格納方式で実現される。変換ルールデータベース1401と、メタモデルデータベース1402と、書出しルールデータベース1403とは互いに同一の方式で実現される必要性は無く、互いに異なる方式で実現されていてもよい。また、変換ルールデータベース1401と、メタモデルデータベース1402と、書出しルールデータベース1403とのそれぞれは、単一の方式で実現される必要性は無く、例えば、保有すべき情報の一部を関係データベースに格納し、保有すべき情報の一部を、発明を実現するコンピュータプログラム中に組込むなど、それぞれ異なる方式の組合せで実現されてもよい。 In the storage unit 1400, each of the conversion rule database 1401, the metamodel database 1402, and the writing rule database 1403 is an arbitrary data storage method realized on a computer, such as a relational database or a hierarchical database. Realized. The conversion rule database 1401, the metamodel database 1402, and the write-out rule database 1403 do not have to be implemented by the same method, and may be implemented by different methods. Further, each of the conversion rule database 1401, the metamodel database 1402, and the writing rule database 1403 does not need to be realized by a single method. For example, a part of information to be held is stored in the relational database. In addition, a part of information to be held may be realized by a combination of different methods, such as being incorporated into a computer program for realizing the invention.
 記憶部1400は、入力部1100と、変換処理部1200と、出力部1300とが、それぞれの処理を実行するために必要な情報を供給する。例えば、記憶部1400は、変換ルールに関する情報と、メタモデルに関する情報と、モデルチェッカの記述言語の文法に関する情報とを格納する。 The storage unit 1400 supplies information necessary for the input unit 1100, the conversion processing unit 1200, and the output unit 1300 to execute the respective processes. For example, the storage unit 1400 stores information on conversion rules, information on metamodels, and information on grammar of a model checker description language.
 変換ルールデータベース1401は、既に述べたとおり、変換ルールをメタデータとともに保有する。前記メタデータは、変換ルールを選択するためのものであり、実装-汎化変換ルール1005と、抽象化変換ルール1006と、汎化-検査変換ルール1007の、それぞれ異なる情報を持つ方法があり得る。実装-汎化変換ルール1005のメタデータは、例えば、変換元ソースコードの記述言語の種類があり得る。抽象化変換ルール1006のメタデータは、例えば、抽象化を分かりやすく端的に表現した名前、簡単な説明、「データの抽象化」、「処理の抽象化」などの抽象化の種別、自然語(例えばアルファベット又は数値)で表現された抽象化による状態数削減効果、自然語(例えばアルファベット又は数値)で表現された抽象化による性質への影響、及び抽象化の適用できるソフトウェアのドメイン、があり得る。汎化-検査変換ルール1007のメタデータは、例えば、検査に使用するモデルチェッカを指し示す名前があり得る。 The conversion rule database 1401 holds conversion rules together with metadata as described above. The metadata is for selecting a conversion rule, and there may be a method having different information for the implementation-generalization conversion rule 1005, the abstraction conversion rule 1006, and the generalization-inspection conversion rule 1007. . The metadata of the implementation-generalization conversion rule 1005 can be, for example, the type of description language of the conversion source code. The metadata of the abstraction conversion rule 1006 includes, for example, a name that simply represents the abstraction in a straightforward manner, a brief description, an abstraction type such as “data abstraction”, “processing abstraction”, and a natural language ( For example, there may be an effect of reducing the number of states by abstraction expressed in alphabets or numerical values, an influence on properties by abstraction expressed in natural language (for example, alphabets or numerical values), and a software domain to which the abstraction can be applied. . The metadata of the generalization-inspection conversion rule 1007 may have a name indicating a model checker used for inspection, for example.
 以降、図4ないし図6を参照しながら入力部1100、変換処理部1200、出力部1300、記憶部1400、及び制御部1500の詳細を説明する。 Hereinafter, details of the input unit 1100, the conversion processing unit 1200, the output unit 1300, the storage unit 1400, and the control unit 1500 will be described with reference to FIGS. 4 to 6.
 まず、本実施例におけるソースコード変換手順の一例を、図4及び図6を参照しながら説明する。本実施例におけるソースコード変換手順は、ソースコード入力ステップS101と、変換ルール入力ステップS102と、変換ルール適用ステップS103と、検査コード出力ステップS104と、を含む。このソースコード変換手順は、制御部1500が主体となって実行される。 First, an example of the source code conversion procedure in the present embodiment will be described with reference to FIGS. The source code conversion procedure in this embodiment includes a source code input step S101, a conversion rule input step S102, a conversion rule application step S103, and an inspection code output step S104. This source code conversion procedure is executed mainly by the control unit 1500.
 まず、ソースコード入力ステップS101において、ソースコード入力部1101により、ソースコード0001がソースコード変換装置1000に読み込まれ、ソースコード情報1001へ変換される。 First, in the source code input step S101, the source code input unit 1101 reads the source code 0001 into the source code conversion device 1000 and converts it into the source code information 1001.
 ソースコード入力部1101は、利用者から入力された検査対象のソースコード0001を受け付け、ソースコード情報1001へ変換する。ソースコード0001は、例えば、JIS X3010-1993に公開されるプログラミング言語Cにより記述される。ソースコード情報1001は、具体的には、例えば抽象構文木の形式で保持される。ソースコード情報1001の形式は、抽象構文木に限らず、構造及び論理などソースコード0001の検査に要する情報を保持する、任意の形式でもよい。 The source code input unit 1101 receives the source code 0001 to be inspected input from the user, and converts it into source code information 1001. The source code 0001 is described in, for example, a programming language C disclosed in JIS X3010-1993. Specifically, the source code information 1001 is held, for example, in the form of an abstract syntax tree. The format of the source code information 1001 is not limited to the abstract syntax tree, but may be any format that holds information required for the inspection of the source code 0001 such as structure and logic.
 ソースコード入力ステップS101に続き、変換ルール入力ステップS102において、変換ルール入力部1102により、細粒度に分割された複数の変換ルールである変換ルール集合0002がソースコード変換装置1000に読み込まれる。この変換ルール入力ステップS102では、変換前のモデルの要素と変換後のモデル要素との対応関係、及び変換によって変換前のモデルの要素に加えられる操作の少なくとも一方が定義される。変換ルール集合0002をソースコード変換装置1000に読み込む処理は、利用者による一度の操作で実行される必要性は無く、繰り返しの操作により実行されてもよい。また、ソースコード入力ステップS101、及び変換ルール入力ステップS102は、必ずしもこの順番で完了する必要性は無く、ソースコード入力部1101によりソースコード情報1001が生成される前にソースコード0001が入力され、かつ、変換ルール入力部1102が変換ルール入力処理のためにソースコード情報1001を要求する前にソースコード0001が入力されていればよい。したがって、ソースコード入力ステップS101の処理と、変換ルール入力ステップS102の処理とが混在する順番で処理がすすんでもよい。例えば、ソースコード入力部1101がソースコード0001を受け付け、続いて、変換ルール入力部1102が、変換ルール集合0002を受け付け、続いて、ソースコード入力部1101が、ソースコード0001をソースコード情報1001へ変換する、手順があり得る。 Following the source code input step S101, in the conversion rule input step S102, the conversion rule input unit 1102 reads a conversion rule set 0002, which is a plurality of conversion rules divided into fine granularities, into the source code conversion apparatus 1000. In this conversion rule input step S102, at least one of a correspondence relationship between the model element before conversion and the model element after conversion, and an operation applied to the element of the model before conversion by conversion is defined. The process of reading the conversion rule set 0002 into the source code conversion apparatus 1000 need not be executed by a single operation by the user, and may be executed by repeated operations. Further, the source code input step S101 and the conversion rule input step S102 are not necessarily completed in this order, and the source code 0001 is input before the source code information 1001 is generated by the source code input unit 1101. In addition, the source code 0001 may be input before the conversion rule input unit 1102 requests the source code information 1001 for the conversion rule input process. Therefore, the processing may proceed in the order in which the processing of the source code input step S101 and the processing of the conversion rule input step S102 are mixed. For example, the source code input unit 1101 receives the source code 0001, then the conversion rule input unit 1102 receives the conversion rule set 0002, and then the source code input unit 1101 transfers the source code 0001 to the source code information 1001. There can be a procedure to convert.
 変換ルール入力部1102は、利用者から入力された変換ルール集合0002を受け付ける。利用者から変換ルール集合0002を受け付ける方法は、例えば、次に示す方法があり得る。 The conversion rule input unit 1102 receives the conversion rule set 0002 input from the user. As a method for receiving the conversion rule set 0002 from the user, for example, there may be the following method.
 一つめの変換ルール入力方法の例として、変換ルール入力部1102は、変換ルール集合0002の一部として、利用者が手作業で直接入力した変換ルールを受け取る。 As an example of the first conversion rule input method, the conversion rule input unit 1102 receives a conversion rule input manually by a user as part of the conversion rule set 0002.
 二つめの変換ルール入力方法の例として、図5Aに示すように、変換ルール集合0002の少なくとも一部は、利用者が記述した変換ルール(記述)0010により入力されてもよい。また、入力部1100が、記憶部1400から変換ルールの一覧0015を取得し、取得した変換ルールの一覧0015を利用者に一覧などの形式で提示し、前記提示された一覧から変換ルールを利用者が選択することによって、変換ルール集合0002の入力を受け付けてもよい。すなわち、利用者が、変換ルールの入力に前置して、変換ルールの検索条件0011を入力部1100の変換ルール入力部1102に入力(記述)し、続いて、変換ルール入力部1102が、前記検索条件に合致する変換ルールを、記憶部1400が有する変換ルールデータベース1401から取得し、変換ルール一覧0015として前記利用者に提示する。続いて、前記利用者が、提示された前記変換ルール一覧0015に含まれる一つ以上の変換ルールを選択する。この利用者によって選択された一つ以上の変換ルールを、変換ルール入力部1102が、変換ルール集合0002の一部として受け付ける。 As an example of the second conversion rule input method, as shown in FIG. 5A, at least a part of the conversion rule set 0002 may be input by a conversion rule (description) 0010 described by the user. Also, the input unit 1100 acquires the conversion rule list 0015 from the storage unit 1400, presents the acquired conversion rule list 0015 to the user in the form of a list or the like, and the conversion rule is displayed from the presented list to the user. May select the conversion rule set 0002. That is, the user inputs (describes) the conversion rule search condition 0011 to the conversion rule input unit 1102 of the input unit 1100 before the input of the conversion rule, and then the conversion rule input unit 1102 A conversion rule that matches the search condition is acquired from the conversion rule database 1401 of the storage unit 1400 and presented to the user as a conversion rule list 0015. Subsequently, the user selects one or more conversion rules included in the presented conversion rule list 0015. The conversion rule input unit 1102 accepts one or more conversion rules selected by the user as a part of the conversion rule set 0002.
 三つめの変換ルール入力方法の例として、まず、利用者が、変換ルールの入力に前置して、変換ルールの検索条件0011を変換ルール入力部1102に入力し、続いて、変換ルール入力部1102が、前記検索条件に合致する変換ルールを、変換ルールデータベース1401から取得して、変換ルール集合0002の一部として受け付けてもよい。 As an example of the third conversion rule input method, first, the user inputs the conversion rule search condition 0011 to the conversion rule input unit 1102 before the conversion rule input, and then the conversion rule input unit. 1102 may acquire a conversion rule that matches the search condition from the conversion rule database 1401 and accept it as a part of the conversion rule set 0002.
 四つめの変換ルール入力方法の例として、図5Bに示すように、入力されたソースコード0001から、変換ルール入力部1102が、変換ルールの検索条件0012を抽出、生成し、さらに、前記検索条件に合致する変換ルールを、変換ルールデータベース1401から取得し、変換ルール集合0002の一部として受け付ける。 As an example of the fourth conversion rule input method, as shown in FIG. 5B, the conversion rule input unit 1102 extracts and generates the conversion rule search condition 0012 from the input source code 0001, and further, the search condition Is obtained from the conversion rule database 1401 and accepted as a part of the conversion rule set 0002.
 二つめの変換ルール入力方法の例と、三つめの変換ルール入力方法の例と、四つめの変換ルール入力方法の例における、変換ルール検索条件の因子としては、例えば、後述する、変換ルールデータベース1401において、変換ルールのメタデータとして格納される情報があり得る。 Examples of the conversion rule search condition factor in the second conversion rule input method example, the third conversion rule input method example, and the fourth conversion rule input method example are the conversion rule database described later. At 1401, there may be information stored as metadata for the conversion rule.
 また、五つめの変換ルール入力方法の例として、変換ルール入力部1102は、何らかの方法で入力された変換ルールを加工することにより、変換ルールを受け付ける。前記加工方法の例としては、変換ルールデータベース1401には、ソースコード0001中の変数名などをパラメタ化した状態で変換ルールを保持しておき、例えば利用者の明示的な入力による方法などにより、ソースコード0001の情報にてパラメタを埋めたものを、変換ルール集合0002に含める方法があり得る。五つめの変換ルール入力方法の例において、加工元の変換ルールの入力方法としては、既に述べた一つめの変換ルール入力方法の例など、入力された変換ルールを加工せずに用いる場合と同様の方法があり得る。 Also, as an example of the fifth conversion rule input method, the conversion rule input unit 1102 accepts the conversion rule by processing the conversion rule input by some method. As an example of the processing method, the conversion rule database 1401 holds the conversion rule in a state in which the variable name or the like in the source code 0001 is parameterized, for example, by a method by explicit input of the user, There may be a method of including the parameter embedded with the information of the source code 0001 in the conversion rule set 0002. In the fifth conversion rule input method example, the conversion rule input method for the processing source is the same as the case of using the input conversion rule without processing, such as the first conversion rule input method described above. There can be a method.
 変換ルール入力部1102が、変換ルール集合0002を受け付ける方法は、これらの変換ルール入力方法に限らず、変換処理部1200で用いる変換ルールの集合を受け付ける任意の方法でよく、また、これらの変換ルール入力方法の一つ以上の組合せにより変換ルール集合0002を受け付けてもよい。 The method by which the conversion rule input unit 1102 receives the conversion rule set 0002 is not limited to these conversion rule input methods, and any method that receives a set of conversion rules used by the conversion processing unit 1200 may be used. The conversion rule set 0002 may be received by one or more combinations of input methods.
 変換ルール入力ステップS102に続き、変換ルール適用ステップS103において、モデル構築部1201がソースコード情報1001を実装モデル1205へ変換し、続いて、実装-汎化モデル変換部1202が実装モデル1205を汎化モデル1206へ変換し(S1031)、続いて、抽象化モデル変換部1203が汎化モデル1206を抽象化し(S1032)、続いて、汎化-検査モデル変換部1204が汎化モデル1206を検査モデル1008へ変換する(S1033)。変換ルール入力ステップS102と、変換ルール適用ステップS103とは、必ずしもこの順番で処理が完了する必要性は無く、実装-汎化モデル変換部1202の処理までに実装-汎化変換ルール1005が入力され、かつ、抽象化モデル変換部1203の処理までに抽象化変換ルール1006が入力され、かつ、汎化-検査モデル変換部の処理までに汎化-検査変換ルール1007が入力されていればよい。 Following the conversion rule input step S102, in the conversion rule application step S103, the model construction unit 1201 converts the source code information 1001 into the mounting model 1205, and then the mounting-generalization model conversion unit 1202 generalizes the mounting model 1205. Next, the abstract model conversion unit 1203 abstracts the generalized model 1206 (S1032), and then the generalization-check model conversion unit 1204 converts the generalized model 1206 to the check model 1008. (S1033). The conversion rule input step S102 and the conversion rule application step S103 do not necessarily have to be completed in this order, and the implementation-generalization conversion rule 1005 is input before the processing of the implementation-generalization model conversion unit 1202. In addition, the abstraction conversion rule 1006 may be input before the process of the abstraction model conversion unit 1203, and the generalization-check conversion rule 1007 may be input before the process of the generalization-check model conversion unit.
 変換ルール適用ステップS103に続き、検査コード出力ステップS104において、検査コード書出し部1301により、検査モデル1008が、検査コード0005として書き出される。検査コード0005の書出し先の指定は、必ずしも変換ルール適用ステップS103の後である必要性は無く、検査コード0005の書出しよりも先であればよい。例えば検査コード0005の書出し先の指定がソースコード入力ステップS101と平行して行われる手順があり得る。 Subsequent to the conversion rule application step S103, in the inspection code output step S104, the inspection code writing unit 1301 writes the inspection model 1008 as the inspection code 0005. The designation of the writing destination of the inspection code 0005 does not necessarily have to be after the conversion rule applying step S103, and may be any earlier than the writing of the inspection code 0005. For example, there may be a procedure in which the designation of the writing destination of the inspection code 0005 is performed in parallel with the source code input step S101.
 次に、図7、図8A、図8Bを用いて、変換の手順をより詳細に説明する。図7に示すように、本発明では、モデル変換技術を利用し、段階的に変換するために、次のような処理を行う。 Next, the conversion procedure will be described in more detail with reference to FIGS. 7, 8A, and 8B. As shown in FIG. 7, in the present invention, the following processing is performed in order to perform conversion step by step using a model conversion technique.
 (1)ソースコード0001をこれと(ほぼ)等価な「実装モデル」1205へ変換 (1) Convert source code 0001 to (almost) equivalent “implementation model” 1205
 (2)「実装モデル」を特定のプログラミング言語に依存しない形式にて構造及び論理などのプログラム情報を表現する「汎化モデル」1206へ変換 (2) Convert "implementation model" into "generalization model" 1206 that expresses program information such as structure and logic in a format independent of a specific programming language
 すなわち、異なる複数の第1変換ルール1005-1~1005-nの少なくとも一つを用いて、「実装モデル」1205を特定のプログラミング言語に依存しない形式である中間形式の「汎化モデル」1206へ変換する。図7の例では、第1変換ルールとして、「“if文”→条件分岐」、「“switch文”→条件分岐」、「“while文”→“繰り返し”」、及び「“for文”→“繰り返し”」の少なくとも四つの異なる変換ルールが選択されている。 That is, by using at least one of a plurality of different first conversion rules 1005-1 to 1005-n, the “implementation model” 1205 is changed to the “generalization model” 1206 in an intermediate format which is a format independent of a specific programming language. Convert. In the example of FIG. 7, as the first conversion rule, ““ if statement ”→ conditional branch”, ““ switch statement ”→ conditional branch”, ““ while statement ”→“ repeat ””, and ““ for statement ”→ At least four different conversion rules “Repeat” are selected.
 (3)汎化モデル1206に対して、抽象化のための変換を実施
 すなわち、異なる複数の第2変換ルール1006-1~1006-nの少なくとも一つを用いて、前記中間形式の汎化モデル1206に対して抽象化処理を実行する。図7の例では、第2変換ルールとして、「データ読み込み→ランダム入力」、及び「データの抽象化」の少なくとも二つの異なる変換ルールが選択されている。
(3) Conversion for abstraction is performed on the generalization model 1206. That is, the generalization model of the intermediate format is used by using at least one of a plurality of different second conversion rules 1006-1 to 1006-n. An abstraction process is executed for 1206. In the example of FIG. 7, at least two different conversion rules of “data reading → random input” and “data abstraction” are selected as the second conversion rule.
 (4)汎化モデル1206を、「検査モデル」1008に変換し、コード生成(出力) (4) The generalization model 1206 is converted into an “inspection model” 1008 to generate a code (output)
 すなわち、異なる複数の第3変換ルール1007-1~1007-nの少なくとも一つを用いて、前記中間形式の汎化モデル1206から検査コードの生成に要する情報を有する検査モデル1008に変換する。図7の例では、第3変換ルールとして、第1変換ルールに対応した「“条件分岐”→“if”文」、及び「“繰り返し”→“do”文」の少なくとも二つの異なる変換ルールが選択されている。 That is, using at least one of a plurality of different third conversion rules 1007-1 to 1007-n, the generalized model 1206 in the intermediate format is converted into the inspection model 1008 having information necessary for generating the inspection code. In the example of FIG. 7, as the third conversion rule, there are at least two different conversion rules corresponding to the first conversion rule: ““ conditional branch ”→“ if ”sentence” and ““ repeat ”→“ do ”sentence”. Is selected.
 また、実装モデル1205、汎化モデル1206、及び検査モデル1008は、それぞれ構文を定義する「メタモデル」によりデータ構造及び意味論が定義される。 In addition, the implementation model 1205, the generalization model 1206, and the inspection model 1008 each have a data structure and semantics defined by a “meta model” that defines a syntax.
 このように、実装モデル1205から汎化モデル1206への変換に際しては、例えば、変換対象ソースコードの記述言語の文法が、繰り返し処理の記法として“for文” 及び“while文”を含む場合、使用者が“for文”を「繰り返し」へ変換するルールと、“While文”を「繰り返し」へ変換するルールとを、既に述べた変換ルール入力方法を用いて、第1変換ルールとして選択する。汎化モデル1206の抽象化の変換に際しては、使用者が検査水準(抽象化の度合い)を決定し、決定した検査水準を達成する変換ルールとして、例えば、外部データの読込みに関する命令及び一連の処理をランダムな入力へ変換するルールと、特定のデータ型をより抽象度の高い型へ変換するルールとを、既に述べた変換ルール入力方法を用いて、第2変換ルール1006として選択する。さらに、汎化モデル1206から検査モデル1008への変換に当たっては、例えば、モデルチェッカの入力言語の文法が、繰り返し処理の記法として“do文”をもつとき、使用者が「繰り返し」を“do文”へ変換するルールを、既に述べた変換ルール入力方法を用いて、第3変換ルール1007として選択する。変換ルールは、複数のソフトウェアにまたがって適用可能な汎用的なルールなど、繰り返し利用可能なものがデータベース化される。データベースに格納された変換ルールは、使用者による検索及びルール選択の判断材料として用いられるメタ情報として、ドメイン情報や検査水準(抽象化による検査への影響)の情報を有する。 As described above, when converting from the mounting model 1205 to the generalized model 1206, for example, when the grammar of the description language of the source code to be converted includes “for sentence” and “while sentence” as the notation of the iterative process, A person selects a rule for converting “for sentence” to “repetition” and a rule for converting “while sentence” to “repetition” as the first conversion rule using the conversion rule input method described above. When converting the abstraction of the generalization model 1206, the user determines the inspection level (degree of abstraction), and as a conversion rule for achieving the determined inspection level, for example, an instruction and a series of processing related to reading of external data Are selected as the second conversion rule 1006 by using the conversion rule input method described above, and the rule for converting a specific data type to a higher abstract type. Furthermore, when converting from the generalized model 1206 to the check model 1008, for example, when the grammar of the input language of the model checker has “do sentence” as a notation of repetition processing, the user sets “repetition” to “do sentence”. The rule to be converted to “” is selected as the third conversion rule 1007 using the conversion rule input method described above. As the conversion rules, those that can be used repeatedly, such as general-purpose rules that can be applied across a plurality of software, are stored in a database. The conversion rules stored in the database have domain information and information on inspection level (influence on inspection by abstraction) as meta information used as a judgment material for search and rule selection by the user.
 また、変換ルールの選択方法としては、次のようなものがある。 Also, there are the following methods for selecting conversion rules.
 (1)汎用的なルール:常に選択
 (2)特定のライブラリに依存したルール:使用ライブラリ、及び検査対象のドメイン(カテゴリ)を入力することで、まとめて選択
 (3)抽象化に対応したルール:(検査したい性質及び検査水準を入力して得た)変換ルール一覧から、利用者が選択、もしくは利用者自身が記述して入力、もしくは検査したい性質などから、自動生成。
(1) General-purpose rules: always selected (2) Rules dependent on a specific library: Selection by entering the library used and the domain (category) to be inspected (3) Rules corresponding to abstraction : Automatically generated from the list of conversion rules (obtained by inputting the property to be inspected and the inspection level), the property selected by the user, entered by the user himself / herself, or the property to be inspected.
 図8A、図8Bに、それぞれモデルの抽象化の一例を示す。モデルの抽象化により、状態数を削減することができる。しかし、抽象化によりモデルの性質に影響を与えることがある。例えば、検出された欠陥(反例)がもとのシステムに存在しない、及びもとのシステムに存在する欠陥を発見できない等である。一方で、性質に影響を与えない健全な抽象化は、状態数削減効果が小さい傾向がある。 8A and 8B show examples of model abstraction, respectively. The model abstraction can reduce the number of states. However, abstraction can affect the properties of the model. For example, the detected defect (counterexample) does not exist in the original system, and the defect present in the original system cannot be found. On the other hand, a sound abstraction that does not affect properties tends to have a small effect on the number of states.
 図9に、メタ・実装モデル1002の一例の一部を示し、図10にメタ・汎化モデル1003の一例の一部を示し、図11にメタ・検査モデル1004の一例の一部を示す。本実施例におけるメタ・実装モデル1002と、メタ・汎化モデル1003と、メタ・検査モデル1004とは、非特許文献2に開示される記法を用いて示されている。例えば、図9において、IfStatementクラスC101は、関係R101によりStatementクラスC102を継承することが示され、関係R102により、属性conditionとしてExpressionクラスC103を所有することが示され、関係R103により、属性bodyとしてStatementクラスC102の集合を所有することが示され、関係R104により属性elseBodyとしてStatementクラスC102の集合を所有することが示されている。また、例えば、図9において、IntegerConstantクラスC104は、整数値である属性valueを所有することが示され、関係R105により、ExpressionクラスC103を継承すること等が示されている。また、例えば、図9において、VariableReferenceクラスC105は、関係R106により、ExpressionクラスC103を継承することが示され、関係R107により、VariableDeclarationクラスC106を参照することが示されている。 9 shows a part of an example of the meta / implementation model 1002, FIG. 10 shows a part of an example of the meta / generalization model 1003, and FIG. 11 shows a part of an example of the meta / inspection model 1004. The meta / implementation model 1002, the meta / generalization model 1003, and the meta / inspection model 1004 in the present embodiment are shown using the notation disclosed in Non-Patent Document 2. For example, in FIG. 9, the IfStatement class C101 is shown to inherit the Statement class C102 by the relationship R101, and the relationship R102 shows that the Expression class C103 is owned as the attribute condition, and the relationship R103 shows that the attribute body It is shown that the set of Statement class C102 is owned, and the relationship R104 shows that the set of Statement class C102 is owned as attribute elseBody. Further, for example, in FIG. 9, the IntegerConstant class C104 is shown to possess an attribute value that is an integer value, and the relationship R105 indicates that the Expression class C103 is inherited. Further, for example, in FIG. 9, the VariableReference class C105 is shown to inherit the Expression class C103 by the relationship R106, and the relationship R107 indicates that the VariableDeclaration class C106 is referred to.
 メタ・実装モデル1002の各要素、及び、メタ・検査モデル1004の各要素には、それぞれ、実装プログラミング言語の言語要素、及び、検査用言語の言語要素に対応付く要素が含まれる。本実施例においては、実装プログラミング言語はC言語であり、検査用言語はPromela言語であるため、それぞれ、メタ・実装モデル1002はC言語の言語要素と対応付く要素を含み、メタ・検査モデル1004はPromela言語の言語要素と対応付く要素を含む。例えば、図9におけるIfStatementクラスC101は、C言語におけるIf文を表現し、IntegerConstantクラスC104は、C言語における整数型定数値を表現している。 Each element of the meta / implementation model 1002 and each element of the meta / inspection model 1004 include an element corresponding to the language element of the implementation programming language and the language element of the inspection language. In this embodiment, the implementation programming language is C language, and the inspection language is Promela language. Therefore, the meta / implementation model 1002 includes elements corresponding to C language elements, and the meta / inspection model 1004. Includes elements associated with language elements of the Promela language. For example, the IfStatement class C101 in FIG. 9 represents an If statement in C language, and the IntegerConstant class C104 represents an integer type constant value in C language.
 図10に示すメタ・汎化モデル1003には、メタ・実装モデル1002に含まれる要素と意味的に対応付く要素であるか、メタ・検査モデル1004に含まれる要素と意味的に対応付く要素である、物理要素が含まれる。本実施例におけるメタ・汎化モデル1003においては、物理要素は、図10において、PhysicalElementクラスC201を推移的に継承する要素として表現されている。例えば、StatementクラスC203及びSelectionStatementクラスC204が、物理要素の一例である。それぞれの物理要素は、メタ・実装モデル1002に含まれる要素、又はメタ・検査モデル1004に含まれる要素と、一対一で対応付く必要は無く、複数の要素の組合せで、等価な意味を持つ言語要素を表現できればよい。例えば、本実施例においては、メタ・実装モデル1002でIfStatementクラスC101として表現されるC言語のIf文は、メタ・汎化モデル1003でSelectionStatementクラスC204とSelectionItemクラスC205との組合せで表現される。 The meta / generalization model 1003 shown in FIG. 10 is an element that is semantically associated with an element included in the meta / implementation model 1002 or an element that is semantically associated with an element included in the meta / inspection model 1004. A physical element is included. In the meta / generalization model 1003 in this embodiment, the physical element is expressed as an element that inherits the PhysicalElement class C201 transitively in FIG. For example, the Statement class C203 and the SelectionStatement class C204 are examples of physical elements. Each physical element does not have to have a one-to-one correspondence with an element included in the meta / implementation model 1002 or an element included in the meta / inspection model 1004. It only needs to be able to express the element. For example, in this embodiment, a C language If statement expressed as an IfStatement class C101 in the meta / implementation model 1002 is expressed by a combination of the SelectionStatement class C204 and the SelectionItem class C205 in the meta / generalization model 1003.
 メタ・汎化モデル1003は、上述した物理要素の他に、ソースコードの性質、変換の目的、及び制約条件などに応じて、変換ルールによって対応付けられる要素を変更可能とする論理要素を含む。論理要素は、本実施例においては、図10における、LogicalElementクラスC202を推移的に継承する要素として表現される。 The meta / generalization model 1003 includes, in addition to the physical elements described above, logical elements that allow the elements associated with the conversion rules to be changed according to the nature of the source code, the purpose of the conversion, and the constraint conditions. In this embodiment, the logical element is expressed as an element that transitively inherits the LogicalElement class C202 in FIG.
 LogicalElementクラスC202は、AttiributeクラスC206の集合を所有する。AttributeクラスC206は、クラス及びメソッドなどに対して属性情報を付加する機能を備える。これによって、ある変換ルールは、ある物理要素を論理要素に変換することによって、変換後の論理要素に追加の属性情報を付加できる。また、付加された属性情報は異なる変換ルールによっても利用可能となる。 The LogicalElement class C202 owns a set of Attilibute class C206. The Attribute class C206 has a function of adding attribute information to classes and methods. Thus, a certain conversion rule can add additional attribute information to the converted logical element by converting a certain physical element into a logical element. Also, the added attribute information can be used by different conversion rules.
 また、LogicalElementクラスC202は、任意の物理要素を参照できるRelatedElementクラスC207の集合を所有する。これによって、変換ルールは、任意の要素に対する関連を、その関連の名前とともに論理要素に付加することができ、また、他の変換ルールは、その関連を利用することが可能となる。 In addition, the LogicalElement class C202 owns a set of RelatedElement class C207 that can refer to an arbitrary physical element. This allows a transformation rule to add a relationship to an arbitrary element to the logical element along with the name of that association, and other transformation rules can utilize the association.
 また、論理要素は、例えば、StatementクラスC203に対するLogical_StatementクラスC208のように、各物理要素に対して定義される。このため、変換ルールが、任意の物理要素を、当該物理要素に対して情報又は関連を付加した論理要素へ変換することが可能となる。また、すべての論理要素は、何らかの物理要素を継承していることから、ある変換ルールにおいて、ある物理要素が論理要素へ変換された後、異なる変換ルールにおいて、それが論理要素であることを意識せず、物理要素として扱うことも可能である。 Also, a logical element is defined for each physical element, for example, a Logical_Statement class C208 for a Statement class C203. For this reason, the conversion rule can convert an arbitrary physical element into a logical element obtained by adding information or a relation to the physical element. In addition, since all logical elements inherit some physical element, after a certain physical element is converted to a logical element in a certain conversion rule, it is conscious that it is a logical element in a different conversion rule. It can also be handled as a physical element.
 論理要素を利用する変換ルールには、例えば、下記(1)~(3)のような方法があり得る。 For example, the following conversion rules using logical elements can include the following methods (1) to (3).
 (1)あるパターンに一致する汎化モデルの物理要素を、ある構造を有する論理要素(又は、論理要素と物理要素との組み合わせ)へ変換する。 (1) A physical element of a generalization model that matches a certain pattern is converted into a logical element having a certain structure (or a combination of a logical element and a physical element).
 (2)あるパターンに一致する論理要素(又は、論理要素と物理要素との組み合わせ)を、異なる構造を有する論理要素(又は、論理要素と物理要素との組み合わせ)へ変換する。 (2) A logical element (or a combination of a logical element and a physical element) that matches a certain pattern is converted into a logical element (or a combination of a logical element and a physical element) having a different structure.
 (3)あるパターンに一致する論理要素(又は、論理要素と物理要素との組み合わせ)を、物理要素へ変換する。 (3) A logical element (or a combination of a logical element and a physical element) that matches a certain pattern is converted into a physical element.
 汎化モデル1206上で、論理要素を物理要素へ完全に変換してから、汎化モデル1206を検査モデル1008へ変換してもよい。汎化モデル1206の論理要素を検査モデル1008の要素へ変換可能な変換ルールを用い、論理要素を含む汎化モデル1206を直接検査モデル1008へ変換してもよい。また、本実施例の後述する第1の変換例~第5の変換例における論理要素は、乱数生成方法及び非決定的な値を選択する方法を表現したが、これに限らず、プログラミング言語の文法が直接表現可能な範囲を超える任意の要素を表現してもよい。論理要素によって表現される概念の例としては、例えば、ハードウェア操作など外部環境とのやり取りの抽象化、並びに、データ構造及びモジュールの抽象化などが挙げられる。 The generalization model 1206 may be converted into the inspection model 1008 after the logical elements are completely converted into physical elements on the generalization model 1206. The generalization model 1206 including a logical element may be directly converted into the inspection model 1008 using a conversion rule that can convert the logical element of the generalization model 1206 into the element of the inspection model 1008. In addition, the logical elements in the first to fifth conversion examples to be described later of the present embodiment express the random number generation method and the non-deterministic value selection method. Any element exceeding the range that can be directly expressed may be expressed. Examples of concepts expressed by logical elements include, for example, abstraction of exchanges with external environments such as hardware operations, abstraction of data structures and modules, and the like.
 また、各メタモデルは、図9~図11に示す限りではなく、変換対象となるプログラムを表現可能な任意の形式でよい。また、汎化モデル1206における論理要素に関しても、この限りではなく、変換ルールの記述に必要な、論理要素の種類を示す要素、論理要素、及び、他の要素(物理要素又は論理要素)との関連を示す要素、を表現可能な任意の記法でよい。また、論理要素は、特定の頻出する要素に関して、予め構造を定義してもよい。このような論理要素の定義の一例としては、最大値と最小値とを属性として有し、乱数生成を示す論理要素を、LogicalElementクラスC202を推移的に継承する新たなクラスの定義などがあり得る。乱数生成を示す論理要素は図16で詳細を説明する。 Further, each meta model is not limited to those shown in FIGS. 9 to 11 and may be in any format capable of expressing a program to be converted. In addition, the logical elements in the generalization model 1206 are not limited to this, and the elements indicating the types of logical elements, logical elements, and other elements (physical elements or logical elements) necessary for describing the conversion rules Any notation that can express the element indicating the relationship may be used. In addition, the logical element may define a structure in advance for a specific frequent element. As an example of the definition of such a logical element, there may be a definition of a new class that has a maximum value and a minimum value as attributes, and that logically indicates random number generation and inherits the LogicalElement class C202 transitively. . Details of the logic element indicating the random number generation will be described with reference to FIG.
 以降、図9に示すメタ・実装モデル1002、図10に示すメタ・汎化モデル1003、及び図11に示すメタ・検査モデル1004を用いた、ソースコード0001から検査コード0005への第1の変換例~第5の変換例を図12~図32に示す。 Thereafter, the first conversion from the source code 0001 to the inspection code 0005 using the meta / implementation model 1002 shown in FIG. 9, the meta / generalization model 1003 shown in FIG. 10, and the meta / inspection model 1004 shown in FIG. Examples to fifth conversion examples are shown in FIGS.
 ソースコード0001から検査コード0005への第1の変換例について図12~図17を用いて説明する。 A first conversion example from the source code 0001 to the inspection code 0005 will be described with reference to FIGS.
 図12は、C言語のソースコード0001の一例の説明図である。 FIG. 12 is an explanatory diagram of an example of the C language source code 0001.
 図12に示すソースコード0001の行001では、ランダムな整数値を生成する関数rand()の戻り値を50で割った余りに1が加算されることによって、1から50までのランダムな値が生成される。行002では、行001で生成したランダムな値を引数として関数do_something()が実行される。 In the line 001 of the source code 0001 shown in FIG. 12, a random value from 1 to 50 is generated by adding 1 to the remainder of dividing the return value of the function rand () that generates a random integer value by 50. Is done. In line 002, the function do_something () is executed with the random value generated in line 001 as an argument.
 図13は、Promela言語による検査コード0005の一例の説明図である。 FIG. 13 is an explanatory diagram of an example of the inspection code 0005 in the Promela language.
 図13に示す検査コード0005の行001では、整数型の変数valが定義される。行002では、1から50までの整数から変数valの値が選択される。行003では、行002で選択された変数valの値を引数として関数do_something()が実行される。 In line 001 of the inspection code 0005 shown in FIG. 13, an integer type variable val is defined. In line 002, the value of the variable val is selected from integers from 1 to 50. In line 003, the function do_something () is executed with the value of the variable val selected in line 002 as an argument.
 図14は、図12に示すソースコード0001の実装モデル1205の一例である。 FIG. 14 is an example of an implementation model 1205 of the source code 0001 shown in FIG.
 図14に示す実装モデル1205は、図9に示すメタ・実装モデル1002による定義を用いて表現される。例えば、図12に示すソースコード0001の行001では、変数valがint型で宣言されているため、当該宣言は、図14に示す実装モデル1205では、属性nameとして「val」を有し、属性typeとして「int」を有するVariableDeclaration要素O0101として表現される。 14 is expressed using the definition by the meta / implementation model 1002 shown in FIG. For example, in the line 001 of the source code 0001 shown in FIG. 12, since the variable val is declared as an int type, the declaration has “val” as the attribute name in the implementation model 1205 shown in FIG. It is expressed as a VariableDeclaration element O0101 having “int” as the type.
 また、図12に示すソースコード0001の行002における変数valの参照は、VariableDeclaration要素O0101とVariableReference要素O0102とが、declarationをラベルとして有するリンクL0101を介して接続されることによって、表現される。 Further, the reference of the variable val in the line 002 of the source code 0001 shown in FIG. 12 is expressed by connecting the VariableDeclaration element O0101 and the VariableReference element O0102 via the link L0101 having the declaration as a label.
 図14に示す実装モデル1205が、“for文”及び“while文”を「繰り返し」へ変換する図6に示す実装-汎化変換ルール1005(図7に示す第1変換ルール1005-1)によって汎化モデル1206へ変換された結果を図15に示す。図15は、図12に示すソースコード0001の抽象化された汎化モデル1206の説明図である。図12に示すソースコード0001は“for文”及び“while文”を含まないので、当該変換は実行されず、図15に示す汎化モデル1206は、図14に示す実装モデル1205と実質的に同一である。 14 implements the implementation-generalization conversion rule 1005 (first conversion rule 1005-1 shown in FIG. 7) that converts “for statement” and “while statement” into “repetition”. The result of conversion to the generalized model 1206 is shown in FIG. FIG. 15 is an explanatory diagram of the generalized model 1206 abstracted from the source code 0001 shown in FIG. Since the source code 0001 shown in FIG. 12 does not include “for statement” and “while statement”, the conversion is not executed, and the generalization model 1206 shown in FIG. 15 is substantially the same as the implementation model 1205 shown in FIG. Are the same.
 次に、図15に示す汎化モデル1206が、乱数生成処理を抽象化して論理要素に変換する図6に示す抽象化変換ルール1006(図7に示す第2変換ルール1006-1)によって変換された汎化モデル1206を図16に示す。図16は、図15に示す汎化モデル1206の抽象化結果である。 Next, the generalization model 1206 shown in FIG. 15 is converted by the abstraction conversion rule 1006 (second conversion rule 1006-1 shown in FIG. 7) shown in FIG. 6 which abstracts the random number generation processing and converts it into logical elements. The generalized model 1206 is shown in FIG. FIG. 16 shows the abstraction result of the generalization model 1206 shown in FIG.
 抽象化変換ルール1006による変換処理では、図15に示すBinaryOperation要素O0401、及び当該BinaryOperation要素O0401が推移的に所有する要素集合は、最小値1を示すAttribute要素O0702と最大値50を示すAttribute要素O0703とを所有する乱数生成式を意味する論理要素(Logical_Expression要素O0701)に変換される。 In the conversion process based on the abstraction conversion rule 1006, the BinaryOperation element O0401 shown in FIG. 15 and the element set owned by the BinaryOperation element O0401 transitively are an Attribute element O0702 indicating the minimum value 1 and an Attribute element O0703 indicating the maximum value 50. Is converted into a logical element (Logical_Expression element O0701) that means a random number generation expression that owns.
 図16に示す抽象化された汎化モデル1206が、図6に示す汎化-検査変換ルール1007(図7に示す第3変換ルール1007-1)によって検査モデル1008に変換された結果を図17に示す。図17は、図16に示す抽象化された汎化モデル1206から変換された検査モデル1008の説明図である。 The abstracted generalization model 1206 shown in FIG. 16 is converted into the inspection model 1008 by the generalization-inspection conversion rule 1007 (third conversion rule 1007-1 shown in FIG. 7) shown in FIG. Shown in FIG. 17 is an explanatory diagram of the inspection model 1008 converted from the abstracted generalized model 1206 shown in FIG.
 図16に示す論理要素であるLogical_Expression要素O0701と、最小値を表すAttribute要素O0702と、最大値を表すAttribute要素O0703との組合せは、Promela言語において非決定的な値の代入を行うselect文を表現するSelectStatement要素O0801と、最小値を意味するIntegerConstant要素O0802と、最大値を意味するIntegerConstant要素0O803との組合せに変換される。IntegerConstant要素O0802は、minをラベルとして有するリンクL0801を介してSelectStatement要素O0801に接続される。IntegerConstant要素O0803は、maxをラベルとして有するリンクL0802を介してSelectStatement要素O0801に接続される。 The combination of the Logical_Expression element O0701, which is the logical element shown in FIG. 16, the Attribute element O0702 representing the minimum value, and the Attribute element O0703 representing the maximum value represents a select statement that performs nondeterministic value substitution in the Promela language. It is converted into a combination of a SelectStatement element O0801, an IntegerConstant element O0802 meaning a minimum value, and an IntegerConstant element 0O803 meaning a maximum value. The IntegerConstant element O0802 is connected to the SelectStatement element O0801 via a link L0801 having min as a label. The IntegerConstant element O0803 is connected to the SelectStatement element O0801 via a link L0802 having max as a label.
 最後に、図17に示す検査モデル1008からコードが生成されることによって、図13に示すPromela言語による検査コード0005が生成される。 Finally, by generating a code from the inspection model 1008 shown in FIG. 17, the inspection code 0005 in the Promela language shown in FIG. 13 is generated.
 次に、図18に示すC言語のソースコード0001から図13に示すPromela言語による検査コード0005へ変換する第2の変換例、及び、図19に示すC言語のソースコード0001から図13に示すPromela言語による検査コード0005へ変換する第3の変換例について図18~図23を用いて説明する。図18及び図19はC言語のソースコード0001の一例の説明図である。 Next, a second example of conversion from the C language source code 0001 shown in FIG. 18 into the inspection code 0005 in the Promela language shown in FIG. 13 and the C language source code 0001 shown in FIG. 19 are shown in FIG. A third conversion example for conversion to the inspection code 0005 in the Promela language will be described with reference to FIGS. 18 and 19 are diagrams for explaining an example of C language source code 0001. FIG.
 図18及び図19に示すソースコード0001は、図12に示すソースコード0001と、ある関数do_something()を、1から50の任意の値を引数として実行するプログラムである点で同じである。しかし、図12、図18及び図19に示すソースコード0001では、それぞれ、乱数を生成する方法が異なる。 The source code 0001 shown in FIGS. 18 and 19 is the same as the source code 0001 shown in FIG. 12 in that it is a program that executes a certain function do_something () with an arbitrary value from 1 to 50 as an argument. However, the source code 0001 shown in FIGS. 12, 18 and 19 is different in the method of generating random numbers.
 図18に示すソースコード0001では、現在時刻を返すシステム関数time()を、擬似的な乱数発生関数とし、当該乱数発生関数の戻り値を50で割った余りに1を加えることによって、1から50のランダムな値が生成される。 In the source code 0001 shown in FIG. 18, the system function time () that returns the current time is set as a pseudo random number generation function, and 1 is added to the remainder obtained by dividing the return value of the random number generation function by 50. A random value of is generated.
 図19に示すソースコード0001では、行101から行107にて独自に定義した乱数生成関数my_rand()の戻り値を50で割った余りに1を加えることによって、1から50のランダムな値が生成される。ここで、行101から行107で定義される乱数発生関数my_rand()は、自身が生成する乱数の範囲の最大値(50)と最小値(1)を、引数として受け取り、乱数発生関数my_rand()は、最大値から最小値を減算して1を加えた値を除算値とし、ランダムな整数値を生成する関数rand()の戻り値を除算値で割った余りに最小値を加えることによって、1から50のランダムな値を生成する。なお、乱数発生関数my_rand()が生成する乱数の範囲は行0001で定義される。 In the source code 0001 shown in FIG. 19, a random value of 1 to 50 is generated by adding 1 to the remainder of dividing the return value of the random number generation function my_rand () uniquely defined in lines 101 to 107 by 50. Is done. Here, the random number generation function my_rand () defined in the lines 101 to 107 receives the maximum value (50) and the minimum value (1) of the range of random numbers generated by itself as arguments, and the random number generation function my_rand ( ) Is obtained by subtracting the minimum value from the maximum value and adding 1 as the division value, and adding the minimum value to the remainder of dividing the return value of the function rand () that generates a random integer value by the division value. Generate random values from 1 to 50. Note that the range of random numbers generated by the random number generation function my_rand () is defined in line 0001.
 図18及び図19に示すソースコード0001が示すプログラムは、それぞれ、図20及び図21に示す実装モデル1205で表現される。 The program indicated by the source code 0001 shown in FIG. 18 and FIG. 19 is represented by the mounting model 1205 shown in FIG. 20 and FIG.
 第1の変換例と同じ実装-汎化変換ルール1005によって、図20及び図21に示す実装モデル1205は、図22及び図23に示す汎化モデル1206に変換される。 The implementation model 1205 shown in FIGS. 20 and 21 is converted into the generalization model 1206 shown in FIGS. 22 and 23 by the same implementation-generalization conversion rule 1005 as in the first conversion example.
 図22に示す汎化モデル1206は、抽象化変換ルール1006によって抽象化され、図16に示す汎化モデル1206に変換される。この抽象化に用いる抽象化変換ルール1006は、第1の変換例で用いた抽象化変換ルール1006を、関数time()を関数rand()と同じく乱数発生関数として扱うように変換したものである。つまり、この抽象化変換ルール1006によって、図22に示す汎化モデル1206のBinaryOperation要素O0501、及び当該BinaryOperation要素O0501が推移的に所有する要素集合は、図16に示す論理要素(Logical_Expression要素O0701)に変換される。 22 is abstracted by the abstraction conversion rule 1006 and converted into the generalization model 1206 shown in FIG. The abstraction conversion rule 1006 used for the abstraction is obtained by converting the abstraction conversion rule 1006 used in the first conversion example so that the function time () is treated as a random number generation function like the function rand (). . That is, according to this abstraction conversion rule 1006, the BinaryOperation element O0501 of the generalization model 1206 shown in FIG. 22 and the element set that the BinaryOperation element O0501 has transitively are assigned to the logical element (Logical_Expression element O0701) shown in FIG. Converted.
 同様に、図23に示す汎化モデル1206は、抽象化変換ルール1006によって抽象化され、図16に示す汎化モデル1206に変換される。この抽象化に用いる抽象化変換ルール1006は、第1の変換例で用いた抽象化変換ルール1006を、関数my_rand()を、第1引数を最小値、第2引数を最大値として、乱数を発生する関数として扱うように変更したものである。つまり、この抽象化変換ルール1006によって、図23に示す汎化モデル1206のFunctionCall要素O0601、及び当該FunctionCall要素O0601が推移的に所有する要素集合は、図16に示す論理要素(Logical_Expression要素O0701)に変換される。 Similarly, the generalization model 1206 shown in FIG. 23 is abstracted by the abstraction conversion rule 1006 and converted into the generalization model 1206 shown in FIG. The abstraction conversion rule 1006 used for the abstraction is the same as the abstraction conversion rule 1006 used in the first conversion example, with the function my_rand (), the first argument as the minimum value, the second argument as the maximum value, and a random number. It has been changed to handle it as a function that occurs. That is, according to this abstraction conversion rule 1006, the FunctionCall element O0601 of the generalization model 1206 shown in FIG. 23 and the element set that the FunctionCall element O0601 transitively possesses are logical elements (Logical_Expression elements O0701) shown in FIG. Converted.
 図16に示す汎化モデル1206は、第1の変換例で用いた汎化-検査変換ルール1007と同じ変換ルールによって、図17に示す検査モデル1207に変換され、最終的には図13にPromela言語による検査コード0005が出力される。 The generalization model 1206 shown in FIG. 16 is converted into the inspection model 1207 shown in FIG. 17 by the same conversion rule as the generalization-inspection conversion rule 1007 used in the first conversion example. A test code 0005 in language is output.
 第1の変換例~第3の変換例では、抽象化変換ルール1006を変更することによって、図12、図18及び図19に示す異なるソースコード0001から同一の図13に示す検査コード0005へ変換するものである。 In the first to third conversion examples, the abstraction conversion rule 1006 is changed to convert the different source code 0001 shown in FIGS. 12, 18 and 19 to the same inspection code 0005 shown in FIG. To do.
 本実施例では、抽象化変換ルール1006を用いて汎化モデル1206を抽象化する処理で、所定の条件に適合する要素を論理要素に変換する。これによって、第2の変換例及び第3の変換例で説明したように、入力されたソースコード0001が変更されたとしても、管理者は、すべての変換ルール1005~1007を変更せずとも、抽象化変換ルール1006を変更するのみで、当該ソースコード0001が変更されて変更前と同じ検査コード0005を出力することができる。 In the present embodiment, an element that meets a predetermined condition is converted into a logical element in the process of abstracting the generalization model 1206 using the abstraction conversion rule 1006. Thus, as described in the second conversion example and the third conversion example, even if the input source code 0001 is changed, the administrator does not change all the conversion rules 1005 to 1007. By simply changing the abstraction conversion rule 1006, the source code 0001 can be changed and the same inspection code 0005 as before the change can be output.
 第4の変換例では、図12に示すソースコード0001から図13に示す検査コード0005と異なる図24に示す検査コード0005への変換例である。 The fourth conversion example is a conversion example from the source code 0001 shown in FIG. 12 to the inspection code 0005 shown in FIG. 24 different from the inspection code 0005 shown in FIG.
 図24に示す検査コード0005について説明する。図13に示す検査コード0005では、行002に示すようにselect文を利用している。select文は、非特許文献1に開示された検査ツールであるSPINのバージョン6以降で追加された構文であり、検査ツールがバージョン5以前のSPINである場合、select文を利用できない。このため、検査ツールがバージョン5以前のSPINである場合、図24の行101から行116に示すように、非決定的な実行を表現する構文を検査コード0005に定義することによって、select文と等価な処理を表現する必要がある。 The inspection code 0005 shown in FIG. 24 will be described. In the inspection code 0005 shown in FIG. 13, a select statement is used as shown in the line 002. The select statement is a syntax added in SPIN version 6 or later, which is the inspection tool disclosed in Non-Patent Document 1, and if the inspection tool is a SPIN version 5 or earlier, the select statement cannot be used. Therefore, when the inspection tool is a version 5 or earlier SPIN, as shown in the line 101 to the line 116 in FIG. 24, by defining a syntax expressing non-deterministic execution in the inspection code 0005, it is equivalent to the select statement. It is necessary to express a simple process.
 本変換例において、図12に示すソースコード0001を図24に示す検査コード0005へ変換するためには、図12に示すソースコード0001を図14に示す実装モデル1205で表現し、続いて、図15で示される汎化モデル1206へ変換し、当該汎化モデル1206を抽象化して図16に示す汎化モデル1206に変換する点までは、第1の変換例と同じである。図16に示す汎化モデル1206を検査モデル1008に変換する汎化-検査変換ルール1007が第1の変換例と異なる。 In this conversion example, in order to convert the source code 0001 shown in FIG. 12 into the inspection code 0005 shown in FIG. 24, the source code 0001 shown in FIG. 12 is expressed by the mounting model 1205 shown in FIG. 15 is the same as the first conversion example, up to conversion to the generalization model 1206 shown in FIG. 15, abstracting the generalization model 1206, and converting it into the generalization model 1206 shown in FIG. A generalization-inspection conversion rule 1007 for converting the generalization model 1206 shown in FIG. 16 into an inspection model 1008 is different from the first conversion example.
 具体的には、第4の変換例の汎化-検査変換ルール1007では、図16に示す抽象化された汎化モデル1206のnameとして「random value genaration」を有するLogigal_Expression要素O0701の変換先の要素が変更される。この汎化-検査変換ルール1007によって、図16に示す汎化モデル1206は図25に示す検査モデル1008に変換される。 Specifically, in the generalization-check conversion rule 1007 of the fourth conversion example, the conversion destination element of the Logical_Expression element O0701 having “random value genaration” as the name of the abstracted generalization model 1206 shown in FIG. Is changed. With this generalization-inspection conversion rule 1007, the generalization model 1206 shown in FIG. 16 is converted into an inspection model 1008 shown in FIG.
 本変換例で用いる汎化-検査変換ルール1007では、図16に示す抽象化された汎化モデル1206のLogical_Expression要素O0701と、最小値を示すAttribute要素O0702と、最大値を表すAttribute要素O0703との組合せは、図25に示す検査モデル1008の要素O0901~0904の組合せに変換される。 In the generalization-inspection conversion rule 1007 used in this conversion example, the logical_expression element O0701 of the abstracted generalization model 1206 shown in FIG. 16, the attribute element O0702 indicating the minimum value, and the attribute element O0703 indicating the maximum value are included. The combination is converted into a combination of elements O0901 to 0904 of the inspection model 1008 shown in FIG.
 具体的には、図25に示す検査モデル1008のInlineFunctionCall要素O0905は、declarationのラベルを有するリンクL0901によって参照するInlineFunctionDeclaration要素O0901と、引数を示すargumentのラベルを有するリンクL0902によって参照するVariableReference要素O0902と、argumentのラベルを有するリンクL0903によって参照するIntegerConstant要素O0903と、argumentのラベルを有するリンクL0904によって参照するIntegerConstant要素O0904と、をこの順で所有する。なお、図25では、InlineFunctionDeclaration要素O0901の宣言内部は省略されているが、InlineFunctionDeclaration要素O0901は、第1引数に変数をとり、第2引数に最小値をとり、第3引数に最大値をとり、非決定的な選択を実現するプログラム構造を所有するように宣言される。VariableReference要素O0902は、値の代入先となる変数を定義する。IntegerConstant要素O0903は最小値となる。IntegerConstant要素O0904は最大値となる。 Specifically, an InlineFunctionCall element O0905 of the inspection model 1008 illustrated in FIG. 25 includes an InlineFunctionDeclaration element O0901 referred to by a link L0901 having a declaration label, and a VariableReference element O0902 referred to by a link L0902 having an argument label indicating an argument. , An IntegerConstant element O0903 referred to by a link L0903 having an argument label, and an IntegerConstant element O0904 referred to by a link L0904 having an argument label are owned in this order. In FIG. 25, the inside of the declaration of the InlineFunctionDeclaration element O0901 is omitted, but the InlineFunctionDeclaration element O0901 takes a variable as the first argument, a minimum value as the second argument, and a maximum value as the third argument. Declared to have a program structure that implements a non-deterministic choice. A VariableReference element O0902 defines a variable to which a value is assigned. The IntegerConstant element O0903 is the minimum value. The IntegerConstant element O0904 is the maximum value.
 なお、図25に示す検査モデル1008から図24に示す検査コード0005が取得できる。 Note that the inspection code 0005 shown in FIG. 24 can be acquired from the inspection model 1008 shown in FIG.
 以上のように、抽象化変換ルール1006を用いて汎化モデル1206を抽象化する処理で、所定の条件に適合する要素を論理要素に変換する。これによって、出力する検査コード0005の変更を管理者が所望する場合であっても、すべての変換ルール1005~1007を変更する必要はなく、第1の変換例の汎化-検査変換ルール1007のみを変更することによって、所望の検査コードを出力できる。したがって、バージョン5以前のSPINである検査ツールを使用する場合には、第1の変換例の汎化-検査変換ルール1007のみを変更するだけで、バージョン5以前のSPINに対応させることができる
 第2の変換例で用いた変換ルールのうち汎化-検査変換ルール1007を第4の変換例で用いた汎化-検査変換ルール1007に変更すれば、図18に示すソースコード0001を図24に示す検査コード0005に変換することも可能である。また、同様に、第3の変換例で用いた変換ルールのうち汎化-検査変換ルール1007を第4の変換例で用いた汎化-検査変換ルール1007に変更すれば、図19に示すソースコード0001を図24に示す検査コード0005に変換することも可能である。
As described above, in the process of abstracting the generalization model 1206 using the abstraction conversion rule 1006, an element that meets a predetermined condition is converted into a logical element. As a result, even if the administrator desires to change the inspection code 0005 to be output, it is not necessary to change all the conversion rules 1005 to 1007, only the generalization-inspection conversion rule 1007 of the first conversion example. By changing, a desired inspection code can be output. Therefore, when using an inspection tool that is an SPIN of version 5 or earlier, it is possible to support an SPIN of version 5 or earlier by changing only the generalization-inspection conversion rule 1007 of the first conversion example. If the generalization-inspection conversion rule 1007 in the conversion rules used in the second conversion example is changed to the generalization-inspection conversion rule 1007 used in the fourth conversion example, the source code 0001 shown in FIG. It is also possible to convert into the inspection code 0005 shown. Similarly, if the generalization-check conversion rule 1007 in the conversion rules used in the third conversion example is changed to the generalization-check conversion rule 1007 used in the fourth conversion example, the source shown in FIG. It is also possible to convert the code 0001 into the inspection code 0005 shown in FIG.
 次に、汎化モデル1206に対する抽象化処理が複数回実行され、ある論理要素から異なる論理要素へ変換される第5の変換例について図26~図32を用いて説明する。第5の変換例では、図26に示すC言語によるソースコード0001を図27に示すPromela言語による検査コード0005へ変換する。 Next, a fifth conversion example in which the abstraction process for the generalization model 1206 is executed a plurality of times and converted from a certain logical element to a different logical element will be described with reference to FIGS. In the fifth conversion example, the source code 0001 in the C language shown in FIG. 26 is converted into the inspection code 0005 in the Promela language shown in FIG.
 図26に示すソースコード0001では、乱数を生成するrand()関数の戻り値を2で割った余りが0である場合にはdo_something1()関数が実行され、余りが0以外である場合にはdo_something2()関数が実行される。換言すれば、図26に示すソースコード0001は、do_something1()関数又はdo_something2()関数がランダムに選択され、選択された関数が実行されるプログラムを示す。 In the source code 0001 shown in FIG. 26, the do_something1 () function is executed when the remainder obtained by dividing the return value of the rand () function that generates a random number by 2 is 0, and when the remainder is other than 0, The do_something2 () function is executed. In other words, the source code 0001 illustrated in FIG. 26 indicates a program in which the do_something1 () function or the do_something2 () function is selected at random and the selected function is executed.
 図26に示すソースコード0001は、図28に示す実装モデル1205によって表現される。また、図28に示す実装モデル1205は、実装-汎化変換ルール1005によって、図29に示す汎化モデル1206に変換される。 The source code 0001 shown in FIG. 26 is expressed by a mounting model 1205 shown in FIG. Also, the mounting model 1205 shown in FIG. 28 is converted into a generalization model 1206 shown in FIG. 29 by the mounting-generalization conversion rule 1005.
 次に、図29に示す汎化モデル1206は、第1の変換例と同じ抽象化変換ルール1006によって抽象化され、図30に示す汎化モデル1206に変換される。この変換において、図30に示す汎化モデル1206における、rand関数の呼出し及びrand関数の戻り値を2で割った余りの算出に対応する、図29に示すBinaryOperation要素O1101、FunctionCall要素O1102、FunctionDeclaration要素O1103、及びIntegerConstant要素1104の組合せは、図30に示す汎化モデル1206における、Logical_Expression要素O1201、Attribute要素O1202、及びAttribute要素O1203の組合せに変換される。 Next, the generalization model 1206 shown in FIG. 29 is abstracted by the same abstraction conversion rule 1006 as in the first conversion example, and converted into the generalization model 1206 shown in FIG. In this conversion, the BinaryOperation element O1101, FunctionCall element O1102, and FunctionDeclaration element shown in FIG. 29 corresponding to the call of the rand function and the calculation of the remainder obtained by dividing the return value of the rand function by 2 in the generalization model 1206 shown in FIG. A combination of O1103 and IntegerConstant element 1104 is converted into a combination of Logical_Expression element O1201, Attribute element O1202, and Attribute element O1203 in generalization model 1206 shown in FIG.
 さらに、図30に示す汎化モデル1206は、図30に示す汎化モデル1206への変換に用いた抽象化変換ルール1006と異なる抽象化変換ルール1006によって、図31に示す汎化モデル1206に変換される。この抽象化変換ルール1006は、条件式に用いられる変数に乱数値が代入される選択的実行文を非決定的な選択的実行文に変換するものである。上述した選択的実行文は、換言すれば、二つの選択肢のうち一つ選択肢がランダムに選択される選択的実行文を示す論理要素に変換される。 Further, the generalization model 1206 shown in FIG. 30 is converted into the generalization model 1206 shown in FIG. 31 by an abstraction conversion rule 1006 different from the abstraction conversion rule 1006 used for conversion to the generalization model 1206 shown in FIG. Is done. The abstract conversion rule 1006 converts a selective executable statement in which a random value is substituted into a variable used in a conditional expression into a non-deterministic selective executable statement. In other words, the above-mentioned selective executable statement is converted into a logical element indicating a selective executable statement in which one of the two options is randomly selected.
 具体的には、図30に示す汎化モデル1206のSelectionStatement要素O1204が図31に示す汎化モデル1206のLogical_SelectionStatement要素O1301に変換される。この理由について以下に説明する。 Specifically, the SelectionStatement element O1204 of the generalization model 1206 shown in FIG. 30 is converted into the Logical_SelectionStatement element O1301 of the generalization model 1206 shown in FIG. The reason for this will be described below.
 図30に示す汎化モデル1206のVariableReference要素O1206は、name属性の値が「random value generation」であるLogical_Expression要素O1201が代入される変数を表す。また、当該VariableReference要素O1206は、リンクL1201を通じて推移的にSelectionItem要素O1205に接続され、当該SelectionItem要素O1205がSelectionStatement要素O1204に所有される。このため、SelectionStatement要素O1204は、条件式に用いられる変数に乱数値が代入される選択実行文に一致するので、非決定的な選択的実行文を表現する論理要素であるLogical_SelectionStatement要素O1301に変換される。 30. The VariableReference element O1206 of the generalization model 1206 shown in FIG. 30 represents a variable to which the Logical_Expression element O1201 whose name attribute value is “random value generation” is substituted. The VariableReference element O1206 is transitively connected to the SelectionItem element O1205 through the link L1201, and the SelectionItem element O1205 is owned by the SelectionStatement element O1204. For this reason, since the SelectionStatement element O1204 matches a selection execution statement in which a random number value is substituted into a variable used in the conditional expression, the SelectionStatement element O1204 is converted into a Logical_SelectionStatement element O1301 that is a logical element expressing a nondeterministic selective execution statement. .
 また、図30に示す汎化モデル1206におけるSelectionItem要素O1205からconditionラベルを有するリンクL1201で推移的に接続される要素は、do_something1()関数又はdo_something2()関数を選択するために、乱数を生成し、生成した乱数を2で割った余りが0であるか否かを判定する要素である。図31に示す汎化モデル1206では、非決定的な選択的実行文を表現するLogical_SelectionStatement要素O1301が定義されたため、図30に示す汎化モデル1206の上述した要素は不要となる。このため、これらの要素は削除される。 In addition, an element that is transitively connected by the link L1201 having the condition label from the SelectionItem element O1205 in the generalization model 1206 shown in FIG. 30 generates a random number in order to select the do_something1 () function or the do_something2 () function. This is an element for determining whether or not the remainder obtained by dividing the generated random number by 2 is 0. In the generalization model 1206 shown in FIG. 31, since the Logical_SelectionStatement element O1301 expressing a nondeterministic selective execution statement is defined, the above-described elements of the generalization model 1206 shown in FIG. 30 are not necessary. For this reason, these elements are deleted.
 以上によって、本変換例では、抽象化処理が複数回実行され、1回目の抽象化処理で変換された論理要素であるLogical_Expression要素O1201を含むSlectionStatement要素O1204は、2回目の抽象化処理で、論理要素であるLogical_SelectionStatement要素O1301に変換される。 As described above, in this conversion example, the Abstraction process is executed a plurality of times, and the SectionStatement element O1204 including the Logical_Expression element O1201 that is the logical element converted by the first abstraction process is the second abstraction process. It is converted into a Logical_SelectionStatement element O1301 which is an element.
 そして、図31に示す汎化モデル1206は、汎化-検査変換ルール1007によって、図32に示す検査モデル1008に変換され、図27に示す検査コード0005が出力される。 31 is converted into an inspection model 1008 shown in FIG. 32 by the generalization-inspection conversion rule 1007, and an inspection code 0005 shown in FIG. 27 is output.
 以上のように、第5の変換例では、抽象化処理が複数回実行され、ある抽象化処理で変換された論理要素を他の抽象化処理でさらに論理要素に変換するので、より単純化された検査コードを出力でき、検査すべき状態数が膨大な分量となる状態爆発に至ることを防止できる。 As described above, in the fifth conversion example, the abstraction process is executed a plurality of times, and a logical element converted in one abstraction process is further converted into a logical element in another abstraction process. The inspection code can be output, and it is possible to prevent the explosion of the state where the number of states to be inspected becomes a huge amount.
 第5の変換例は、図26に示すソースコード0001と異なる乱数生成方法を用いるソースコード0001に変更した場合であっても、第1の変換例~第4の変換例と同じく、変更後の乱数生成方法に対応する変換ルールのみを変更すれば、他の変換ルールを変換しなくても、変更後のソースコード0001を所望の検査コード0005に変換できる。 Even if the fifth conversion example is changed to the source code 0001 using a different random number generation method from the source code 0001 shown in FIG. 26, the changed conversion example is the same as the first to fourth conversion examples. If only the conversion rule corresponding to the random number generation method is changed, the changed source code 0001 can be converted into the desired inspection code 0005 without converting other conversion rules.
 本実施例によれば、細粒度に分割された複数の変換ルールを入力するインタフェースを所有することによって、利用者による抽象化の水準の変更は、変換ルールを入力する操作により容易に実現される。すなわち、複数の細粒度の変換ルールを利用者が入力インタフェースにより選択できるため、図8A、図8Bに示したような抽象化の水準を、状況に応じて利用者が容易に選定、変更することが可能となる。 According to this embodiment, by possessing an interface for inputting a plurality of conversion rules divided into fine granularities, a change in the level of abstraction by a user can be easily realized by an operation for inputting the conversion rules. . That is, since the user can select a plurality of fine-grained conversion rules through the input interface, the user can easily select and change the level of abstraction as shown in FIGS. 8A and 8B according to the situation. Is possible.
 ソースコード変換方法は、複数の変換ルールを用いて検査対象のソースコードをモデルチェッカの入力言語で記述された検査コードへ変換する手順を有し、前記変換ルールは、実装-汎化変換ルールと、抽象化変換ルールと、汎化-検査変換ルールと、に分類され、変換が段階的に行われる。これにより、検査対象のソースコードの設計変更に追従する際には、複数の変換ルールの中の変更に関連する変換ルールのみを変更すればよく、変更が最小限にとどめられる。加えて、実装モデルと、汎化モデルと、検査モデルとをそれぞれメタモデルで定義し、制約を加えることにより、変換ルールによる変換結果が不正でないことを検証可能となる。これにより、検査対象のソースコードを検査コードへ抽象化しながら変換する一連の処理を、細粒度の変換ルールを組み合わせることで実現することによって生じる、変換ルールの検証コストの増大を防ぐことが出来る。 The source code conversion method includes a procedure for converting a source code to be inspected into an inspection code described in an input language of a model checker using a plurality of conversion rules, and the conversion rule includes an implementation-generalization conversion rule and Are classified into abstract conversion rules and generalization-check conversion rules, and conversion is performed in stages. Accordingly, when following the design change of the source code to be inspected, only the conversion rule related to the change among the plurality of conversion rules may be changed, and the change can be minimized. In addition, the implementation model, the generalization model, and the inspection model are each defined in the meta model, and by adding constraints, it is possible to verify that the conversion result by the conversion rule is not illegal. Accordingly, it is possible to prevent an increase in the verification cost of the conversion rule, which is caused by realizing a series of processes for converting the source code to be inspected while abstracting it into the inspection code by combining the fine-grained conversion rules.
 また、細粒度に分割された複数の変換ルールを入力するインタフェースを所有することによって、利用者による抽象化の水準の変更は、検査したい性質、検査水準に応じて、利用者が変換ルールを選択・入力する操作で容易に実現される。これにより、抽象化の水準の変更が困難であるという課題が解決される。例えば、繰り返し実行時のみに発生する特定の不具合がある場合、その繰返しを除去することで、特定の不具合の検出はできなくなるものの、その繰返しを発生原因に含まない不具合の検出は可能であるままに、大幅に状態数を削減できる。 In addition, by possessing an interface for inputting multiple conversion rules divided into fine granularities, users can select the conversion rule according to the property to be inspected and the inspection level when changing the level of abstraction.・ Easily realized by input operation. This solves the problem that it is difficult to change the level of abstraction. For example, if there is a specific defect that occurs only during repeated execution, it is not possible to detect the specific defect by removing the repetition, but it is still possible to detect a defect that does not include the cause of the repetition. In addition, the number of states can be greatly reduced.
 さらに、モデルの変換ルールをデータベースに蓄積・再利用することで、検査対象ソースコードの設計変更や、別ソフトウェアへの応用に、低コストで対応可能になる。 Furthermore, by storing and reusing model conversion rules in the database, it becomes possible to respond to design changes of inspection source code and application to other software at low cost.
 なお、異なる検査ツールにて検査するために、検査ツールの形式で出力する際には、メタ・検査モデルと、汎化-検査変換ルールのみを作成すればよく、作成部分が最小限に留められる。これによって、異なるモデルチェッカにて検査する際のコストを低減できる。 In order to inspect with different inspection tools, when outputting in the inspection tool format, only the meta / inspection model and generalization-inspection conversion rules need to be created, and the creation part is kept to a minimum. . This can reduce the cost when inspecting with different model checkers.
 また、汎化モデルを、検査モデルに変換するために用いる変換ルールにおいて、汎化モデルを直接検査モデルに変換する、又は、汎化モデル上にて物理要素間で変換を行う代わりに、いったん、汎化モデルにおいて論理要素への変換を行った上で、検査モデルへ変換することによって、変換ルールの共通化が可能となる。 In addition, in the conversion rule used to convert the generalized model into the inspection model, instead of converting the generalized model directly into the inspection model or converting between physical elements on the generalization model, A conversion rule can be shared by converting to a logical element in the generalization model and then converting to a check model.
 (第2の実施例)
 図33によって、本発明の第2の実施例のソースコード変換装置及び変換処理方法を説明する。この実施例においては、図33に示す検査コード出力ステップS104に続き、変換ルール入力ステップS102へ進むことで、既に入力されたソースコード0001を、繰り返し、異なる変換ルール集合0002を用いて、変換する手順をとってもよい。また、ある実施形態においては、検査コード出力ステップS104に続き、変換ルール入力ステップS102へ進み、既に入力された変換ルール集合0002の全て又は一部と、新たに変換ルール入力ステップS102で入力された変換ルール集合0002とをあわせて、変換ルール集合0002として用いてもよい。
(Second embodiment)
The source code conversion apparatus and conversion processing method according to the second embodiment of the present invention will be described with reference to FIG. In this embodiment, following the inspection code output step S104 shown in FIG. 33, the process proceeds to the conversion rule input step S102, whereby the input source code 0001 is repeatedly converted using a different conversion rule set 0002. Procedures may be taken. Further, in an embodiment, following the inspection code output step S104, the process proceeds to the conversion rule input step S102, and all or a part of the already input conversion rule set 0002 and newly input in the conversion rule input step S102. A combination with the conversion rule set 0002 may be used as the conversion rule set 0002.
 本実施例によれば、細粒度に分割された複数の変換ルールを入力するインタフェースを所有し、入力されたソースコードと、変換に用いた変換ルール集合を保存し、前記ソースコードを前記変換ルール集合の一部を入れ替えて変換できることによって、異なる抽象度の複数の検査コードを生成する場合などの、同一のソースコードを繰り返し変換する手間を削減できる。 According to this embodiment, the interface for inputting a plurality of conversion rules divided into fine granularities is owned, the input source code and the conversion rule set used for conversion are stored, and the source code is converted into the conversion rule. Since conversion can be performed by exchanging a part of the set, it is possible to reduce the trouble of repeatedly converting the same source code, such as when generating a plurality of inspection codes having different abstractions.
 (第3の実施例)
 図34を用いて、本発明の第3の実施例のソースコード変換装置及び変換処理方法を説明する。本実施例では、ソースコードから検査コードを得る過程において生成される実装モデルと、汎化モデルと、検査モデルとを制約条件に基づいて検証するステップを有する。
(Third embodiment)
A source code conversion apparatus and conversion processing method according to the third embodiment of the present invention will be described with reference to FIG. In the present embodiment, there is a step of verifying the mounting model generated in the process of obtaining the inspection code from the source code, the generalization model, and the inspection model based on the constraint condition.
 図34を用いて、変換の妥当性の検証手順を詳細に説明する。図34では、メタモデルと変換ルールは省略する。 34, the procedure for verifying the validity of the conversion will be described in detail. In FIG. 34, the metamodel and conversion rules are omitted.
 特定の変換ルールが、その変換に際して対象モデルについての前提条件をもつ場合、変換対象のモデルにおいて、前記特定の変換ルールの前提条件が、他の変換ルールの適用によって満たされなくなることがあり得る。このように前提条件が満たされないときに前記特定の変換ルールによってモデル変換を実施すると、変換結果のモデルが不正な状態になり得る。また、単に変換ルールに誤りが含まれるときも、変換結果のモデルが不正な状態になり得る。 When a specific conversion rule has a precondition for the target model at the time of conversion, the precondition of the specific conversion rule may not be satisfied by application of another conversion rule in the conversion target model. As described above, if model conversion is performed according to the specific conversion rule when the precondition is not satisfied, the model of the conversion result may be in an invalid state. In addition, even when an error is included in the conversion rule, the conversion result model may be in an invalid state.
 本実施例では、ソフトウェアのソースコード0001を入力するステップと、ソースコード情報1001を有する実装モデル1205を特定のプログラミング言語に依存しない形式である中間形式(汎化モデル1206)へ変換する第1変換ルールを入力するステップと、中間形式に対して抽象化処理を行う第2変換ルールを入力するステップと、中間形式から検査コードの情報をもつ検査モデル1008に変換する第3変換ルールを入力するステップと、ソフトウェアのソースコード0001を解析して実装モデル1205へ変換するステップと、前記第1変換ルールを用いてソフトウェアのソースコード0001を前記中間形式の汎化モデル1206へ変換するステップと、第2変換ルールを用いて、前記中間形式で表現されたソフトウェアを抽象化するステップと、第3変換ルールを用いて、前記中間形式を検査モデル1008に変換するステップと、検査モデル1008を用いて検証ツールの入力言語で記述された検査コード0005を生成するステップと、前記各段階のモデルを各々第1の制約条件0300、第2の制約条件0301、及び第3の制約条件0302に基づいて検証する充足性検証ステップと、を有する。 In this embodiment, the step of inputting the source code 0001 of the software and the first conversion for converting the mounting model 1205 having the source code information 1001 into an intermediate format (generalization model 1206) that is a format independent of a specific programming language. A step of inputting a rule, a step of inputting a second conversion rule for performing an abstraction process on the intermediate format, and a step of inputting a third conversion rule for converting from the intermediate format to an inspection model 1008 having inspection code information Analyzing the software source code 0001 and converting it into an implementation model 1205; converting the software source code 0001 into the intermediate generalized model 1206 using the first conversion rule; Software expressed in the intermediate format using conversion rules Abstracting the wire, converting the intermediate format into the inspection model 1008 using the third conversion rule, and generating the inspection code 0005 described in the input language of the verification tool using the inspection model 1008 And a sufficiency verification step of verifying the model at each stage based on the first constraint condition 0300, the second constraint condition 0301, and the third constraint condition 0302, respectively.
 前記各段階のモデルの、各々第1の制約条件0300、第2の制約条件0301、及び第3の制約条件0302に基づく充足性検証は、例えば、非特許文献2に開示されるMOFでメタモデルを記述することによって、又は非特許文献4に開示されるOCLによりメタモデルにより定義されるモデルに対する制約条件を記述することによって、実現される。 The sufficiency verification based on the first constraint condition 0300, the second constraint condition 0301, and the third constraint condition 0302 of the model at each stage is performed by, for example, a meta model using MOF disclosed in Non-Patent Document 2. Or by describing constraints on the model defined by the meta model by OCL disclosed in Non-Patent Document 4.
 本実施例によれば、メタモデル及び制約条件を用いることで、変換ルール同士の衝突や変換ルールの不具合による変換の妥当性を保証できる。このモデル変換では、メタモデルによって定義された形式のモデルが生成される。また、制約条件を追加し、生成されたモデルの妥当性を制約条件0300~00302で充足性検証することができる。 According to the present embodiment, by using the meta model and the constraint conditions, it is possible to guarantee the validity of the conversion due to the collision between the conversion rules or the failure of the conversion rule. In this model conversion, a model in a format defined by the meta model is generated. Further, a constraint condition can be added, and the validity of the generated model can be verified with the constraint conditions 0300 to 00302.
 なお、本発明のソースコード変換装置1000の制御部1500によって実行される、入力部1100、変換処理部1200、及び出力部1300等を実現するためのプログラムは、リムーバブルメディア(CD-ROM、フラッシュメモリなど)又はネットワークを介してソースコード変換装置1000に提供され、非一時的記憶媒体である不図示の補助記憶装置に格納される。このため、ソースコード変換装置1000は、リムーバブルメディアを読み込むインタフェースを備えるとよい。 Note that a program for realizing the input unit 1100, the conversion processing unit 1200, the output unit 1300, and the like executed by the control unit 1500 of the source code conversion apparatus 1000 of the present invention is a removable medium (CD-ROM, flash memory). Or provided to the source code conversion apparatus 1000 via a network and stored in an auxiliary storage device (not shown) which is a non-temporary storage medium. For this reason, the source code conversion apparatus 1000 may include an interface for reading a removable medium.
 以上、本発明者によりなされた発明を実施形態に基づき具体的に説明したが、本発明は上述した実施形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることは言うまでもない。 Although the invention made by the present inventor has been specifically described based on the embodiments, the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the scope of the invention. Needless to say.

Claims (13)

  1.  ソフトウェアのソースコードを、異なる複数の変換ルールを用いて、検証ツールの入力言語で記述された検査コードに変換するソースコード変換装置で実行されるソースコード変換方法であって、
     前記異なる複数の変換ルールは、前記ソースコードを前記検査コードへ変換し抽象化する一連の処理を、細粒度に分割したものであり、
     前記異なる複数の変換ルールは、
     前記ソースコードを特定のプログラミング言語に依存しない形式である中間形式へ変換する第1変換ルールと、
     前記変換された中間形式を抽象化する第2変換ルールと、
     前記変換された中間形式を前記検査コードに変換する第3変換ルールと、を含み、
     前記方法は、
     前記ソースコードを入力するステップと、
     少なくとも一つの前記第1変換ルールの入力を受け付けるステップと、
     少なくとも一つの前記第2変換ルールの入力を受け付けるステップと、
     少なくとも一つの前記第3変換ルールの入力を受け付けるステップと、
     前記入力された第1変換ルールを用いて、前記ソースコードを前記中間形式へ変換するステップと、
     前記入力された第2変換ルールを用いて、前記変換された中間形式を抽象化するステップと、
     前記入力された第3変換ルールを用いて、前記変換された中間形式を前記検査コードへ変換するステップと、を含み、
     前記中間形式は、前記ソースコード又は前記検査コードの要素と等価な要素である物理要素の他に、前記変換された中間形式を抽象化するステップで生成される要素である論理要素を表現可能であることを特徴とするソースコード変換方法。
    A source code conversion method executed by a source code conversion apparatus that converts a software source code into an inspection code written in an input language of a verification tool using a plurality of different conversion rules,
    The plurality of different conversion rules are obtained by dividing a series of processes for converting and abstracting the source code into the inspection code and dividing it into fine granularity,
    The plurality of different conversion rules are:
    A first conversion rule for converting the source code into an intermediate format that is independent of a specific programming language;
    A second conversion rule that abstracts the converted intermediate format;
    A third conversion rule for converting the converted intermediate form into the inspection code,
    The method
    Inputting the source code;
    Receiving an input of at least one first conversion rule;
    Receiving an input of at least one second conversion rule;
    Receiving an input of at least one third conversion rule;
    Converting the source code into the intermediate format using the input first conversion rule;
    Abstracting the transformed intermediate form using the input second transformation rule;
    Converting the converted intermediate form into the inspection code using the input third conversion rule, and
    The intermediate format can represent not only a physical element that is equivalent to an element of the source code or the inspection code but also a logical element that is an element generated in the step of abstracting the converted intermediate format. A source code conversion method characterized by that.
  2.  請求項1に記載のソースコード変換方法において、
     前記論理要素は、関連する物理要素への参照及び任意の情報を含み、
     前記変換された中間形式を抽象化するステップは、前記第2変換ルールで定められた所定の条件と合致する要素を前記論理要素に変換することによって、追加の属性情報を付与するステップを含み、
     前記検査コードに変換するステップは、前記論理要素を前記検査コードの要素と等価な要素に変換するステップを含むことを特徴とするソースコード変換方法。
    The source code conversion method according to claim 1,
    The logical element includes a reference to the associated physical element and any information;
    Abstracting the converted intermediate form includes adding additional attribute information by converting an element that matches a predetermined condition defined in the second conversion rule into the logical element;
    The step of converting into the inspection code includes the step of converting the logical element into an element equivalent to the element of the inspection code.
  3.  請求項1に記載のソースコード変換方法において、
     前記変換された中間形式を抽象化するステップは複数回実行可能であって、
     ある回の前記変換された中間形式を抽象化するステップで生成された論理要素は、当該回よりも後の回の前記変換された中間形式を抽象化するステップで新たな論理要素に変換されることを特徴とするソースコード変換方法。
    The source code conversion method according to claim 1,
    The step of abstracting the transformed intermediate form can be performed multiple times,
    The logical element generated in the step of abstracting the converted intermediate form at a certain time is converted into a new logical element in the step of abstracting the converted intermediate form at a later time. A source code conversion method characterized by that.
  4.  請求項1に記載のソースコード変換方法において、
     前記第1変換ルール、前記第2変換ルール、及び前記第3変換ルールの少なくとも一つは、前記ソースコード変換装置の内部に蓄積された複数の変換ルールの中から選択されることによって、入力が受け付けられることを特徴とするソースコード変換方法。
    The source code conversion method according to claim 1,
    At least one of the first conversion rule, the second conversion rule, and the third conversion rule is selected from a plurality of conversion rules stored in the source code conversion device, whereby an input is made. A source code conversion method characterized by being accepted.
  5.  請求項1に記載のソースコード変換方法において、
     前記第1変換ルール、前記第2変換ルール、及び前記第3変換ルールの少なくとも一つは、利用者の記述によって入力が受け付けられることを特徴とするソースコード変換方法。
    The source code conversion method according to claim 1,
    At least one of the first conversion rule, the second conversion rule, and the third conversion rule is accepted according to a user description, and the source code conversion method is characterized in that:
  6.  ソースコード変換装置によるソースコード変換方法であって、
     ソフトウェアのソースコードを入力するステップと、
     異なる複数の変換ルールを入力するステップと、
     前記ソースコードを、前記異なる複数の変換ルールを用いて、検証ツールの入力言語で記述された検査コードに変換するステップと、を含み、
     前記複数の変換ルールの少なくとも一部は、前記ソースコード変換装置の内部に蓄積された複数の変換ルールの中から選択して入力され、
     前記異なる複数の変換ルールは、前記ソースコードを、該ソースコードの記述言語に依存しない汎化されたプログラム情報をもつ汎化モデルへ変換する実装-汎化変換ルールと、前記汎化モデルを抽象化する抽象化変換ルールと、前記汎化モデルを前記検査コードへ変換する汎化-検査変換ルールとを含み、
     前記ソースコードを前記検査コードに変換するステップは、
     前記実装-汎化変換ルールを用いて、前記ソースコードを前記汎化モデルへ変換するステップと、
     前記抽象化変換ルールを用いて、前記汎化モデルを抽象化するステップと、
     前記汎化-検査変換ルールを用いて、前記汎化モデルを前記検査コードに変換するステップと、を含み、
     前記検査対象のソースコードを前記検査コードへ変換する一連のステップにおいて、内部的に保持される情報であるモデルの形式はメタモデルによって定義され、
     前記モデルは、前記ソースコードに対応する情報をもつ実装モデルと、前記汎化モデルと、前記検査コードに対応する情報をもつ検査モデルとを含み、
     前記実装モデルは、そのメタモデルであるメタ・実装モデルによって定義され、
     前記汎化モデルは、そのメタモデルであるメタ・汎化モデルによって定義され、
     前記検査モデルは、そのメタモデルであるメタ・検査モデルによって定義され、
     前記各メタモデルは、データ構造の定義と、データに含まれる要素間の制約に関する情報とを保持し、
     前記メタ・汎化モデルは、前記メタ・実装モデルの要素に等価な要素である第1物理要素の定義と、前記メタ・検査モデルの要素に等価な要素である第2物理要素の定義と、前記抽象化変換ルールを用いて前記汎化モデルを抽象化するステップで生成される要素である論理要素の定義と、を含むことを特徴とするソースコード変換方法。
    A source code conversion method by a source code conversion device,
    Entering the software source code;
    Entering different transformation rules,
    Converting the source code into an inspection code described in an input language of a verification tool using the plurality of different conversion rules,
    At least some of the plurality of conversion rules are selected and input from among a plurality of conversion rules stored in the source code conversion device,
    The plurality of different conversion rules include an implementation-generalization conversion rule for converting the source code into a generalization model having generalized program information independent of a description language of the source code, and abstracting the generalization model An abstraction conversion rule to be converted into a generalization-check conversion rule for converting the generalized model into the check code,
    The step of converting the source code into the inspection code includes:
    Converting the source code into the generalization model using the implementation-generalization conversion rules;
    Abstracting the generalization model using the abstraction transformation rules;
    Converting the generalization model into the inspection code using the generalization-inspection conversion rule, and
    In a series of steps for converting the source code to be inspected into the inspection code, the format of the model, which is information held internally, is defined by the meta model,
    The model includes an implementation model having information corresponding to the source code, the generalization model, and an inspection model having information corresponding to the inspection code,
    The implementation model is defined by the meta / implementation model that is its metamodel,
    The generalization model is defined by a meta-generalization model that is a metamodel thereof,
    The inspection model is defined by a meta-inspection model that is a meta model thereof,
    Each of the metamodels holds a definition of a data structure and information on constraints between elements included in the data,
    The meta-generalization model includes a definition of a first physical element that is an element equivalent to the element of the meta-implementation model, a definition of a second physical element that is an element equivalent to an element of the meta-inspection model, And a definition of a logical element that is an element generated in the step of abstracting the generalization model using the abstraction conversion rule.
  7.  請求項6に記載のソースコード変換方法において、
     前記メタ・汎化モデルでは、前記メタ・汎化モデルで定義される前記論理要素が、前記メタ・汎化モデルで定義される前記第1物理要素又は前記第2物理要素を継承するように定義されることを特徴とするソースコード変換方法。
    The source code conversion method according to claim 6,
    In the meta / generalization model, the logical element defined in the meta / generalization model is defined to inherit the first physical element or the second physical element defined in the meta / generalization model. A source code conversion method characterized in that:
  8.  請求項6に記載のソースコード変換方法において、
     前記論理要素は、関連する物理要素への参照及び任意の情報を含み、
     前記汎化モデルを抽象化するステップは、前記抽象化変換ルールで定められた所定の条件と合致する要素を前記論理要素に変換することによって、追加の属性情報を付与するステップを含み、
     前記汎化モデルを前記検査コードに変換するステップは、前記論理要素を前記検査コードの要素と等価な要素に変換するステップを含むことを特徴とするソースコード変換方法。
    The source code conversion method according to claim 6,
    The logical element includes a reference to the associated physical element and any information;
    Abstracting the generalized model includes providing additional attribute information by converting an element that matches a predetermined condition defined in the abstraction conversion rule into the logical element;
    The step of converting the generalized model into the inspection code includes the step of converting the logical element into an element equivalent to the element of the inspection code.
  9.  請求項6に記載のソースコード変換方法において、
     前記汎化モデルを前記検査コードに変換するステップは複数回実行可能であって、
     ある回の汎化モデルを抽象化するステップで生成された論理要素は、当該回よりも後の回の前記汎化モデルを抽象化するステップで新たな論理要素に変換されることを特徴とするソースコード変換方法。
    The source code conversion method according to claim 6,
    The step of converting the generalized model into the inspection code can be executed a plurality of times,
    A logical element generated in a step of abstracting a generalization model of a certain time is converted into a new logical element in a step of abstracting the generalization model of the subsequent times. Source code conversion method.
  10.  請求項6に記載のソースコード変換方法において、
     前記変換ルールに関する情報は、ソースコード変換装置の記憶部に格納された変換ルールを指し示す識別情報のみが含まれており、
     前記変換ルールの実体を、前記識別情報を用いて前記記憶部から取り出し、前記取り出された変換ルールの実態を変換に用いることを特徴とするソースコード変換方法。
    The source code conversion method according to claim 6,
    The information about the conversion rule includes only identification information indicating the conversion rule stored in the storage unit of the source code conversion device,
    A source code conversion method, wherein an entity of the conversion rule is extracted from the storage unit using the identification information, and the actual condition of the extracted conversion rule is used for conversion.
  11.  請求項6に記載のソースコード変換方法において、
     前記入力されたソースコードから、前記変換ルールの検索条件を抽出又は生成し、
     前記検索条件と合致する変換ルールを、ソースコード変換装置の記憶部から取得し、前記取得された変換ルールを前記変換ルールとして受け付けることを特徴とするソースコード変換方法。
    The source code conversion method according to claim 6,
    Extracting or generating search conditions for the conversion rule from the input source code,
    A source code conversion method, wherein a conversion rule that matches the search condition is acquired from a storage unit of a source code conversion device, and the acquired conversion rule is received as the conversion rule.
  12.  請求項6に記載のソースコード変換方法において、
     前記実装モデル、前記汎化モデル、及び前記検査モデルの各中間のモデルは、それぞれ構文を定義するメタモデルによってデータ構造と意味論が定義されることを特徴とするソースコード変換方法。
    The source code conversion method according to claim 6,
    A source code conversion method characterized in that a data structure and semantics of each intermediate model of the implementation model, the generalization model, and the inspection model are defined by a meta model that defines a syntax.
  13.  プロセッサ及び記憶領域を備えるソースコード変換装置に、ソフトウェアのソースコードを、前記異なる複数の変換ルールを用いて、検証ツールの入力言語で記述された検査コードに変換する処理を、前記プロセッサに実行させるソースコード変換プログラムを記憶する計算機読み取り可能な記憶媒体であって、
     前記異なる複数の変換ルールは、前記ソースコードを前記検査コードへ変換し抽象化する一連の処理を、細粒度に分割したものであり、
     前記異なる複数の変換ルールは、
     前記ソースコードを特定のプログラミング言語に依存しない形式である中間形式へ変換する第1変換ルールと、
     前記変換された中間形式を抽象化する第2変換ルールと、
     前記変換された中間形式を前記検査コードへ変換する第3変換ルールと、を含み、
     前記処理は、
     前記ソースコードを入力するステップと、
     少なくとも一つの前記第1変換ルールの入力を受け付けるステップと、
     少なくとも一つの前記第2変換ルールの入力を受け付けるステップと、
     少なくとも一つの前記第3変換ルールの入力を受け付けるステップと、
     前記入力された第1変換ルールを用いて、前記ソースコードを前記中間形式へ変換するステップと、
     前記入力された第2変換ルールを用いて、前記変換された中間形式を抽象化するステップと、
     前記入力された第3変換ルールを用いて、前記変換された中間形式を前記検査コードへ変換するステップと、を含み、
     前記中間形式は、前記ソースコード又は前記検査コードの要素と等価な要素である物理要素の他に、前記変換された中間形式を抽象化するステップで生成される要素である論理要素を表現可能であることを特徴とする計算機読み取り可能な記憶媒体。
    A source code conversion device including a processor and a storage area causes the processor to execute a process of converting a software source code into an inspection code described in an input language of a verification tool using the plurality of different conversion rules. A computer-readable storage medium for storing a source code conversion program,
    The plurality of different conversion rules are obtained by dividing a series of processes for converting and abstracting the source code into the inspection code and dividing it into fine granularity,
    The plurality of different conversion rules are:
    A first conversion rule for converting the source code into an intermediate format that is independent of a specific programming language;
    A second conversion rule that abstracts the converted intermediate format;
    A third conversion rule for converting the converted intermediate form into the inspection code,
    The processing is as follows:
    Inputting the source code;
    Receiving an input of at least one first conversion rule;
    Receiving an input of at least one second conversion rule;
    Receiving an input of at least one third conversion rule;
    Converting the source code into the intermediate format using the input first conversion rule;
    Abstracting the transformed intermediate form using the input second transformation rule;
    Converting the converted intermediate form into the inspection code using the input third conversion rule, and
    The intermediate format can represent not only a physical element that is equivalent to an element of the source code or the inspection code but also a logical element that is an element generated in the step of abstracting the converted intermediate format. A computer-readable storage medium characterized by being.
PCT/JP2012/080077 2011-12-01 2012-11-20 Source code conversion method and computer-readable storage medium WO2013080842A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2011263765A JP5643971B2 (en) 2011-12-01 2011-12-01 Source code conversion method and source code conversion program
JP2011-263765 2011-12-01

Publications (1)

Publication Number Publication Date
WO2013080842A1 true WO2013080842A1 (en) 2013-06-06

Family

ID=48535304

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/080077 WO2013080842A1 (en) 2011-12-01 2012-11-20 Source code conversion method and computer-readable storage medium

Country Status (2)

Country Link
JP (1) JP5643971B2 (en)
WO (1) WO2013080842A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000181750A (en) * 1998-12-15 2000-06-30 Lucent Technol Inc Software testing method
WO2006038394A1 (en) * 2004-10-04 2006-04-13 Matsushita Electric Industrial Co., Ltd. Source code inspection device, method, program, and recording medium
JP2010211521A (en) * 2009-03-10 2010-09-24 Nec Corp Device, method and program for automatically selecting verification target function

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000181750A (en) * 1998-12-15 2000-06-30 Lucent Technol Inc Software testing method
WO2006038394A1 (en) * 2004-10-04 2006-04-13 Matsushita Electric Industrial Co., Ltd. Source code inspection device, method, program, and recording medium
JP2010211521A (en) * 2009-03-10 2010-09-24 Nec Corp Device, method and program for automatically selecting verification target function

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
FRANJO IVANCIC ET AL.: "Model Checking C Programs Using F-SOFT", PROCEEDINGS OF THE 2005 INTERNATIONAL CONFERENCE ON COMPUTER DESIGN, 2 October 2005 (2005-10-02), pages 297 - 308, XP010846434 *

Also Published As

Publication number Publication date
JP5643971B2 (en) 2014-12-24
JP2013117767A (en) 2013-06-13

Similar Documents

Publication Publication Date Title
WO2012032890A1 (en) Source code conversion method and source code conversion program
JP5659238B2 (en) Source code conversion method and source code conversion program
Baudry et al. Barriers to systematic model transformation testing
Papadopoulos et al. Model-based synthesis of fault trees from matlab-simulink models
Gosain et al. Static analysis: A survey of techniques and tools
US9208057B2 (en) Efficient model checking technique for finding software defects
Gervasi et al. Lightweight validation of natural language requirements
US6941546B2 (en) Method and apparatus for testing a software component using an abstraction matrix
US9501269B2 (en) Automatic source code generation for accelerated function calls
US20170315903A1 (en) Systems and methods for analyzing violations of coding rules
Shacham et al. Verifying atomicity via data independence
Auguston Behavior models for software architecture
JP2008305079A (en) Requirement specification automatic verification method
Elmqvist et al. Safety-oriented design of component assemblies using safety interfaces
Lai et al. Defining and verifying behaviour of domain specific language with fUML
WO2013161057A1 (en) Source code inspection method and device
JP5643971B2 (en) Source code conversion method and source code conversion program
Wehrmeister et al. Support for early verification of embedded real-time systems through UML models simulation
JP6279750B2 (en) Source code equivalence verification device
JP5736588B2 (en) Source code conversion method and source code conversion program
CN114647568A (en) Automatic testing method and device, electronic equipment and readable storage medium
JP2011154568A (en) Information processing apparatus, program verification method and program
Gulan et al. Graphical modelling meets formal methods
CN118034661B (en) Intelligent task application system of large language model
Graf et al. Gaining insight into executable models during runtime: Architecture and mappings

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: 12852854

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12852854

Country of ref document: EP

Kind code of ref document: A1