Automatic integrated test method, tool, equipment and medium for rail transit signal system

Through the automated integration testing method, the cumbersome and inaccurate integration testing of rail transit signal system software is solved, efficient and accurate test results are achieved, and the development cycle is shortened.

CN118939550APending Publication Date: 2024-11-12CASCO SIGNAL LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411014464.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The software integration testing process of rail transit signal systems is cumbersome and relies on manual operations, resulting in low testing efficiency and difficult to ensure accuracy, which affects the software release progress and security.

Method used

Provide an automated integrated testing method, which realizes automatic pile insertion and automatic comparison of test results through configuration processing, data preprocessing, code pile addition, test case execution and test result comparison, and reduces manual intervention.

Benefits of technology

It improves testing efficiency, reduces working hours, ensures the accuracy and reliability of test results, and shortens the software development cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939550A_ABST
    Figure CN118939550A_ABST
Patent Text Reader

Abstract

The invention relates to an automatic integrated test method, tool, equipment and medium for a rail transit signal system, and the method comprises the following steps: configuration processing: reading a test case document exported by a demand verification management module, and copying an expected result column of each test case in the test case document into an expected result column in a configuration file; data preprocessing: reading a configuration file, and moving a to-be-tested software code to a specified path given in the configuration file; code pile adding: loading software codes to be tested and performing batch pile pitching; executing the test case; saving a test log; and test result comparison and generation: reading and analyzing the test log file, comparing the analyzed data with the expected effect in the configuration file, and generating a test result document. Compared with the prior art, the method has the advantages of high test accuracy, high efficiency and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of rail transit system testing, and in particular to an automated integrated testing method, tool, equipment and medium for a rail transit signal system. Background Art

[0002] In order to ensure its high safety performance, the software of the rail transit signal system usually needs to go through multiple rounds of rigorous integration testing before it can be put into use. The software integration test of the rail transit signal system often takes several weeks to several months due to the large amount of data, many test points, strict test result comparison process and many test rounds.

[0003] At present, the rail transit signal system mainly relies on testers to manually complete all steps of the integration test, which has the following problems:

[0004] (1) The steps of integration testing are cumbersome and repetitive, which consumes a lot of testers' energy and time to do repetitive and inefficient work, resulting in delays in the integration testing process and affecting the software release progress.

[0005] (2) Relying on manual integration testing is also accompanied by system risks caused by possible errors in the subjective judgment of testers, which makes it impossible to guarantee the accuracy of integration testing and, in turn, the security of the software.

[0006] After searching, China's invention patent CN111209206B discloses an automatic testing method and system for software products. It provides a process from obtaining test files from the configuration database to generating test reports, but it does not take into account the realization of automatic plug-in and automatic comparison of test results. The test accuracy and efficiency need to be further improved. Summary of the invention

[0007] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide an automated integrated testing method, tool, equipment and medium for rail transit signal systems, which can realize automatic insertion and automatic comparison of test results, with higher test accuracy and efficiency.

[0008] The purpose of the present invention can be achieved by the following technical solutions:

[0009] According to a first aspect of the present invention, there is provided an automated integrated testing method for a rail transit signal system, the method comprising:

[0010] Configuration processing: read the test case document exported by the requirement verification management module, and copy the expected result column of each test case in the test case document to the expected result column in the configuration file;

[0011] Data preprocessing: Read the configuration file and move the software code to be tested to the specified path given in the configuration file;

[0012] Code stubbing: load the software code to be tested and perform batch stubbing;

[0013] Test case execution: According to the configuration file data, the test cases are executed in the order of case number-step number until all the test cases in this round are executed, and the test logs generated during the execution of the test cases are saved to the specified path;

[0014] Test result comparison: Read and parse the test log file, compare the parsed data with the expected effect in the configuration file, and generate a test result document.

[0015] Preferably, the configuration process further includes:

[0016] Use data stream reading to obtain the tested software and test log storage path information, and at the same time obtain the data in the "use case number-step number", "whether to execute", and "expected result" columns in the configuration file and store them in categories;

[0017] Determine whether this use case is executed in this round of testing based on the information filled in the Execution column.

[0018] Preferably, the configuration process also includes modifying the expected result data in the configuration file to a standard form, wherein the standard form is specifically: the [.] function of the [.] module [.] class is called.

[0019] Preferably, the automatic reading of configuration files in the data preprocessing is specifically: using the EasyExcel class in JAVA to automatically read the configuration files in the excel format in the specified directory.

[0020] Preferably, the moving the software code to be tested to the specified path given in the configuration file specifically includes: using JAVA's FILE class to move the software code to be tested to the specified path in the configuration file.

[0021] Preferably, in the code stubbing, the code of the software to be tested is loaded and batch stubbing is performed, which specifically includes:

[0022] Load the code of the software to be tested, traverse and filter out the class and interface types, traverse the class and interface types, filter out the constructors and methods without inheritance, and add stub functions to the constructor and method headers.

[0023] Preferably, the filtering out of constructors and methods without inheritance and adding stub functions to constructor and method headers specifically includes:

[0024] Get all constructors and methods defined by the filtered class and interface types and traverse them, print all constructor names or method names that do not contain super() or this() calls and the corresponding class names or interface names, and form corresponding statements to insert into the header of the constructor or method code block.

[0025] Preferably, the test case execution specifically includes:

[0026] Read the "Use Case Number - Step Number" column data from the configuration file, sort them in ascending order of use case number and step number, and give each use case a separate ID number;

[0027] Run the test cases in order from small to large ID numbers: create a test log file to the log path configured in the configuration file. When testing each test case, automatically run the software under test by calling the getExecute() method, and save the log of each execution of the software under test to the test log file. The test log file includes the ID number and the test case number-step number.

[0028] After each test case is executed, clear the buffer, reload the new test case input file, and repeat the above steps.

[0029] Preferably, the test result comparison and generation specifically includes:

[0030] Get the "Expected Result" column data read from the configuration file and the test log file saved during the execution process, and compare them to generate a new Excel test result file;

[0031] Take out the "expected result" and test log files with the same ID number, identify the characteristic identifier of the function to be tested, take out the complete function name, perform string comparison, and find out whether the specified function of the specified class listed in the "expected result" column is run during the test case execution through two loops; if all the functions to be tested are run, fill in "success" in the "whether successful" column added to the test result file; if any function to be tested is not run, fill in "failure" in the "whether successful" column added to the test result file. The function that is not run will generate a record and be added to the second column "methods that are not run" in the test result file;

[0032] After the results of each test case are compared, clear the cache, reload the new test case "expected results" and test log file, and repeat the above steps.

[0033] According to a second aspect of the present invention, an integrated testing tool based on the automated integrated testing method for a rail transit signal system is provided, comprising:

[0034] The configuration processing module is used to read the test case document exported by the requirement verification management module, and copy the expected result column of each test case in the test case document to the expected result column in the configuration file;

[0035] A data preprocessing module is used to read the configuration file and move the software code to be tested to the specified path given in the configuration file;

[0036] Code stubbing module, used to load the software code to be tested and perform batch stubbing;

[0037] The test case execution module is used to execute the test cases in sequence according to the configuration file data and in the order of the test case number-step number until all the test cases in this round are executed, and save the test logs generated during the execution of the test cases to the specified path;

[0038] The test result comparison module is used to read and parse the test log file, compare the parsed data with the expected effect in the configuration file, and generate a test result document.

[0039] According to a third aspect of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, any one of the methods described above is implemented.

[0040] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, any one of the methods described above is implemented.

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

[0042] (1) The software integration testing method for rail transit system of the present invention realizes the functions of automatic code stub insertion and automatic execution of use cases, thereby eliminating the time for testers to manually find the location of code test points, manually modify the code to add stub functions, and manually run the software to execute the test, thereby avoiding testers from performing a large amount of repetitive and inefficient work, reducing the time and effort consumed by integration testing, improving testing efficiency, and shortening the development cycle of rail transit signal system software.

[0043] (2) The automated integrated test tool of the present invention realizes the functions of automatic comparison and automatic recording of test results, avoiding the problems of inaccurate test results and incomplete test records caused by misjudgment and omissions due to subjective factors such as fatigue and unclear thinking of testers, ensuring the accuracy of test results and improving the reliability of rail transit signal system software. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1A flow chart of an automated integrated testing method for a rail transit signal system according to the present invention;

[0045] Figure 2 Flowchart for performing integration testing for automated integration testing tools;

[0046] Figure 3 Module decomposition diagram for automated integration testing tools;

[0047] Figure 4 A breakdown of the code stub module;

[0048] Figure 5 This is an exploded view of the result comparison module. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0050] Example

[0051] In view of the defects existing in the integration test process of the rail transit signal system, this embodiment has developed an automated integration test method for the rail transit signal system, which can automatically complete the series of test steps from preparing input data to comparing test results and the middle based on the configuration file provided by the tester and the test case document exported from the requirement verification management module RVS, and automatically generate test results and test logs. If the test case fails, it will be clearly recorded in the generated test results, prompting the tester to check the reliability of the software.

[0052] The automated integrated testing method for a rail transit signal system proposed in this embodiment is as follows: Figure 1 As shown, including:

[0053] S1. Configuration processing: read the test case document exported by the requirement verification management module, copy the expected result column of each test case in the test case document to the expected result column in the configuration file, and modify the expected result data in the configuration file to the standard form (for example, the [.] function of the [.] module [.] class is called).

[0054] S2. Data preprocessing: Use the EasyExcel class in JAVA to automatically read the configuration file in Excel format in the specified directory, and use JAVA's FILE class to move the software code to be tested to the specified path in the configuration file; use the data stream reading method to obtain the storage path information of the software to be tested and the test log, and at the same time obtain the data in the "Use Case Number-Step Number", "Whether to Execute", and "Expected Results" columns in the configuration file and store them in categories; determine whether this use case is executed in this round of testing based on the information filled in the "Whether to Execute" column.

[0055] S3. Code stubbing: Load the code of the software to be tested and perform batch stubbing, including: loading the code of the software to be tested, traversing and filtering out class and interface types, traversing the class and interface types, obtaining all constructors and methods defined by the filtered class and interface types and traversing them, printing all constructor names or method names that do not contain super() or this() calls and the corresponding class names or interface names, and composing corresponding statements to be inserted into the header of the constructor or method code block.

[0056] S4. Test case execution: According to the configuration file data, the test case numbers and step numbers are sorted in order from small to large, and each test case is given a separate ID number; the test cases are run in order from small to large according to the ID number: a test log file is created to the log path configured in the configuration file. During each test case test, the software under test is automatically run by calling the getExecute() method, and the log of each execution of the software under test is saved in the test log file. The test log file includes the ID number and the test case number-step number; after each test case is executed, the cache area is cleared, a new test case input file is reloaded, and the above operations are repeated until all test cases in this round are executed.

[0057] S5. Comparison of test results: obtain the data in the "Expected Result" column read from the configuration file and the test log file saved during the execution process, compare and generate a new Excel test result file; take out the "Expected Result" and test log files with the same ID number, identify the characteristic identifier of the function to be tested, take out the complete function name, perform string comparison, and through two loops, find out whether the specified function of the specified class listed in the "Expected Result" column is run during the execution of the test case; if all the functions to be tested are run, fill in "Success" in the "Whether Successful" column added to the test result file; if any function to be tested is not run, fill in "Failure" in the "Whether Successful" column added to the test result file, where the function that is not run will generate a record and be added to the second column "Methods that have not been run" in the test result file; after the result comparison of each test case is completed, clear the cache area, reload the new test case "Expected Result" and test log file, and repeat the above operation.

[0058] In addition, this embodiment develops an integrated test automation tool for rail transit signal systems to address defects in the integrated test process of rail transit signal systems. By adding multiple automation modules, it can automatically complete the process from preparing input data to comparing test results and a series of test steps in between, and automatically generate test results and test logs based on the configuration files provided by the testers and the test case documents exported from the requirements verification management module RVS. If the test case fails, it will be clearly recorded in the generated test results, prompting the testers to check the reliability of the software.

[0059] like Figure 3 to Figure 5 As shown, this embodiment also provides an automated integrated testing tool for a rail transit signal system, including:

[0060] Configuration processing module: Automatically read the test case document taken out from the requirement verification management module RVS, and automatically copy the "expected result" column of each case in the test case document to the "expected result" column in the corresponding configuration file excel document. Modify the "expected result" to the standard form (the [] function of the [] module [] class is called). Using the EasyExcel class in JAVA, the tool automatically reads the configuration file excel document in the specified directory. Using the data flow reading method, obtain the path information of the tested software and the test log storage, and at the same time obtain the data in the "case number-step number", "whether to execute", and "expected result" columns in the excel document and classify them into the storage area. According to the "Y" or "N" filled in the "whether to execute" column, determine whether this case is executed in this round of testing. If "Y" is filled in, the automation tool will perform subsequent operations to ensure that this case is executed and the test results are generated. If "N" is filled in, the execution of this case will be skipped and no test results will be generated.

[0061] Data preprocessing module: Use JAVA's FILE class to move the input file to the path preset in the configuration file. Add import statements to the software code to be tested, import the Excel file parsing module, stub function adding module, and case running module in the automation tool jar package. If you add statements repeatedly, the automation tool will alarm and display "Repeatinsert code, insert cancel!". Load the test case data.

[0062] Code stubbing module: load the software code to be tested, and use the JavaParser library to parse the software code to be tested. Traverse the software code to be tested and filter out all class and interface type definitions. Get all constructors and methods defined by the above class and interface types and traverse them, print out all constructor names or method names that do not contain super() or this() calls and the corresponding class names or interface names, and then construct these names into a statement trackMethodCall("full class name or interface name", "constructor or method name") and insert it at the beginning of the constructor or method code block.

[0063] Test case execution: Take out the "case number-step number" data read from the configuration file, sort them in order according to the principle of different case numbers, from small to large, and from small to large for the same case numbers, and give each case a unique ID number (starting from 1 and continuous). The automation tool will run the cases in order from small to large according to the ID number for testing. The automation tool will create a test log file to the log path configured in the configuration file. During each case test, the automation tool will automatically run the software under test by calling the getExecute() method, and save the log of each time the software under test runs to the test log file. The log will have an ID number, and the case number-step number is easy for testers to distinguish. After each test case is executed, the automation tool will clear the cache, reload the new test case input file, and repeat the above operations.

[0064] Result comparison module: Get the "expected result" column data read from the configuration file and the test log file saved during the tool execution, compare the two, and generate a new excel test result file. Take out the "expected result" and test log files with the same ID number, identify the characteristic identifier of the function to be tested, take out the complete function name, perform string comparison, and find out whether the specified function of the specified class listed in the "expected result" column is run during the test case execution through two cycles. If all the functions to be tested are run, fill in "success" in the "whether successful" column added to the test result file. If there are functions to be tested that are not run, fill in "failure" in the "whether successful" column added to the test result file. The functions that are not run will generate records and be added to the second column "methods that are not run" in the test result file for testers to review; after the result comparison of each test case is completed, the integrated test tool will clear the cache, reload the new test case "expected result" and test log file, and repeat the above operations.

[0065] like Figure 2 As shown in the figure, the specific process of the automated integration testing tool to perform integration testing is as follows:

[0066] 1) Automatically read the test case documents exported by the verification management module RVS;

[0067] 2) Import test cases;

[0068] 3) Read the configuration file;

[0069] 4) Automatically prepare input data;

[0070] 5) Automatic code stubbing;

[0071] 6) Call and execute the tool under test;

[0072] 7) Collect use case step logs;

[0073] 8) Automatically compare test results;

[0074] 9) Output test results.

[0075] The electronic device of the present invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) or loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0076] Multiple components in the device are connected to the I / O interface, including: input units, such as keyboards, mice, etc.; output units, such as various types of displays, speakers, etc.; storage units, such as disks, optical disks, etc.; and communication units, such as network cards, modems, wireless communication transceivers, etc. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunication networks.

[0077] The processing unit performs the various methods and processes described above, such as methods S1 to S5. For example, in some embodiments, methods S1 to S5 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into the RAM and executed by the CPU, one or more steps of methods S1 to S5 described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute methods S1 to S5 in any other appropriate manner (e.g., by means of firmware).

[0078] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip systems (SOCs), load programmable logic devices (CPLDs), and the like.

[0079] The program code for implementing the method of the present invention can be based on the JAVA language. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as an independent software package and partially on a remote machine, or completely on a remote machine or server.

[0080] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0081] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. An automated integrated testing method for a rail transit signal system, characterized in that: The method includes: Configuration processing: read the test case document exported by the requirement verification management module, and copy the expected result column of each test case in the test case document to the expected result column in the configuration file; Data preprocessing: Read the configuration file and move the software code to be tested to the specified path given in the configuration file; Code stubbing: load the software code to be tested and perform batch stubbing; Test case execution: According to the configuration file data, the test cases are executed in the order of case number-step number until all the test cases in this round are executed, and the test logs generated during the execution of the test cases are saved to the specified path; Test result comparison: Read and parse the test log file, compare the parsed data with the expected effect in the configuration file, and generate a test result document.

2. The automated integrated testing method for a rail transit signal system according to claim 1, characterized in that: The configuration process further includes: Use data stream reading to obtain the tested software and test log storage path information, and at the same time obtain the data in the "Use Case Number-Step Number", "Whether to Execute", and "Expected Result" columns in the configuration file and store them in categories; Determine whether this use case is executed in this round of testing based on the information filled in the Execution column.

3. The automated integrated testing method for a rail transit signal system according to claim 1, characterized in that: The configuration process also includes modifying the expected result data in the configuration file to a standard form, wherein the standard form is specifically: the [.] function of the [.] module [.] class is called.

4. The automated integrated testing method for a rail transit signal system according to claim 1, characterized in that: The automatic reading of configuration files in the data preprocessing is specifically as follows: the EasyExcel class in JAVA is used to automatically read the configuration files in the excel format in the specified directory.

5. The automated integrated testing method for a rail transit signal system according to claim 1, characterized in that: The moving the software code to be tested to the specified path given in the configuration file specifically includes: using the FILE class of JAVA to move the software code to be tested to the specified path in the configuration file.

6. The automated integrated testing method for a rail transit signal system according to claim 1, characterized in that: In the code stubbing, the code of the software to be tested is loaded and batch stubbing is performed, which specifically includes: Load the code of the software to be tested, traverse and filter out the class and interface types, traverse the class and interface types, filter out the constructors and methods without inheritance, and add stub functions to the constructor and method headers.

7. The automated integrated testing method for a rail transit signal system according to claim 6, characterized in that: The filtering out of constructors and methods without inheritance and adding stub functions to the constructor and method headers specifically includes: Get all constructors and methods defined by the filtered class and interface types and traverse them, print all constructor names or method names that do not contain super() or this() calls and the corresponding class names or interface names, and form corresponding statements to insert into the header of the constructor or method code block.

8. The automated integrated testing method for a rail transit signal system according to claim 2, characterized in that: The test case execution specifically includes: Read the "Use Case Number - Step Number" column data from the configuration file, sort them in ascending order of use case number and step number, and give each use case a separate ID number; Run the test cases in order from small to large ID numbers: create a test log file to the log path configured in the configuration file. When testing each test case, automatically run the software under test by calling the getExecute() method, and save the log of each execution of the software under test to the test log file. The test log file includes the ID number and the test case number-step number. After each test case is executed, clear the buffer, reload the new test case input file, and repeat the above steps.

9. The automated integrated testing method for a rail transit signal system according to claim 2, characterized in that: The test result comparison and generation specifically includes: Get the "Expected Result" column data read from the configuration file and the test log file saved during the execution process, and compare them to generate a new Excel test result file; Take out the "Expected Result" and test log files with the same ID number, identify the characteristic identifier of the function to be tested, take out the complete function name, perform string comparison, and find out whether the specified function of the specified class listed in the "Expected Result" column is run during the test case execution through two loops; if all the functions to be tested are run, fill in "Success" in the "Whether Success" column added to the test result file; if any function to be tested is not run, fill in "Failure" in the "Whether Success" column added to the test result file. The function that is not run will generate a record and be added to the second column "Methods that are not run" in the test result file; After the results of each test case are compared, clear the cache, reload the new test case "expected results" and test log file, and repeat the above steps.

10. An integrated testing tool based on the automated integrated testing method for rail transit signal systems according to claim 1, characterized in that: include: The configuration processing module is used to read the test case document exported by the requirement verification management module, and copy the expected result column of each test case in the test case document to the expected result column in the configuration file; A data preprocessing module is used to read the configuration file and move the software code to be tested to the specified path given in the configuration file; Code stubbing module, used to load the software code to be tested and perform batch stubbing; The test case execution module is used to execute the test cases in sequence according to the configuration file data and in the order of the test case number-step number until all the test cases in this round are executed, and save the test logs generated during the execution of the test cases to the specified path; The test result comparison module is used to read and parse the test log file, compare the parsed data with the expected effect in the configuration file, and generate a test result document.

11. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 9 is implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Cited By

  • Automatic test scheduling management method and device based on data driving

    CN120316000A