Software testing method and device, equipment, storage medium and computer program product

By automatically acquiring and comparing actual freight rate data and expected freight rate data for software testing, the problem of low testing efficiency and accuracy in the existing technology is solved, and more efficient and accurate software testing is achieved.

CN119336644APending Publication Date: 2025-01-21TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411501233.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In the prior art, the testing efficiency and accuracy of test results of software testing are low, mainly due to the low efficiency of manual testing and the difficulty in ensuring the accuracy of test results.

Method used

By obtaining actual freight rate data and expected freight rate data, the target data is filtered out for comparison based on preset conditions, and splicing rules are used to conduct refined comparisons to automatically complete software testing.

Benefits of technology

It improves the efficiency and accuracy of software testing, avoids possible errors caused by manual comparison, and ensures the reliability of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336644A_ABST
    Figure CN119336644A_ABST
Patent Text Reader

Abstract

The invention discloses a software testing method and device, equipment, a storage medium and a computer program product. The method comprises the steps of obtaining actual freight rate data and expected freight rate data; obtaining target actual freight rate data meeting a first preset condition from the actual freight rate data; obtaining target expected freight rate data meeting a second preset condition from the expected freight rate data; and comparing the target actual freight rate data with the target expected freight rate data to obtain a software test result. According to the invention, refined one-to-one comparison is carried out based on the target actual freight rate data and the target expected freight rate data, errors caused by manual comparison are avoided through the differentiated test mode, the test efficiency is improved, the accuracy is improved, and the test efficiency is improved. The technical problem that in the prior art, the testing efficiency of software testing and the accuracy of a testing result are low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing technology, and in particular to a software testing method, device, equipment, storage medium and computer program product. Background Art

[0002] At present, in software development, testing work has a vital impact on ensuring software quality, correctly responding to user needs, and shortening the software delivery cycle. After the program is upgraded, in order to ensure system security and confirm that the original functions are not affected, it is necessary to use sufficient test cases to conduct complete software testing on the software system.

[0003] In the related art, software testing of software systems is mainly performed manually. However, the workload of environment preparation and data preparation required for software testing is huge. Manual software testing not only has low testing efficiency, but also cannot guarantee the accuracy of test results. Summary of the invention

[0004] The present invention provides a software testing method, device, equipment, storage medium and computer program product, which can solve the technical problems of low test efficiency and low accuracy of test results of software testing in the prior art.

[0005] To achieve the above object, the present invention provides the following technical solutions:

[0006] In a first aspect, an embodiment of the present invention provides a software testing method, the method comprising:

[0007] Obtain actual freight rate data and expected freight rate data;

[0008] Acquire target actual freight rate data satisfying a first preset condition from the actual freight rate data;

[0009] Acquire target expected freight rate data satisfying a second preset condition from the expected freight rate data;

[0010] The target actual freight rate data and the target expected freight rate data are compared to obtain a software test result.

[0011] Furthermore, the step of obtaining actual freight rate data and expected freight rate data includes:

[0012] Get actual freight rate data through FTP path;

[0013] The freight rate data released during the preset period is monitored, and the data released during the preset period and stored in the database is used as the expected freight rate data.

[0014] Furthermore, the first preset condition includes a preset data type and a data generation time, and the second preset condition includes a preset data type and a time period.

[0015] Furthermore, the step of acquiring target expected freight rate data satisfying a second preset condition from the expected freight rate data includes:

[0016] The data field corresponding to each of the expected freight rate data is parsed to obtain target expected freight rate data within a preset time period whose data type is a preset data type.

[0017] Furthermore, the step of comparing the target actual freight rate data with the target expected freight rate data to obtain a software test result includes:

[0018] Based on the splicing rule, each of the target expected freight rate data is spliced ​​respectively to obtain multiple character strings, wherein the character strings correspond to the target expected freight rate data one by one;

[0019] Compare the target actual freight rate data with each character string in turn to obtain a comparison result;

[0020] Acquire the updated first preset condition, and use the updated first preset condition as the first preset condition;

[0021] Return to the step of acquiring target actual freight rate data satisfying the first preset condition from the actual freight rate data until the updated first preset condition cannot be acquired, and the loop ends;

[0022] Based on the comparison results obtained in each cycle, the software test results are obtained.

[0023] In a second aspect, an embodiment of the present invention provides a software testing device, the device comprising:

[0024] An information acquisition module is configured to acquire actual freight rate data and expected freight rate data;

[0025] An information screening module is configured to obtain target actual freight rate data satisfying a first preset condition from the actual freight rate data; and obtain target expected freight rate data satisfying a second preset condition from the expected freight rate data;

[0026] The comparison test module is configured to compare the target actual freight rate data with the target expected freight rate data to obtain a software test result.

[0027] Furthermore, the comparison test module is specifically configured to:

[0028] Based on the splicing rule, each of the target expected freight rate data is spliced ​​respectively to obtain multiple character strings, wherein the character strings correspond to the target expected freight rate data one by one;

[0029] Compare the target actual freight rate data with each character string in turn to obtain a comparison result;

[0030] Acquire the updated first preset condition, and use the updated first preset condition as the first preset condition;

[0031] Return to the step of acquiring target actual freight rate data satisfying the first preset condition from the actual freight rate data until the updated first preset condition cannot be acquired, and the loop ends;

[0032] Based on the comparison results obtained in each cycle, the software test results are obtained.

[0033] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising: a memory, a processor; the processor is used to read and execute a computer program stored in the memory to implement the steps of the aforementioned software testing method.

[0034] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions, when executed, implement the steps of the aforementioned software testing method.

[0035] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the aforementioned software testing method.

[0036] The beneficial effects brought by the technical solution provided by the embodiment of the present invention include:

[0037] Acquire actual freight rate data and expected freight rate data; acquire target actual freight rate data that meets a first preset condition from the actual freight rate data; acquire target expected freight rate data that meets a second preset condition from the expected freight rate data; compare the target actual freight rate data with the target expected freight rate data to obtain a software test result. Through the present invention, a refined one-to-one comparison is performed based on the target actual freight rate data and the target expected freight rate data. Through this differentiated testing method, errors caused by manual comparison are avoided, test efficiency is improved, and accuracy is improved, thereby solving the technical problems of low test efficiency and low accuracy of test results of software testing in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0039] Figure 1 A schematic diagram of a flow chart of an embodiment of a software testing method of the present invention;

[0040] Figure 2 It is a schematic diagram of the overall flow of the software testing method of the present invention;

[0041] Figure 3 A schematic diagram of functional modules of an embodiment of a software testing device of the present invention;

[0042] Figure 4 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0043] 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 only 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 are within the scope of protection of the present invention.

[0044] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0045] In a first aspect, an embodiment of the present invention provides a software testing method.

[0046] In one embodiment, referring to Figure 1 , Figure 1 FIG. 1 is a flow chart of an embodiment of a software testing method of the present invention. Figure 1 As shown, the software testing method includes:

[0047] Step S10, obtaining actual freight rate data and expected freight rate data;

[0048] In some specific embodiments, step S10 includes:

[0049] Get actual freight rate data through FTP path;

[0050] The freight rate data released during the preset period is monitored, and the data released during the preset period and stored in the database is used as the expected freight rate data.

[0051] In this embodiment, refer to Figure 2 , Figure 2 FIG. 1 is a schematic diagram of the overall flow of the software testing method of the present invention. Figure 2 As shown, the FTP path generated by the pre-configured data is used to obtain the actually generated international freight rate data through the FTP path. The pre-configured database is used to store the data released during the preset time period monitored after connecting to the data source. The data released during the preset time period stored in the database is the expected freight rate data. Among them, the data types of actual freight rate data and expected freight rate data include: addon, CDC, CMSconfiguration, Commission, Fare, fareclass, fareclass_text, fare suppression, footnote, rule, hem, routing, optionalServices, RBD, addonzone, YQYR and more than a dozen types. The configured FTP path and the information contained in the database are shown in Table 1.

[0052] Table 1

[0053]

[0054] Step S20, acquiring target actual freight rate data satisfying a first preset condition from the actual freight rate data;

[0055] In this embodiment, the first preset condition includes a preset data type and a data generation time. After obtaining the actually generated international freight rate data through the FTP path, the target actually generated international freight rate data file TSK.PROD.S01CMSC.D230925.T0040.zip that meets the preset data type and the preset data generation time is searched in the path / home / ftpdata / data / DIT / DIT_8087T_Tmp. The target actually generated international freight rate data file TSK.PROD.S01CMSC.D230925.T0040.zip is decompressed into a .txt file, the data file is parsed and stored, and the specific target actual freight rate data in the .txt file is displayed at the position corresponding to the actual data on the front-end page for relevant personnel to view. The target actual freight rate data is used as the freight rate data to be tested for subsequent comparison testing.

[0056] Step S30, acquiring target expected freight rate data satisfying a second preset condition from the expected freight rate data;

[0057] In some specific embodiments, the second preset condition includes a preset data type and time period, and step S30 includes:

[0058] The data field corresponding to each of the expected freight rate data is parsed to obtain target expected freight rate data within a preset time period whose data type is a preset data type.

[0059] In this embodiment, since the test environment is set to generate a data file every 10 minutes, if you want to obtain the freight rate data file released at 2023-9-25 12:40:00, you need to monitor the freight rate data released during the period of 2023-9-25 12:30:00 to 2023-9-25 12:40:00. After receiving the "get expected data" signal, connect to the data source, and store the monitored freight rate data released during the preset period by pre-configuring the database. In the monitor_data table of the database, parse the data field corresponding to each expected freight rate data, and obtain the target expected freight rate data with a preset data type within the preset period.

[0060] Specifically, taking the preset time period of 2023-9-25 12:30:00 to 2023-9-25 12:40:00 and the preset data type of Commission as an example, in the monitor_data table of the database, the data field is parsed to obtain the newly added Commission data in the time period of 2023-9-25 12:30:00 to 2023-9-25 12:40:00, that is, a set list A[{type:commission,id:xxxxx},{},{}] is obtained. ID represents the sequence number of the Commission data in this time period. The newly added Commission data in the time period of 2023-9-2512:30:00 to 2023-9-25 12:40:00 is the target expected freight rate data.

[0061] Step S40, comparing the target actual freight rate data with the target expected freight rate data to obtain a software test result.

[0062] In some specific embodiments, step S40 includes:

[0063] Based on the splicing rule, each of the target expected freight rate data is spliced ​​respectively to obtain multiple character strings, wherein the character strings correspond to the target expected freight rate data one by one;

[0064] Compare the target actual freight rate data with each character string in turn to obtain a comparison result;

[0065] Acquire the updated first preset condition, and use the updated first preset condition as the first preset condition;

[0066] Return to the step of acquiring target actual freight rate data satisfying the first preset condition from the actual freight rate data until the updated first preset condition cannot be acquired, and the loop ends;

[0067] Based on the comparison results obtained in each cycle, the software test results are obtained.

[0068] In this embodiment, taking the splicing of a certain target expected freight rate data: Commission data as an example, the sales effective time and sales deadline described in the Commission business table in the Commission business requirements need to be stored in the 33rd-40th and 41st-48th bits of the file generated by the software to be tested, respectively, and the storage format is YYYYMMDD. The target expected freight rate data is read, and splicing is performed based on the second preset condition of the target expected freight rate data and the business requirements to obtain a spliced ​​string. Based on the splicing rules, each target expected freight rate data is spliced ​​separately to obtain multiple strings. The strings correspond one-to-one to the target expected freight rate data. It should be noted that there are multiple fields in the Commission business table, and the sales effective time and sales deadline are only used as examples here and are not limited.

[0069] Furthermore, each string is stored in a set list B, and the set list B is stored in the expectedRes of the ifpcomparison database, and the obtained string content is displayed at the corresponding position of the front-end page for relevant personnel to view. The set list B is used as the expected freight rate data.

[0070] After obtaining the concatenated character string, when the "comparison test" signal is obtained, the obtained target actual freight rate data and the concatenated multiple character strings are compared to obtain a comparison result. Specifically, the obtained target actual freight rate data is compared with each character string in turn. If the target actual freight rate data is the same as any character string, the comparison process is terminated and the comparison result is the same; if the target actual freight rate data is different from multiple character strings, the comparison process is terminated and the comparison result is different.

[0071] After this round of comparison process is completed, the updated first preset condition is obtained, and the updated first preset condition is used as the first preset condition, and the step of obtaining the target actual freight rate data that meets the first preset condition from the actual freight rate data is returned to execute, that is, the target actual freight rate data and the target expected freight rate data are re-obtained, and a new round of comparison is performed again, until the updated first preset condition cannot be obtained, and the cycle ends. If the updated first preset condition is not obtained within the preset time, it means that the updated first preset condition cannot be obtained.

[0072] The comparison results obtained in each cycle are recorded, and the software test results can be obtained based on the comparison results obtained in each cycle. Specifically, if the comparison results obtained in each cycle are the same, the software test results are obtained that the new function code meets expectations, and the modification of the old code does not introduce new errors or cause errors in other codes. If the comparison results obtained in each cycle are different, the software test results are obtained that the new function code does not meet expectations, or after modifying the old code, new errors are introduced or errors in other codes are caused.

[0073] Specifically, the comparison between the target actual freight rate data and the string is as follows:

[0074]

[0075]

[0076] The actual target freight rate data is compared one-to-one with the multiple concatenated strings. This differentiated testing method can avoid errors caused by manual comparison, improve test efficiency and accuracy.

[0077] In this embodiment, actual freight rate data and expected freight rate data are obtained; target actual freight rate data that meets the first preset condition is obtained from the actual freight rate data; target expected freight rate data that meets the second preset condition is obtained from the expected freight rate data; the target actual freight rate data and the target expected freight rate data are compared to obtain software test results. Through this embodiment, a refined one-to-one comparison is performed based on the target actual freight rate data and the target expected freight rate data. Through this differentiated testing method, errors caused by manual comparison are avoided, test efficiency is improved, and accuracy is improved, which solves the technical problems of low test efficiency and low accuracy of test results of software testing in related technologies.

[0078] In a second aspect, an embodiment of the present invention further provides a software testing device.

[0079] In one embodiment, referring to Figure 3 , Figure 3 FIG. 1 is a schematic diagram of the functional modules of an embodiment of a software testing device of the present invention. Figure 3 As shown, the software testing device includes:

[0080] The information acquisition module 10 is configured to acquire actual freight rate data and expected freight rate data;

[0081] The information screening module 20 is configured to obtain target actual freight rate data satisfying a first preset condition from the actual freight rate data; and obtain target expected freight rate data satisfying a second preset condition from the expected freight rate data;

[0082] The comparison test module 30 is configured to compare the target actual freight rate data with the target expected freight rate data to obtain a software test result.

[0083] Optionally, in one embodiment, the information acquisition module 10 is configured to:

[0084] Get actual freight rate data through FTP path;

[0085] The freight rate data released during the preset period is monitored, and the data released during the preset period and stored in the database is used as the expected freight rate data.

[0086] Optionally, in one embodiment, the first preset condition includes a preset data type and a data generation time, and the second preset condition includes a preset data type and a time period.

[0087] Optionally, in one embodiment, the information screening module 20 is configured to:

[0088] The data field corresponding to each of the expected freight rate data is parsed to obtain target expected freight rate data within a preset time period whose data type is a preset data type.

[0089] Optionally, in one embodiment, the comparison test module 30 is configured to:

[0090] Based on the splicing rule, each of the target expected freight rate data is spliced ​​respectively to obtain multiple character strings, wherein the character strings correspond to the target expected freight rate data one by one;

[0091] Compare the target actual freight rate data with each character string in turn to obtain a comparison result;

[0092] Acquire the updated first preset condition, and use the updated first preset condition as the first preset condition;

[0093] Return to the step of acquiring target actual freight rate data satisfying the first preset condition from the actual freight rate data until the updated first preset condition cannot be acquired, and the loop ends;

[0094] Based on the comparison results obtained in each cycle, the software test results are obtained.

[0095] Among them, the functional implementation of each module in the above-mentioned software testing device corresponds to each step in the above-mentioned software testing method embodiment, and its functions and implementation processes are no longer repeated here.

[0096] In a third aspect, an embodiment of the present invention further provides an electronic device, whose structure is as follows: Figure 4As shown, it includes: a memory and a processor, wherein the processor is used to read and execute the computer program stored in the memory to implement the aforementioned software testing method.

[0097] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions implement the aforementioned software testing method when executed.

[0098] In the fifth aspect, an embodiment of the present invention provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the various processes of the above-mentioned software testing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0099] Finally, it should be noted that: in some processes described in the embodiments of the present invention, multiple operations or steps appearing in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present invention or may be executed in parallel, and the sequence number of the operation is only used to distinguish between different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.

[0100] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A software testing method, characterized in that: The method comprises: Obtain actual freight rate data and expected freight rate data; Acquire target actual freight rate data satisfying a first preset condition from the actual freight rate data; Acquire target expected freight rate data satisfying a second preset condition from the expected freight rate data; The target actual freight rate data and the target expected freight rate data are compared to obtain a software test result.

2. The software testing method according to claim 1, characterized in that: The step of obtaining actual freight rate data and expected freight rate data includes: Get actual freight rate data through FTP path; The freight rate data released during the preset period is monitored, and the data released during the preset period and stored in the database is used as the expected freight rate data.

3. The software testing method according to claim 1, characterized in that: The first preset condition includes a preset data type and a data generation time, and the second preset condition includes a preset data type and a time period.

4. The software testing method according to claim 3, characterized in that: The step of acquiring target expected freight rate data satisfying a second preset condition from the expected freight rate data comprises: The data field corresponding to each of the expected freight rate data is parsed to obtain target expected freight rate data within a preset time period whose data type is a preset data type.

5. The software testing method according to claim 1, characterized in that: The step of comparing the target actual freight rate data with the target expected freight rate data to obtain a software test result includes: Based on the splicing rule, each of the target expected freight rate data is spliced ​​respectively to obtain multiple character strings, wherein the character strings correspond to the target expected freight rate data one by one; Compare the target actual freight rate data with each character string in turn to obtain a comparison result; Acquire the updated first preset condition, and use the updated first preset condition as the first preset condition; Return to the step of acquiring target actual freight rate data satisfying the first preset condition from the actual freight rate data until the updated first preset condition cannot be acquired, and the loop ends; Based on the comparison results obtained in each cycle, the software test results are obtained.

6. A software testing device, characterized in that: The device comprises: An information acquisition module is configured to acquire actual freight rate data and expected freight rate data; An information screening module is configured to obtain target actual freight rate data satisfying a first preset condition from the actual freight rate data; and obtain target expected freight rate data satisfying a second preset condition from the expected freight rate data; The comparison test module is configured to compare the target actual freight rate data with the target expected freight rate data to obtain a software test result.

7. The software testing device according to claim 6, characterized in that: The comparison test module is specifically configured to: Based on the splicing rule, each of the target expected freight rate data is spliced ​​respectively to obtain multiple character strings, wherein the character strings correspond to the target expected freight rate data one by one; Compare the target actual freight rate data with each character string in turn to obtain a comparison result; Acquire the updated first preset condition, and use the updated first preset condition as the first preset condition; Return to the step of acquiring target actual freight rate data satisfying the first preset condition from the actual freight rate data until the updated first preset condition cannot be acquired, and the loop ends; Based on the comparison results obtained in each cycle, the software test results are obtained.

8. An electronic device, characterized in that: include: Memory and processor; The processor is used to read and execute the computer program stored in the memory to implement the steps of the software testing method as described in any one of claims 1-5.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed, the steps of the software testing method according to any one of claims 1 to 5 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the software testing method as described in any one of claims 1 to 5 are implemented.