Test data processing method and device, electronic equipment and storage medium
By comparing file identification and version identification and integrating test line information, the compatibility of test data in different versions is solved, and the rapid integration and efficiency improvement of test data is achieved.
Patent Information
- Application Number
- CN202411329517.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-13
AI Technical Summary
It is difficult for the existing technology to effectively integrate multiple test data, resulting in the incompatibility of different versions of the test data, which affects the effectiveness of the test results.
By obtaining the first test data and the second test data of the target program, comparing the file identifier and the version identifier, determining the test file category, and integrating the test line information based on the file modification information to generate new test data.
It realizes rapid and accurate integration of test data at different stages, obtains complete test data, is compatible with different versions of test data, and improves program debugging and testing efficiency.
Smart Images

Figure CN119127715A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a test data processing method, a test data processing device, an electronic device, and a computer-readable storage medium. Background Art
[0002] For applications, high-quality program testing is crucial in multiple stages such as software development, operation and maintenance. When testing a program, test data is generated. The test data can include coverage data of the files that are run, such as test line data. Test line data refers to information about the lines that the running file runs, such as which code line the file runs to, etc. It can be used to evaluate the quality of the test data. The more test line data, the more line code branches and code logic are executed, and the more comprehensive the test data will be.
[0003] In the prior art, during multiple tests, the test line data of the last test may become invalid in the latest program version due to different code versions. For example, if a line is added to a file in the new version, the number of lines in the old version cannot correspond to the new version. Therefore, how to integrate multiple test data, make it compatible with different versions of test data, and improve the effectiveness of test results is a technical problem that needs to be solved in the prior art.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The present disclosure provides a test data processing method, a test data processing device, an electronic device and a computer-readable storage medium, thereby overcoming the problem that test data cannot be effectively integrated in the prior art at least to a certain extent.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to one aspect of the present disclosure, a test data processing method is provided, comprising: obtaining first test data and second test data of a target program; the first test data comprising a first version identifier, a first file identifier, first test line information, and first file modification information; the second test data comprising a second version identifier, a second file identifier, second test line information, and second file modification information; determining the following one or more categories of test files according to a comparison result between the first file identifier and the second file identifier: a first category of test files corresponding to file identifiers included in the first file identifier and not included in the second file identifier; a second category of test files corresponding to file identifiers not included in the first file identifier and included in the second file identifier; a third category of test files corresponding to file identifiers included in both the first file identifier and the second file identifier; integrating the first test line information and the second test line information to form third test line information according to the categories of the test files, and the comparison results between the first version identifier and the second version identifier and / or the comparison results between the first file modification information and the second file modification information; and generating third test data including the third test line information.
[0008] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the test data processing methods described above by executing the executable instructions.
[0009] According to one aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the test data processing methods described above.
[0010] The exemplary embodiments of the present disclosure have the following beneficial effects:
[0011] Acquire first test data and second test data of a target program; the first test data includes a first version identifier, a first file identifier, a first test line information, and a first file modification information; the second test data includes a second version identifier, a second file identifier, a second test line information, and a second file modification information; determine one or more of the following categories of test files based on a comparison result between the first file identifier and the second file identifier: a first category of test files corresponding to file identifiers included in the first file identifier and not included in the second file identifier; a second category of test files corresponding to file identifiers not included in the first file identifier and included in the second file identifier; a third category of test files corresponding to file identifiers included in both the first file identifier and the second file identifier; integrate the first test line information and the second test line information to form third test line information based on the category of the test files, and a comparison result between the first version identifier and the second version identifier and / or a comparison result between the first file modification information and the second file modification information to form third test line information; generate third test data including the third test line information. On the one hand, the present exemplary embodiment proposes a new test data processing method, which can integrate the first test line information and the second test line information in the first test data and the second test data to generate third test data including the third test line information, so as to realize the integrated processing of test data of different stages in a fast and accurate manner, and obtain complete test data including multi-stage test data; on the other hand, the present exemplary embodiment can integrate the first test line information and the second test line information according to the category of the test file, and the comparison result of the first version identifier and the second version identifier and / or the comparison result of the first file modification information and the second file modification information to form the third test line information, and the third test line information is obtained by integrating information from multiple aspects, and is more accurate and effective; on another hand, the integration of test data in the present exemplary embodiment can be compatible with test data of different versions, and can realize the integrated processing of test data in a fast and convenient manner, thereby improving the efficiency of program debugging and testing, and has a wide range of applications in fields such as program development.
[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0014] Figure 1 A schematic diagram schematically illustrates a system architecture of a test data processing method in this exemplary embodiment;
[0015] Figure 2 A flow chart schematically illustrates a test data processing method in this exemplary embodiment;
[0016] Figure 3 A sub-flow chart schematically illustrates a test data processing method in this exemplary embodiment;
[0017] Figure 4 A structural block diagram of a test data processing device in this exemplary embodiment is schematically shown;
[0018] Figure 5 An electronic device for implementing the above method in this exemplary embodiment is schematically shown. DETAILED DESCRIPTION
[0019] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0020] An exemplary embodiment of the present disclosure first provides a test data processing method.
[0021] Figure 1 A schematic diagram of the system architecture of the operating environment of this exemplary embodiment is shown. Figure 1 As shown, the system 100 may include a test terminal 110, a management service terminal 120 and a user terminal 130, and may also include other test terminals 140 as needed, and there may be multiple other test terminals 140. The test terminal 110 may be a mobile phone, a computer, a tablet computer or a personal computer, etc., and may include a program process 111 for running a target program and an agent process 112 for forwarding data. The other test terminals 140 may include a program process 141 and an agent process 142. The program process may be used to test and run the target program, such as a game process, and the generated test data may be sent to the management service terminal 120 by the agent process 112; the management service terminal 120 may be used to receive and integrate the test data sent by the test terminal 110 and other test terminals 140, and send the integrated data to the user terminal 130 for display. The user may also interact with the test user terminal 130 to obtain the test data of the test terminal 110 or other test terminals 140, or the status information of the test data.
[0022] It should be understood that Figure 1The data of each device shown in the figure is only exemplary. According to actual needs, any number of test terminals, management servers or user terminals can be set, and the server can also be a server cluster composed of multiple servers.
[0023] Based on the above description, the method in this exemplary embodiment can be applied to Figure 1 On the management service terminal 120 shown.
[0024] The following is combined with Figure 2 This exemplary embodiment is further described as follows. Figure 2 As shown, the test data processing method may include the following steps S210 to S240:
[0025] Step S210, obtaining first test data and second test data of the target program; the first test data includes a first version identifier, a first file identifier, first test line information, and first file modification information; the second test data includes a second version identifier, a second file identifier, second test line information, and second file modification information.
[0026] The target program refers to the test program to be tested, which can be any application such as a game program, a video program, etc. The test data refers to the running data generated when the target program is tested, and the first test data and the second test data are two types of test data to be integrated. In this exemplary embodiment, the first test data can be the current test data, and the second test data can be the test data of a certain test in history, or all the test data in history, etc.
[0027] The first test data may include a first version identifier, a first file identifier, a first test line information, and a first file modification information, wherein the first version identifier refers to an identifier of a program version used in a test phase corresponding to the first test data during software testing, such as a version number, a version name, or a version code, etc. The first file identifier refers to the identification information of the running file included in the first test data, such as a file name, a sequence number, a path, a code, etc. The first test line information refers to the information of the code line of the file running included in the first test data, such as the code, sequence number, etc. of the line, and the first file modification information refers to the modification information when there is modification of the file information in the first test data, such as the modification time when the code base is modified, or specific modification code information, etc. It should be noted that the first test data may include multiple test files, and therefore, the first file identifier may be the file identifier of multiple test files, that is, the first file identifier is a set including multiple file identifiers. In addition, the first test line information and the first file modification information are similar, the first test line information may include the line information of all tested files, and the first file modification information may include the modification time and modification content of all files that have been locally modified, etc. In this exemplary embodiment, the test line information may be recorded as lines, the modification time may be recorded as mtimes, and the modification content may be recorded as dirty.
[0028] The second test data includes a second version identifier, a second file identifier, a second test line information, and a second file modification information, which are similar to the first version identifier, the first file identifier, the first test line information, and the first file modification information mentioned above, and refer to the version information, file identifier information, line information of the running file, and file modification information, etc., included in the second test data.
[0029] In this exemplary embodiment, the test data processing method can be executed on the server side, and the server side can obtain test data from the test terminal through the management service process and perform the test data processing process. When the target program is running on the test terminal, it can determine which lines of test information of which test files can be run. According to actual needs or the properties of the target program, it can also be combined with other information and sent to the management service process for processing. For example, when the target program is a game program, the test terminal can send the identification path of the running file, the test line information lines, and the game running service ID and other information to the agent process of the game program. After receiving this information, the agent process can organize it into test data. For example, after receiving the identification path of the running file, the test line information lines, and the game running service ID and other information, the agent process can obtain the corresponding file modification information according to the information of the running file, such as the modification time mtime, and the local modification content dirty, etc., and combine them into the running file coverage data line_info, and then obtain the version identification version, generate test data and upload it to the management service process.
[0030] In an exemplary embodiment, the first test data is test data to be integrated; the second test data is integrated test data obtained by integrating test data of multiple tests; and the test times of the multiple tests are all earlier than the test time corresponding to the first test data.
[0031] The test data to be integrated refers to the test data that has not been integrated yet, for example, it can be the test data D obtained by running the target program at the latest time t. t The second test data is the integrated test data obtained by integrating the test data of multiple tests, and the test time of the multiple tests is earlier than the test time corresponding to the first test data. For example, D is obtained by integrating the test data at time t-1 and before t-1. T .
[0032] Step S220, based on the comparison result of the first file identifier and the second file identifier, determine the following one or more categories of test files: a first category of test files corresponding to file identifiers included in the first file identifier and not included in the second file identifier; a second category of test files corresponding to file identifiers not included in the first file identifier and included in the second file identifier; a third category of test files corresponding to file identifiers included in both the first file identifier and the second file identifier.
[0033] The first test data and the second test data may each include multiple test files, and the test file may be a file that is run when the target program is run. The first file identifier in the first test data may include one or more file identifiers of the run files, and the second file identifier in the second test data may include one or more file identifiers of the run files. This exemplary embodiment may compare the first file identifier with the second file identifier to determine the categories of different test files. The test files whose categories are to be determined may be test files in the first test data or test files in the second test data.
[0034] In this exemplary embodiment, the first category of test files is a file whose file identifier is in the first file identifier and is not in the second file identifier. For example, the first test data includes first file identifiers such as file 1, file 2, and file 3, and the second test data includes second file identifiers such as file 2 and file 3. It can be determined that file 1 is a first category test file that is in the first file identifier but not in the second file identifier. The second category of test files is a file whose file identifier is not in the first file identifier and is in the second file identifier. For example, the first test data includes first file identifiers such as file 2 and file 3, and the second test data includes second file identifiers such as file 2, file 3, and file 4. It can be determined that file 4 is a first category test file that is in the second file identifier but not in the first file identifier. The third category of test files is a file identifier that is in the first file identifier and in the second file identifier. For example, the first test data includes first file identifiers such as file 1, file 2, and file 3, and the second test data includes second file identifiers such as file 2, file 3, and file 4. It can be determined that file 2 and file 3 are third category test files that are in the second file identifier and in the first file identifier.
[0035] Step S230 , according to the category of the test file, and the comparison result between the first version identifier and the second version identifier and / or the comparison result between the first file modification information and the second file modification information, the first test line information and the second test line information are integrated to form third test line information.
[0036] Among them, the comparison result of the first version identifier and the second version identifier may include the comparison result of the newness or size of the versions, etc., and the comparison result of the first file modification information and the second text modification information may include whether the modification information is consistent, whether there is a local modification, or the result of comparing the time when the test file was modified, etc.
[0037] The third test line information refers to the information of the test line in the test data after data integration, such as the ordinal number, identification or coding of the code line of the running file, and which lines in which files are run in the program test can be determined according to the test line information. This exemplary embodiment can integrate the first test line information and the second test line information according to the category of the test file, and the comparison result of the first version identification and the second version identification and / or the comparison result of the first file modification information and the second file modification information to form the third test line information.
[0038] Step S240: Generate third test data including third test row information.
[0039] This exemplary embodiment can obtain integrated third test row information by integrating the first test row information in the first test data with the second test row information in the second test data, and generate integrated third test data, which may include the integrated third test row information.
[0040] Based on the above description, in this exemplary embodiment, first test data and second test data of the target program are obtained; the first test data includes a first version identifier, a first file identifier, a first test line information, and a first file modification information; the second test data includes a second version identifier, a second file identifier, a second test line information, and a second file modification information; according to the comparison result of the first file identifier and the second file identifier, the following one or more categories of test files are determined: a first category of test files corresponding to file identifiers included in the first file identifier and not included in the second file identifier; a second category of test files corresponding to file identifiers not included in the first file identifier and included in the second file identifier; a third category of test files corresponding to file identifiers included in both the first file identifier and the second file identifier; according to the category of the test files, and the comparison result of the first version identifier and the second version identifier and / or the comparison result of the first file modification information and the second file modification information, the first test line information and the second test line information are integrated to form third test line information; and third test data including the third test line information is generated. On the one hand, the present exemplary embodiment proposes a new test data processing method, which can integrate the first test line information and the second test line information in the first test data and the second test data to generate third test data including the third test line information, so as to realize the integrated processing of test data of different stages in a fast and accurate manner, and obtain complete test data including multi-stage test data; on the other hand, the present exemplary embodiment can integrate the first test line information and the second test line information according to the category of the test file, and the comparison result of the first version identifier and the second version identifier and / or the comparison result of the first file modification information and the second file modification information to form the third test line information, and the third test line information is obtained by integrating information from multiple aspects, and is more accurate and effective; on another hand, the integration of test data in the present exemplary embodiment can be compatible with test data of different versions, and can realize the integrated processing of test data in a fast and convenient manner, thereby improving the efficiency of program debugging and testing, and has a wide range of applications in fields such as program development.
[0041] In an exemplary embodiment, the test files include a first type of test files; Figure 3 As shown, the above step S230 integrates the first test line information and the second test line information to form the third test line information according to the category of the test file, and the comparison result of the first version identifier and the second version identifier and / or the comparison result of the first file modification information and the second file modification information, which may include:
[0042] Step S310: If the first version identifier is greater than or equal to the second version identifier, the first test line information corresponding to the first type of test file is added to the third test line information.
[0043] In this exemplary embodiment, the test file includes a first type of test file, that is, the identifier of the test file is in the first test data but not in the second test data. At this time, if it is determined that the first version identifier is greater than or equal to the second version identifier, for example, the first test data new_version is greater than or equal to the second test data old_version, then the third test line information can be generated according to the first type of test file in the first test data. Specifically, the first test line information corresponding to the first type of test file is added to the third test line information, that is, the third test line information is determined by retaining the first test line information new_lines in the first test data.
[0044] In addition, according to actual needs, this exemplary embodiment may also add other information in the test data to the third test row information to generate integrated test row data. Specifically, in an exemplary embodiment, generating the third test data including the third test row information may include at least one of the following steps:
[0045] adding a larger one of the first version identifier and the second version identifier to the third test data;
[0046] adding an identifier of the test file associated with the third test row information to the third test data;
[0047] The first file modification information and the second file modification information corresponding to the test file associated with the third test row information are integrated and added to the third test data.
[0048] In this exemplary embodiment, when generating the third test data including the third test line information, the third test data may include not only the third test line information lines, but also other information, such as a version identifier version, an identifier path of the test file, or file modification information including the latest modification time mtime and the modification content dirty, etc.
[0049] Specifically, the larger of the first version identifier and the second version identifier can be added to the third test data as the third version identifier; the identifier of the test file associated with the third test line information can be added to the third test data as the third file identifier; or the first file modification information and the second file modification information corresponding to the test file associated with the third test line information can be integrated to form the third file modification information, and added to the third test data.
[0050] Furthermore, if the first version identifier is greater than or equal to the second version identifier, the first line of test information corresponding to the first type of test file, the file identifier of the first type of test file, the version identifier, and the file modification information can be added to the third test data. For example, the first test line information corresponding to the first type of test file is added to the third test line information. For example, (path, new_lineinfo) can be retained, where path represents the file identifier of the added test file, and new_lineinfo represents the first running file coverage data, which may include file modification information, such as the modification time mtime, the modification content dirty, and the number of lines the file runs to, etc.
[0051] If the test file is a second-category test file, that is, the identification of the test file is in the second test data but not in the first test data, this exemplary embodiment can determine the data integration method by further comparing the version identification. In an exemplary embodiment, the test file includes a second-category test file; the above step S230 integrates the first test line information and the second test line information according to the category of the test file, and the comparison result of the first version identification and the second version identification and / or the comparison result of the first file modification information and the second file modification information to form the third test line information, which may include:
[0052] Step S320: If the first version identifier is equal to the second version identifier, the second test line information corresponding to the second type of test file is added to the third test line information.
[0053] If the test file is a second-type test file, and it is determined that the first version identifier is equal to the second version identifier, for example, the first test data new_version is equal to the second test data old_version, indicating that the code base has not changed, then the second test line information corresponding to the second-type test file can be added to the third test line information, that is, the second test line information old_lines in the second test data is retained. In addition, other information can be retained according to actual needs, such as retaining (path, old_lineinfo), to retain the file identifier and the second run file coverage data, etc.
[0054] In an exemplary embodiment, the test file includes a second type of test file; the above step S230 integrates the first test line information and the second test line information according to the type of the test file and the comparison result of the first version identifier and the second version identifier and / or the comparison result of the first file modification information and the second file modification information to form the third test line information, which may include:
[0055] Step S330, if the first version identifier is greater than the second version identifier, and the second type of test file is not modified during the program version upgrade, then the second test line information corresponding to the second type of test file is added to the third test line information; the program version upgrade refers to the target program being upgraded from the second version indicated by the second version identifier to the first version indicated by the first version identifier;
[0056] Step S340: If the first version identifier is greater than the second version identifier, and the second type test file is modified during the program version upgrade, the second test line information corresponding to the second type test file is processed according to the second file modification information.
[0057] When it is determined that the first version identifier is greater than the second version identifier, the third test line information needs to be determined in combination with whether the second type of test file has been modified during the program version upgrade. If the first version identifier is greater than the second version identifier, and the second type of test file has not been modified during the program version upgrade, the second test line information corresponding to the second type of test file is added to the third test line information, such as retaining the second test line information old_lines, or retaining the running file coverage data (path, old_lineinfo) including the second test line information. If the first version identifier is greater than the second version identifier, and the second type of test file has been modified during the program version upgrade, the second test line information corresponding to the second type of test file is processed according to the second file modification information, such as discarding the second test line number information.
[0058] In an exemplary embodiment, processing the second test line information corresponding to the second type of test file according to the second file modification information may include:
[0059] If the second file modification information includes modification information for the second type of test file, discarding the second test line information corresponding to the second type of test file;
[0060] If the second file modification information does not include modification information for the second type of test file, the second test line information corresponding to the second type of test file is converted into line numbers according to the modification information of the second type of test file in the program version upgrade and then added to the third test line information.
[0061] This exemplary embodiment can determine the third test line information by determining whether the second file modification information includes modification information for the second type of test file. If the second file modification information includes modification information for the second type of test file, it means that there is a local modification, and the second test line information corresponding to the second type of test file is discarded; if the second file modification information does not include modification information for the second type of test file, it means that no local modification is performed, and it is necessary to combine the modification information of the second type of test file in the program version upgrade, and add the second test line information corresponding to the second type of test file to the third test line information after performing line number conversion. This exemplary embodiment can determine whether the second file modification information includes modification information for the second type of test file by judging the truth or falsehood of the second file modification information old_dirty. For example, if old_dirty is true, it means that there was a local modification originally, and the version migration of the line information may not be performed, and the second test line information corresponding to the second type of test file can be discarded; if old_dirty is false, it means that no local modification has occurred, and the line number information version migration can be performed on old_lineinfo according to the version change, and the path and the converted old_lines or old_lineinfo are retained.
[0062] In an exemplary embodiment, the test file includes a third type of test file; the first file modification information includes a first modification time of the third type of test file; the second file modification information includes a second modification time of the third type of test file; according to the type of the test file, and the comparison result of the first version identifier and the second version identifier and / or the comparison result of the first file modification information and the second file modification information, the first test line information and the second test line information are integrated to form the third test line information, which may include:
[0063] According to the comparison result of the first modification time and the second modification time of the third type test file, the first test line information and the second test line information corresponding to the third type test file are integrated and added to the third test line information.
[0064] When the test file includes a third type of test file, it means that the test file identifier is in both the first file identifier of the first test data and the second file identifier of the second test data. For example, the first test data runs file 1 and file 2, and the second test data also runs file 1 and file 2.
[0065] At this time, the modification time of the third type of test file can be further compared to determine the integration method of the test data. The first modification time refers to the modification time of the third type of test file in the first test data, such as the modification time of the modification of file 1 in the first test data, which is recorded as new_mtime, and the second modification time refers to the modification time of the third type of test file in the second test data, such as the modification time of the modification of file 1 in the second test data, which is recorded as old_time. This exemplary embodiment can integrate the first test line information and the second test line information corresponding to the third type of test file according to the comparison result of the first modification time and the second modification time of the third type of test file and add them to the third test line information.
[0066] In an exemplary embodiment, according to the comparison result of the first modification time and the second modification time of the third type of test file, integrating and adding the first test line information and the second test line information corresponding to the third type of test file to the third test line information may include:
[0067] If the first modification time and the second modification time of the third type test file are the same, the first test line information and the second test line information corresponding to the third type test file are combined and added to the third test line information.
[0068] If it is determined that the first modification time and the second modification time of the third type of test file are the same, for example, new_mtime is equal to old_time, it means that there may be no file modification during the two tests. The first test line information and the second test line information corresponding to the third type of test file can be taken as the union and added to the third test line information to merge the first test line information new_lines with the second test line information old_lines. For example, the new first test line information obtained by running the file can be added to the original second test line information to form a new third test line information.
[0069] In addition, this exemplary embodiment can also process other information including test line information, merge new_lineinfo with old_lineinfo, for example, the new first test line information of the file can be added to old_lineinfo to form a new lineinfo, retaining (path, lineinfo), where lineinfo can include file identifier path, modification time mtime, modification content dirty, etc.
[0070] In an exemplary embodiment, according to the comparison result of the first modification time and the second modification time of the third type of test file, integrating and adding the first test line information and the second test line information corresponding to the third type of test file to the third test line information may include:
[0071] If the first modification time of the third type test file is greater than the second modification time, and at least one of the first file modification information and the second file modification information includes modification information for the third type test file, discard the second test line information corresponding to the third type test file, and add the first test line information corresponding to the third type test file to the third test line information;
[0072] If the first modification time of the third category test file is greater than the second modification time, and the first file modification information and the second file modification information do not include modification information for the third category test file, then the first test line information and the second test line information corresponding to the third category test file are integrated and added to the third test line information according to the modification information of the third category test file in the program version upgrade; program version upgrade refers to the target program being upgraded from the second version indicated by the second version identifier to the first version indicated by the first version identifier.
[0073] If the first modification time of the third type of test file is greater than the second modification time, for example, new_mtime>old_time, it is necessary to determine the processing method of the test data based on whether the modification information for the third type of test file is included in at least one of the first file modification information and the second file modification information, that is, it is necessary to compare the first file modification information with the second file modification information to determine whether there is a local modification or version change, and determine the third test line information. Among them, at least one of the first file modification information and the second file modification information includes the modification information for the third type of test file, which may be that the first file modification information includes the modification information for the third type of test file, or the second file modification information includes the modification information for the third type of test file, or both the first file modification information and the second file modification information include the modification information for the third type of test file, and the modification information for the third type of test file refers to the modification content generated by the local modification of the third type of test file.
[0074] If the first modification time of the third type of test file is greater than the second modification time, and at least one of the first file modification information and the second file modification information includes modification information for the third type of test file, for example, new_dirty is true or old_dirty is true, it means that line number information version migration cannot be performed, and the second test line information corresponding to the third type of test file is discarded, and the first test line information corresponding to the third type of test file is added to the third test line information, for example, new_lines is retained, or (path, new_lineinfo) including new_lines is retained as needed.
[0075] If the first modification time of the third category test file is greater than the second modification time, and the first file modification information and the second file modification information do not include modification information for the third category test file, for example, new_dirty and old_dirty are both false, then the first test line information and the second test line information corresponding to the third category test file can be further integrated and added to the third test line information based on the modification information of the third category test file in the program version upgrade.
[0076] In an exemplary embodiment, integrating the first test line information and the second test line information corresponding to the third type of test file and adding them to the third test line information according to the modification information of the third type of test file in the program version upgrade may include:
[0077] If the third type of test file is not modified during the program version upgrade, the first test line information and the second test line information corresponding to the third type of test file are combined and added to the third test line information;
[0078] If the third category test file is modified during the program version upgrade, the second test line information corresponding to the third category test file is converted to row numbers based on the modification information of the third category test file during the program version upgrade, and the second test line information corresponding to the third category test file is taken as the union and added to the third test line information.
[0079] When the first modification time of the third category test file is greater than the second modification time, and both the first file modification information and the second file modification information do not include modification information for the third category test file, this exemplary embodiment can determine the third category test row information by judging whether the third category test file is modified during the program version upgrade.
[0080] In this exemplary embodiment, if the third type of test file has not been modified during the program version upgrade, the first test line information and the second test line information corresponding to the third type of test file are unioned and added to the third test line information. For example, if the third test file has not been modified during the program version upgrade, the old_lines of the second test data can continue to be used, and the first test line information new_lines and the second test line information old_lines corresponding to the third type of test file are unioned and added to the third test line information; or the running file of the second test data can continue to be used to overwrite the data old_lineinfo, and then new_lineinfo is merged with old_lineinfo to form a new lineinfo, retaining (path, lineinfo).
[0081] If the third type of test file is modified during the program version upgrade, the second test line information corresponding to the third type of test file is converted to a new line number according to the modification information of the third type of test file during the program version upgrade, and the second test line information corresponding to the third type of test file is merged with the first test line information corresponding to the third type of test file and added to the third test line information. For example, old_lineinfo is migrated to a new old_lineinfo.
[0082] In an exemplary embodiment, the test time corresponding to the first test data is later than the test time corresponding to the second test data; integrating the first test line information and the second test line information corresponding to the third test file according to the modification information of the third test file in the program version upgrade and adding them to the third test line information may include:
[0083] If the first modification time of the third type test file is less than the second modification time, the first test line information corresponding to the third type test file is discarded, and the second test line information corresponding to the third type test file is added to the third test line information.
[0084] In this exemplary embodiment, if the first modification time of the third type test file is less than the second modification time, for example, the new modification time of the third type test file is less than the old modification time, it is generally considered that an error may occur. Therefore, the first test line information corresponding to the third type test file can be discarded, and the second test line information old_lines corresponding to the third type test file can be added to the third test line information, or other related content including the second test line information old_lines can be retained, for example, (path, old_lineinfo) can be retained.
[0085] In an exemplary embodiment, the test time corresponding to the first test data is later than the test time corresponding to the second test data; the test data processing method may further include:
[0086] Step S350: If the first version identifier is smaller than the second version identifier, the first test data is discarded.
[0087] In this exemplary embodiment, if the first version identifier is smaller than the second version identifier, for example, new_mtime is smaller than old_time, it means that the new modification time of the file is smaller than the old modification time. It is generally believed that an error may have occurred. Therefore, the first test data can be discarded and the second test data, such as (path, old_lineinfo), can be retained.
[0088] In an exemplary embodiment, the third test data includes a third version identifier, third test line information, and third file modification information; the test data processing method may further include:
[0089] In response to receiving a preset interactive instruction about the test data, obtaining fourth test data of the target program; the fourth test data includes a fourth version identifier, fourth file modification information, and test file content;
[0090] The test data status information is determined according to a comparison result between the third version identifier and the fourth version identifier and / or a comparison result between the third file modification information and the fourth file modification information.
[0091] Among them, the preset interactive instructions may refer to instructions for obtaining and viewing test data. For example, on the user side, the user can send preset interactive instructions to the management service terminal through various interactive operations such as clicking, inputting or selecting, so that the management service terminal obtains test data from the test terminal, processes the data, and then sends the processing results to the user side for display.
[0092] The fourth test data may be the test data to be processed that the user requests to view, and the fourth test data may refer to the test data generated by the latest running of the target program, which has not yet performed the data integration process. The fourth test data includes a fourth version identifier, fourth file modification information, test file content, and a fourth version identifier. The fourth file modification information is similar to the first version identifier and the first file modification information in the first test data, and the test file content may be the test data content presented to the user.
[0093] In this exemplary embodiment, when the user wants to view the coverage data of the running file of the test data, the user terminal can interact with the management service process to obtain the coverage data of the running files of different game servers according to the interactive operation, and display the list of files that have been run. When the user needs to view the specific coverage data of each running file in detail, the user can send a request message to the service management process. After receiving the request message, the management service process can forward it to the agent process of the test terminal, and the agent process returns the test file content of the test data, the last version of the local code library, and the fourth modified file information, wherein the test file content of the returned test data is recorded as content, the last version of the local code library, that is, the fourth version identifier version2, and the fourth modified file information, which can include the fourth modification time mtime2 of the test file, and the modified content dirty2. The third test data includes the third version identifier version1, the third test line information lines, and the third file modification information, including the third modification time mtime1 of the test file, and the modified content dirty1.
[0094] This exemplary embodiment may determine test data status information based on a comparison result between the third version identifier and the fourth version identifier and / or a comparison result between the third file modification information and the fourth file modification information. The test data status information may reflect the status of the current fourth test data, or the difference status between the fourth test data and the third test data, or the status of program testing performed by the test terminal, and so on.
[0095] In an exemplary embodiment, the third file modification information includes a third modification time of the test file, and the fourth file modification information includes a fourth modification time of the test file;
[0096] Determining the test data status information according to the comparison result of the third version identifier and the fourth version identifier and / or the comparison result of the third file modification information and the fourth file modification information may include:
[0097] If the fourth version identifier is smaller than the third version identifier, or the fourth modification time is smaller than the third modification time, determining that the test data state information is in the first state;
[0098] If the fourth modification time is equal to the third modification time, processing the test file content according to the third test row data, and determining that the test data state information is in the second state;
[0099] If the fourth version identifier is greater than the third version identifier, test row data processing is performed on the third test row data, and the test data state information is determined to be in the third state.
[0100] In this exemplary embodiment, if the fourth version identifier is less than the third version identifier, or the fourth modification time is less than the third modification time, the state information of the fourth test data is determined to be in the first state. The first state may indicate that the test data has exceeded the timeliness, that is, the test data is outdated. For example, if version2 is less than version1 or mtime2 is less than mtime1, the test data of the management service process is outdated relative to the code of the test machine, and the state information is that the test data is outdated.
[0101] If the fourth modification time is equal to the third modification time, the fourth test data is processed according to the fourth test line data, and the state of the fourth test data is determined to be the second state. The second state may indicate that the test data is normal. For example, if mtime2 is equal to mtime1, it means that the test file content has not been changed. Then, content may be marked according to the third test line data lines. The marking may be used to distinguish and display the number of lines being run. For example, the number of lines being run may be displayed in green or yellow. Specifically, style processing may be performed using, for example, css (Cascading Style Sheets) language. Then, the marked test file content content may be sent to the front end so that the user can see the running test line data at the front end, and the status information of the current test data is normal.
[0102] If the fourth version identifier is greater than the third version identifier, the third test line data is processed and the test data status information is determined to be in the third state. The third state may indicate that the test data has been modified. For example, if version2 is greater than version1, the file has a version change. The line number information version of the third test line data lines may be migrated and converted into new test line data lines to process the third test line data. Furthermore, the content may be annotated and the annotated test file content may be sent to the front end. The third state may be annotated as a new change in the program code.
[0103] The following is an example of line number information version migration. Line number information version migration refers to converting one test line information into another test line information, for example, converting old line number information into new line number information. Specifically, you can use the diff function of the version control tool to obtain the mapping relationship between the old line number information and the new line number information for the unchanged lines. For the modified lines, since the code has been modified, the old test line number can be discarded.
[0104] Taking svn (subversion, version management tool) as an example, svn diff (a command) can obtain the modification diff between the new version and the old version. The code example is as follows:
[0105] Index:1.txt
[0106] ==============================
[0107] ---1.txt(revision4)
[0108] ++1.txt(revison5)
[0109] @@-6,7+6,6@@ 6 7 8
[0113] -9 10 11 12
[0117] @-23,6+22,7@@ twenty three twenty four 25
[0121] +9 26 27 28
[0125] Among them, @@-6,7+6,6@@ can record the changes of file 1.txt, indicating that the 7 lines starting from line 6 (lines 6-12) of the old version file are changed to the 6 lines starting from line 6 (lines 6-11) of the new version file. @@-23,6+22,7@@ also has a similar meaning. It should be noted that the above code is only an example, and the specific complete code is determined according to the actual situation.
[0126] After analysis, the number of rows that have not been modified corresponding to the new version can be:
[0127] 1,5=>1,5
[0128] 13,22=>12,21
[0129] 30, last row => 30, last row
[0130] The modified rows are the remaining rows. According to the above correspondence, for the rows that have not been modified, the old row number information is converted into the new row number information, and for the rows that have been modified, the old row number information is discarded.
[0131] The exemplary embodiment of the present disclosure also provides a test data processing device. Figure 4The device 400 may include a test data acquisition module 410, which is used to acquire first test data and second test data of a target program; the first test data includes a first version identifier, a first file identifier, a first test line information, and a first file modification information; the second test data includes a second version identifier, a second file identifier, a second test line information, and a second file modification information; a file category determination module 420, which is used to determine the following one or more categories of test files according to the comparison result of the first file identifier and the second file identifier: a first category of test files corresponding to file identifiers included in the first file identifier and not included in the second file identifier; a second category of test files corresponding to file identifiers not included in the first file identifier and included in the second file identifier; a third category of test files corresponding to file identifiers included in both the first file identifier and the second file identifier; a test information integration module 430, which is used to integrate the first test line information and the second test line information to form third test line information according to the category of the test file, and the comparison result of the first version identifier and the second version identifier and / or the comparison result of the first file modification information and the second file modification information; a test data generation module 440, which is used to generate third test data including the third test line information.
[0132] In an exemplary embodiment, the test file includes a first type of test file; the test information integration module 430 includes: a first version comparison unit, used to add the first test line information corresponding to the first type of test file to the third test line information if the first version identifier is greater than or equal to the second version identifier.
[0133] In an exemplary embodiment, the test file includes a second type of test file; the test information integration module 430 includes: a second version comparison unit, which is used to add the second test line information corresponding to the second type of test file to the third test line information if the first version identifier is equal to the second version identifier.
[0134] In an exemplary embodiment, the test file includes a second type of test file; the test information integration module 430 includes: a third version comparison unit, which is used to add the second test line information corresponding to the second type of test file to the third test line information if the first version identifier is greater than the second version identifier and the second type of test file has not been modified during the program version upgrade; the program version upgrade refers to the target program being upgraded from the second version indicated by the second version identifier to the first version indicated by the first version identifier; a fourth version comparison unit, which is used to process the second test line information corresponding to the second type of test file according to the second file modification information if the first version identifier is greater than the second version identifier and the second type of test file has been modified during the program version upgrade.
[0135] In an exemplary embodiment, the fourth version comparison unit includes: a first processing subunit, used to discard the second test line information corresponding to the second type of test file if the second file modification information includes modification information for the second type of test file; and a second processing subunit, used to convert the second test line information corresponding to the second type of test file into line numbers according to the modification information of the second type of test file in the program version upgrade, and then add it to the third test line information if the second file modification information does not include modification information for the second type of test file.
[0136] In an exemplary embodiment, the test file includes a third category test file; the first file modification information includes a first modification time of the third category test file; the second file modification information includes a second modification time of the third category test file; the test information integration module 430 includes: a time comparison unit, which is used to integrate the first test line information and the second test line information corresponding to the third category test file and add them to the third test line information based on the comparison result of the first modification time and the second modification time of the third category test file.
[0137] In an exemplary embodiment, the time comparison unit includes: a first time comparison unit, which is used to take the union of the first test line information and the second test line information corresponding to the third type of test file and add them to the third test line information if the first modification time and the second modification time of the third type of test file are the same.
[0138] In an exemplary embodiment, the time comparison unit includes: a second time comparison unit, which is used to discard the second test line information corresponding to the third type of test file and add the first test line information corresponding to the third type of test file to the third test line information if the first modification time of the third type of test file is greater than the second modification time, and at least one of the first file modification information and the second file modification information includes modification information for the third type of test file; a third time comparison unit, which is used to integrate the first test line information and the second test line information corresponding to the third type of test file according to the modification information of the third type of test file in the program version upgrade and add them to the third test line information if the first modification time of the third type of test file is greater than the second modification time, and both the first file modification information and the second file modification information do not include modification information for the third type of test file; the program version upgrade refers to the target program being upgraded from the second version indicated by the second version identifier to the first version indicated by the first version identifier.
[0139] In an exemplary embodiment, the third time comparison unit includes: a program version upgrade judgment subunit, which is used to, if the third type of test file has not been modified during the program version upgrade, take the union of first test line information and second test line information corresponding to the third type of test file and add them to the third test line information; and if the third type of test file has been modified during the program version upgrade, convert the second test line information corresponding to the third type of test file according to the modification information of the third type of test file during the program version upgrade, and take the union of the second test line information corresponding to the third type of test file and add it to the third test line information.
[0140] In an exemplary embodiment, the test time corresponding to the first test data is later than the test time corresponding to the second test data; the time comparison unit includes: a fourth time comparison unit, which is used to discard the first test line information corresponding to the third type of test file if the first modification time of the third type of test file is less than the second modification time, and add the second test line information corresponding to the third type of test file to the third test line information.
[0141] In an exemplary embodiment, the test time corresponding to the first test data is later than the test time corresponding to the second test data; the device also includes: a fifth version comparison unit, configured to discard the first test data if the first version identifier is smaller than the second version identifier.
[0142] In an exemplary embodiment, the test data generation module 440 includes at least one of the following units: a version identifier adding unit, used to add the larger of the first version identifier and the second version identifier to the third test data; a file identifier adding unit, used to add the identifier of the test file associated with the third test line information to the third test data; a file modification information adding unit, used to integrate the first file modification information and the second file modification information corresponding to the test file associated with the third test line information, and add them to the third test data.
[0143] In an exemplary embodiment, the first test data is test data to be integrated; the second test data is integrated test data obtained by integrating test data of multiple tests; and the test times of the multiple tests are all earlier than the test time corresponding to the first test data.
[0144] In an exemplary embodiment, the third test data includes a third version identifier, third test line information, and third file modification information; the device also includes: a fourth test data acquisition unit, used to acquire fourth test data of the target program in response to receiving a preset interactive instruction regarding the test data; the fourth test data includes a fourth version identifier, fourth file modification information, and test file content; a status information determination unit, used to determine the test data status information based on the comparison result of the third version identifier and the fourth version identifier and / or the comparison result of the third file modification information and the fourth file modification information.
[0145] In an exemplary embodiment, the third file modification information includes the third modification time of the test file, and the fourth file modification information includes the fourth modification time of the test file; the state information determination unit includes: a first state determination subunit, used to determine that the test data state information is in the first state if the fourth version identifier is less than the third version identifier, or the fourth modification time is less than the third modification time; a second state determination subunit, used to process the test file content according to the third test row data if the fourth modification time is equal to the third modification time, and determine that the test data state information is in the second state; a third state determination subunit, used to perform test row data processing on the third test row data if the fourth version identifier is greater than the third version identifier, and determine that the test data state information is in the third state.
[0146] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.
[0147] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0148] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the test data processing method is implemented.
[0149] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0150] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0151] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0152] The computer program may be carried or transmitted via electrical, magnetic, optical, electromagnetic, infrared, or other signals. The electronic device may convert the signal carrying the computer program into a digital signal, thereby running the computer program. When the computer program is run on an electronic device, its code is used to enable the electronic device to execute (more specifically, enable the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure, such as the test data processing method described above.
[0153] The exemplary embodiment of the present disclosure also provides an electronic device. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as program code. The processor executes the method in the exemplary embodiment by executing the executable instructions. In addition, the electronic device may also include a display for displaying a graphical user interface.
[0154] Reference below Figure 5 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Figure 5The electronic device 500 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0155] like Figure 5 As shown, the electronic device 500 may include: a processor 510 , a memory 520 , a bus 530 , an I / O (input / output) interface 540 , a network adapter 550 , and a display 560 .
[0156] The memory 520 may include a volatile memory, such as a RAM 521, a cache unit 522, and may also include a non-volatile memory, such as a ROM 523. The memory 520 may also include one or more program modules 524, such program modules 524 include but are not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. For example, the program module 524 may include each module in the above-mentioned device.
[0157] The processor 510 may include one or more processing units. For example, the processor 510 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.
[0158] The processor 510 can be used to execute the executable instructions stored in the memory 520, such as the above-mentioned test data processing method, which includes the following steps: obtaining first test data and second test data of the target program; the first test data includes a first version identifier, a first file identifier, a first test line information, and a first file modification information; the second test data includes a second version identifier, a second file identifier, a second test line information, and a second file modification information; according to the comparison result of the first file identifier and the second file identifier, determining the following one or more categories of test files: a first category of test files corresponding to file identifiers included in the first file identifier and not included in the second file identifier; a second category of test files corresponding to file identifiers not included in the first file identifier and included in the second file identifier; a third category of test files corresponding to file identifiers included in both the first file identifier and the second file identifier; according to the category of the test file, and the comparison result of the first version identifier and the second version identifier and / or the comparison result of the first file modification information and the second file modification information, integrating the first test line information and the second test line information to form third test line information; generating third test data including the third test line information.
[0159] The above method is implemented by a computer program. On the one hand, this exemplary embodiment proposes a new test data processing method, which can integrate the first test line information and the second test line information in the first test data and the second test data to generate third test data including the third test line information, and realize the integration processing of test data in different stages in a fast and accurate manner to obtain complete test data including multi-stage test data; on the other hand, this exemplary embodiment can integrate the first test line information and the second test line information according to the category of the test file, and the comparison result of the first version identifier and the second version identifier and / or the comparison result of the first file modification information and the second file modification information to form the third test line information. The third test line information is obtained by integrating information from multiple aspects, and is more accurate and effective; on the other hand, the integration of test data in this exemplary embodiment can be compatible with test data of different versions, and can realize the integration processing of test data in a fast and convenient manner, thereby improving program debugging and testing efficiency, and has a wide range of applications in fields such as program development.
[0160] The bus 530 is used to realize the connection between different components of the electronic device 500, and may include a data bus, an address bus, and a control bus.
[0161] The electronic device 500 can communicate with one or more external devices 600 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 540 .
[0162] The electronic device 500 can communicate with one or more networks through the network adapter 550. For example, the network adapter 550 can provide mobile communication solutions such as 3G / 4G / 5G, or provide wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. The network adapter 550 can communicate with other modules of the electronic device 500 through the bus 530.
[0163] The electronic device 500 can display a graphical user interface through the display 560, such as displaying a game editing scene.
[0164] although Figure 5 Not shown, other hardware and / or software modules may also be provided in the electronic device 500, including but not limited to: a display, a microcode, a device driver, a redundant processor, an external disk drive array, a RAID system, a tape drive, and a data backup storage system.
[0165] As can be seen from the above, the technical solution of the present disclosure can be implemented as a method, an apparatus, a system, a computer program product, a storage medium, an electronic device, etc. Those skilled in the art can understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, such as being respectively referred to as a "circuit", "module" or "system".
[0166] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art will easily think of other embodiments based on the specific embodiments provided by the present disclosure. Therefore, the specific embodiments provided by the present disclosure are only exemplary, and the scope and spirit of the present disclosure are indicated by the claims, and any variations, uses or adaptive changes of the present disclosure should be covered, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the present disclosure.
[0167] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module" or "system". Those skilled in the art will readily think of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0168] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A test data processing method, characterized in that: include: Acquire first test data and second test data of the target program; The first test data includes a first version identifier, a first file identifier, first test line information, and first file modification information; the second test data includes a second version identifier, a second file identifier, second test line information, and second file modification information; According to the comparison result of the first file identifier and the second file identifier, determine the following one or more categories of test files: a first category of test files corresponding to file identifiers included in the first file identifier and not included in the second file identifier; a second category of test files corresponding to file identifiers not included in the first file identifier and included in the second file identifier; a third category of test files corresponding to file identifiers included in both the first file identifier and the second file identifier; According to the category of the test file, and the comparison result between the first version identifier and the second version identifier and / or the comparison result between the first file modification information and the second file modification information, integrating the first test line information and the second test line information to form third test line information; Third test data including the third test row information is generated.
2. The method according to claim 1, characterized in that The test file includes a first type of test file; and according to the type of the test file, and a comparison result of the first version identifier and the second version identifier and / or a comparison result of the first file modification information and the second file modification information, the first test line information and the second test line information are integrated to form third test line information, including: If the first version identifier is greater than or equal to the second version identifier, the first test line information corresponding to the first type of test file is added to the third test line information.
3. The method according to claim 1, characterized in that The test file includes a second type of test file; and according to the type of the test file, and the comparison result of the first version identifier and the second version identifier and / or the comparison result of the first file modification information and the second file modification information, the first test line information and the second test line information are integrated to form third test line information, including: If the first version identifier is equal to the second version identifier, the second test line information corresponding to the second type of test file is added to the third test line information.
4. The method according to claim 1, characterized in that: The test file includes a second type of test file; and according to the type of the test file, and the comparison result of the first version identifier and the second version identifier and / or the comparison result of the first file modification information and the second file modification information, the first test line information and the second test line information are integrated to form third test line information, including: If the first version identifier is greater than the second version identifier, and the second type of test file is not modified during the program version upgrade, then the second test line information corresponding to the second type of test file is added to the third test line information; the program version upgrade refers to the target program being upgraded from the second version indicated by the second version identifier to the first version indicated by the first version identifier; If the first version identifier is greater than the second version identifier, and the second type of test file is modified during the program version upgrade, the second test line information corresponding to the second type of test file is processed according to the second file modification information.
5. The method according to claim 4, characterized in that The processing of the second test line information corresponding to the second type of test file according to the second file modification information includes: If the second file modification information includes modification information for the second type of test file, discarding the second test line information corresponding to the second type of test file; If the second file modification information does not include modification information for the second type of test file, the second test line information corresponding to the second type of test file is converted into line numbers according to the modification information of the second type of test file in the program version upgrade and then added to the third test line information.
6. The method according to claim 1, characterized in that The test file includes a third type of test file; the first file modification information includes a first modification time of the third type of test file; the second file modification information includes a second modification time of the third type of test file; and the first test line information and the second test line information are integrated according to the type of the test file, and a comparison result between the first version identifier and the second version identifier and / or a comparison result between the first file modification information and the second file modification information to form third test line information, including: According to the comparison result of the first modification time and the second modification time of the third type test file, the first test line information and the second test line information corresponding to the third type test file are integrated and added to the third test line information.
7. The method according to claim 6, characterized in that The step of integrating the first test line information and the second test line information corresponding to the third type of test file and adding the first test line information and the second test line information corresponding to the third type of test file to the third test line information according to the comparison result of the first modification time and the second modification time of the third type of test file comprises: If the first modification time and the second modification time of the third type test file are the same, the first test line information and the second test line information corresponding to the third type test file are combined and added to the third test line information.
8. The method according to claim 6, characterized in that The step of integrating the first test line information and the second test line information corresponding to the third type of test file and adding the first test line information and the second test line information corresponding to the third type of test file to the third test line information according to the comparison result of the first modification time and the second modification time of the third type of test file comprises: If the first modification time of the third type test file is greater than the second modification time, and at least one of the first file modification information and the second file modification information includes modification information for the third type test file, discarding the second test line information corresponding to the third type test file, and adding the first test line information corresponding to the third type test file to the third test line information; If the first modification time of the third type of test file is greater than the second modification time, and neither the first file modification information nor the second file modification information includes modification information for the third type of test file, then the first test line information and the second test line information corresponding to the third type of test file are integrated and added to the third test line information according to the modification information of the third type of test file in the program version upgrade; the program version upgrade refers to the target program being upgraded from the second version indicated by the second version identifier to the first version indicated by the first version identifier.
9. The method according to claim 8, characterized in that The step of integrating the first test line information and the second test line information corresponding to the third test file with the third test line information according to the modification information of the third test file in the program version upgrade and adding the information to the third test line information comprises: If the third type of test file is not modified during the program version upgrade, taking the union of the first test line information and the second test line information corresponding to the third type of test file and adding the union to the third test line information; If the third-category test file is modified during a program version upgrade, the second test line information corresponding to the third-category test file is converted to a row number according to the modification information of the third-category test file during the program version upgrade, and the second test line information corresponding to the third-category test file is merged with the first test line information corresponding to the third-category test file and added to the third test line information.
10. The method according to claim 6, characterized in that The test time corresponding to the first test data is later than the test time corresponding to the second test data; and the first test line information and the second test line information corresponding to the third type of test file are integrated and added to the third test line information according to the modification information of the third type of test file in the program version upgrade, including: If the first modification time of the third type test file is less than the second modification time, the first test line information corresponding to the third type test file is discarded, and the second test line information corresponding to the third type test file is added to the third test line information.
11. The method according to claim 1, characterized in that: The test time corresponding to the first test data is later than the test time corresponding to the second test data; the method further includes: If the first version identifier is smaller than the second version identifier, the first test data is discarded.
12. The method according to claim 1, characterized in that The generating of the third test data including the third test row information comprises at least one of the following steps: adding a larger one of the first version identifier and the second version identifier to the third test data; adding an identifier of the test file associated with the third test row information to the third test data; The first file modification information and the second file modification information corresponding to the test file associated with the third test row information are integrated and added to the third test data.
13. The method according to any one of claims 1 to 12, characterized in that: The first test data is test data to be integrated; the second test data is integrated test data formed by integrating test data of multiple tests; and the test times of the multiple tests are all earlier than the test time corresponding to the first test data.
14. The method according to claim 1, characterized in that The third test data includes a third version identifier, third test line information, and third file modification information; the method further includes: In response to receiving a preset interactive instruction about test data, obtaining fourth test data of the target program; the fourth test data includes a fourth version identifier, fourth file modification information, and test file content; Test data status information is determined according to a comparison result between the third version identifier and the fourth version identifier and / or a comparison result between the third file modification information and the fourth file modification information.
15. The method according to claim 14, characterized in that The third file modification information includes a third modification time of the test file, and the fourth file modification information includes a fourth modification time of the test file; The determining the test data status information according to the comparison result of the third version identifier and the fourth version identifier and / or the comparison result of the third file modification information and the fourth file modification information includes: If the fourth version identifier is smaller than the third version identifier, or the fourth modification time is smaller than the third modification time, determining that the test data state information is in the first state; If the fourth modification time is equal to the third modification time, processing the test file content according to the third test row data, and determining that the test data state information is in the second state; If the fourth version identifier is greater than the third version identifier, test row data processing is performed on the third test row data, and the test data state information is determined to be in a third state.
16. A test data processing device, characterized in that: include: A test data acquisition module, used to acquire first test data and second test data of a target program; The first test data includes a first version identifier, a first file identifier, first test line information, and first file modification information; the second test data includes a second version identifier, a second file identifier, second test line information, and second file modification information; A file category determination module, configured to determine the following one or more categories of test files according to a comparison result between the first file identifier and the second file identifier: a first category of test files corresponding to file identifiers included in the first file identifier and not included in the second file identifier; a second category of test files corresponding to file identifiers not included in the first file identifier and included in the second file identifier; a third category of test files corresponding to file identifiers included in both the first file identifier and the second file identifier; a test information integration module, configured to integrate the first test line information and the second test line information to form third test line information according to the category of the test file and the comparison result between the first version identifier and the second version identifier and / or the comparison result between the first file modification information and the second file modification information; The test data generating module is used to generate third test data including the third test row information.
17. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1-15 by executing the executable instructions.
18. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 15 is implemented.
Citation Information
Cited By
Test coverage data generation method and device, electronic equipment and storage medium
CN118708477A
Test coverage data generation method and device, electronic equipment and storage medium
CN118708477B
