WebUI-based industrial control software automatic test management platform integration method

By designing an automated test management platform in industrial control software, integrating automated tests into the CI platform, and automatically generating test reports using Jenkins tools, solving the problem of low manual testing efficiency, achieving efficient software development and testing processes, and meeting modern industry Control system requirements.

CN119065958APending Publication Date: 2024-12-03CHANGZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410939655.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-12-03

Smart Images

  • Figure CN119065958A_ABST
    Figure CN119065958A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of software testing, in particular to a WebUI-based industrial control software automatic test management platform integration method, which comprises the following steps of S1, designing a database; s2, designing a WebUI (User Interface) layer; s3, designing a test management service module; s4, designing an execution agent module; and S5, automatic testing and CI platform integration are carried out. According to the invention, by designing the automatic test database, the WebUI layer, the test management service and the execution agent module and finally using the Jenkins tool, the automatic test is integrated into the CI platform, and the test result report of the software code to be tested can be automatically generated, so that the efficiency and the quality of software development and test can be effectively improved, the test coverage rate is increased, and the test efficiency is improved. Code quality and stability are improved, and the development period is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to an integration method of an industrial control software automated testing management platform based on WebUI. Background Art

[0002] As the speed of software version updates continues to accelerate, a complete software testing solution is needed to ensure the quality of the software. At present, most companies generally adopt manual testing, which involves designing and executing test cases, comparing the differences between actual results and expected results, and outputting defect reports and test reports. Manual testing can give full play to the subjective initiative of test engineers, but this method has certain limitations and is monotonous and boring. For repeatable tests such as regression testing or tests that are difficult to implement manually such as stress testing, automated testing can be used, which eliminates the need for engineers to manually repeat a large number of test cases. This not only saves a lot of material and manpower resources, but also greatly improves work efficiency and shortens the software development and testing cycle.

[0003] The development of automated testing technology has promoted the development of a series of automated testing tools. Although powerful third-party testing tools can be used as solutions, it is difficult to meet the needs of enterprises in actual practice. The solution to this problem is to build a complete and pragmatic automated testing solution, that is, to design a reasonable automated testing framework to make automated testing more effective. Summary of the invention

[0004] The technical problem to be solved by the present invention is: in order to solve the technical problems of long testing cycle and low testing efficiency in the existing manual testing software testing method, the present invention provides an integration method of the industrial control software automated testing management platform based on WebUI, which integrates automated testing into the CI platform and can automatically generate a test result report of the required test software code, thereby shortening the testing cycle of the software code and improving its testing efficiency.

[0005] The technical solution adopted by the present invention to solve the technical problem is: an integration method of an industrial control software automated test management platform based on WebUI, comprising the following steps:

[0006] S1. Database design: The database is designed using a relational database management system to ensure data consistency, integrity and scalability;

[0007] S2. Design WebUI layer: Based on Python Django framework and relational database management system, it provides a user interface that users can access through a browser to perform task testing and relational database management system management.

[0008] S3: Design the test management service module: Use the Apache server to provide Web services to the IE client, manage each test execution node through the RemoteServer process on each test machine, generate test cases for Apache configuration by using Python, and be able to write Python scripts to parse the Apache configuration file and generate corresponding test cases;

[0009] S4. Design execution agent module: execution agent integration;

[0010] S5. Integration of automated testing and CI platform: Use the Jenkins tool to integrate automated testing into the continuous integration platform to automatically generate test result reports for the required test software code.

[0011] Therefore, by designing the automated testing database, WebUI layer, test management service and execution agent module, and finally using the Jenkins tool to integrate automated testing into the CI platform, the test result report of the required test software code can be automatically generated, which can effectively improve the efficiency and quality of software development and testing, increase test coverage, improve code quality and stability, and shorten the development cycle.

[0012] Further, in step S2, the WebUI layer includes: user interface, user management and task management; wherein: user interface: provides a user interaction interface so that testers can conveniently operate and view test information; user management: supports multi-user access and authority management; task management: users can create, modify and delete test tasks through the interface.

[0013] Furthermore, in step S2, the WebUI layer also includes: use case management, script management and result viewing; among which: use case management: users can view and manage test cases; script management: manage the upload, version control and development of test scripts; result viewing: users can view test results and generated reports through the interface.

[0014] Furthermore, step S3 includes the following steps:

[0015] S3-1. Import json module: used to process json data;

[0016] S3-2. Define the generate_test_cases function: used to read the Apache configuration file and generate test cases;

[0017] S3-3. Specify the configuration file path: Specify the Apache configuration file path to be parsed;

[0018] S3-4. Generate test cases: call the generate_test_cases function to generate test cases;

[0019] S3-5. Save test case: Save the generated test case as a json file.

[0020] Furthermore, the step S4 comprises the following steps:

[0021] S4-1. Receive test tasks from test management services;

[0022] S4-2. Select a test framework that matches the task for testing;

[0023] S4-3. Execute the test script and record the test results;

[0024] S4-4, the test result is transmitted back to the CI test result receiving module.

[0025] Further, in step S4, the execution agent module includes: a virtualization technology submodule, a UI test framework submodule, a Robot Framework test framework submodule and a NI virtual instrument submodule.

[0026] Furthermore, the step S5 comprises the following steps:

[0027] S5-1. The developer submits the code to the WebUI interface;

[0028] S5-2, the CI server detects that the code has been submitted to the WebUI interface and triggers the build process;

[0029] S5-3, build a binder to compile the code and generate a .out file;

[0030] S5-4, upload the .out file to the FTP server;

[0031] S5-5, download the .out file from the FTP server and create an installation package;

[0032] S5-6. Upload the installation package to the FTP server;

[0033] S5-7, the test machine downloads the installation package from the FTP server and runs the automated smoke test;

[0034] S5-8, the test results are sent back to the CI server;

[0035] S5-9. The CI server generates and publishes a test report.

[0036] Furthermore, in step S5, the CI platform module includes: a CI test result receiving module, a package making machine, a binding machine and an FTP server.

[0037] Compared with the prior art, the present invention has the following beneficial effects:

[0038] By designing the automated testing database, WebUI layer, test management service and execution agent module, and finally using the Jenkins tool to integrate automated testing into the CI platform, the test result report of the required test software code can be automatically generated, thereby effectively improving the efficiency and quality of software development and testing, increasing test coverage, improving code quality and stability, and shortening the development cycle. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0040] Figure 1 The present invention is a flowchart of the method for integrating the WebUI-based industrial control software automated test management platform. DETAILED DESCRIPTION

[0041] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0042] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying 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 a limitation on the present invention. In addition, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.

[0043] In the description of the present invention, it should be noted that, 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 an electrical connection; it can be a direct connection, or it can be indirectly connected 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.

[0044] like Figure 1 As shown, it is the best embodiment of the present invention. The integration method of the industrial control software automatic test management platform based on WebUI (Webpage UserInterface, webpage interface) of this embodiment includes the following steps:

[0045] S1. Database design: The database is designed using a relational database management system to ensure data consistency, integrity and scalability;

[0046] S2. Design WebUI layer: Based on Python Django framework and relational database management system, it provides a user interface that users can access through a browser to perform task testing and relational database management system management.

[0047] S3: Design the test management service module: Use the Apache server to provide Web services to the IE client, manage each test execution node through the RemoteServer process on each test machine, generate test cases for Apache configuration by using Python, and be able to write Python scripts to parse the Apache configuration file and generate corresponding test cases;

[0048] S4. Design execution agent module: execution agent integration;

[0049] S5. Integration of automated testing and CI platform: Use the Jenkins tool to integrate automated testing into the continuous integration platform to automatically generate test result reports for the required test software code. Therefore, by designing the automated testing database, WebUI layer, test management service and execution agent module, and finally using the Jenkins tool to integrate automated testing into the CI platform, the test result report for the required test software code can be automatically generated (i.e., the automated process from code submission to test result report generation), which can effectively improve the efficiency and quality of software development and testing, increase test coverage, improve code quality and stability, and shorten the development cycle.

[0050] In other words, while improving testing efficiency, it reduces human errors, lowers testing costs, and can quickly respond to frequent software updates to ensure system stability and reliability, thereby improving software testing efficiency and meeting the high standards of modern industrial control systems; the design database, WebUI layer, test management service module, execution agent module and CI platform are efficiently integrated to achieve automation of code submission, building, testing and reporting.

[0051] Specifically, in step S1, the relational database management system includes: a test task table, a test case table, a test script table, a test result table, and a test environment table;

[0052] Among them: Test task table: records all test task information, including: task ID, task name, task description, task status and creation time;

[0053] The code is as follows:

[0054] CREATE TABLE test_tasks(

[0055] task_id INT AUTO_INCREMENT PRIMARY KEY, (task ID)

[0056] task_name VARCHAR(255) NOT NULL, (task name)

[0057] task_description TEXT, (task description)

[0058] task_status VARCHAR(50), (task status)

[0059] created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP(creation time);

[0060] Test case table: stores test case information, including: case ID, case name, case steps, expected results, actual results, and associated task ID;

[0061] The code is as follows:

[0062] CREATE TABLE teat_cases(

[0063] case_id INT AUTO_INCREMENT PRIMARY KEY, (use case ID)

[0064] case_name VARCHAR(255) NOT NULL, (case name)

[0065] case_steps TEXT, (use case steps)

[0066] expected_result TEXT, (expected result)

[0067] actual_result TEXT, (actual result)

[0068] task_id INT, (associated task ID)

[0069] FOREING KEY(task_id)REFERENGES test_tasks(task_id) );

[0071] Test script table: saves the path and version information of the test script, including: script ID, script path, script version and associated use case ID;

[0072] The code is as follows:

[0073] CREATE TABLE test_scripts(

[0074] script_id INT AUTO_INCREMENT PRIMARY KEY, (script ID)

[0075] script_path VARCHAR(255) NOT NULL, (script path)

[0076] script_version VARCHAR(50), (script version)

[0077] case_id INT, (associated case ID)

[0078] FOREINGN KEY(case_id)REFERENCES test_cases(case_id) );

[0080] Test result table: records the results of each test execution, including: result ID, execution time, execution machine, result status, log path, and associated test case ID;

[0081] The code is as follows:

[0082] CREATE TABLE test_results(

[0083] result_id INT AUTO_INCREMENT PRIMARY KEY, (result ID)

[0084] executed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, (execution time)

[0085] execution_machine VARCHAR(255), (execution machine)

[0086] result_status VARCHAR(50), (result status)

[0087] log_path VARCHAR(255), (log path)

[0088] case_id INT, (associated case ID)

[0089] FOREING KEY(case_id)REFERENCES test_cases(case_id) );

[0091] Test environment table: records the configuration information of the test environment, including: environment ID, machine ID, IP address, operating system, and software version;

[0092] CREATE TABLE test_environments(

[0093] Environment_id INT AUTO_INCREMENT PRIMARY KEY, (environment ID)

[0094] machine_id VARCHAR(255), (machine ID)

[0095] ip_address VARCHAR(255), (IP address)

[0096] operating_system VARCHAR(255), (operating system)

[0097] software_version VARCHAR(255) (software version)

[0098] ).

[0099] For example, in step S1, the relational database management system uses MySQL; in step S4, the test framework is QTP, Ranorex or Robot Framework (RF).

[0100] In this embodiment, in step S2, the WebUI layer includes: user interface, user management, task management, use case management, script management and result viewing; wherein: user interface: provides a user interaction interface so that testers can easily operate and view test information; user management: supports multi-user access and permission management; task management: users can create, modify and delete test tasks through the interface; use case management: users can view and manage test cases; script management: manages the upload, version control and development of test scripts. Result viewing: users can view test results and generated reports through the interface.

[0101] For example, managing test cases includes: adding, modifying, and deleting cases.

[0102] In this embodiment, step S3 includes the following steps:

[0103] S3-1. Import json module: used to process json data;

[0104] S3-2. Define the generate_test_cases function: used to read the Apache configuration file and generate test cases;

[0105] S3-3. Specify the configuration file path: Specify the Apache configuration file path to be parsed;

[0106] S3-4. Generate test cases: call the generate_test_cases function to generate test cases;

[0107] S3-5. Save test cases: Save the generated test cases as json files. Specifically, the code for generating test cases is as follows:

[0108]

[0109]

[0110] In this embodiment, step S4 includes the following steps:

[0111] S4-1. Receive test tasks from test management services;

[0112] S4-2. Select a test framework that matches the task for testing;

[0113] S4-3. Execute the test script and record the test results;

[0114] S4-4, transmitting the test result back to the CI test result receiving module;

[0115] The execution agent module includes: virtualization technology submodule, UI test framework submodule, Robot Framework test framework submodule and NI virtual instrument submodule. Specifically, for different test tasks, this module integrates different test frameworks, and different test execution nodes complete different test tasks; mainly including: integrated virtualization technology, mainly used for single-machine unfamiliarity, complexity and scale issues; integrated UI test framework, including: QPT, Ranorex, mainly used for smoke testing, interface testing and interface testing; integrated Robot Framework test framework, mainly used for functional testing; integrated NI virtual instrument technology, mainly used for system-level testing.

[0116] In this embodiment, step S5 includes the following steps:

[0117] S5-1. The developer submits the code to the WebUI interface;

[0118] S5-2, the CI server detects that the code has been submitted to the WebUI interface and triggers the build process;

[0119] S5-3, build a binder to compile the code and generate a .out file;

[0120] S5-4, upload the .out file to the FTP server;

[0121] S5-5, download the .out file from the FTP server and create an installation package;

[0122] S5-6. Upload the installation package to the FTP server;

[0123] S5-7, the test machine downloads the installation package from the FTP server and runs the automated smoke test;

[0124] S5-8, the test results are sent back to the CI server;

[0125] S5-9, CI server generates and publishes test report;

[0126] The CI platform modules include: CI test result receiving module, package making machine, linking machine and FTP server. Specifically, Jenkins is used for configuration: Jenkins triggers the CI / CD pipeline, pulls the latest code and builds it; after the build is completed, the automated testing interface is automatically called to uninstall the old version of the software and install the new version of the software; runs the automated testing script, executes the test cases, and generates and publishes the test report.

[0127] In summary, the present invention designs an automated test database, a WebUI layer, a test management service and an execution agent module, and finally uses the Jenkins tool to integrate automated testing into the CI platform, which can automatically generate a test result report for the required test software code, thereby effectively improving the efficiency and quality of software development and testing, increasing test coverage, improving code quality and stability, and shortening the development cycle.

[0128] The above description is based on the ideal embodiment of the present invention. Through the above description, relevant personnel can make various changes and modifications without departing from the technical concept of the present invention. The technical scope of the present invention is not limited to the content in the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. An integration method of an industrial control software automated test management platform based on WebUI, characterized in that: The following steps are involved: S1. Database design: The database is designed using a relational database management system to ensure data consistency, integrity and scalability; S2. Design WebUI layer: Based on Python Django framework and relational database management system, it provides a user interface that users can access through a browser to perform task testing and relational database management system management. S3: Design the test management service module: Use the Apache server to provide Web services to the IE client, manage each test execution node through the RemoteServer process on each test machine, generate test cases for Apache configuration by using Python, and be able to write Python scripts to parse the Apache configuration file and generate corresponding test cases; S4. Design execution agent module: execution agent integration; S5. Integration of automated testing and CI platform: Use the Jenkins tool to integrate automated testing into the continuous integration platform to automatically generate test result reports for the required test software code.

2. The integration method of the WebUI-based industrial control software automated test management platform according to claim 1 is characterized in that: In step S2, the WebUI layer includes: User interface, user management, and task management; Among them: User interface: provides a user interaction interface so that testers can easily operate and view test information; User management: support multi-user access and permission management; Task management: Users can create, modify and delete test tasks through the interface.

3. The integration method of the WebUI-based industrial control software automated test management platform according to claim 1 is characterized in that: In step S2, the WebUI layer further includes: Use case management, script management, and result viewing; Among them: Use case management: users can view and manage test cases; Script management: manage the upload, version control and development of test scripts; Result viewing: Users can view test results and generated reports through the interface.

4. The integration method of the WebUI-based industrial control software automated test management platform according to claim 1 is characterized in that: The step S3 comprises the following steps: S3-1. Import json module: used to process json data; S3-2. Define the generate_test_cases function: used to read the Apache configuration file and generate test cases; S3-3. Specify the configuration file path: Specify the Apache configuration file path to be parsed; S3-4. Generate test cases: call generate_test_cases function to generate test cases; S3-5. Save test case: Save the generated test case as a json file.

5. The integration method of the WebUI-based industrial control software automated test management platform according to claim 1 is characterized in that: The step S4 comprises the following steps: S4-1. Receive test tasks from test management services; S4-2. Select a test framework that matches the task for testing; S4-3. Execute the test script and record the test results; S4-4, the test result is transmitted back to the CI test result receiving module.

6. The integration method of the WebUI-based industrial control software automated test management platform according to claim 1, characterized in that: In step S4, executing the proxy module includes: Virtualization technology sub-module, UI test framework sub-module, Robot Framework test framework sub-module and NI virtual instrument sub-module.

7. The integration method of the WebUI-based industrial control software automated test management platform according to claim 1, characterized in that: The step S5 comprises the following steps: S5-1. The developer submits the code to the WebUI interface; S5-2, the CI server detects that the code has been submitted to the WebUI interface and triggers the build process; S5-3, build a binder to compile the code and generate a .out file; S5-4, upload the .out file to the FTP server; S5-5, download the .out file from the FTP server and create an installation package; S5-6. Upload the installation package to the FTP server; S5-7, the test machine downloads the installation package from the FTP server and runs the automated smoke test; S5-8, the test results are sent back to the CI server; S5-9. The CI server generates and publishes a test report.

8. The method for integrating the WebUI-based industrial control software automated test management platform according to claim 1, characterized in that: In step S5, the CI platform module includes: CI test result receiving module, package making machine, compilation machine and FTP server.