A method and system for generating PLC software test cases based on state machine
Through a state machine-based method, PLC software testing requirements are automatically extracted and test cases are generated, which solves the problems of insufficient design and inefficient PLC software test cases in the prior art, and achieves efficient and streamlined test case generation.
Patent Information
- Application Number
- CN202210071708.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2042-01-21
AI Technical Summary
When designing PLC software test cases, it is difficult to fully cover all conditional branches of state transition, functional linkage, and fault processing, resulting in the inability to guarantee the test sufficiency and a large amount of redundancy, which reduces the testing efficiency.
Using a state machine-based method, by modeling the PLC software state machine, automatically extracting software testing requirements, building a state machine transformation model, and generating test cases based on the test strategy to ensure the adequacy and simplicity of the test cases.
The automatic generation of PLC software test cases is realized, ensuring the adequacy of test cases, reducing redundant tests, and improving testing efficiency.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of software testing, and more specifically, relates to a method and system for generating PLC software test cases based on a state machine. Background Art
[0002] Different from ordinary industrial control environments, shipborne equipment has complex structures, diverse signals, harsh operating environments, limited space, and high requirements for electromagnetic interference and virus intrusion protection. Most shipborne equipment requires real-time and high reliability. Once it crashes, it may cause serious consequences. Programmable Logic Controller (PLC) has the characteristics of high reliability, stability, and easy control. It is increasingly widely used in the field of ship equipment control. Therefore, designing PLC software test cases and discovering defects in the software operation process has become a new topic in the current field of software testing technology.
[0003] Currently, the design of PLC software test cases mainly relies on traditional test case design methods. By decomposing the functional points of the requirement documents, testers design test cases based on subjective analysis and experience. It is difficult to fully cover all conditional branches of state transitions, functional linkages, fault handling and other implicit test requirements, and the adequacy of the test cannot be guaranteed.
[0004] On the other hand, there are intrinsic connections between the functional points of PLC software. The traditional test case design method does not conduct a global analysis at the system level. The designed test cases contain a lot of redundancy, which reduces the test efficiency and makes it difficult to discover systematic software defects.
[0005] In summary, although the existing technology can design PLC software test cases, there are also problems such as insufficient test case design and low test efficiency. Therefore, providing a method and system that can automatically generate PLC software test cases and ensure test adequacy has become a top priority in the current field of shipborne PLC software testing. Summary of the invention
[0006] In view of the defects of the prior art, the present invention provides a method and system for generating PLC software test cases based on a state machine, which solves the technical problems of insufficient design and low efficiency of PLC software test cases in the prior art.
[0007] To achieve the above object, the present invention provides a method for generating PLC software test cases based on a state machine, comprising the following steps:
[0008] (1) PLC software test requirement extraction step: Analyze the software development documents to obtain software requirements, automatically extract the key contents of the software requirements to obtain software test requirements, and establish a software requirement table and a test item table in the database based on the obtained software requirements and software test requirements;
[0009] (2) PLC software state machine modeling step: According to all states contained in the PLC software state machine, the transition conditions of each state, and the achieved state of each state after the transition conditions are met, a PLC software state machine transition model is constructed, and each state in the PLC software state machine model is marked and associated with the corresponding test item in the test item table;
[0010] (3) Automatic generation of PLC software test cases: Generate test drive data for the input of each state in the PLC software state machine model according to a given test strategy, generate test cases based on the test drive data of each state and the transition conditions of each state, and save the test cases of each state under the corresponding test item in the test item table.
[0011] In an optional embodiment, in the step of extracting the PLC software test requirements, the key contents of the software requirements are automatically extracted to obtain the software test requirements, which are specifically:
[0012] The software requirements are searched using keywords, including: function, interface, performance, security, and working mode, and a fuzzy matching algorithm is used to automatically extract the content containing the keywords to obtain the software testing requirements.
[0013] In an optional embodiment, in the step of extracting the PLC software test requirements, a software requirement table and a test item table are established in the database, specifically:
[0014] A software requirement table and a test item table are created in the database, wherein the software requirement table includes: software requirement serial number, software requirement identifier, software requirement description, test requirement identifier, and test requirement description; the test item table includes: test item serial number, test item identifier, test item description, test requirement identifier, and status identifier; wherein the software requirement table and the test item table are associated through the test requirement identifier.
[0015] In an optional embodiment, the PLC software test requirement extraction step further includes:
[0016] The software requirement table and test item table established in the database include an operation interface, and the operation interface supports adding, modifying, and deleting operations on the software requirement table and the test item table.
[0017] In an optional embodiment, the PLC software state machine modeling step is specifically:
[0018] Extract all states included in the PLC software state machine, the transition conditions of each state, and the achieved states of each state after the transition conditions are met from the software development document, and construct the PLC software state machine transition diagram in a star or ring shape;
[0019] The transition conditions of each state are marked, and the marking includes the external signals and intermediate variables that need to be input to realize the state transition of each state, and the external signals and intermediate variables that are output after the conversion, and the input intermediate variables and output intermediate variables of two adjacent states are logically associated, that is, the intermediate variables output by the current state are used as the intermediate variables input by the next state;
[0020] According to the conversion relationship and conversion conditions between the states in the PLC software state machine conversion diagram, a PLC software state machine conversion model is constructed. The PLC software state machine conversion model can be represented by a four-tuple, and the four-tuple includes: a state set of the PLC software state machine, an initial state of the PLC software state machine, a set of intermediate variables of the PLC software state machine, and a set of conversion conditions of the PLC software state machine. Each state in the PLC software state machine model is identified and associated with a test item in the test item table having the same state identification;
[0021] The PLC software state machine intermediate variable set includes intermediate variables input to each state in the PLC software state machine and intermediate variable sets output;
[0022] Any transition condition in the PLC software state machine transition condition set can be represented by a quintuple, and the quintuple includes: a starting state, an arrival state, an input condition for the transition, a trigger condition for the transition, and a transition action; when the PLC software state machine is in any state, after receiving an input, the matching quintuple in the PLC software state machine transition condition set is searched, and if there is a quintuple whose starting state is the same as any of the states, and the input of any of the states meets the input condition for the transition in the quintuple, and at the same time makes the trigger condition for the transition meet, the transition action is executed to migrate to the arrival state.
[0023] In an optional embodiment, the input external signal further includes:
[0024] The input external signal is defined, wherein the definition includes the data type, conversion dimension, and value range of the external signal.
[0025] In an optional embodiment, it also includes creating storage space in a database for a set of intermediate variables of a PLC software state machine, a set of state transitions of a PLC software state machine, and input external signals, and providing an access interface.
[0026] In an optional embodiment, it is characterized in that the step of automatically generating a PLC software test case is specifically:
[0027] The external signals and intermediate variables input to each state in the PLC software state machine are classified according to functions, interfaces, performance, safety and working modes, and test drive data is generated according to a given test strategy to obtain input data of each state based on functions, interfaces, performance, safety and working modes, and according to the PLC software state machine conversion model, the output data of each state based on functions, interfaces, performance, safety and working modes is obtained, and according to the input data and output data of each state based on functions, interfaces, performance, safety and working modes, an input-output data comparison table of each state in the PLC software state machine based on functions, interfaces, performance, safety and working modes is obtained, and test cases of each state based on functions, interfaces, performance, safety and working modes are generated according to the input-output data comparison table, and the test cases of each state are saved under the corresponding test items in the test item table.
[0028] In an optional embodiment, the given testing strategy includes equivalence class partitioning, random partitioning, and boundary value partitioning.
[0029] On the other hand, the present invention provides a PLC software test case generation system based on a state machine, comprising the following units:
[0030] PLC software test requirement extraction unit: analyzes software development documents to obtain software requirements, automatically extracts key contents of the software requirements to obtain software test requirements, and establishes a software requirement table and a test item table in the database based on the obtained software requirements and software test requirements;
[0031] PLC software state machine modeling unit: constructs a PLC software state machine transition model according to all states contained in the PLC software state machine, the transition conditions of each state, and the achieved state of each state after the transition conditions are met, and identifies each state in the PLC software state machine model and associates it with the corresponding test item in the test item table;
[0032] PLC software test case automatic generation unit: generates test drive data for the input of each state in the PLC software state machine model according to a given test strategy, generates test cases based on the test drive data of each state and the transition conditions of each state, and saves the test cases of each state under the corresponding test items in the test item table.
[0033] In general, the above technical solution conceived by the present invention has the following beneficial effects compared with the prior art:
[0034] The invention provides a method and system for generating PLC software test cases based on a state machine. The method realizes automatic extraction of PLC software test requirements by matching keywords used in software development documents, and creates a test item table in a database. The method extracts all states, transition conditions of each state, and the reached states of each state after the transition conditions are met from the software development documents, and constructs a PLC software state machine conversion model. Each state in the PLC software state machine model is marked and associated with a corresponding test item in the test item table. The input of each state in the PLC software state machine model generates test drive data according to a given test strategy, and generates test cases according to the test drive data of each state and the transition conditions of each state, and the test cases of each state are stored under the corresponding test items in the test item table.
[0035] The present invention realizes the automatic generation of PLC software test cases, ensures the adequacy of test cases generated to meet the requirements of PLC software functions, performance, interfaces, etc., while streamlining the number of test cases and improving the testing efficiency of PLC software. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A flow chart of a method for generating a PLC software test case based on a state machine according to the present invention;
[0037] Figure 2 It is a working diagram of the PLC software state machine model of an embodiment of the present invention;
[0038] Figure 3 Schematic diagram showing the input and output data comparison of each state of the PLC software state machine in an embodiment of the present invention;
[0039] Figure 4 A test case diagram is generated for the input and output data comparison table of each state of the PLC software state machine in the embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0041] The method for generating a PLC software test case based on a state machine of the present invention comprises the following steps:
[0042] (1) PLC software test requirement extraction step: Analyze the software development documents to obtain software requirements, automatically extract the key contents of the software requirements to obtain software test requirements, and establish a software requirement table and a test item table in the database based on the obtained software requirements and software test requirements;
[0043] (2) PLC software state machine modeling step: According to all states contained in the PLC software state machine, the transition conditions of each state, and the achieved state of each state after the transition conditions are met, a PLC software state machine transition model is constructed, and each state in the PLC software state machine model is marked and associated with the corresponding test item in the test item table;
[0044] (3) Automatic generation of PLC software test cases: Generate test drive data for the input of each state in the PLC software state machine model according to a given test strategy, generate test cases based on the test drive data of each state and the transition conditions of each state, and save the test cases of each state under the corresponding test item in the test item table.
[0045] Specifically, the state machine-based PLC software test case generation method provided by the embodiment of the present invention is as follows: Figure 1 As shown, the following is a detailed technical solution, including the following steps:
[0046] (1) PLC software testing requirements extraction steps.
[0047] The two references of Microsoft.Office.Core and Microsoft.Office.Core.InterPro.Word are used to obtain the contents of the software requirement specification and the software design specification to obtain the software requirements. Then, keywords are used to search for the functions, interfaces, performance, security, and working modes in the software requirements. The fuzzy matching algorithm is used to realize the automatic extraction of software testing requirements.
[0048] Based on the obtained software requirements and software testing requirements, a software requirement table and a test item table are created in the SQL database.
[0049] The software requirement table includes: software requirement serial number, software requirement identifier, software requirement description, test requirement identifier, and test requirement description. The test item table includes: test item serial number, test item identifier, test item description, test requirement identifier, and status identifier. The software requirement table and the test item table are associated through the test requirement identifier.
[0050] The software requirement table and test item table established in the database include an operation interface, and the operation interface is used to add, modify, and delete the software requirement table and the test item table.
[0051] (2) PLC software state machine modeling steps.
[0052] According to the software development document, all states of the PLC software state machine, the transition conditions of each state, and the achieved states of each state after the transition conditions are met are extracted, and the PLC software state machine transition diagram is constructed in a star or ring shape.
[0053] The transition conditions of each state are marked, including the external signals and intermediate variables that need to be input to realize the state transition of each state, as well as the external signals and intermediate variables that are output after the conversion, and the intermediate variables of the input and output of two adjacent states are logically associated, that is, the intermediate variable output of the current state is used as the intermediate variable input of the next state. After the transition conditions of each state are marked, the external signals input to each state are defined, including the data type, conversion dimension, and value range of the external signal.
[0054] According to the conversion relationship and conversion conditions between the states in the PLC software state machine transition diagram, a PLC software state machine transition model is constructed. The PLC software state machine transition model can be represented by a quaternion M:
[0055] M=(S,S0,X,T)
[0056] Wherein, S represents the state set of the PLC software state machine, S0 represents the initial state of the PLC software state machine, X represents the intermediate variable set of the PLC software state machine, T represents the transition condition set of the PLC software state machine, and each state in the PLC software state machine model is identified, and the test items with the same state identification in the test item table are associated;
[0057] The intermediate variable set of the PLC software state machine includes intermediate variables of each state input and intermediate variables of each state output, and the intermediate variables of each state input and intermediate variables of each state output are extracted from the software design specification.
[0058] Any transition condition t in the transition condition set of the PLC software state machine can be represented by a quintuple:
[0059] t=<Si,Sj,I,P,A>
[0060] Among them, Si represents the starting state, Sj represents the arrival state, I represents the input condition of the conversion, P represents the trigger condition of the conversion, and A represents the conversion action.
[0061] For any state in the PLC software state machine, after receiving the input, search for the matching quintuple in the PLC software state machine transition condition set. If there is a quintuple whose starting state is the same as any of the states, and the input of any of the states meets the input condition of the quintuple transition, and the trigger condition of the transition is met, then execute the transition action and migrate to the arrival state.
[0062] A storage space is created in a database for a set of intermediate variables of a PLC software state machine, a set of state transitions of a PLC software state machine, and an input external signal, and an access interface is provided.
[0063] The work flow diagram of the PLC software state machine model of the embodiment of the present invention is as follows Figure 2 As shown, the PLC software state machine contains 8 states, namely S0, S1, S2, S3, S4, S5, S6 and S7. Take S1 as an example for explanation. T1.2 is the transition condition from S1 to S2, and T1.3 is the transition condition from S1 to S3. When the PLC software state machine is in the S1 state, if the received input satisfies the input condition of the five-tuple from the S1 state to the S2 state in the PLC software state machine transition condition set, and the transition condition in the five-tuple is true, the PLC software state machine migrates to the S2 state; if the received input satisfies the input condition of the five-tuple from the S1 state to the S3 state in the PLC software state machine transition condition set, and the transition condition in the five-tuple is true, the PLC software state machine migrates to the S3 state; if the received input does not satisfy the input condition of all the five-tuples of the S1 state in the PLC software state machine transition condition set, the PLC software state machine maintains the original state.
[0064] (3) Generate PLC software state machine test cases and associate test item steps.
[0065] The external signals and intermediate variables input to each state in the PLC software state machine are classified according to function, interface, performance, safety and working mode, and test drive data is generated according to a given test strategy to obtain the input data of each state based on function, interface, performance, safety and working mode, and according to the PLC software state machine conversion model, the output data of each state based on function, interface, performance, safety and working mode is obtained, and according to the input data and output data of each state based on function, interface, performance, safety and working mode, a comparison table of input and output data of each state in the PLC software state machine based on function, interface, performance, safety and working mode is obtained.
[0066] Figure 3 Schematic diagram of the input and output data comparison of each state of the PLC software state machine in an embodiment of the present invention.
[0067] Generate test cases for each state based on function, interface, performance, security and working mode according to the input-output data comparison table, and save the test cases for each state under the corresponding test items in the test item table.
[0068] Figure 4A test case diagram is generated for the input and output data comparison table of each state of the PLC software state machine in the embodiment of the present invention.
[0069] Specifically, the state machine-based PLC software test case generation system provided by the embodiment of the present invention includes the following units:
[0070] PLC software test requirement extraction unit: analyzes software development documents to obtain software requirements, automatically extracts key contents of the software requirements to obtain software test requirements, and establishes a software requirement table and a test item table in the database based on the obtained software requirements and software test requirements;
[0071] PLC software state machine modeling unit: constructs a PLC software state machine transition model according to all states contained in the PLC software state machine, the transition conditions of each state, and the achieved state of each state after the transition conditions are met, and identifies each state in the PLC software state machine model and associates it with the corresponding test item in the test item table;
[0072] PLC software test case automatic generation unit: generates test drive data for the input of each state in the PLC software state machine model according to a given test strategy, generates test cases based on the test drive data of each state and the transition conditions of each state, and saves the test cases of each state under the corresponding test items in the test item table.
[0073] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for generating PLC software test cases based on a state machine, characterized in that: The steps include: (1) PLC software test requirement extraction step: analyzing the software development documents to obtain software requirements, automatically extracting key contents of the software requirements to obtain software test requirements, and establishing a software requirement table and a test item table in the database based on the obtained software requirements and software test requirements; (2) PLC software state machine modeling step: According to all states contained in the PLC software state machine, the transition conditions of each state, and the achieved state of each state after the transition conditions are met, a PLC software state machine transition model is constructed, and each state in the PLC software state machine model is marked and associated with the corresponding test item in the test item table; (3) Automatic generation of PLC software test cases: generating test drive data according to a given test strategy for the input of each state in the PLC software state machine model, generating test cases according to the test drive data of each state and the transition conditions of each state, and saving the test cases of each state under the corresponding test item in the test item table; The PLC software state machine modeling steps are specifically as follows: Extract all states included in the PLC software state machine, the transition conditions of each state, and the achieved states of each state after the transition conditions are met from the software development document, and construct the PLC software state machine transition diagram in a star or ring shape; The transition conditions of each state are marked, and the marking includes the external signals and intermediate variables that need to be input to realize the state transition of each state, and the external signals and intermediate variables that are output after the conversion, and the input intermediate variables and output intermediate variables of two adjacent states are logically associated, that is, the intermediate variables output by the current state are used as the intermediate variables input by the next state; According to the conversion relationship and conversion conditions between the states in the PLC software state machine conversion diagram, a PLC software state machine conversion model is constructed, wherein the PLC software state machine conversion model is represented by a quaternary group, wherein the quaternary group includes: a state set of the PLC software state machine, an initial state of the PLC software state machine, a set of intermediate variables of the PLC software state machine, and a set of conversion conditions of the PLC software state machine. Each state in the PLC software state machine model is identified and associated with a test item in the test item table having the same state identification; The PLC software state machine intermediate variable set includes intermediate variables input to each state in the PLC software state machine and intermediate variable sets output; Any transition condition in the transition condition set of the PLC software state machine is represented by a five-tuple, and the five-tuple includes: a starting state, an arrival state, an input condition for transition, a trigger condition for transition, and a transition action; when the PLC software state machine is in any state, after receiving an input, a matching five-tuple in the transition condition set of the PLC software state machine is searched, and if there is a five-tuple whose starting state is the same as any state, and the input of any state meets the input condition for transition in the five-tuple, and at the same time makes the trigger condition for transition meet, then the transition action is executed to migrate to the arrival state; The steps for automatically generating PLC software test cases are specifically as follows: The external signals and intermediate variables input to each state in the PLC software state machine are classified according to functions, interfaces, performance, safety and working modes, and test drive data is generated according to a given test strategy to obtain input data of each state based on functions, interfaces, performance, safety and working modes, and according to the PLC software state machine conversion model, the output data of each state based on functions, interfaces, performance, safety and working modes is obtained, and according to the input data and output data of each state based on functions, interfaces, performance, safety and working modes, an input-output data comparison table of each state in the PLC software state machine based on functions, interfaces, performance, safety and working modes is obtained, and according to the input-output data comparison table, test cases of each state based on functions, interfaces, performance, safety and working modes are generated, and the test cases of each state are saved under the corresponding test items in the test item table; In the step of extracting the PLC software test requirements, a software requirement table and a test item table are established in the database, specifically: A software requirement table and a test item table are created in the database, wherein the software requirement table includes: software requirement serial number, software requirement identifier, software requirement description, test requirement identifier, and test requirement description; the test item table includes: test item serial number, test item identifier, test item description, test requirement identifier, and status identifier; wherein the software requirement table and the test item table are associated through the test requirement identifier.
2. A method for generating PLC software test cases based on a state machine as claimed in claim 1, characterized in that: In the PLC software test requirement extraction step, the key contents of the software requirements are automatically extracted to obtain the software test requirements, which are specifically: Search software requirements using keywords, including: Functions, interfaces, performance, security, and working modes, and use fuzzy matching algorithms to automatically extract content containing keywords to obtain software testing requirements.
3. A method for generating PLC software test cases based on a state machine as claimed in claim 1, characterized in that: The PLC software test requirement extraction step further includes: The software requirement table and test item table established in the database include an operation interface, and the operation interface supports adding, modifying, and deleting operations on the software requirement table and the test item table.
4. A method for generating PLC software test cases based on a state machine as claimed in claim 1, characterized in that: The input external signal also includes: The input external signal is defined, wherein the definition includes the data type, conversion dimension, and value range of the external signal.
5. A method for generating PLC software test cases based on a state machine as claimed in claim 1, characterized in that: It also includes creating storage space in a database for a PLC software state machine intermediate variable set, a PLC software state machine state transition set, and an input external signal, and providing an access interface.
6. A method for generating PLC software test cases based on a state machine as claimed in claim 1, characterized in that: The given testing strategies include equivalence class partitioning, random partitioning, and boundary value partitioning.
7. A PLC software test case generation system based on a state machine, characterized in that: The following units are included: PLC software test requirement extraction unit: analyzes software development documents to obtain software requirements, automatically extracts key contents of the software requirements to obtain software test requirements, and establishes a software requirement table and a test item table in the database based on the obtained software requirements and software test requirements; PLC software state machine modeling unit: constructs a PLC software state machine transition model according to all states contained in the PLC software state machine, the transition conditions of each state, and the achieved state of each state after the transition conditions are met, and identifies each state in the PLC software state machine model and associates it with the corresponding test item in the test item table; The PLC software test case automatic generation unit generates test drive data according to a given test strategy for the input of each state in the PLC software state machine model, generates test cases according to the test drive data of each state and the transition conditions of each state, and saves the test cases of each state under the corresponding test items in the test item table; The PLC software state machine modeling unit is also used to extract all states contained in the PLC software state machine, the transition conditions of each state, and the achieved states of each state after the transition conditions are met from the software development document, and construct the PLC software state machine transition diagram in a star or ring shape; The transition conditions of each state are marked, and the marking includes the external signals and intermediate variables that need to be input to realize the state transition of each state, and the external signals and intermediate variables that are output after the conversion, and the input intermediate variables and output intermediate variables of two adjacent states are logically associated, that is, the intermediate variables output by the current state are used as the intermediate variables input by the next state; According to the conversion relationship and conversion conditions between the states in the PLC software state machine conversion diagram, a PLC software state machine conversion model is constructed, wherein the PLC software state machine conversion model is represented by a quaternary group, wherein the quaternary group includes: a state set of the PLC software state machine, an initial state of the PLC software state machine, a set of intermediate variables of the PLC software state machine, and a set of conversion conditions of the PLC software state machine. Each state in the PLC software state machine model is identified and associated with a test item in the test item table having the same state identification; The PLC software state machine intermediate variable set includes intermediate variables input to each state in the PLC software state machine and intermediate variable sets output; Any transition condition in the transition condition set of the PLC software state machine is represented by a five-tuple, and the five-tuple includes: a starting state, an arrival state, an input condition for transition, a trigger condition for transition, and a transition action; when the PLC software state machine is in any state, after receiving an input, a matching five-tuple in the transition condition set of the PLC software state machine is searched, and if there is a five-tuple whose starting state is the same as any state, and the input of any state meets the input condition for transition in the five-tuple, and at the same time makes the trigger condition for transition meet, then the transition action is executed to migrate to the arrival state; The PLC software test case automatic generation unit is also used to classify the external signals and intermediate variables input to each state in the PLC software state machine according to function, interface, performance, safety and working mode, and generate test drive data according to a given test strategy, to obtain the input data of each state based on function, interface, performance, safety and working mode, and according to the PLC software state machine conversion model, to obtain the output data of each state based on function, interface, performance, safety and working mode, to obtain the input and output data comparison table of each state in the PLC software state machine based on function, interface, performance, safety and working mode, to generate the test cases of each state based on function, interface, performance, safety and working mode according to the input and output data comparison table, and to save the test cases of each state under the corresponding test items in the test item table; In the step of extracting the PLC software test requirements, a software requirement table and a test item table are established in the database, specifically: A software requirement table and a test item table are created in the database, wherein the software requirement table includes: software requirement serial number, software requirement identifier, software requirement description, test requirement identifier, and test requirement description; the test item table includes: test item serial number, test item identifier, test item description, test requirement identifier, and status identifier; wherein the software requirement table and the test item table are associated through the test requirement identifier.
Citation Information
Patent Citations
Cloud application correctness verification method based on SoaML
CN103281329A
NLP-based system test case automatic generation method
CN107832229A
Method and device for generating satellite-borne software test case
CN112015639A