CN117112450A - Method and device for testing temporary speed limiting server - Google Patents

Method and device for testing temporary speed limiting server Download PDF

Info

Publication number
CN117112450A
CN117112450A CN202311379106.2A CN202311379106A CN117112450A CN 117112450 A CN117112450 A CN 117112450A CN 202311379106 A CN202311379106 A CN 202311379106A CN 117112450 A CN117112450 A CN 117112450A
Authority
CN
China
Prior art keywords
basic function
test
tested
step number
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311379106.2A
Other languages
Chinese (zh)
Other versions
CN117112450B (en
Inventor
毕晋攀
陈莹
王秋莉
徐建华
徐东晖
田恩彤
曹欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Casco Signal Beijing Ltd
Original Assignee
Casco Signal Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Casco Signal Beijing Ltd filed Critical Casco Signal Beijing Ltd
Priority to CN202311379106.2A priority Critical patent/CN117112450B/en
Publication of CN117112450A publication Critical patent/CN117112450A/en
Application granted granted Critical
Publication of CN117112450B publication Critical patent/CN117112450B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method and a device for testing a temporary speed limiting server, and relates to the technical field of temporary speed limiting servers. The method of the application comprises the following steps: receiving a basic function test request; acquiring a function description text corresponding to the basic function to be tested from a software basic function library according to the unique identifier corresponding to the basic function to be tested, and acquiring a test data set corresponding to the basic function to be tested from a target database according to the unique identifier corresponding to the basic function to be tested; generating a test script corresponding to the basic function to be tested according to the function description text corresponding to the basic function to be tested and the test data set; receiving a test step selection request; sequentially sending the data packets to be input corresponding to each target step number to a receiving port corresponding to the target TSRS software so that the target TSRS software outputs the actual output data packets corresponding to each target step number; a test result document is generated based on the one or more actual output data packets.

Description

Method and device for testing temporary speed limiting server
Technical Field
The application relates to the technical field of temporary speed limiting servers, in particular to a method and a device for testing a temporary speed limiting server.
Background
The temporary speed limiting server (TSRS, temporary Speed Restriction Server) is an important component of the China train operation control system (CTCS, chinese TrainControl System), and the TSRS can distribute temporary speed limiting information to each train control center and each wireless blocking center according to a temporary speed limiting command, so that the running safety of the high-speed rail train is ensured.
In order to ensure that each basic function contained in the TSRS software meets the requirements, each basic function contained in the TSRS software needs to be tested before the TSRS software is put into use.
Currently, a worker usually generates a test script manually, and then tests each basic function included in the TSRS software based on the test script. Thus, testing individual basic functions contained in TSRS software is severely dependent on personal experience capabilities of the staff and understanding business knowledge, and may not be accomplished for inexperienced staff.
Disclosure of Invention
The embodiment of the application provides a method and a device for testing a temporary speed limiting server, which mainly aim at testing all basic functions contained in TSRS software.
In order to solve the technical problems, the embodiment of the application provides the following technical scheme:
in a first aspect, the present application provides a method of testing a temporary speed limit server, the method comprising:
receiving a basic function test request, wherein the basic function test request comprises a unique identifier corresponding to a basic function to be tested;
acquiring a function description text corresponding to the basic function to be tested from a software basic function library according to the unique identifier corresponding to the basic function to be tested, and acquiring a test data set corresponding to the basic function to be tested from a target database according to the unique identifier corresponding to the basic function to be tested;
generating a test script corresponding to the basic function to be tested according to the function description text and the test data set corresponding to the basic function to be tested, wherein the test script comprises a plurality of step numbers and data packets to be input corresponding to each step number;
receiving a test step selection request, wherein the test step selection request comprises one or more target step numbers;
sequentially sending the data packets to be input corresponding to each target step number to a receiving port corresponding to target TSRS software, so that the target TSRS software outputs actual output data packets corresponding to each target step number;
And generating the test result document according to one or more of the actual output data packets.
In a second aspect, the present application also provides an apparatus for testing a temporary speed limit server, the apparatus comprising:
the first receiving unit is used for receiving a basic function test request, wherein the basic function test request comprises a unique identifier corresponding to a basic function to be tested;
the acquisition unit is used for acquiring a function description text corresponding to the basic function to be tested in a software basic function library according to the unique identifier corresponding to the basic function to be tested, and acquiring a test data set corresponding to the basic function to be tested in a target database according to the unique identifier corresponding to the basic function to be tested;
the first generation unit is used for generating a test script corresponding to the basic function to be tested according to the function description text and the test data set corresponding to the basic function to be tested, wherein the test script comprises a plurality of step numbers and data packets to be input corresponding to each step number;
the second receiving unit is used for receiving a test step selection request, wherein the test step selection request comprises one or more target step numbers;
The input unit is used for sequentially sending the data packets to be input corresponding to each target step number to a receiving port corresponding to target TSRS software so that the target TSRS software outputs the actual output data packets corresponding to each target step number;
and the second generation unit is used for generating the test result document according to one or more of the actual output data packets.
In a third aspect, an embodiment of the present application provides a storage medium, where the storage medium includes a stored program, where the program, when executed, controls a device where the storage medium is located to execute the method for testing a temporary speed limit server according to the first aspect.
In a fourth aspect, embodiments of the present application provide an apparatus for testing a temporary speed limit server, the apparatus comprising a storage medium; and one or more processors coupled to the storage medium, the processors configured to execute the program instructions stored in the storage medium; the program instructions, when run, perform the method of testing a temporary speed limit server of the first aspect.
By means of the technical scheme, the technical scheme provided by the application has at least the following advantages:
The application provides a method and a device for testing a temporary speed limiting server, which can obtain a basic function test request carrying a unique identifier corresponding to a basic function to be tested after a basic function test application program receives the basic function test request, wherein the basic function test application program firstly obtains a function description text corresponding to the basic function to be tested in a software basic function library according to the unique identifier corresponding to the basic function to be tested, obtains a test data set corresponding to the basic function to be tested in a target database according to the unique identifier corresponding to the basic function to be tested, and then generates a test script corresponding to the basic function to be tested according to the function description text and the test data set corresponding to the basic function to be tested, and the test script comprises a plurality of step numbers and data packets to be input corresponding to each step number; after receiving a test step selection request carrying one or more target step numbers, the basic function test application program sequentially sends data packets to be input corresponding to each target step number to a receiving port corresponding to target TSRS software so that the target TSRS software outputs actual output data packets corresponding to each target step number; after receiving the actual output data packet corresponding to each target step number, the basic function test application program generates a test result document according to one or more actual output data packets, thereby realizing the test of the basic function to be tested. Therefore, in the application, the work of testing each basic function contained in the target TSRS software can be completed without the participation of staff.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present application more readily apparent.
Drawings
The above, as well as additional purposes, features, and advantages of exemplary embodiments of the present application will become readily apparent from the following detailed description when read in conjunction with the accompanying drawings. In the drawings, wherein like or corresponding reference numerals indicate like or corresponding parts, there are shown by way of illustration, and not limitation, several embodiments of the application, in which:
FIG. 1 shows a flow chart of a method for testing a temporary speed limit server provided by an embodiment of the application;
FIG. 2 shows a block diagram of an apparatus for testing a temporary speed limit server according to an embodiment of the present application;
fig. 3 shows a block diagram of another apparatus for testing a temporary speed limit server according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
It is noted that unless otherwise indicated, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs.
The embodiment of the application provides a method for testing a temporary speed limiting server, as shown in fig. 1, comprising the following steps:
101. a basic function test request is received.
In the embodiment of the present application, the execution subject in each step is a basic function test application running in a target terminal device, and the target terminal device may be, but is not limited to,: computers, smart phones, tablet computers, etc.
The target TSRS software is TSRS software which needs to be subjected to basic function test, and comprises a plurality of basic functions; the basic function test request comprises a unique identifier corresponding to a basic function to be tested, wherein the basic function to be tested is any basic function of a plurality of basic functions contained in target TSRS software.
In the embodiment of the application, when a worker needs to test a certain basic function (namely, a basic function to be tested) of the target TSRS software, the worker sends a basic function test request carrying a unique identifier corresponding to the basic function to be tested to a basic function test application program, and at the moment, the basic function test application program can receive the basic function test request.
102. Acquiring a function description text corresponding to the basic function to be tested from a software basic function library according to the unique identifier corresponding to the basic function to be tested, and acquiring a test data set corresponding to the basic function to be tested from a target database according to the unique identifier corresponding to the basic function to be tested.
The software basic function library is constructed by an expert group in the railway field according to all basic functions contained in target TSRS software, and comprises a function description text and a unique identifier corresponding to each basic function contained in the target TSRS software, wherein for any function description text corresponding to the basic function, the function description text comprises a plurality of step numbers, an operation description text corresponding to each step number and an expected result text; the target database comprises a test data set and a unique identifier, wherein the test data set corresponds to each basic function contained in target TSRS software, and for any one test data set, the test data set comprises a plurality of data types and test data corresponding to each data type.
In the embodiment of the application, after receiving the basic function test request carrying the unique identifier corresponding to the basic function to be tested, the basic function test application program can acquire the function description text corresponding to the basic function to be tested in the software basic function library according to the unique identifier corresponding to the basic function to be tested, and acquire the test data set corresponding to the basic function to be tested in the target database according to the unique identifier corresponding to the basic function to be tested.
103. And generating a test script corresponding to the basic function to be tested according to the function description text corresponding to the basic function to be tested and the test data set.
In the embodiment of the application, after the basic function test application program obtains the function description text and the test data set corresponding to the basic function to be tested, the test script corresponding to the basic function to be tested can be generated according to the function description text and the test data set corresponding to the basic function to be tested.
104. Executing the test script to obtain a test result document corresponding to the basic function to be tested.
In the embodiment of the application, after the basic function testing application program obtains the testing script corresponding to the basic function to be tested, the testing script corresponding to the basic function to be tested can be executed, so that the basic function to be tested is tested, and after the execution of the testing script corresponding to the basic function to be tested is completed, the testing result document corresponding to the basic function to be tested can be obtained.
Specifically, in this step, the basic function test application executes the test script, so that the specific process of obtaining the test result document corresponding to the basic function to be tested is:
The test script corresponding to the basic function to be tested comprises a plurality of step numbers and data packets to be input corresponding to each step number.
When a worker expects to test a basic function to be tested based on a certain or a plurality of test steps in a test script corresponding to the basic function to be tested, the worker sends a test step selection request carrying one or a plurality of target step numbers to a basic function test application program, after obtaining the test step selection request, the basic function test application program sequentially sends a data packet to be input corresponding to each target step number to a receiving port corresponding to target TSRS software, so that the target TSRS software outputs an actual output data packet corresponding to each target step number, after receiving the actual output data packet corresponding to each target step number, a test result document can be generated according to one or a plurality of actual output data packets, wherein for any one target step number, after the data packet to be input corresponding to the target step number is sent to the receiving port of the target TSRS software, the target TSRS software executes a test execution action carried in the data packet to be input based on the data to be input carried in the data packet to be input, and after executing the test execution action, the output port of the target TSRS software outputs the actual output data packet corresponding to the target step number.
The embodiment of the application provides a method for testing a temporary speed limiting server, which can obtain a basic function test request carrying a unique identifier corresponding to a basic function to be tested after a basic function test application program receives the basic function test request, wherein the basic function test application program firstly obtains a function description text corresponding to the basic function to be tested in a software basic function library according to the unique identifier corresponding to the basic function to be tested, obtains a test data set corresponding to the basic function to be tested in a target database according to the unique identifier corresponding to the basic function to be tested, and then generates a test script corresponding to the basic function to be tested according to the function description text and the test data set corresponding to the basic function to be tested, and the test script comprises a plurality of step numbers and data packets to be input corresponding to each step number; after receiving a test step selection request carrying one or more target step numbers, the basic function test application program sequentially sends data packets to be input corresponding to each target step number to a receiving port corresponding to target TSRS software so that the target TSRS software outputs actual output data packets corresponding to each target step number; after receiving the actual output data packet corresponding to each target step number, the basic function test application program generates a test result document according to one or more actual output data packets, thereby realizing the test of the basic function to be tested. Therefore, in the embodiment of the application, the work of testing each basic function contained in the target TSRS software can be completed without the participation of staff.
Further, in the embodiment of the present application, the test script further includes an expected output data packet corresponding to each step number;
after obtaining the test result document corresponding to the basic function to be tested, the basic function test application program can also compare the expected output data packet corresponding to each target step number with the actual output data packet to obtain a comparison result corresponding to each target step number, and generate an analysis result document according to a plurality of comparison results, wherein for any one target step number, when the keywords in the expected output data packet corresponding to the target step number are the same as the keywords in the actual output data packet, the comparison result corresponding to the target step number is the same as the keywords in the expected output data packet, and when the keywords in the expected output data packet corresponding to the target step number are different from the keywords in the actual output data packet, the comparison result corresponding to the target step number is inconsistent.
Further, in the embodiment of the present application, the specific process of the basic function test application program generating the test script corresponding to the basic function to be tested according to the function description text and the test data set corresponding to the basic function to be tested is:
Firstly, acquiring a preset case template; then, generating a test case form corresponding to the basic function to be tested according to a preset case template and a function description text corresponding to the basic function to be tested; and finally, generating a test script corresponding to the basic function to be tested according to the test case table and the test data set corresponding to the basic function to be tested.
Specifically, in the step, the function description text corresponding to the basic function to be tested includes a plurality of step numbers, and a test operation description text and an expected result text corresponding to each step number; the basic function test application program generates a test case table corresponding to the basic function to be tested according to a preset case template and a function description text corresponding to the basic function to be tested, and the specific process is as follows:
firstly, matching a test operation description text and an expected result text corresponding to each step number with a template keyword corresponding to a preset case template respectively to obtain test operation information and expected result information corresponding to each step number, wherein for the test operation information corresponding to any step number, the test operation information comprises: the unique identifier of the operator corresponding to the step number, the test execution action and the data type of the data to be input, and for the expected result information corresponding to any step number, the expected result information includes: the unique identifier of the operator corresponding to the step number, the data type of expected output data, key fields and value; and secondly, adding the step numbers, the test operation information corresponding to each step number and the expected result information into a preset case template to obtain a test case form corresponding to the basic function to be tested.
Specifically, in this step, the test data set corresponding to the basic function to be tested includes a plurality of data types and test data corresponding to each data type, the test operation information corresponding to any one step number includes the data type of the data to be input, and the expected result information corresponding to any one step number includes the data type of the expected output data; the specific process of the basic function test application program generating the test script corresponding to the basic function to be tested according to the test case table and the test data set corresponding to the basic function to be tested is as follows:
firstly, according to the data type of the data to be input and the data type of the expected output data corresponding to each step number, acquiring the data to be input and the expected output data corresponding to each step number from a test data set corresponding to a basic function to be tested; secondly, adding the data to be input corresponding to each step number to the test operation information corresponding to each step number in the test case table corresponding to the basic function to be tested (namely, adding the data to be input corresponding to the first step number to the test operation information corresponding to the first step number and the data to be input corresponding to the second step number to the test operation information … corresponding to the second step number in the test case table corresponding to the basic function to be tested), and adding the expected output data corresponding to each step number to the expected result information corresponding to each step number (namely, adding the expected output data corresponding to the first step number to the expected result information corresponding to the first step number and the expected output data corresponding to the second step number to the expected result information … corresponding to the second step number in the test case table corresponding to the basic function to be tested); thirdly, generating a data packet to be input corresponding to each step number according to test operation information corresponding to each step number recorded in a test case table corresponding to the basic function to be tested, and generating an expected output data packet corresponding to each step number according to expected result information corresponding to each step number recorded in the test case table corresponding to the basic function to be tested; and finally, generating a test script corresponding to the basic function to be tested according to the step numbers, the data packet to be input corresponding to each step number and the expected output data packet.
Further, as an implementation of the method shown in fig. 1, another embodiment of the present application further provides an apparatus for testing a temporary speed limiting server. The embodiment of the device corresponds to the embodiment of the method, and for convenience of reading, details of the embodiment of the method are not repeated one by one, but it should be clear that the device in the embodiment can correspondingly realize all the details of the embodiment of the method. The device is applied to test each basic function contained in target TSRS software, and specifically as shown in FIG. 2, the device comprises:
a first receiving unit 21, configured to receive a basic function test request, where the basic function test request includes a unique identifier corresponding to a basic function to be tested;
the obtaining unit 22 is configured to obtain, in a software basic function library, a function description text corresponding to the basic function to be tested according to the unique identifier corresponding to the basic function to be tested, and obtain, in a target database, a test data set corresponding to the basic function to be tested according to the unique identifier corresponding to the basic function to be tested;
a first generating unit 23, configured to generate a test script corresponding to the basic function to be tested according to a function description text and a test data set corresponding to the basic function to be tested, where the test script includes a plurality of step numbers and a data packet to be input corresponding to each step number;
A second receiving unit 24, configured to receive a test step selection request, where the test step selection request includes one or more target step numbers;
an input unit 25, configured to sequentially send the data packets to be input corresponding to each target step number to a receiving port corresponding to a target TSRS software, so that the target TSRS software outputs an actual output data packet corresponding to each target step number;
a second generating unit 26, configured to generate the test result document according to one or more of the actual output data packets.
Further, as shown in fig. 3, the test script further includes an expected output data packet corresponding to each step number; the apparatus further comprises:
the comparison unit 27 is configured to compare the expected output data packet corresponding to each target step number with the actual output data packet, so as to obtain a comparison result corresponding to each target step number;
and a third generating unit 28 for generating an analysis result document according to a plurality of the comparison results.
Further, as shown in fig. 3, the first generating unit 23 is specifically configured to: acquiring a preset case template; generating a test case form corresponding to the basic function to be tested according to the preset case template and a function description text corresponding to the basic function to be tested; and generating a test script corresponding to the basic function to be tested according to the test case table and the test data set corresponding to the basic function to be tested.
Further, as shown in fig. 3, the test data set corresponding to the basic function to be tested includes a plurality of data types and test data corresponding to each data type, the test operation information corresponding to any one of the step numbers includes a data type of the data to be input, and the expected result information corresponding to any one of the step numbers includes a data type of the expected output data;
the first generating unit 23 is specifically configured to: acquiring the data to be input and the expected output corresponding to each step number from a test data set corresponding to the basic function to be tested according to the data type of the data to be input and the data type of the expected output corresponding to each step number; adding the data to be input corresponding to each step number to the test operation information corresponding to each step number in the test case table corresponding to the basic function to be tested, and adding the expected output data corresponding to each step number to the expected result information corresponding to each step number; generating a data packet to be input corresponding to each step number according to the test operation information corresponding to each step number, and generating an expected output data packet corresponding to each step number according to expected result information corresponding to each step number; and generating a test script corresponding to the basic function to be tested according to the step numbers, the data packet to be input corresponding to each step number and the expected output data packet.
Further, as shown in fig. 3, the function description text corresponding to the basic function to be tested includes a plurality of step numbers, and a test operation description text and an expected result text corresponding to each step number;
the first generating unit 23 is specifically configured to: matching the test operation description text and the expected result text corresponding to each step number with the template keywords corresponding to the preset case template respectively to obtain test operation information and expected result information corresponding to each step number; and adding a plurality of step numbers and test operation information and expected result information corresponding to each step number into the preset case template to obtain a test case table corresponding to the basic function to be tested.
The embodiment of the application provides a method and a device for testing a temporary speed limiting server, which can obtain a basic function test request carrying a unique identifier corresponding to a basic function to be tested after a basic function test application program receives the basic function test request, wherein the basic function test application program firstly obtains a function description text corresponding to the basic function to be tested in a software basic function library according to the unique identifier corresponding to the basic function to be tested, obtains a test data set corresponding to the basic function to be tested in a target database according to the unique identifier corresponding to the basic function to be tested, and then generates a test script corresponding to the basic function to be tested according to the function description text and the test data set corresponding to the basic function to be tested, and the test script comprises a plurality of step numbers and data packets to be input corresponding to each step number; after receiving a test step selection request carrying one or more target step numbers, the basic function test application program sequentially sends data packets to be input corresponding to each target step number to a receiving port corresponding to target TSRS software so that the target TSRS software outputs actual output data packets corresponding to each target step number; after receiving the actual output data packet corresponding to each target step number, the basic function test application program generates a test result document according to one or more actual output data packets, thereby realizing the test of the basic function to be tested. Therefore, in the embodiment of the application, the work of testing each basic function contained in the target TSRS software can be completed without the participation of staff.
The embodiment of the application provides a storage medium which comprises a stored program, wherein when the program runs, equipment where the storage medium is located is controlled to execute the method for testing the temporary speed limiting server.
The storage medium may include volatile memory, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the application also provides a device for testing the temporary speed limiting server, which comprises a storage medium; and one or more processors coupled to the storage medium, the processors configured to execute the program instructions stored in the storage medium; and executing the method for testing the temporary speed limiting server when the program instructions run.
The embodiment of the application provides equipment, which comprises a processor, a memory and a program stored in the memory and capable of running on the processor, wherein the processor realizes the following steps when executing the program:
receiving a basic function test request, wherein the basic function test request comprises a unique identifier corresponding to a basic function to be tested;
Acquiring a function description text corresponding to the basic function to be tested from a software basic function library according to the unique identifier corresponding to the basic function to be tested, and acquiring a test data set corresponding to the basic function to be tested from a target database according to the unique identifier corresponding to the basic function to be tested;
generating a test script corresponding to the basic function to be tested according to the function description text and the test data set corresponding to the basic function to be tested, wherein the test script comprises a plurality of step numbers and data packets to be input corresponding to each step number;
receiving a test step selection request, wherein the test step selection request comprises one or more target step numbers;
sequentially sending the data packets to be input corresponding to each target step number to a receiving port corresponding to target TSRS software, so that the target TSRS software outputs actual output data packets corresponding to each target step number;
and generating the test result document according to one or more of the actual output data packets.
Further, the test script further comprises an expected output data packet corresponding to each step number; the method further comprises the steps of:
Comparing the expected output data packet corresponding to each target step number with the actual output data packet to obtain a comparison result corresponding to each target step number;
and generating an analysis result document according to the comparison results.
Further, the generating the test script corresponding to the basic function to be tested according to the function description text and the test data set corresponding to the basic function to be tested includes:
acquiring a preset case template;
generating a test case form corresponding to the basic function to be tested according to the preset case template and a function description text corresponding to the basic function to be tested;
and generating a test script corresponding to the basic function to be tested according to the test case table and the test data set corresponding to the basic function to be tested.
Further, the test data set corresponding to the basic function to be tested comprises a plurality of data types and test data corresponding to each data type, the test operation information corresponding to any one step number comprises the data type of the data to be input, and the expected result information corresponding to any one step number comprises the data type of the expected output data; the generating the test script corresponding to the basic function to be tested according to the test case table and the test data set corresponding to the basic function to be tested includes:
Acquiring the data to be input and the expected output corresponding to each step number from a test data set corresponding to the basic function to be tested according to the data type of the data to be input and the data type of the expected output corresponding to each step number;
adding the data to be input corresponding to each step number to the test operation information corresponding to each step number in the test case table corresponding to the basic function to be tested, and adding the expected output data corresponding to each step number to the expected result information corresponding to each step number;
generating a data packet to be input corresponding to each step number according to the test operation information corresponding to each step number, and generating an expected output data packet corresponding to each step number according to expected result information corresponding to each step number;
and generating a test script corresponding to the basic function to be tested according to the step numbers, the data packet to be input corresponding to each step number and the expected output data packet.
Further, the function description text corresponding to the basic function to be tested comprises a plurality of step numbers, a test operation description text corresponding to each step number and an expected result text; the generating a test case table corresponding to the basic function to be tested according to the preset case template and the function description text corresponding to the basic function to be tested includes:
Matching the test operation description text and the expected result text corresponding to each step number with the template keywords corresponding to the preset case template respectively to obtain test operation information and expected result information corresponding to each step number;
and adding a plurality of step numbers and test operation information and expected result information corresponding to each step number into the preset case template to obtain a test case table corresponding to the basic function to be tested.
The application also provides a computer program product adapted to perform, when executed on a data processing device, a program code initialized with the method steps of: receiving a basic function test request, wherein the basic function test request comprises a unique identifier corresponding to a basic function to be tested; acquiring a function description text corresponding to the basic function to be tested from a software basic function library according to the unique identifier corresponding to the basic function to be tested, and acquiring a test data set corresponding to the basic function to be tested from a target database according to the unique identifier corresponding to the basic function to be tested; generating a test script corresponding to the basic function to be tested according to the function description text and the test data set corresponding to the basic function to be tested, wherein the test script comprises a plurality of step numbers and data packets to be input corresponding to each step number; receiving a test step selection request, wherein the test step selection request comprises one or more target step numbers; sequentially sending the data packets to be input corresponding to each target step number to a receiving port corresponding to target TSRS software, so that the target TSRS software outputs actual output data packets corresponding to each target step number; and generating the test result document according to one or more of the actual output data packets.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (10)

1. A method of testing a temporary speed limit server, the method comprising:
receiving a basic function test request, wherein the basic function test request comprises a unique identifier corresponding to a basic function to be tested;
acquiring a function description text corresponding to the basic function to be tested from a software basic function library according to the unique identifier corresponding to the basic function to be tested, and acquiring a test data set corresponding to the basic function to be tested from a target database according to the unique identifier corresponding to the basic function to be tested;
Generating a test script corresponding to the basic function to be tested according to the function description text and the test data set corresponding to the basic function to be tested, wherein the test script comprises a plurality of step numbers and data packets to be input corresponding to each step number;
receiving a test step selection request, wherein the test step selection request comprises one or more target step numbers;
sequentially sending the data packets to be input corresponding to each target step number to a receiving port corresponding to target TSRS software, so that the target TSRS software outputs actual output data packets corresponding to each target step number;
and generating the test result document according to one or more of the actual output data packets.
2. The method of claim 1, wherein the test script further comprises a desired output data packet corresponding to each of the step numbers; the method further comprises the steps of:
comparing the expected output data packet corresponding to each target step number with the actual output data packet to obtain a comparison result corresponding to each target step number;
and generating an analysis result document according to the comparison results.
3. The method according to claim 1, wherein the generating the test script corresponding to the basic function to be tested according to the function description text corresponding to the basic function to be tested and the test data set includes:
acquiring a preset case template;
generating a test case form corresponding to the basic function to be tested according to the preset case template and a function description text corresponding to the basic function to be tested;
and generating a test script corresponding to the basic function to be tested according to the test case table and the test data set corresponding to the basic function to be tested.
4. A method according to claim 3, wherein the test data set corresponding to the basic function to be tested includes a plurality of data types and test data corresponding to each data type, the test operation information corresponding to any one of the step numbers includes a data type of data to be input, and the expected result information corresponding to any one of the step numbers includes a data type of expected output data; the generating the test script corresponding to the basic function to be tested according to the test case table and the test data set corresponding to the basic function to be tested includes:
Acquiring the data to be input and the expected output corresponding to each step number from a test data set corresponding to the basic function to be tested according to the data type of the data to be input and the data type of the expected output corresponding to each step number;
adding the data to be input corresponding to each step number to the test operation information corresponding to each step number in the test case table corresponding to the basic function to be tested, and adding the expected output data corresponding to each step number to the expected result information corresponding to each step number;
generating a data packet to be input corresponding to each step number according to the test operation information corresponding to each step number, and generating an expected output data packet corresponding to each step number according to expected result information corresponding to each step number;
and generating a test script corresponding to the basic function to be tested according to the step numbers, the data packet to be input corresponding to each step number and the expected output data packet.
5. A method according to claim 3, wherein the function description text corresponding to the basic function to be tested includes a plurality of step numbers and test operation description text and expected result text corresponding to each step number; the generating a test case table corresponding to the basic function to be tested according to the preset case template and the function description text corresponding to the basic function to be tested includes:
Matching the test operation description text and the expected result text corresponding to each step number with the template keywords corresponding to the preset case template respectively to obtain test operation information and expected result information corresponding to each step number;
and adding a plurality of step numbers and test operation information and expected result information corresponding to each step number into the preset case template to obtain a test case table corresponding to the basic function to be tested.
6. An apparatus for testing a temporary speed limit server, the apparatus comprising:
the first receiving unit is used for receiving a basic function test request, wherein the basic function test request comprises a unique identifier corresponding to a basic function to be tested;
the acquisition unit is used for acquiring a function description text corresponding to the basic function to be tested in a software basic function library according to the unique identifier corresponding to the basic function to be tested, and acquiring a test data set corresponding to the basic function to be tested in a target database according to the unique identifier corresponding to the basic function to be tested;
the first generation unit is used for generating a test script corresponding to the basic function to be tested according to the function description text and the test data set corresponding to the basic function to be tested, wherein the test script comprises a plurality of step numbers and data packets to be input corresponding to each step number;
The second receiving unit is used for receiving a test step selection request, wherein the test step selection request comprises one or more target step numbers;
the input unit is used for sequentially sending the data packets to be input corresponding to each target step number to a receiving port corresponding to target TSRS software so that the target TSRS software outputs the actual output data packets corresponding to each target step number;
and the second generation unit is used for generating the test result document according to one or more of the actual output data packets.
7. The apparatus of claim 6, wherein the test script further comprises a desired output data packet corresponding to each of the step numbers; the apparatus further comprises:
the comparison unit is used for comparing the expected output data packet corresponding to each target step number with the actual output data packet so as to obtain a comparison result corresponding to each target step number;
and the third generation unit is used for generating an analysis result document according to the comparison results.
8. The apparatus of claim 6, wherein the device comprises a plurality of sensors,
the first generation unit is specifically configured to: acquiring a preset case template; generating a test case form corresponding to the basic function to be tested according to the preset case template and a function description text corresponding to the basic function to be tested; and generating a test script corresponding to the basic function to be tested according to the test case table and the test data set corresponding to the basic function to be tested.
9. A storage medium comprising a stored program, wherein the program, when run, controls a device in which the storage medium is located to perform the method of testing a temporary speed limit server according to any one of claims 1 to 5.
10. An apparatus for testing a temporary speed limit server, the apparatus comprising a storage medium; and one or more processors coupled to the storage medium, the processors configured to execute the program instructions stored in the storage medium; the program instructions, when executed, perform the method of testing a temporary speed limit server according to any one of claims 1 to 5.
CN202311379106.2A 2023-10-24 2023-10-24 Method and device for testing temporary speed limiting server Active CN117112450B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311379106.2A CN117112450B (en) 2023-10-24 2023-10-24 Method and device for testing temporary speed limiting server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311379106.2A CN117112450B (en) 2023-10-24 2023-10-24 Method and device for testing temporary speed limiting server

Publications (2)

Publication Number Publication Date
CN117112450A true CN117112450A (en) 2023-11-24
CN117112450B CN117112450B (en) 2024-03-26

Family

ID=88811408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311379106.2A Active CN117112450B (en) 2023-10-24 2023-10-24 Method and device for testing temporary speed limiting server

Country Status (1)

Country Link
CN (1) CN117112450B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200110694A1 (en) * 2018-10-09 2020-04-09 Charter Communications Operating, Llc System and computer implemented method for generating test scripts
CN113127366A (en) * 2021-04-28 2021-07-16 芜湖雄狮汽车科技有限公司 Matrix automatic testing method based on model and computer readable storage medium
CN113760763A (en) * 2021-09-09 2021-12-07 竹间智能科技(上海)有限公司 Software testing method, device, server and system
CN116166525A (en) * 2022-11-16 2023-05-26 超聚变数字技术有限公司 Method and device for generating test script

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200110694A1 (en) * 2018-10-09 2020-04-09 Charter Communications Operating, Llc System and computer implemented method for generating test scripts
CN113127366A (en) * 2021-04-28 2021-07-16 芜湖雄狮汽车科技有限公司 Matrix automatic testing method based on model and computer readable storage medium
CN113760763A (en) * 2021-09-09 2021-12-07 竹间智能科技(上海)有限公司 Software testing method, device, server and system
CN116166525A (en) * 2022-11-16 2023-05-26 超聚变数字技术有限公司 Method and device for generating test script

Also Published As

Publication number Publication date
CN117112450B (en) 2024-03-26

Similar Documents

Publication Publication Date Title
CN107122297B (en) Method and equipment for generating request message of test interface
CN106897206B (en) Service testing method and device
CN104657140B (en) Code generating method and device
CN111241073B (en) Data quality inspection method and device
WO2015131804A1 (en) Call stack relationship acquiring method and apparatus
CN107092535B (en) Method and apparatus for data storage of test interface
CN107402878B (en) Test method and device
CN106980571A (en) The construction method and equipment of a kind of test use cases
CN112905451B (en) Automatic testing method and device for application program
CN111897828B (en) Method, device, equipment and storage medium for realizing data batch processing
CN113641592B (en) Test sequence generation method and device
CN109582476B (en) Data processing method, device and system
CN114861208A (en) Data authority control method and data authority control service
CN116595588A (en) Safety analysis method and device for railway signal system development process
CN117492670A (en) Log printing sequence determining method and device and electronic equipment
CN117112450B (en) Method and device for testing temporary speed limiting server
CN116383055A (en) Financial scene testing method and device, processor and electronic equipment
CN111078905A (en) Data processing method, device, medium and equipment
CN109558249B (en) Control method and device for concurrent operation
CN108076450B (en) Method and device for identifying same user
CN111125087A (en) Data storage method and device
CN110968500A (en) Test case execution method and device
CN113591231B (en) Method and device for simulating driving
CN108628750B (en) Test code processing method and device
CN110968888B (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant