Variable definition and extraction method and computer

The variable definition extraction method addresses compilation errors in large-scale software development by generating a provisional definition file to ensure consistent variable definitions across different development models, reducing re-compilation and shortening development time.

JP2025015274APending Publication Date: 2025-01-30ASTEMO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2023118585
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-07-20
Publication Date
2025-01-30

AI Technical Summary

Technical Problem

Large-scale software development faces challenges with compilation errors due to variable definitions being created at different times and speeds, leading to lengthy compilation times and increased development lead times.

Method used

A variable definition extraction method using a calculator system to identify and register input variables that are not supported by the output variables in different development models, generating a provisional definition file to ensure consistency before compilation.

Benefits of technology

Reduces the need for re-compilation by suppressing compilation errors and leaks, thereby shortening software development time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025015274000001_ABST
    Figure 2025015274000001_ABST
Patent Text Reader

Abstract

To provide a variable definition and extraction method capable of inhibiting compilation error due to variable definition omission from generating and further inhibiting re-compiling.SOLUTION: There is provided a variable definition and extraction method for extracting variable definition required for compilation from software. A variable definition and extraction processing part 203 of a computer: registers, in a first model group (base model group 201) serving as development basis, an input variable not corresponding to an output variable in a first external input variable list (base model group external input variable list 801); registers, in a second model group (creation model group 202) developed on the basis of the first model group, the input variable not corresponding to the output variable in a second external input variable list (creation model group external input variable list 802); compares the first external input variable list with the second external input variable list; and extracts new external input variable in the second model group.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a variable definition extraction method. [Background technology]

[0002] Programs may be developed by combining multiple source codes. For example, depending on differences in areas of expertise or implementation convenience, model-based development and hand-coding development may be divided into separate tasks to develop a single piece of software. In this case, the source code on the model-based development side and the source code on the hand-coding side are ultimately integrated to create a single piece of software. Depending on the difference in development scale, difficulty, and number of personnel, the source code on the model-based development side and the source code on the hand-coding side are often completed at different times. For this reason, for example, if the source code on the model-based development side is completed first, the source code on the model-based development side may be incorporated into the base environment and compiled to generate an executable file, and the verifiable parts may be confirmed in advance on the actual device. In this case, if the source code created this time on the model-based development side refers to a new variable to be implemented on the hand-coding side, the new variable must be provisionally defined (hereinafter, provisionally defined) during compilation, and if the provisional definition of the variable is insufficient, a compilation error will occur. Since compilation takes a long time for large-scale software, rework due to compilation errors will affect the lead time of software development.

[0003] Patent Literature 1 (JP Patent Publication No. 2011-53948 A) discloses a compilation error processing system that, when a compilation error occurs, analyzes a compilation list to identify a program causing the compilation error, imports a program that needs to be updated into a compilation area, and recompiles the program, and includes a library that stores all program sources required for compiling software in advance, a means for detecting the presence or absence of a character string that is written when a compilation error occurs from a compilation list that outputs the compilation result, a means for identifying a program that needs to be replaced from a character string at the location where the error occurs that is written after the character string due to a compilation error, and a means for replacing the identified program with a new program of the same name in a program storage library. [Prior art documents] [Patent documents]

[0004] [Patent Document 1] JP 2011-53948 A Summary of the Invention [Problem to be solved by the invention]

[0005] However, in the technology described in Patent Document 1, a compilation error needs to be generated once in order to resolve the compilation error, which requires recompilation. In the case of large-scale software development, compilation takes a long time, so reducing the number of compilations is important in order to shorten the software development period.

[0006] The present invention aims to reduce the occurrence of compilation errors caused by missing variable definitions and to reduce recompilation in software development in which the work is divided among different teams at different work speeds, such as model-based development and hand-coding development. [Means for solving the problem]

[0007] A representative example of the invention disclosed in the present application is as follows: That is, a variable definition extraction method for extracting variable definitions required for compilation from software, the variable definition extraction method being executed by a computer having an arithmetic unit for executing a program and a memory for storing the program, the arithmetic unit registering input variables not corresponding to output variables in a first model group serving as a base for development in a first external input variable list, the arithmetic unit registering input variables not corresponding to output variables in a second model group developed based on the first model group in a second external input variable list, and the arithmetic unit comparing the first external input variable list with the second external input variable list to extract new external input variables in the second model group. Effect of the Invention

[0008] According to one aspect of the present invention, it is possible to suppress recompilation and shorten the software development time. Problems, configurations and effects other than those described above will become apparent from the following description of the embodiments. [Brief description of the drawings]

[0009] [Figure 1] 1 is a diagram illustrating a configuration of a system in which a program processed by a variable definition extraction processing unit according to a first embodiment runs. [Diagram 2] FIG. 2 is a diagram illustrating a logical configuration of a computer in which a variable definition extraction processing unit according to the first embodiment is implemented. [Figure 3A] FIG. 2 is a model diagram of a functional model according to the first embodiment. [Figure 3B] FIG. 13 is a diagram showing an example of a variable list of the functional model according to the first embodiment. [Figure 3C] FIG. 13 is a diagram illustrating an example of a variable definition file of the functional model according to the first embodiment. [Figure 4A] FIG. 2 is a diagram showing a group of base models according to the first embodiment. [Figure 4B] FIG. 2 is a diagram showing a group of created models in the first embodiment. [Diagram 5] 11 is a flowchart of a model input / output variable extraction process according to the first embodiment. [Figure 6A] FIG. 13 is a diagram showing an example of the configuration of a base model group variable list in the first embodiment. [Figure 6B] FIG. 13 is a diagram showing an example of the configuration of a created model group variable list in the first embodiment. [Figure 7] 13 is a flowchart of an external input variable extraction process according to the first embodiment. [Figure 8A] FIG. 13 is a diagram showing a configuration example of a base model group external input variable list in the first embodiment. [Figure 8B] FIG. 13 is a diagram showing an example of the configuration of a created model group external input variable list in the first embodiment. [Figure 9] 13 is a flowchart of a provisional definition file creation process. [Figure 10A] FIG. 13 is a diagram illustrating an example of new external input variables in the first embodiment. [Figure 10B] FIG. 11 is a diagram illustrating an example of a provisional definition file according to the first embodiment. [Figure 11A] FIG. 11 is a diagram showing a group of base models according to a second embodiment. [Figure 11B] FIG. 11 is a diagram showing a group of created models in the second embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0010] Hereinafter, embodiments of the present invention will be described with reference to the drawings.

[0011] <Example 1> In the following embodiment, a method is described for reducing compilation rework caused by missing variable definitions in source code developed using a model base in differential software development where the work is divided between model-based development and hand-coding development. This can also be applied when integrating source code with different development schedules to generate a single piece of software.

[0012] FIG. 1 is a diagram showing the configuration of a system in which a program processed by the variable definition extraction processor 203 according to the first embodiment runs.

[0013] The system of the first embodiment is composed of application software 101, basic software 102, and hardware 103. The application software 101 includes hand-coding side software 104 created by a developer through hand-coding, and model-based development side software 105 created by the developer through model-based development using, for example, MATLAB (registered trademark). The hand-coding side software 104, the model-based development side software 105, and the basic software 102 exchange information bidirectionally via variables in the program. There is no overlap in variable definitions between the hand-coding side software 104, the model-based development side software 105, and the basic software 102. The hand-coding side software 104 has a definition file of variables output by the hand-coding side software 104, the model-based development side software 105 has a definition file of variables output by the model-based development side software 105, and the basic software 102 has a definition file of variables output by the basic software 102. Therefore, for example, if the changed source code created on the model-based development side is code that references new output variables on the hand-coding side, and only the changed source code created on the model-based development side is incorporated into the base environment for differential development, a shortage of variable definitions will occur. Therefore, in the above case, at the time of compilation, it is necessary to prepare a provisional definition file that defines the new output variables on the hand-coding side, and to include this provisional definition file in the compilation target.

[0014] In the above, an example has been described in which the software 104 is developed by hand coding and the software 105 is developed based on a model. However, as long as the two pieces of software 104 and 105 that refer to each other are completed at different times, the present invention can be applied regardless of the development method used for the software 104 and 105.

[0015] FIG. 2 is a diagram showing a logical configuration of a computer in which the variable definition extraction processor 203 of the first embodiment is implemented.

[0016] The base model group 201 is a model group that serves as a base for differential development in model-based development. The created model group 202 is a model group that is created by adding new design content to the base model group 201. The base model group 201 and the created model group 202 each have a plurality of models by function. The base model group variable list 601 and the created model group variable list 602 are lists in which, for variables possessed by the base model group 201 and the created model group 202, the model name to which the variable belongs, the variable name, the input / output classification, and the data type of the variable are described. The base model group external input variable list 801 is a list in which, among the variables possessed by the base model group 201, variables input from outside the model group are described, and the created model group external input variable list 802 is a list in which, among the variables possessed by the created model group 202, variables input from outside the model group are described. That is, the base model group external input variable list 801 and the created model group external input variable list 802 are lists that compile the hand-coding side and the output variables of the basic software among the variables referenced by the model-based development side. The provisional definition file 1001 is a file in which the variable definitions required for incorporating the created model group 202 into the base environment in differential development and performing compilation are described.

[0017] Next, the processing executed by the system of this embodiment will be described. The base model group 201 and the created model group 202 are input to the variable definition extraction processing unit 203 as input files. The input base model group 201 is subjected to the model input / output variable extraction processing 204 to generate a base model group variable list 601. Then, the base model group variable list 601 is subjected to the external input variable extraction processing 207 to generate a base model group external input variable list 801. Also, the input created model group 202 is subjected to the model input / output variable extraction processing 204 to generate a created model group variable list 602. Then, the external input variable extraction processing 207 is performed on the created model group variable list 602 to generate a created model group external input variable list 802. Then, the provisional definition file creation processing 210 is performed on the base model group external input variable list 801 and the created model group external input variable list 802 to generate a provisional definition file 1001 as an output file.

[0018] The variable definition extraction processing unit 203 is a computer system configured with a computer having a processor (CPU), a memory, an auxiliary storage device, a communication interface, an input interface, and an output interface.

[0019] The processor is a calculation device that executes programs stored in a memory. The processor executes various programs to realize the functions of each processing unit of the variable definition extraction processing unit 203. Note that some of the processes performed by the processor by executing the programs may be executed by other calculation devices (for example, hardware such as ASIC and FPGA).

[0020] Memory includes ROM, which is a non-volatile storage element, and RAM, which is a volatile storage element. ROM stores unchanging programs (e.g., BIOS), etc. RAM is a high-speed, volatile storage element such as DRAM (Dynamic Random Access Memory), and temporarily stores programs executed by a processor and data used when executing the programs.

[0021] The auxiliary storage device is, for example, a large-capacity, non-volatile storage device such as a magnetic storage device (HDD) or a flash memory (SSD). The auxiliary storage device also stores data used by the processor when it executes a program, and the program executed by the processor. That is, the program is read from the auxiliary storage device, loaded into the memory, and executed by the processor to realize each function of the variable definition extraction processing unit 203.

[0022] The communication interface is a network interface device that controls communications with other devices according to a predetermined protocol.

[0023] The input interface is an interface that receives input from a user, such as a keyboard or a mouse. For example, the input interface receives input of a file in which cost data is recorded and stored in an auxiliary storage device. The input interface may also provide a GUI and receive input of cost data from a user.

[0024] The output interface is an interface that outputs the execution result of a program in a format that can be viewed by a user, such as a display device or a printer. For example, the output interface outputs the execution result of a program. The output interface may also be a data output port that outputs the execution result of a program in a format that can be viewed by a user.

[0025] A terminal connected to the computer via a network may provide the input interface and the output interface.

[0026] The programs executed by the processor are provided to the computer via removable media (CD-ROM, flash memory, etc.) or a network, and are stored in a non-volatile auxiliary storage device, which is a non-transitory storage medium. For this reason, the computer should have an interface for reading data from removable media.

[0027] The variable definition extraction processing unit 203 is a computer system configured on one physical computer, or on multiple logically or physically configured computers, and may operate on a virtual computer constructed on multiple physical computer resources. For example, each functional unit may operate on a separate physical or logical computer, or multiple functional units may be combined to operate on a single physical or logical computer.

[0028] FIG. 3A is a model diagram of a functional model, FIG. 3B is a diagram showing an example of a variable list 303 of a functional model, and FIG. 3C is a diagram showing an example of a variable definition file 304 of a functional model.

[0029] 3A, each functional model has an input port 301 and an output port 302, where the input port 301 is an input variable of the functional model, and the output port 302 is an output variable of the functional model. In addition, a data type of each variable is assigned to each port, as shown below.

[0030] Fig. 3B is a diagram showing an example of the configuration of variable list 303. The variable list 303 shown in Fig. 3B is an example when model input / output variable extraction process 204 is executed on functional model 1. Variable list 303 includes a model name, variable names assigned to the model, input / output classification of the variables, and data types of the variables.

[0031] A variable definition file 304 shown in Fig. 3C is assigned to each functional model, and definitions including the variable names and data types of the output variables of each functional model are described in the variable definition file 304. In the case of functional model 1, definitions of output variables X4 and X5 are described. If input variable definitions are described in the variable definition file 304, duplicate definitions will occur when an output variable of a certain functional model is referenced as an input variable in another functional model. Therefore, input variable definitions are not described in the variable definition file 304, but only output variable definitions are described.

[0032] Fig. 4A is a diagram showing a base model group of Example 1, and Fig. 4B is a diagram showing a created model group created from the base model group shown in Fig. 4A. There is a reference relationship between the functional models constituting the illustrated base model group and created model group, with the functional model 2 referring to the output variable X5 of the functional model 1, and the functional model 3 referring to the output variable Y3 of the functional model 2. The difference between the base model group 201 and the created model group 202 is that a new external input variable Y4 is assigned to the functional model 2, and the existing input variable X3, a new input variable Z2, and a new output variable Z3 are assigned to the functional model 3.

[0033] FIG. 5 is a flowchart of the model input / output variable extraction process 204.

[0034] In step 501, information on the functional models included in the base model group 201 is obtained. Next, the processes from step 502 to step 505 are repeatedly executed for each of the obtained functional models.

[0035] In step 503, information on variable names and data types is obtained from the input and output ports of the functional model. In step 504, the model name, variable name, input / output classification, and variable data type information are registered in the base model group variable list 601. In step 505, it is determined whether the repetitive process has been executed for all functional models included in the base model group 201, and if the repetitive process has been executed, the process ends.

[0036] Similarly, model input / output variable extraction process 204 is executed for created model group 202 to generate created model group variable list 602 in which model name, variable name, input / output classification, and variable data type information are registered.

[0037] FIG. 6A is a diagram showing an example of the configuration of a base model group variable list 601, and FIG. 6B is a diagram showing an example of the configuration of a created model group variable list 602.

[0038] The base model group variable list 601 is generated from the base model group 201 by the model input / output variable extraction process 204 , and the created model group variable list 602 is generated from the created model group 202 by the model input / output variable extraction process 204 .

[0039] Corresponding to the base model group 201 and the created model group 202 shown in Figures 4A and 4B, the created model group variable list 602 has been augmented from the base model group variable list 601 by adding variable Y4 of record No. 8, variable X3 of record No. 12, variable Z2 of record No. 13, and variable Z3 of record No. 14.

[0040] FIG. 7 is a flowchart of the external input variable extraction process 207.

[0041] In step 701, information on the base model group variable list 601 is obtained. Next, the processes from step 702 to step 706 are repeatedly executed for each record of the obtained base model group variable list 601.

[0042] In step 703, if the input / output classification of the variable is input, proceed to step 704, and if the input / output classification of the variable is output, proceed to step 706. In step 704, if the same variable whose input / output classification is output is present in the base model group variable list 601, proceed to step 706, and if the same variable whose input / output classification is output is not present in the base model group variable list 601, proceed to step 705. In step 705, since there is no output variable corresponding to the input variable, the variable is determined to be an external input variable input from outside, and information including the variable name and data type of the external input variable is registered in the base model group external input variable list 801. In step 706, it is determined whether the repetitive process has been executed for all variables in the base model group variable list 601, and if the repetitive process has been executed, the process is terminated.

[0043] Similarly, the external input variable extraction process 207 is executed on the created model group variable list 602 to generate a created model group external input variable list 802 in which information including the variable names and data types of the external input variables is registered.

[0044] FIG. 8A is a diagram showing an example of the configuration of a base model group external input variable list 801, and FIG. 8B is a diagram showing an example of the configuration of a created model group external input variable list 802.

[0045] The base model group external input variable list 801 is generated from the base model group variable list 601 by the external input variable extraction process 207 , and the created model group external input variable list 802 is generated from the created model group variable list 602 by the external input variable extraction process 207 .

[0046] 6A and 6B, the created model group external input variable list 802 has been added with the addition of variable Y4 of record No. 8, variable X3 of record No. 12, and variable Z2 of record No. 13 from the base model group external input variable list 801. Of these variables, variable Y4 and variable Z2, excluding variable X3 which is duplicated on the created model group external input variable list 802, are new external input variables.

[0047] FIG. 9 is a flowchart of the temporary definition file creation process 210.

[0048] In step 901, the base model group external input variable list 801 is obtained, and duplicate variables in the list are deleted. In step 902, the created model group external input variable list 802 is obtained, and duplicate variables in the list are deleted.

[0049] In step 903, the difference between the base model group external input variable list 801 in which the duplicated variables have been eliminated and the created model group external input variable list 802 in which the duplicated variables have been eliminated is obtained, and new external input variables are extracted. In step 904, the definitions of the new external input variables extracted in step 903 are written in the provisional definition file 1001, and the process ends.

[0050] FIG. 10A is a diagram showing an example of a new external input variable, and FIG. 10B is a diagram showing an example of a temporary definition file 1001. As shown in FIG.

[0051] 10A and a provisional definition file 1001 shown in FIG. 10B can be created from the base model group external input variable list 801 and the created model group external input variable list 802. The provisional definition file 1001 describes definitions including the variable names and data types of new external input variables Y4 and Z2. The provisional definition file 1001 describes variable definitions in the same format as the variable definition file 304, and is required when incorporating the created model group 202 into the base environment for differential development and performing compilation.

[0052] <Example 2> FIG. 11A is a diagram showing a base model group in the second embodiment, and FIG. 11B is a diagram showing a created model group created from the base model group shown in FIG. 11A.

[0053] In the created model group 1102, a new input variable U6 and a new output variable U7 are assigned to the functional model 4 with respect to the base model group 1101, and the functional model 5 refers to the new output variable U7 of the functional model 4 as a new input variable. However, when the change response of the functional model 4 is not completed and the functional model 5 is incorporated in advance into the base environment of the differential development, a new variable U7 appears in the source code of the functional model 5, so that a provisional definition of the variable U7 is required at the time of compilation. The present invention is also applicable to the case where some of the functional models as described above are incorporated in a stepwise manner into the base environment of the differential development. In the second embodiment, when the model input / output variable extraction process 204 and the external input variable extraction process 207 are executed on the created model group 1102, the variable U7 is extracted as an external input variable, and the provisional definition file 1001 in which the definition of the variable U7 is described is generated by the provisional definition file creation process 210.

[0054] As described above, in the variable definition extraction method of the embodiment of the present invention, in a first model group (base model group 201) that is the base for differential development, input variables that do not correspond to output variables are registered in a first external input variable list (base model group external input variable list 801) (703 to 705), and in a second model group (created model group 202) developed based on the first model group, input variables that do not correspond to output variables are registered in a second external input variable list (created model group external input variable list 802) (703 to 705), and the first external input variable list and the second external input variable list are compared to extract new external input variables in the second model group (903). Therefore, variables that require provisional definition can be listed before checking the consistency of the source code by compilation, which makes it possible to suppress recompilation caused by omission of extraction of variables that require provisional definition, and shorten the software development period.

[0055] In addition, a provisional definition file is created in which the variable names and data types of the extracted external input variables are described, so that coding errors can be reduced by the variable definitions described in the provisional definition file.

[0056] The present invention is not limited to the above-described embodiments, and includes various modified examples and equivalent configurations within the spirit of the appended claims. For example, the above-described embodiments have been described in detail to clearly explain the present invention, and the present invention is not necessarily limited to those including all of the configurations described. Furthermore, a part of the configuration of one embodiment may be replaced with the configuration of another embodiment. Furthermore, the configuration of another embodiment may be added to the configuration of one embodiment. Furthermore, a part of the configuration of each embodiment may be added, deleted, or replaced with another configuration.

[0057] Furthermore, each of the aforementioned configurations, functions, processing units, processing means, etc. may be realized in hardware, for example by designing some or all of them as an integrated circuit, or may be realized in software by a processor interpreting and executing a program that realizes each function.

[0058] Information such as programs, tables, and files that realize each function can be stored in a storage device such as a memory, a hard disk, or an SSD (Solid State Drive), or in a recording medium such as an IC card, an SD card, or a DVD.

[0059] In addition, the control lines and information lines shown are those considered necessary for the explanation, and do not necessarily show all the control lines and information lines necessary for implementation. In reality, it can be considered that almost all components are connected to each other. [Explanation of symbols]

[0060] 101 Application Software 102 Basic Software 103 Hardware 104, 105 Software 201, 1101 base models 202, 1102 created models 203 Variable definition extraction processing section 204 Model Input / Output Variable Extraction Processing 207 External Input Variable Extraction Processing 210 Provisional definition file creation process 301 Input port 302 output port 303 Variable List 304 Variable definition file 601 Base Model Group Variable List 602 Created model group variable list 801 Base model group external input variable list 802 List of external input variables for created models 1001 Provisional definition file

Claims

1. A variable definition extraction method for extracting variable definitions required for compiling from software, comprising the steps of: The variable definition extraction method is executed by a computer having an arithmetic unit that executes a program and a memory that stores the program, The computing device registers input variables that do not correspond to output variables in a first model group that is a basis for development in a first external input variable list; the computing device registers input variables that do not correspond to output variables in a second group of models developed based on the first group of models in a second external input variable list; The variable definition extraction method, wherein the calculation device compares the first external input variable list with the second external input variable list, and extracts new external input variables in the second model group.

2. 2. The variable definition extraction method according to claim 1, the first external input variable list and the second external input variable list each describe a variable name and a data type of the input variable; The variable definition extraction method, wherein the arithmetic device creates a provisional definition file in which variable names and data types of the extracted external input variables are described.

3. A computer comprising: A computing device that executes a program and a memory that stores the program, A variable definition extraction processing unit is installed to extract variable definitions required for compiling from the software by the arithmetic device, The variable definition extraction processing unit registers input variables that do not correspond to output variables in a first model group that is a base for the differential development in a first external input variable list; the variable definition extraction processing unit registers input variables that do not correspond to output variables in a second model group developed based on the first model group in a second external input variable list; A computer characterized in that a variable definition extraction processing unit compares the first external input variable list with the second external input variable list, and extracts new external input variables in the second model group.

4. 4. The computer of claim 3, the first external input variable list and the second external input variable list each describe a variable name and a data type of the input variable; The variable definition extraction processing unit creates a provisional definition file in which variable names and data types of the extracted external input variables are described.

Citation Information

Patent Citations

  • Compile error handling system and program

    JP2011053948A