Industrial control software test case database construction method

By adding test scripts and grid models to industrial control software testing, building test case templates and database models, the problem of difficulty in sharing and reusing test cases is solved, efficient management and automated testing of test case libraries are realized, and the software is improved Test efficiency.

CN119003336APending Publication Date: 2024-11-22CHANGZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410995519.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In industrial control software testing, it is difficult to share and reuse test cases, and the lack of unified design templates and management methods leads to difficulty in retrieval and the inability to effectively manage and automatically execute test cases.

Method used

By obtaining traditional test case elements, adding test scripts and grid models, forming test case templates, building database models, generating entity-relationship diagrams and converting them into data tables, dividing test cases according to modules and levels, generating unique identification codes, and realizing tests Shared multiplexing of use case libraries.

Benefits of technology

It improves the efficiency of software testing, meets the high standard requirements of modern industrial control systems, and realizes efficient management and automated testing of test cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003336A_ABST
    Figure CN119003336A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of software testing, and particularly relates to an industrial control software test case database construction method which comprises the following steps: acquiring traditional test case elements, and adding a test script and a grid model into the traditional test case elements to form a test case template; performing model construction of a database according to the test case template to obtain test case library attributes; and generating an entity-relation graph, and converting the entity-relation graph into a data table. And correcting the test cases of the industrial control software according to the attributes of the test case library to obtain a unified test case, and adding the unified test case into the test case library. The test cases are divided according to modules and levels, and a unique identification code of each test case is generated. According to the method, the sharing and reusing functions of the test cases in the test case library are achieved, efficient management of the test cases is met, then the software testing efficiency is improved, and the high-standard requirement of a modern industrial control system is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of software testing, and in particular relates to a method for constructing an industrial control software test case database. Background Art

[0002] As the update speed of software versions continues to accelerate, a complete software testing solution has become a guarantee of software quality. In the long-term testing activities of industrial control software, a large number of test cases have been accumulated. These test cases not only cover basic control, dynamic system response, fault detection and diagnosis, control system optimization and other issues, but also involve typical application scenarios such as power systems, manufacturing automation, process control, and intelligent control. Because its professional barriers and complexity are much higher than traditional commercial software, the high requirements for testers' cross-professional knowledge increase the difficulty of sharing and reusing test cases. Not only that, these test cases come from different sources, lack a unified test case design template and use document management methods, which also increases the difficulty of test case retrieval during testing practice. Therefore, how to systematically manage test cases has become one of the problems that need to be solved in the current industrial control software testing work.

[0003] Under the background of the urgent need for efficient management and automatic execution of test cases in the current automated testing of industrial control software, a test case database that meets its automated testing requirements is established to achieve unified management and shared reuse of test cases from different sources and types, and to support the interface calls of the integrated automated testing platform for test cases and their grid models and test scripts. This is of great significance for improving the degree of software testing automation and realizing automated testing of domestically produced independent industrial control software. Summary of the invention

[0004] In view of the shortcomings of the existing methods, the present invention establishes a method for constructing an industrial control software test case database, which is applied to the field of industrial control software testing. The method comprises: obtaining traditional test case elements, adding test scripts and grid models to the traditional test case elements to form a test case template; constructing a database model according to the test case template to obtain test case library attributes; generating an entity-relationship diagram and converting it into a data table. The test cases of the industrial control software are corrected according to the test case library attributes to obtain a unified test case, which is added to the test case library. The test cases are divided according to modules and levels, and a unique identification code is generated for each test case. The sharing and reuse function of the test cases in the test case library is realized, and the efficient management of the test cases is met. Thereby improving the efficiency of software testing and meeting the high standard requirements of modern industrial control systems.

[0005] The technical solution adopted by the present invention is: a method for constructing an industrial control software test case database, comprising the following steps:

[0006] Step S1, designing test case elements applicable to industrial control software to form a unified industrial control software test case template;

[0007] Step S2, abstractly analyzing the industrial control software, the industrial control software test cases, and the industrial control software simulation models and generating their attributes;

[0008] Step S3: Based on the generated attributes, the test case library is processed using an entity-relationship diagram, the entities, attributes and relationships of the test case library are described, and converted into a relational model based on the corresponding relationship to obtain an entity-relationship diagram of the test case library;

[0009] Step S4: convert the relational model into a data table according to the entity-relationship diagram, the name of the entity corresponds to the table name of the data table, and the attributes of the entity correspond to the table fields of the data table;

[0010] Step S5: Correct the test cases of the industrial control software according to the test case library attributes to obtain unified test cases, and add them to the test case library;

[0011] Step S6, divide the test cases in the test case library obtained in step S5 into corresponding test case sets according to preset modules and preset levels, and set different identifiers for different modules and different levels respectively. Finally, generate a unique test case identification code for each test case by combining modules and levels.

[0012] Furthermore, in step S1, a test case template is formed by adding a test case execution script and a grid model to traditional test case elements.

[0013] Furthermore, in step S2, the following steps are included:

[0014] Step S21, performing abstract analysis on the industrial control software to obtain test software attributes, wherein the test software attributes include software identification, software name, software type and software version;

[0015] Step S22, abstractly analyzing the industrial control software test case to obtain test case attributes, wherein the test case attributes include test case identification, test type, test case tracking, test case description, test environment, preconditions, test steps, expected results, actual results, tester, test date, notes and test script;

[0016] Step S23: abstractly analyze the industrial control software simulation model to obtain simulation model attributes, where the simulation model attributes include grid code, grid model, grid name, grid type, and grid dimension.

[0017] Further, in step S3,

[0018] There are two layers of connections in the industrial control software attributes, test case attributes and simulation model attributes, including the first layer of connections and the second layer of connections. The first connection is the connection between the industrial control software and the industrial control software test case through the functional module, performance module, indicator verification module and interface module. The second connection is the connection between the industrial control software test case and the industrial control software simulation model through grid coding.

[0019] Furthermore, in step S6, the following steps are included: the industrial control software test cases are divided into four modules: functional module, performance module, indicator verification module, and interface module, and these four modules are identified as a first-level test case set, and then each module is subdivided to obtain a second-level test case set, and the second-level test case set is further subdivided to obtain a third-level test case set, and a unique case identification code is generated for each test case.

[0020] The beneficial effect of the present invention is that the method for constructing a test case database for industrial control software of the present invention forms a test case template by adding a test script and a grid model to traditional test case elements; constructs a model of the database according to the test case template to obtain test case library attributes; generates an entity-relationship diagram and converts it into a data table. The test cases of the industrial control software are corrected according to the test case library attributes to obtain a unified test case, which is added to the test case library. The test cases are divided according to modules and levels, and a unique identification code is generated for each test case, so that the sharing and reuse function of the test cases in the test case library is realized, and the efficient management of the test cases is met. This improves the efficiency of software testing and meets the high standards of modern industrial control systems.

[0021] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0023] Figure 1 A flow chart of a method for constructing an industrial control software test case database according to the present invention;

[0024] Figure 2 It is the entity-relationship diagram of the global test case library of the present invention;

[0025] Figure 3 It is a schematic diagram of multi-level test case division of the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] like Figure 1 As shown, a method for constructing an industrial control software test case database includes the following steps:

[0028] Step S1, analyzing the traditional test case elements. Since the test cases of industrial control software need to consider the complexity of the industrial control system, strict security and reliability requirements, degree of automation, environmental requirements and other factors, therefore, it is necessary to add test case execution scripts and grid models to the traditional test case elements to form a test case template.

[0029] Analyze the traditional test case elements, which include test case identification, test type, case tracking, case description, test environment, preconditions, test steps, expected results, actual results, testers, test date, case notes and other test case elements. Add a "test script" element to the traditional test case elements to facilitate the later storage of test scripts that can be automatically executed by the integrated automatic testing platform. Encode the "test steps" described in text and convert them into "test scripts". Add a "grid model" test case element for later storage of the grid model required for industrial control software testing. Add the test script and grid model to the traditional test case elements to form a test case template. In one embodiment of the present invention, the test case template code is as follows:

[0030]

[0031]

[0032] Step S2, abstractly analyzing the industrial control software, the industrial control software test cases, and the industrial control software simulation model and generating their attributes;

[0033] Step S21, abstractly analyzing the industrial control software to obtain test software attributes, where the test software attributes include software identification, software name, software type and software version;

[0034] Step S22, perform abstract analysis on the test case to obtain test case attributes, where the test case attributes include test case identification, test type, case tracking, case description, test environment, preconditions, test steps, expected results, actual results, tester, test date, case notes, and test script;

[0035] Step S23, performing abstract analysis on the simulation model to obtain simulation model attributes, where the simulation model attributes include grid code, grid model, grid name, grid type, and grid dimension;

[0036] Step S3: Based on the attributes generated in step S2, the test case library is processed using an entity-relationship diagram to describe the entities, attributes and relationships of the test case library, and then converted into a relational model based on the corresponding relationship to obtain Figure 2 Test case library entity-relationship;

[0037] The entities, attributes and connections of the test case library are described to obtain a global entity-relationship diagram of the test case library; the entities are industrial control software, test cases and simulation models, and the industrial control software attributes, test case attributes and simulation model attributes contain two layers of connections, including a first layer of connections and a second layer of connections. The first connection is the connection between the industrial control software and the test case through the function module, performance module, indicator verification module and interface module, and the second connection is the connection between the test case and the simulation model through grid coding.

[0038] Step S4: convert the relational model into a data table according to the entity-relationship diagram, the name of the entity corresponds to the table name of the data table, and the attribute of the entity corresponds to the table field of the data table (entity: industrial control software, test case, simulation model);

[0039] Step S41, a data table named IndustrialControlSoftware is defined through the following code, which includes the following fields: software_id (software identifier), software_name (software name), software_type (software type), and software_version (software version).

[0040]

[0041]

[0042] Step S42, a data table named TestCase is defined by the following code, which includes the following fields: case_id (test case identifier, as the primary key), test_type (test type, such as functional test, performance test, etc.), case_trace (case trace, pointing to the associated location in the requirement document or other documents), case_description (case description, describing the detailed information and expected behavior of the test), test_environment (test environment, describing the operating system, browser and other environmental information used when executing the test), preconditions (preconditions, describing the conditions that need to be met before executing the test case), test_steps (test steps, describing in detail how to execute the test case steps), expected_result (expected result, describing the expected result after each test step is completed), actual_result (actual result, recording the actual result after each test step is executed), tester (tester, the person in charge of executing the test case), test_date (test date, recording the date of test execution), case_remarks (case remarks, including additional comments or information), test_script (test script, recording the script used to automate the execution of the test).

[0043]

[0044] Step S43, a data table named SimulationModel is defined through the following code, which includes the following fields: grid_code (grid code, as primary key), grid_model (grid model, using TEXT type to store larger text data), grid_name (grid name, describing the name of the grid used by the simulation model), grid_type (grid type, describing the grid type used by the simulation model), grid_dimensions (grid dimension, recording the number of dimensions of the grid in the simulation model).

[0045]

[0046] Step S5: Correct the test cases of the industrial control software according to the test case library attributes to obtain unified test cases, and add them to the test case library;

[0047] In the long-term software testing process of industrial control software, a large number of test cases for different test scenarios have been accumulated. Since these test cases come from different sources and have different test types, the original test cases have problems such as incomplete test elements, inconsistent data, and non-standardization, and cannot be directly entered into the automated test case database. During the test case entry stage, the test cases can be changed according to the test case library attributes, and unified and standardized test cases can be formed and then entered into the database. Each test case also needs to have a corresponding test script and grid model that can be executed correctly.

[0048] Step S6, divide the test cases in the test case library according to the preset dimensions and preset levels to obtain corresponding test case sets, thereby obtaining a software test case data model. The industrial control software test cases are divided into four modules: functional module, performance module, indicator verification module, and interface module, and these four modules are identified as a first-level test case set, and then each module is subdivided to obtain a second-level test case set, and then the second-level test case set is subdivided to obtain a third-level test case set. Figure 3 A schematic diagram of a software test case data model provided by an embodiment of the present invention.

[0049] The functional modules are subdivided into equipment management function, production management function, alarm and event processing function, and user authority management function, which are marked as secondary test case sets. Then each module is further subdivided, such as Figure 3 As shown, the test case sets of each subdivided module are obtained, which are marked as three-level test case sets;

[0050] The performance modules are subdivided into real-time test, stability test, resource utilization test, and throughput test, which are marked as secondary test case sets. Then, each module is further subdivided, such as Figure 3 As shown, the test case sets of each subdivided module are obtained, which are marked as three-level test case sets;

[0051] The indicator verification module is subdivided into data accuracy verification, system reliability verification, security verification, and compliance verification, which are marked as secondary test case sets. Then, each module is further subdivided, such as Figure 3 As shown, the test case sets of each subdivided module are obtained, which are marked as three-level test case sets;

[0052] The interface module is subdivided into device interface test, data interface test, external system interface test, and user interface test, which are marked as secondary test case sets. Then each module is further subdivided, such as Figure 3 As shown, the test case sets of each subdivided module are obtained, which are marked as three-level test case sets;

[0053] Generate a unique case identification code for each test case according to the preset module and level. In order to generate a unique identification code for each test case, a hierarchical coding method can be used, and the identification code of each level is composed of the identification code of the previous level plus the code of the current level.

[0054] The first-level test case identification code is: function module: GN, performance module: XN, indicator verification module: ZB, interface module: JK, the second-level test case identification code is sorted from 01, and the third-level test case identification code is also sorted from 01. Figure 3 The "Device Communication Interface" test case in the test case identification code is JK-01-01. Figure 3 The "CPU utilization" test case in the test case identification code is XN-03-01. As the complexity of industrial control software increases, it may contain multiple levels of test cases. The present invention only describes the encoding method and cannot be exhaustive.

[0055] The invention proposes a method for constructing a test case database for industrial control software, which realizes the sharing and reuse function of test cases in a test case library and satisfies the efficient management of test cases. The efficiency of software testing is thereby improved, and the high standard requirements of modern industrial control systems are met. In the invention, a test case template is formed by adding a test script and a grid model to traditional test case elements; a database model is constructed according to the test case template to obtain test case library attributes; an entity-relationship diagram is generated and converted into a data table. The test cases of the industrial control software are corrected according to the test case library attributes to obtain a unified test case, which is added to the test case library. The test cases are divided according to modules and levels, and a unique identification code is generated for each test case.

[0056] The various devices selected in this application are all universal standard parts or parts known to those skilled in the art, and their structures and principles can be known to those skilled in the art through technical manuals or conventional experimental methods.

[0057] In the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or a connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0058] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0059] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A method for constructing an industrial control software test case database, characterized in that: The following steps are involved: Step S1, designing test case elements applicable to industrial control software to form a unified industrial control software test case template; Step S2, abstractly analyzing the industrial control software, the industrial control software test cases, and the industrial control software simulation model and generating their attributes; Step S3: Based on the generated attributes, the test case library is processed using an entity-relationship diagram, the entities, attributes and relationships of the test case library are described, and converted into a relational model based on the corresponding relationship to obtain an entity-relationship diagram of the test case library; Step S4: convert the relational model into a data table according to the entity-relationship diagram, the name of the entity corresponds to the table name of the data table, and the attributes of the entity correspond to the table fields of the data table; Step S5: Correct the test cases of the industrial control software according to the test case library attributes to obtain unified test cases, and add them to the test case library; Step S6, divide the test cases in the test case library obtained in step S5 into corresponding test case sets according to preset modules and preset levels, and set different identifiers for different modules and different levels respectively. Finally, generate a unique test case identification code for each test case by combining modules and levels.

2. The method for constructing an industrial control software test case database according to claim 1, characterized in that: In step S1, a test case template is formed by adding a test case execution script and a grid model to traditional test case elements.

3. The method for constructing an industrial control software test case database according to claim 1, characterized in that: In step S2, the following steps are included: Step S21, performing abstract analysis on the industrial control software to obtain test software attributes, wherein the test software attributes include software identification, software name, software type and software version; Step S22, abstractly analyzing the industrial control software test case to obtain test case attributes, wherein the test case attributes include test case identification, test type, test case tracking, test case description, test environment, preconditions, test steps, expected results, actual results, tester, test date, notes and test script; Step S23: abstractly analyze the industrial control software simulation model to obtain simulation model attributes, where the simulation model attributes include grid code, grid model, grid name, grid type, and grid dimension.

4. The method for constructing an industrial control software test case database according to claim 3, characterized in that: In step S3, the industrial control software attributes, test case attributes and simulation model attributes include two layers of connections, including a first layer of connections and a second layer of connections. The first connection is the connection between the industrial control software and the industrial control software test case through the functional module, performance module, indicator verification module and interface module. The second connection is the connection between the industrial control software test case and the industrial control software simulation model through grid coding.

5. The method for constructing an industrial control software test case database according to claim 1, characterized in that: In step S6, The method comprises the following steps: dividing the industrial control software test cases into four modules: a functional module, a performance module, an indicator verification module and an interface module, and identifying the four modules as a first-level test case set, and then subdividing each module to obtain a second-level test case set, and then further subdividing the second-level test case set to obtain a third-level test case set, and generating a unique case identification code for each test case.