WO2018151277A1 - ソフトウェア試験装置、ソフトウェア試験システム、ソフトウェア試験方法およびプログラム - Google Patents
ソフトウェア試験装置、ソフトウェア試験システム、ソフトウェア試験方法およびプログラム Download PDFInfo
- Publication number
- WO2018151277A1 WO2018151277A1 PCT/JP2018/005583 JP2018005583W WO2018151277A1 WO 2018151277 A1 WO2018151277 A1 WO 2018151277A1 JP 2018005583 W JP2018005583 W JP 2018005583W WO 2018151277 A1 WO2018151277 A1 WO 2018151277A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- program
- test
- general
- plc
- language
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Program-control systems
- G05B19/02—Program-control systems electric
- G05B19/04—Program control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
- G05B19/056—Programming the PLC
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3698—Environments for analysis, debugging or testing of software
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/51—Source to source
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/10—Plc systems
- G05B2219/13—Plc programming
- G05B2219/13022—Convert source program to intermediate program
Definitions
- the present invention relates to a software test apparatus, a software test system, a software test method, and a program.
- This application claims priority based on Japanese Patent Application No. 2017-27927 filed in Japan on February 17, 2017, the contents of which are incorporated herein by reference.
- Patent Literature 1 discloses a verification support system for inspecting a sequence program that operates a PLC.
- This verification support system converts a sequence program into a PLC sequence program described in a hardware description language.
- the verification support system includes an execution model that is described in a hardware description language and executes a PLC function in a simulated manner, and a control target model that is described in a hardware description language and executes a control target function in a simulated manner.
- the verification support system configures a virtual sequence control system and executes a PLC sequence program for debugging.
- Patent Document 1 does not mention coverage (coverage). If the coverage is low, bugs may remain on the paths that failed the test.
- the present invention provides a software test apparatus, a software test system, a software test method, and a program capable of improving coverage in testing a program executed on a PLC.
- the software test apparatus converts the PLC program for operating the programmable logic controller into a general-purpose language program described in a general-purpose programming language, and tests the general-purpose language program.
- a test execution unit converts the PLC program for operating the programmable logic controller into a general-purpose language program described in a general-purpose programming language, and tests the general-purpose language program.
- the conversion unit may convert a description satisfying a predetermined condition among descriptions included in a comment in the PLC program into a description to be executed by the general language program.
- the conversion unit may convert a description satisfying a predetermined condition among descriptions included in a comment in the PLC program into a description executed at the time of a test in the general language program.
- the conversion unit converts the first character string included in the comment in the PLC program into a description indicating a precondition for executing the general-purpose language program, and converts the second character string included in the comment in the PLC program into the general-purpose
- the description is converted into a description indicating a condition to be satisfied after the execution of the language program, and the test execution unit satisfies the input condition and the output of the general language program is the output condition. A case where the condition is not satisfied may be detected as an error.
- the software test apparatus includes a range information acquisition unit that acquires range information indicating an assumed range of a global variable value included in the PLC program, and the test execution unit determines that the global variable value is outside the assumed range. Such a case may be detected as an error.
- the test execution unit may perform the test using a symbol execution method.
- the test execution unit calculates, using the general language program, a variable value when the pass is executed for each of the paths having the specified number of steps or less among the paths in the PLC program, A case where the variable value does not satisfy the condition indicated by the PLC program may be detected as an error.
- the software test apparatus may include a display unit that displays the PLC program and indicates an execution location in the general-purpose language program on the display of the PLC program.
- the conversion unit uses the entry condition indicated in the subroutine called in the PLC program as the condition at the time of the subroutine call.
- the exit condition indicated in the subroutine called in the PLC program included in the general language program is included in the general language program on the subroutine call side as a condition upon return from the subroutine call, and the test execution unit includes the subroutine
- the general-purpose language program on the subroutine call side may be unit tested using the condition at the time of calling and the condition at the time of returning from the subroutine call.
- the test execution unit may cut out a path that did not pass through the test and perform a test on the cut out path.
- a software test system includes any one of the software test apparatuses described above, a PLC simulation unit that executes a general-purpose language program converted from the PLC program by the software test apparatus, and a PLC.
- a control target simulation unit that simulates the control target.
- a software test method includes a step of converting a PLC program for operating a programmable logic controller into a general language program described in a general-purpose programming language, and a step of performing a test on the general-purpose language program.
- the program causes the computer to convert a PLC program for operating the programmable logic controller into a general-purpose language program described in a general-purpose programming language, and to test the general-purpose language program. And a process for executing the process.
- FIG. 1 is a schematic block diagram illustrating a functional configuration of the software test apparatus according to the embodiment.
- the software testing apparatus 100 includes a communication unit 110, a display unit 120, an operation input unit 130, a storage unit 170, and a control unit 180.
- the control unit 180 includes a conversion unit 181 and a test execution unit 182.
- the software test apparatus 100 performs a test (test) such as bug detection on a program executed by the PLC.
- a program executed by the PLC is referred to as a PLC program.
- the description language of the PLC program source code is referred to as a PLC language.
- Examples of the PLC language include a ladder (LD) language, a sequential function chart (SFC), a function block diagram (FBD), and a structured text (ST).
- Ladder language is also called ladder logic or simply ladder.
- the function block diagram is also referred to as a function block.
- the programming language to be tested by the software test apparatus 100 is not limited to these, and any programming language that is executed by the PLC may be used.
- a comprehensive test cannot be performed.
- a test of a system including a program is performed in order from a small unit such as a unit test, a combination test, a hardware combination test, and a system test.
- a test is performed for each part of the program such as for each subroutine.
- a test is performed by combining a plurality of program parts such as calling a subroutine from the main routine.
- a test is performed by mounting a program on actual hardware.
- the actual hardware is hardware actually used in the system.
- an operation test of the entire system is performed.
- a system test using an actual PLC is often performed from the beginning. In this case, the unit test or the like is virtually performed by limiting some functions of the system in the system test.
- test case is set so that the coverage of the entire source code is as close to 100% as possible.
- the test case is a combination of inputs to the program. Coverage can be improved by selecting combinations of inputs so that all the program paths pass through as much as possible.
- test environment automatically executes a number of automatically set test cases.
- the test environment here is a system for performing a test, such as a computer that executes debug software.
- automatic test case generation a test environment automatically generates a test case for achieving high coverage using a symbol execution method or the like, and automatically executes a test using the generated test case.
- the test environment logically analyzes the program to detect bugs or determine the presence or absence of bugs.
- the unit test is not performed as described above, and therefore the white box test in the unit test is not performed.
- the white box test in the unit test is not performed, it is possible that a path that has not been tested remains in the program and a bug remains in this path. In this respect, in the case of a PLC program, it is not possible to sufficiently execute a test of a complicated program.
- the method for testing the PLC program is limited.
- a general-purpose language program such as C language on a general computer such as a personal computer (PC)
- various methods such as step execution, variable value monitoring, and program execution with variable values overwritten are used. be able to.
- the general-purpose language here is a language that is not specialized for a specific application.
- the general computer referred to here is a computer that is not specialized for a specific application.
- PLCs Unlike debugging general-purpose language programs on a general computer, PLCs generally do not have sufficient functions and commands for program testing, and are used when testing PLC programs. The possible approaches are limited. Unlike general-purpose languages, software for testing PLC programs on a general computer is not generally known. This also limits the techniques that can be used when testing a PLC program. As described above, a complex program test cannot be sufficiently performed in that the techniques that can be used when testing a PLC program are limited.
- the software test apparatus 100 generally uses the source code of the PLC program (described in the PLC language) for the problem that a complex program cannot be sufficiently tested.
- the test is performed by converting the source code into a general-purpose language on a typical computer. That is, the software test apparatus 100 converts the PLC program into a general language program at the source code level, and tests the obtained general language program. As a result, the software test apparatus 100 can test the program using various existing software.
- the software test apparatus 100 can convert existing ST (structured text) source code into C language source code on a personal computer, so that existing software for testing the C language source code on the personal computer can be used. In this respect, it is possible to sufficiently test complex programs. Further, the software test apparatus 100 provides a function for improving the accuracy of debugging as will be described later.
- the software test apparatus 100 is configured using a personal computer and the software test apparatus 100 converts ST source code into C language source code will be described as an example.
- the software testing apparatus 100 is not limited to a personal computer, and may be any computer to which existing software for testing a general language program can be applied.
- the PLC language targeted by the software testing apparatus 100 is not limited to ST, and various PLC languages can be used.
- the language in which the software test apparatus 100 converts the PLC program is not limited to the C language, and any language that can use the existing software for testing the source code of this language may be used.
- the communication unit 110 communicates with other devices.
- the communication unit 110 may receive the source code of the test target ST from a computer used as an editor for the PLC program.
- the display unit 120 includes a display screen such as a liquid crystal panel or an LED (Light Emitting Diode) panel, and displays various images.
- the operation input unit 130 includes input devices such as a keyboard and a mouse and receives user operations.
- the storage unit 170 stores various data.
- the storage unit 170 stores the source code of the test target ST, the grammar definition for the conversion unit 181 to parse the source code, the syntax tree obtained by the syntax analysis, and the conversion unit 181. Stores the C source code converted from the ST source code.
- the storage unit 170 is configured using a storage device provided in the software test apparatus 100.
- the control unit 180 controls each unit of the software test apparatus 100 and executes various processes.
- the control unit 180 is configured by a CPU (Central Processing Unit) included in the software test apparatus 100 reading out and executing a program from the storage unit 170.
- the conversion unit 181 converts the ST source code into C language source code.
- the test execution unit 182 performs a test on the C language source code obtained by the conversion of the conversion unit 181.
- the C language source code and the ST source code have a common syntax tree, and each part of the C language source code is associated with each part of the ST source code. Therefore, if the position of the bug can be specified on the C source code, the position of the bug on the ST source code can be specified.
- FIG. 2 is a diagram illustrating an example of a processing procedure in which the software test system 1 performs a PLC program test.
- the conversion unit 181 functions as a parser generator 191, a parser 192, and a C language generator 193.
- the parser generator 191 generates the parser 192 with reference to the grammar definition stored in the storage unit 170.
- the grammar definition stored in the storage unit 170 may be described in BNF (Backus Naur Form), but is not limited to a specific expression format.
- the parser 192 analyzes the source code and generates a syntax tree. It is not necessary for the parser generator 191 to generate the parser 192 every time the ST source code is input to the conversion unit 181, and the same parser 192 may perform the syntax analysis repeatedly.
- the C language generator 193 generates a C language source code using the syntax tree.
- the test execution unit 182 performs a test on the C language source code generated by the C language generator 193, and outputs the test result as a report.
- FIG. 3 is a diagram illustrating a first example of program conversion performed by the software test apparatus 100.
- the ST source code C ⁇ b> 11 is the source code before conversion by the conversion unit 181
- the C source code C ⁇ b> 12 is the source code after conversion by the conversion unit 181.
- the conversion unit 181 performs the same operation as the ST source code, such as converting the IF statement, CASE statement, and FOR loop of the ST into the IF statement, CASE statement (SWITCH statement), and FOR loop of the C language, respectively.
- C language source code is generated.
- the conversion unit 181 converts the PLC program into a general-purpose language program at the source code level. And the test execution part 182 performs the test with respect to the general purpose language program obtained by conversion.
- the conversion unit 181 converts the PLC program into a general-purpose language program, so that a test can be efficiently performed using an existing test tool for the general-purpose language program.
- the conversion unit 181 converts an ST source code into a C language source code on a personal computer, thereby enabling efficient testing using an existing test tool for C language.
- FIG. 4 is a diagram illustrating a second example of program conversion performed by the software test apparatus 100.
- the ST source code C ⁇ b> 21 is the source code before conversion by the conversion unit 181
- the C source code C ⁇ b> 22 is the source code after conversion by the conversion unit 181.
- the conversion unit 181 converts the line L112 indicating the calculation of the square root in the ST source code into a line L122 that performs the same processing with the C language source code.
- the conversion unit 181 converts the comment of the ST source code C21 into a description to be executed by the C source code C22.
- the description (*... *)"
- the conversion unit 181 converts the line L111 into an IF sentence starting from the line L121, and converts the line L113 into an IF sentence starting from the line L123.
- the description of “#ASSUME” and the conditional expression in the row L111 indicates a precondition in the software test apparatus 100.
- the precondition here is a precondition for executing the program such as a condition of an argument value and a condition of a global variable value in a subroutine call when the subroutine is called.
- the function Sqrt in the row L112 is a function that calculates the square root within a real number range. Therefore, it is a precondition that the value of the argument x of this function is 0 or more. Therefore, in the row L111, “x ⁇ 0” is shown as a precondition.
- the post condition here is a condition that should be satisfied after the execution of the program, such as a condition that the return value of the subroutine call should satisfy.
- the value of the variable y indicating the calculation result should be 0 or more. Therefore, in row L113, “y ⁇ 0” is shown as the postcondition.
- the software testing apparatus 100 determines that there is a bug if the precondition is satisfied and the postcondition is not satisfied. Neither the case where the precondition is satisfied nor the case where the postcondition is satisfied determines that there is a bug.
- the conversion unit 181 does not convert the comment into a C language comment but sets a precondition as an execution target. Convert to the description shown.
- the conversion unit 181 converts the line L111 into an IF-ELSE sentence starting from the line L121. Then, the conversion unit 181 provides a line L122 corresponding to the line L112 that is a substantial part of the source code C21 in the THEN of the IF-ELSE statement.
- the THEN of the IF-ELSE statement here is a portion that is executed when the IF condition is satisfied. Also, the conversion unit 181 sets RETURN for ELSE. RETURN indicates that this program is to be terminated, and if it is called from the main program, indicates that the program returns to the caller. In the source code C22, the part from “//” to the end of the line is treated as a comment and is not an execution target.
- the test execution unit 182 determines whether or not the precondition “x ⁇ 0” is satisfied in the row L121. When the precondition is satisfied, the test execution unit 182 executes the row L122 and the subsequent steps. On the other hand, if the precondition is not satisfied, the process by the test execution unit 182 proceeds to “else” in the line L126, and the program of the source code C22 is terminated without error in the RETURN statement in the line L127.
- the conversion unit 181 when there is a description of “#ASSERT” in the comment of the ST source code, the conversion unit 181 does not convert this description into a C language comment but converts it into a description indicating a postcondition as an execution target. .
- the conversion unit 181 converts the line L113 into an IF-ELSE sentence starting from the line L123.
- the IF-ELSE statement starting from the line L123 is a THEN of the IF-ELSE statement starting from the line L121 which is the pre-condition IF-ELSE statement, and is executed after the execution of the line L122. That is, the IF-ELSE statement starting from line L123 is executed after execution of line L122, which is a substantial part of source code C22.
- the conversion unit 181 sets the THEN of the IF-ELSE statement starting from the line L123 to null. Therefore, when the post-condition is satisfied at the time of the test execution, the test execution unit 182 ends the IF-ELSE statement as it is. Also, the conversion unit 181 sets abort (0) for the case of the ELSE of the IF-ELSE statement starting from the line L123.
- abort (0) indicates program execution interruption due to an error.
- the test execution unit 182 executes the IF-ELSE statement starting from the line L123.
- the test execution unit 182 determines whether or not the post condition “y ⁇ 0” is satisfied in the row L123.
- the test execution unit 182 ends the IF-ESLE statement as it is as described above.
- the test execution unit 182 proceeds to “else” in the row L124, outputs an error at abort (0) in the row L125, and interrupts the execution of the program.
- FIG. 5 is a diagram illustrating a third example of program conversion performed by the software test apparatus 100.
- the rows L111, L112, and L113 of the ST source code C31 in FIG. 5 are the same as the rows L111, L112, and L113 of the ST source code C21 in FIG.
- the conversion unit 181 converts the lines L111, L112, and L113 of the ST source code C31 into lines L131, L132, and L133 of the C language source code C32, respectively.
- the assert statement in line L131 indicates a branch due to a precondition.
- the line L132 and the subsequent steps are executed only when the precondition “x ⁇ 0” is satisfied.
- the row L132 shows the calculation of the square root similarly to the row L122 of FIG.
- the assert statement in line L133 indicates whether or not the post-condition is satisfied.
- the test execution unit 182 detects a case where the post-condition “y ⁇ 0” is not satisfied as an error.
- the conversion unit 181 converts a description satisfying a predetermined condition among descriptions included in a comment in the PLC program into a description to be executed in the general language program.
- This universal language is used for testing. Therefore, the conversion unit 181 converts a description satisfying a predetermined condition among descriptions included in a comment in the PLC program into a description executed at the time of the test in the general language program.
- “#ASSUME” and a conditional expression are included, and “#ASSERT” and a conditional expression are included, respectively, correspond to examples of predetermined conditions.
- the user can include a test description that satisfies a predetermined condition in the comment.
- the software test apparatus 100 is a test obtained by converting a PLC program into a general-purpose language program, and can perform a test by reflecting a test description.
- the test description is treated as a comment, and the operation can be performed without being affected by the test description.
- the conversion unit 181 converts the first character string included in the comment in the PLC program into a description of a precondition for executing the general language program, and converts the second character string included in the comment in the PLC program into the general language. It is converted into a description that indicates the conditions that must be satisfied after the program is executed.
- the description of “#ASSUME” and the conditional expression corresponds to the example of the first character string
- the IF-ELSE statement starting from the line L121 corresponds to the example of the description of the precondition for executing the general-purpose language program. To do.
- FIG. 4 the description of “#ASSUME” and the conditional expression corresponds to the example of the first character string
- the IF-ELSE statement starting from the line L121 corresponds to the example of the description of the precondition for executing the general-purpose language program.
- test execution unit 182 detects an error when the input to the general language program satisfies the input condition and the output of the general language program does not satisfy the output condition. Thus, the test execution unit 182 does not need to generate or select a test case according to the test target program. In this respect, the test execution unit 182 can perform tests in various test cases, and can improve the coverage rate.
- the test execution unit 182 may perform the test using the symbol execution method. Since the conversion unit 181 converts the ST source code into the C language source code, an existing tool for using the symbol execution method can be used on the personal computer. The accuracy of the test can be improved by using the symbol execution method.
- the display unit 120 may display the PLC program, and the execution location in the general-purpose language program may be shown on the display of the PLC program. For example, the display unit 120 displays the source code C21 of ST in FIG. On the other hand, the test execution unit 182 performs a test using the C language source code C22. As described with reference to FIG. 2, the ST source code and the C language source code are associated with each other by a common syntax tree, and the execution position in the C language source code is changed to the position in the ST source code. Can be displayed in association with each other. Since the display unit 120 indicates the execution location in the ST source code, the user who is used to the ST can easily grasp the execution location.
- the number of search steps in the bounded model check may be written in the ST comment.
- the test execution unit 182 may calculate the variable value when the path is executed for each of the paths of the designated number of steps or less among the paths in the PLC program using the C language source code. Good.
- the test execution unit 182 detects, as an error, a case where the variable value in any of the paths does not satisfy the condition indicated by the PLC program. As described above, it is expected that the test execution unit 182 can automatically detect a program defect by performing the bounded model inspection.
- test execution unit 182 may compare the value of the global variable with the assumed range of the value of the global variable, and detect a case where the value of the global variable is out of the assumed range as an error.
- FIG. 6 is a diagram illustrating an example of the global variable list.
- the global variable list is configured as tabular data, and the variable name, type, lower limit value, and upper limit value of the global variable are stored. This global variable list corresponds to an example of range information indicating an assumed range of global variable values.
- the operation input unit 130 receives a user operation indicating the assumed range of the global variable.
- the conversion unit 181 generates a global variable list based on the global variable range indicated by the user operation.
- the communication unit 110 may communicate with other devices to acquire a global variable list.
- the conversion unit 181 refers to the global variable list, and provides the description of the precondition and the description of the postcondition in the C language source code.
- FIG. 7 is a diagram illustrating a fourth example of program conversion performed by the software test apparatus 100.
- the source code C41 of ST in the source code C41 of ST, only the square root calculation of the row L141 is performed, and neither the precondition nor the postcondition is described.
- the C source code C42 in addition to the line L153 corresponding to the line L141, lines L151 and L152 indicating preconditions for global variables, and lines L154 and L155 indicating postconditions for global variables are provided.
- the conversion unit 181 refers to the global variable in FIG. 6 and provides a description of the preconditions in the lines L151 and L152 and a description of the postconditions in the lines L154 and L155.
- the operation input unit 130 acquires range information indicating an assumed range of values of global variables included in the PLC program.
- the operation input unit 130 corresponds to an example of a range information acquisition unit.
- the test execution unit 182 detects a case where the value of the global variable is outside the assumed range as an error.
- the test execution unit 182 since the precondition based on the global variable list is provided in the C language source code, the test execution unit 182 does not need to generate or select a test case according to the test target program. In this respect, the test execution unit 182 can perform tests in various test cases, and can improve coverage.
- the post-conditions are provided in the C language source code, the test execution unit 182 can more reliably determine whether there is a problem with the program.
- the conversion unit 181 may provide a precondition and a postcondition at a program call location such as a subroutine call.
- FIG. 8 is a diagram illustrating a fifth example of program conversion performed by the software test apparatus 100.
- the conversion unit 181 converts the ST source code C51, C52, and C53 into C language source code C54, C55, and C56.
- Preconditions and postconditions are set at the start and end of each of the ST source codes C51, C52, and C53.
- neither a precondition nor a postcondition is shown in the subroutine call part of the source code C51.
- the conversion unit 181 when converting the source code C51 into the source code C54, the conversion unit 181 provides a postcondition and a precondition at a location corresponding to the subroutine call. Specifically, the conversion unit 181 converts the subroutine call destination precondition Assume2 into the postcondition Assert2 at a location immediately before the subroutine call of the source code C55. In addition, the conversion unit 181 converts the post-condition Assert3 of the subroutine call destination into the precondition Assume3 at the position when the source code C55 returns from the subroutine call.
- the conversion unit 181 converts the subroutine call destination precondition Assume4 to the postcondition Assert4 at a location immediately before the subroutine call of the source code C56.
- the conversion unit 181 converts the post-condition Assert5 of the subroutine call destination into the precondition Assume5 at the position when the source code C56 returns from the subroutine call.
- the conversion unit 181 replaces the subroutine call with a dummy code.
- the conversion unit 181 uses the entry condition indicated in the subroutine called in the PLC program as the condition for the subroutine call. Include in general language programs. Also, the conversion unit 181 includes the exit condition indicated in the subroutine called by the PLC program in the general-purpose language program on the subroutine call side as a condition for returning from the subroutine call.
- the test execution unit 182 unit tests the general-purpose language program on the subroutine call side using the conditions at the time of the subroutine call and the conditions at the time of return from the subroutine call. As described above, the test execution unit 182 performs a unit test of each of the source codes C54, C55, and C56, so that it is expected that the program path becomes relatively short and coverage is improved.
- FIG. 9 is a diagram illustrating an example of modularization performed by the test execution unit 182.
- the source codes C61, C62, and C63 in FIG. 9 are all C language source codes.
- the test execution unit 182 first tests the C language source code C61. When the coverage of the part P11 in the source code C61 is low in the test, the test execution unit 182 modularizes the part P11.
- the source code C63 is a source code obtained by modularizing the part P11. Further, the test execution unit 182 replaces the part P11 with a dummy code for the source code C62.
- the test execution unit 182 provides a precondition Assume2 and a postcondition Assert3 in the source code C63.
- the test execution unit 182 extracts a precondition and a postcondition of the source code C63 using a symbol execution method. Or you may make it the test execution part 182 acquire the information of a precondition and a postcondition by the inquiry to a user.
- the test execution unit 182 converts the precondition Assume2 provided in the source code C63 into the postcondition Assert2, and the test execution unit 182 is provided immediately before the place where the modularized part of the source code C62 is replaced with the dummy code.
- the test execution unit 182 converts the post-condition Assert3 provided in the source code C63 into the precondition Assume3, and immediately after the place where the modularized part of the source code C62 is replaced with the dummy code.
- the test execution unit 182 cuts out a path that did not pass through the test and performs a test on the cut out path. Accordingly, the test execution unit 182 can test each of the source codes C62 and C63 alone, and an improvement in coverage is expected.
- FIG. 10 is a schematic block diagram illustrating a functional configuration example of the software test system.
- the software test system 1 includes a software test apparatus 100 and a control system simulation apparatus 200.
- the control system simulation apparatus 200 includes a second communication unit 210, a second display unit 220, a second operation input unit 230, a second storage unit 270, and a second control unit 280.
- the second control unit 280 includes a PLC simulation unit 281 and a control target simulation unit 282.
- the software test system 1 is a system that performs a program test from a unit test to a system test.
- the software test apparatus 100 among the components of the software test system 1 is the same as the software test apparatus 100 shown in FIG.
- the control system simulation apparatus 200 performs a test of the entire system including the PLC and the control target by simulation.
- the control system simulation apparatus 200 is configured using a general-purpose computer such as a personal computer.
- the second communication unit 210 communicates with other devices.
- the second communication unit 210 communicates with the software test apparatus 100 and receives a C language source code converted from the ST source code by the software test apparatus 100.
- the second display unit 220 includes a display screen such as a liquid crystal panel or an LED panel, and displays various images.
- the second operation input unit 230 includes an input device such as a keyboard and a mouse and receives a user operation.
- the second storage unit 270 stores various data.
- the second storage unit 270 stores a model for simulating a PLC and a control target, and a C language source code received by the second communication unit 210 from the software testing apparatus 100.
- the second storage unit 270 is configured using a storage device provided in the control system simulation apparatus 200.
- the second control unit 280 controls each unit of the control system simulation apparatus 200 and executes various processes.
- the second control unit 280 is configured by a CPU included in the control system simulation apparatus 200 reading out and executing a program from the second storage unit 270.
- the PLC simulation unit 281 simulates the operation of the PLC. Specifically, the PLC simulation unit 281 uses the PLC model stored in the second storage unit 270 to control the control target by executing the C language source code converted by the software testing apparatus 100. Simulate.
- the control target simulation unit 282 simulates the operation of the control target. Specifically, the control target simulation unit 282 simulates the operation of the control target using the control target model stored in the second storage unit 270.
- the software test apparatus 100 converts the C source code from the ST source code, thereby simulating the control of executing the source code on the personal computer using the C source code. System tests can be performed by simulation.
- a program for realizing all or part of the functions of the control unit 180 is recorded on a computer-readable recording medium, and the program recorded on the recording medium is read into a computer system and executed. You may perform the process of.
- the “computer system” includes an OS and hardware such as peripheral devices. Further, the “computer system” includes a homepage providing environment (or display environment) if a WWW system is used.
- the “computer-readable recording medium” refers to a storage device such as a flexible medium, a magneto-optical disk, a portable medium such as a ROM or a CD-ROM, and a hard disk incorporated in a computer system.
- the “computer-readable recording medium” dynamically holds a program for a short time like a communication line when transmitting a program via a network such as the Internet or a communication line such as a telephone line.
- a volatile memory in a computer system serving as a server or a client in that case and a program that holds a program for a certain period of time are also included.
- the program may be a program for realizing a part of the functions described above, and may be a program capable of realizing the functions described above in combination with a program already recorded in a computer system.
- An embodiment of the present invention is a software test comprising: a conversion unit that converts a PLC program that operates a programmable logic controller into a general language program described in a general programming language; and a test execution unit that performs a test on the general language program Relates to the device. According to this embodiment, it is possible to improve the coverage in the test of the program executed by the PLC.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Computer Hardware Design (AREA)
- Automation & Control Theory (AREA)
- Software Systems (AREA)
- Programmable Controllers (AREA)
- Debugging And Monitoring (AREA)
- Testing And Monitoring For Control Systems (AREA)
- Stored Programmes (AREA)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| SG11201906881QA SG11201906881QA (en) | 2017-02-17 | 2018-02-16 | Software-testing device, software-testing system, software-testing method, and program |
| US16/481,485 US10915438B2 (en) | 2017-02-17 | 2018-02-16 | Software-testing device, software-testing system, software-testing method, and program |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2017027927A JP6827340B2 (ja) | 2017-02-17 | 2017-02-17 | ソフトウェア試験装置、ソフトウェア試験システム、ソフトウェア試験方法およびプログラム |
| JP2017-027927 | 2017-02-17 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018151277A1 true WO2018151277A1 (ja) | 2018-08-23 |
Family
ID=63170298
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/JP2018/005583 Ceased WO2018151277A1 (ja) | 2017-02-17 | 2018-02-16 | ソフトウェア試験装置、ソフトウェア試験システム、ソフトウェア試験方法およびプログラム |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US10915438B2 (https=) |
| JP (1) | JP6827340B2 (https=) |
| SG (1) | SG11201906881QA (https=) |
| WO (1) | WO2018151277A1 (https=) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110515840A (zh) * | 2019-08-05 | 2019-11-29 | 华东师范大学 | 一种面向plc程序的自动化测试用例生成方法 |
| CN110532177A (zh) * | 2019-08-05 | 2019-12-03 | 华东师范大学 | 一种面向plc程序的自动化测试用例生成系统 |
| CN111104205A (zh) * | 2019-12-24 | 2020-05-05 | 浙江中控技术股份有限公司 | 一种st语言的解释执行方法及系统 |
Families Citing this family (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP3715975B1 (en) * | 2019-03-28 | 2023-03-01 | Mitsubishi Electric R&D Centre Europe B.V. | Method and apparatus for analysing a ladder program |
| JP7199754B2 (ja) * | 2019-12-05 | 2023-01-06 | 株式会社アクセル | 設計支援装置、設計支援方法、設計支援プログラム及び設計支援システム |
| EP3889703B1 (en) * | 2020-03-31 | 2023-02-01 | Mitsubishi Electric R&D Centre Europe B.V. | Method and apparatus for expressing and verifying functional specifications of a programmable logic controller program |
| CN116615720A (zh) | 2020-12-21 | 2023-08-18 | 发那科株式会社 | 梯形图程序解析装置 |
| EP4047482A1 (en) * | 2021-02-19 | 2022-08-24 | Mitsubishi Electric R&D Centre Europe B.V. | Improved checking of correctness of a plc program |
| CN114610622B (zh) * | 2022-03-14 | 2024-05-28 | 浙江中控技术股份有限公司 | 一种系统功能块自动化测试分层设计方法及相关装置 |
| DE102023203626A1 (de) * | 2023-04-20 | 2024-10-24 | Robert Bosch Gesellschaft mit beschränkter Haftung | Verfahren zur Berücksichtigung einer Rückmeldung bei einem Softwaretest |
| US12608299B2 (en) | 2023-07-13 | 2026-04-21 | Cloudblue Llc | System and method for automated unit test generation for programming source code |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2002099312A (ja) * | 2000-09-22 | 2002-04-05 | Mitsubishi Electric Corp | プログラマブルコントローラおよび制御プログラム開発支援装置 |
| JP2007133622A (ja) * | 2005-11-10 | 2007-05-31 | Hitachi Ltd | エンジニアリングツール及びプログラム変換方法 |
| US20090083719A1 (en) * | 2007-09-20 | 2009-03-26 | Delta Electronics, Inc. | Method of compiling machine code program for programmable logic controller |
| JP2015176230A (ja) * | 2014-03-13 | 2015-10-05 | 富士通株式会社 | テストケース生成装置、方法、及びプログラム |
| WO2016174743A1 (ja) * | 2015-04-28 | 2016-11-03 | 株式会社日立製作所 | ソースコード等価性検証装置、および、ソースコード等価性検証方法 |
Family Cites Families (23)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5613115A (en) * | 1991-12-09 | 1997-03-18 | Total Control Products, Inc. | Method for using PLC programming information to generate secondary functions such as diagnostics and operator interface |
| EP0553731B1 (en) * | 1992-01-23 | 1999-04-14 | Mitsubishi Denki Kabushiki Kaisha | Programmable controller |
| TW421761B (en) * | 1994-04-12 | 2001-02-11 | Yokogawa Electric Corp | Verification support system |
| JP3018912B2 (ja) | 1994-08-12 | 2000-03-13 | 横河電機株式会社 | 検証支援システム |
| US7003733B2 (en) * | 2001-01-30 | 2006-02-21 | Duemler David W | Programmable logic controller programming system |
| US6857110B1 (en) * | 2001-01-30 | 2005-02-15 | Stretch, Inc. | Design methodology for merging programmable logic into a custom IC |
| US7257620B2 (en) * | 2001-09-24 | 2007-08-14 | Siemens Energy & Automation, Inc. | Method for providing engineering tool services |
| US20030149608A1 (en) * | 2002-02-06 | 2003-08-07 | Kall Jonathan J. | Suite of configurable supply chain infrastructure modules for deploying collaborative e-manufacturing solutions |
| CN1567222A (zh) * | 2003-07-09 | 2005-01-19 | 松下电器产业株式会社 | 程序生成装置 |
| CA2548334A1 (en) * | 2003-12-15 | 2005-07-28 | Evolveware Information Technology (India) Pvt. Ltd. | An apparatus for migration and conversion of software code from any source platform to any target platform |
| JP3994090B2 (ja) * | 2004-01-29 | 2007-10-17 | ファナック株式会社 | 数値制御装置 |
| KR100877572B1 (ko) * | 2006-12-01 | 2009-01-08 | 윤성재 | 공정 시퀀스 변환 장치와 방법 및 이를 구현할 수 있는컴퓨터로 읽을 수 있는 기록 매체 |
| US8549486B2 (en) * | 2008-04-21 | 2013-10-01 | Microsoft Corporation | Active property checking |
| US20100313128A1 (en) * | 2009-06-03 | 2010-12-09 | Siemens Energy & Automation, Inc. | System and method for free form comments for a programmable logic controller |
| JP2012103791A (ja) * | 2010-11-08 | 2012-05-31 | Mitsubishi Electric Corp | プログラム試験装置、プログラム試験方法およびプログラム試験用プログラム |
| JP4905597B1 (ja) * | 2011-03-15 | 2012-03-28 | オムロン株式会社 | コントローラサポート装置、その装置において実行されるためのコントローラサポートプログラム、およびそのプログラムを格納する記録媒体 |
| JP5962088B2 (ja) * | 2012-03-15 | 2016-08-03 | オムロン株式会社 | Plcシミュレーションシステム、plcシミュレータ、制御プログラム、および記録媒体 |
| WO2013161057A1 (ja) | 2012-04-27 | 2013-10-31 | 株式会社日立製作所 | ソースコード検査方法及び装置 |
| US20140046457A1 (en) * | 2012-07-05 | 2014-02-13 | Renewable Process Technologies Llc | System and related method to facilitate process control |
| EP2898436A1 (en) * | 2012-09-18 | 2015-07-29 | Siemens Aktiengesellschaft | Multiple programmable logic controller simulator |
| US20160283353A1 (en) * | 2015-03-23 | 2016-09-29 | Tryon Solutions, Inc. | Automated software testing |
| KR101627769B1 (ko) * | 2015-12-17 | 2016-06-08 | 주식회사 유디엠텍 | Plc 제어 프로그램의 공용형식 변환장치 및 방법 |
| DE102016105844A1 (de) * | 2016-03-31 | 2017-10-05 | Dspace Digital Signal Processing And Control Engineering Gmbh | Verfahren zum Testen eines Steuerprogramms eines Steuergeräts in einer Simulationsumgebung auf einem Rechner |
-
2017
- 2017-02-17 JP JP2017027927A patent/JP6827340B2/ja active Active
-
2018
- 2018-02-16 SG SG11201906881QA patent/SG11201906881QA/en unknown
- 2018-02-16 WO PCT/JP2018/005583 patent/WO2018151277A1/ja not_active Ceased
- 2018-02-16 US US16/481,485 patent/US10915438B2/en not_active Expired - Fee Related
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2002099312A (ja) * | 2000-09-22 | 2002-04-05 | Mitsubishi Electric Corp | プログラマブルコントローラおよび制御プログラム開発支援装置 |
| JP2007133622A (ja) * | 2005-11-10 | 2007-05-31 | Hitachi Ltd | エンジニアリングツール及びプログラム変換方法 |
| US20090083719A1 (en) * | 2007-09-20 | 2009-03-26 | Delta Electronics, Inc. | Method of compiling machine code program for programmable logic controller |
| JP2015176230A (ja) * | 2014-03-13 | 2015-10-05 | 富士通株式会社 | テストケース生成装置、方法、及びプログラム |
| WO2016174743A1 (ja) * | 2015-04-28 | 2016-11-03 | 株式会社日立製作所 | ソースコード等価性検証装置、および、ソースコード等価性検証方法 |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110515840A (zh) * | 2019-08-05 | 2019-11-29 | 华东师范大学 | 一种面向plc程序的自动化测试用例生成方法 |
| CN110532177A (zh) * | 2019-08-05 | 2019-12-03 | 华东师范大学 | 一种面向plc程序的自动化测试用例生成系统 |
| CN111104205A (zh) * | 2019-12-24 | 2020-05-05 | 浙江中控技术股份有限公司 | 一种st语言的解释执行方法及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| JP6827340B2 (ja) | 2021-02-10 |
| JP2018133034A (ja) | 2018-08-23 |
| US10915438B2 (en) | 2021-02-09 |
| SG11201906881QA (en) | 2019-09-27 |
| US20190391910A1 (en) | 2019-12-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6827340B2 (ja) | ソフトウェア試験装置、ソフトウェア試験システム、ソフトウェア試験方法およびプログラム | |
| CA2956364C (en) | System and method for coverage-based automated test case augmentation for design models | |
| AU2010350247B2 (en) | Code inspection executing system for performing a code inspection of ABAP source codes | |
| US9582396B2 (en) | Techniques for generating an executable debugger script | |
| JP2019516167A5 (https=) | ||
| US12169396B2 (en) | Method for analyzing a Programmable Logic Controller program | |
| CN106776343A (zh) | 一种Web应用程序自动化测试工具及方法 | |
| CN114911711A (zh) | 一种代码缺陷分析方法、装置、电子设备及存储介质 | |
| US12085911B2 (en) | Method, computer program and apparatus for analysing a programmable logic controller program | |
| KR101722856B1 (ko) | 프로그래밍 언어 기반의 plc 자동 테스트 장치 | |
| KR102546424B1 (ko) | 학습용 데이터 생성 장치, 소스 코드 오류 분석 장치 및 방법 | |
| CN110442520B (zh) | 一种基于plc编程语言的交叉调试系统及方法 | |
| Wynn-Williams et al. | Can Generative AI Produce Test Cases? An Experience from the Automotive Domain | |
| EP2820547B1 (en) | Debugging method and computer program product | |
| US6546526B2 (en) | Active trace debugging for hardware description languages | |
| CN109977019B (zh) | 一种基于增量采样的编译器优化序列测试方法 | |
| Lemos et al. | Is It Time To Treat Prompts As Code? A Multi-Use Case Study For Prompt Optimization Using DSPy | |
| Frey et al. | “Safety automata”—A new specification language for the development of PLC safety applications | |
| CN117834500A (zh) | 一种网络设备指令编排的测试方法及装置 | |
| JP2005316710A (ja) | ソフトウェア試験支援装置 | |
| CN117312153A (zh) | 代码静态检测方法、工具、装置、存储介质及设备 | |
| CN109271237A (zh) | 仿真控制方法和装置 | |
| Schuts et al. | Online Model-Based Testing Reusing Multiple Design Models in an Industrial Setting. | |
| CN110659215A (zh) | 一种开放式工业app快速开发及测试验证方法 | |
| CN111026381A (zh) | 基于软件编程平台的硬件效果的模拟方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18753931 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: 18753931 Country of ref document: EP Kind code of ref document: A1 |