CN110022244B - Method and apparatus for transmitting information - Google Patents

Method and apparatus for transmitting information Download PDF

Info

Publication number
CN110022244B
CN110022244B CN201910264557.9A CN201910264557A CN110022244B CN 110022244 B CN110022244 B CN 110022244B CN 201910264557 A CN201910264557 A CN 201910264557A CN 110022244 B CN110022244 B CN 110022244B
Authority
CN
China
Prior art keywords
test
executed
target
test cases
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910264557.9A
Other languages
Chinese (zh)
Other versions
CN110022244A (en
Inventor
宋立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Douyin Vision Co Ltd
Douyin Vision Beijing Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910264557.9A priority Critical patent/CN110022244B/en
Publication of CN110022244A publication Critical patent/CN110022244A/en
Application granted granted Critical
Publication of CN110022244B publication Critical patent/CN110022244B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Abstract

The embodiment of the disclosure discloses a method and a device for transmitting information. One embodiment of the method comprises: in response to detecting initialization of a test environment of the target application, replacing a first target method for configuring test parameters with a first replacement method and replacing a second target method for executing test cases with a second replacement method; executing a first replacement method to obtain the number of test cases to be executed; for a test case, in response to detecting that the test case executes a second replacement method, recording relevant information of an execution process of the test case in a target file; determining whether the execution of the test cases to be executed is finished or not according to the number of the test cases to be executed; and responding to the fact that the execution of the plurality of test cases to be executed is finished, and sending the latest target file. The embodiment realizes the increase of the storage amount of the effective test information obtained by each test so as to shorten the test period of the whole target application.

Description

Method and apparatus for transmitting information
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a method and an apparatus for transmitting information.
Background
Testing of mobile applications may generally include both manual testing and automated testing. The manual testing method has the disadvantages of large testing workload, long testing period and low testing efficiency due to easy error. The automatic test speed of using various test tools is higher, and the test efficiency can be improved. However, some test tools usually only provide some simple test reports, and cannot provide detailed failure information (such as failure reason) about failed test cases.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for transmitting information.
In a first aspect, an embodiment of the present disclosure provides a method for transmitting information, where the method includes: in response to detecting initialization of a test environment of the target application, replacing a first target method for configuring test parameters with a first replacement method and replacing a second target method for executing test cases with a second replacement method; executing a first replacement method to obtain the number of test cases to be executed, wherein the number of test cases to be executed represents the number of test cases for testing the target application; for a test case in a plurality of test cases to be executed, responding to the detection that the test case executes a second replacement method, and recording relevant information of the execution process of the test case in a target file; determining whether the execution of the test cases to be executed is finished or not according to the number of the test cases to be executed; and responding to the fact that the execution of the plurality of test cases to be executed is finished, and sending the latest target file.
In some embodiments, determining whether the execution of the test cases to be executed is finished according to the number of the test cases to be executed includes: for a test case in a plurality of test cases to be executed, in response to determining that the test case executes the second replacement method, reducing the number of the current test cases to be executed by one to update the number of the test cases to be executed; and responding to the fact that the latest test case number to be executed is zero, and determining that the test case number to be executed is executed and finished.
In some embodiments, the information related to the execution process of the test case includes execution result information, where the execution result information includes information for characterizing the success of the test case execution or information for characterizing the failure reason of the test case execution failure.
In some embodiments, the above method further comprises: in response to detecting that the target application is subjected to flash back, acquiring relevant information of the flash back of the target application, and storing the relevant information of the flash back of the target application in a latest target file.
In some embodiments, the above method further comprises: determining the execution time of the first alternative method as the test start time of the target application; determining the time of the execution end of a plurality of test cases of the test cases to be executed as the test end time of the target application; the test start time and the test end time are recorded in the latest object file.
In some embodiments, sending the latest target file comprises: sending the latest target file to the server so as to be executed by the server as follows: and analyzing the latest target file to obtain analysis result information and displaying the analysis result information.
In a second aspect, an embodiment of the present disclosure provides an apparatus for transmitting information, the apparatus including: a replacing unit configured to replace a first target method for configuring test parameters using a first replacement method and a second target method for executing a test case using a second replacement method in response to detecting initialization of a test environment of a target application; the test system comprises an acquisition unit, a test execution unit and a test execution unit, wherein the acquisition unit is configured to execute a first replacement method to acquire the number of test cases to be executed, and the number of test cases to be executed represents the number of test cases for testing a target application; the recording unit is configured to respond to the detection that the test case executes a second replacement method for the test case in a plurality of test cases to be executed, and record relevant information of the execution process of the test case in a target file; the determining unit is configured to determine whether the execution of the test cases to be executed is finished according to the number of the test cases to be executed; and the sending unit is configured to send the latest target file in response to the fact that the execution of the test cases to be executed is determined to be finished.
In some embodiments, the determining unit is further configured to: for a test case in a plurality of test cases to be executed, in response to determining that the test case executes the second replacement method, reducing the number of the current test cases to be executed by one to update the number of the test cases to be executed; and responding to the fact that the latest test case number to be executed is zero, and determining that the test case number to be executed is executed and finished.
In some embodiments, the information related to the execution process of the test case includes execution result information, where the execution result information includes information for characterizing the success of the test case execution or information for characterizing the failure reason of the test case execution failure.
In some embodiments, the recording unit is further configured to: in response to detecting that the target application is subjected to flash back, acquiring relevant information of the flash back of the target application, and storing the relevant information of the flash back of the target application in a latest target file.
In some embodiments, the recording unit is further configured to: determining the execution time of the first alternative method as the test start time of the target application; determining the time of the execution end of a plurality of test cases of the test cases to be executed as the test end time of the target application; the test start time and the test end time are recorded in the latest object file.
In some embodiments, the transmitting unit is further configured to: sending the latest target file to the server so as to be executed by the server as follows: and analyzing the latest target file to obtain analysis result information and displaying the analysis result information.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable medium on which a computer program is stored, which computer program, when executed by a processor, implements the method as described in any of the implementations of the first aspect.
According to the method and the device for sending the information, before the test case is executed, two methods for configuring the test parameters and executing the test case are replaced, so that the detailed information of the execution process of each test case can be recorded according to the application requirements. Meanwhile, the execution end time of the test case can be determined, so that the target file for recording the test related information can be sent in time for effective storage before the test is finished.
Therefore, after the test is finished, the place where the target application has problems can be timely adjusted according to the detailed test information recorded in the stored target file, and then the adjusted target application can be continuously tested. The method shortens the test period of the whole target application by increasing the storage capacity of the effective test information obtained by each test, thereby improving the test efficiency.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram for one embodiment of a method for transmitting information, according to the present disclosure;
FIG. 3 is a schematic diagram of one application scenario of a method for transmitting information in accordance with an embodiment of the present disclosure;
FIG. 4 is a flow diagram of yet another embodiment of a method for transmitting information according to the present disclosure;
FIG. 5 is a schematic block diagram illustrating one embodiment of an apparatus for transmitting information according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary architecture 100 to which embodiments of a method for transmitting information or an apparatus for transmitting information of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 101, 102, 103 interact with a server 105 via a network 104 to receive or send messages or the like. Various client applications or tools may be installed on the terminal devices 101, 102, 103. Such as applications or tools for testing applications, applications for developing applications, browser-type applications, search-type applications, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting application testing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, such as a back-end server providing support for applications to be tested on the terminal devices 101, 102, 103. The server 105 may receive a target file, which is sent by the terminal devices 101, 102, 103 and which records information about the testing process of the application to be tested. Further, the server 105 may further parse the received target file recorded with the test information to know a possible current problem of the application to be tested, and display the problem to the user, so that the user can adjust the application to be tested in time.
It should be noted that the method for sending information provided by the embodiments of the present disclosure is generally performed by the terminal devices 101, 102, 103, and accordingly, the apparatus for sending information is generally disposed in the terminal devices 101, 102, 103.
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 105 is software, it may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for transmitting information in accordance with the present disclosure is shown. The method for transmitting information includes the steps of:
in response to detecting initialization of the test environment of the target application, replacing a first target method for configuring the test parameters with a first replacement method, and replacing a second target method for executing the test case with a second replacement method, step 201.
In the present embodiment, the execution subject of the method for transmitting information (such as the terminal devices 101, 102, 103 shown in fig. 1) can test the target application with the application or tool for testing the application installed thereon. Wherein the target application may be an application to be tested, which is pre-specified by a technician.
Generally, at the start of an application, there is a process for initializing the test environment. This process is typically used to prepare some of the data necessary for testing. Such as initial assignment of some parameters, some data manipulation associated with the database, etc.
Typically the initialization of the test environment is performed by one method. In this case, the first target method and the second target method may be replaced when the corresponding method for initializing the test environment is detected to be executed.
Wherein the first target method and the second target method may be application or tool-provided methods for testing an application. The first alternative method and the second alternative method may be preset by a technician according to actual application requirements.
The first target method may be used to configure test parameters. The test parameters may include any parameters related to the test process. For example, the test parameters may include the number of test cases included in the test, the location of each test case, and the like.
The second target method may be used to execute the test case. I.e., execution of each test case may require invocation of a second target method.
Optionally, the first target method may be implemented in a first alternative method, and the second target method may be implemented in a second alternative method.
The object of modifying the first target method and the second target method can be achieved by replacing the first target method and the second target method. Therefore, the replaced first target method (i.e. the first replacement method) can also realize other functions required by some application requirements besides the functions realized by the first target method. The second target method after replacement (i.e., the second replacement method) may also be enabled to implement other functions required by some application requirements besides the functions implemented by the second target method.
Specifically, the first target method and the second target method may be replaced based on existing Hook (Hook) technology, rewriting method, or the like.
Here, one of the purposes of replacing the first target method and the second target method is to be able to perform some customized functions before the first target method and the second target method are performed. Therefore, the specific timing for replacing the first target method and the second target method may be before the execution time of the first target method and the second target method.
Step 202, a first alternative method is executed to obtain the number of test cases to be executed.
In this embodiment, the first alternative method may be used to obtain the number of test cases to be executed. The number of test cases to be executed may represent the total number of test cases for testing the target application. Therefore, when the first alternative method is executed, the number of test cases to be executed can be acquired.
Step 203, for a test case in the test cases to be executed, in response to detecting that the test case executes the second replacement method, recording relevant information of the execution process of the test case in the target file.
In this embodiment, since each test case is executed by calling the second target method, the second target method may be replaced to complete the required functions during the execution process (including before execution, after execution, during execution, and the like) of each test case.
The second alternative method may be used to record the relevant information of the execution process of each test case in the execution process of each test case. For any test case, the relevant information of the execution process of the test case may include any information relevant to the execution process of the test case.
For example, for a test case, the information related to the execution process of the test case may include the test operation (such as a login application, etc.) executed by the test case, the execution time of each test operation, and the like.
Optionally, the relevant information of the execution process of the test case may include execution result information. The execution result information may include information for characterizing the success of the test case execution or information for characterizing the failure reason of the test case execution failure. Therefore, when a test case fails to execute, the specific failure reason (such as timeout, function unavailability and the like) can be recorded besides knowing the test case execution failure.
Wherein the target file may be a file for recording information previously designated by a technician.
And 204, determining whether the execution of the test cases to be executed is finished according to the number of the test cases to be executed.
In this embodiment, all the test cases may be considered to be executed and ended only when each test case is executed and ended. Therefore, it is possible to determine whether all the test cases have been executed and ended by determining whether the number of test cases that have been currently executed and the number of test cases to be executed (i.e., the total number of test cases) determined by the first alternative method are the same.
If the number of the currently executed test cases is the same as the number of the test cases to be executed determined by the first alternative method, it can be determined whether all the test cases are executed and finished. Conversely, if the number of currently executed test cases is different from the number of test cases to be executed determined by the first alternative method, it may be determined that there are test cases that have not been executed.
For example, the second alternative method may further be configured to output a preset prompt message (e.g., print a pre-specified special symbol) when the execution of each test case is finished. At this time, it may be counted whether the number of currently output preset prompt messages is equal to the number of test cases to be executed determined by the first replacement method.
If the number of the currently output preset prompt messages is the same as the number of the test cases to be executed determined by the first replacement method, all the test cases can be considered to be executed and finished. Conversely, if the number of the currently output preset prompt messages is different from the number of the test cases to be executed determined by the first replacement method, it can be determined that the test cases are not executed.
Optionally, for a test case in the test cases to be executed, in response to determining that the test case executes the second replacement method, reducing the current number of the test cases to be executed by one to update the number of the test cases to be executed; and responding to the fact that the latest test case number to be executed is zero, and determining that the test case number to be executed is executed and finished.
The method determines whether all the test cases are executed or not by updating the number of the test cases to be executed. Specifically, if it is detected that the second replacement method for executing a test case is finished, the test case may be considered to be finished being executed, and then the number of test cases to be executed may be reduced by one to obtain the latest number of test cases to be executed. In this way, when the number of the latest test cases to be executed is zero, all the test cases to be tested can be considered to be executed completely.
Step 205, in response to determining that the execution of the plurality of test cases to be executed is finished, sending the latest target file.
In this embodiment, when all test cases are executed, the latest target file may be sent in time to save the target file. The destination address of the transmission, i.e. the latest saved address of the target file, may be preset by the technician.
Since some applications or tools for testing applications will perform a method for resource reclamation and the like at the end of the test. For example, some data in the test process is cleared, including parameter restoration or destruction, restoration recovery of the database, and the like.
Therefore, when the execution of all test cases is detected to be finished, the latest target file is timely sent to avoid the situation that the target file can be eliminated when the test is finished. Therefore, more detailed information of the test process of each test case can be obtained. The target file is timely stored by detecting the execution end time of the test case, so that the situation that the target file is cleared or recycled is avoided, resource waste caused by idle work is avoided, and the test efficiency is improved.
With continued reference to fig. 3, fig. 3 is a schematic diagram 300 of an application scenario of the method for transmitting information according to the present embodiment. In the application scenario of fig. 3, the main implementation of the method for sending information is a computer 301. An XCTest framework for testing mobile-side applications is installed on the computer 301 to test the applications to be tested.
When detecting that the "+ Load ()" method of the XCTest framework for initializing the test environment starts to execute, the testsuteforttestconfiguration () method of the XCTest framework for configuring the test parameters may be replaced with a first replacement method (as indicated by reference numeral 302 in the figure), and the InvokeTest () method of the XCTest framework for executing the test case may be replaced with a second replacement method (as indicated by reference numeral 303 in the figure).
In the first alternative method, a method for obtaining test cases may be preset, so that when the first alternative method is executed, the number of test cases to be tested is 3 (as shown by reference numeral 304 in the figure).
As shown in the figure, the three cases to be tested are respectively a test case "01" 3051, a test case "02" 3052 and a test case "03" 3053. In the second alternative method, a method for acquiring relevant information of an execution process of each test case may be preset.
Therefore, as shown by reference number 3061 in the figure, when the second replacement method is executed by the test case "01" 3051, the relevant information of the execution process of the test case "01" 3051 is acquired as "successful execution", and the acquired information is recorded in the target file 307.
As shown by reference number 3062 in the figure, when the second alternative method is executed by the test case "02" 3052, the relevant information of the execution process of the test case "02" 3052 is acquired as "successful execution", and the acquired information is recorded in the latest target file 307.
As shown by reference numeral 3063 in the figure, when the second alternative method is executed by the test case "03" 3053, the information on the execution process of the test case "03" 3053 is acquired as "login timeout failure", and the acquired information is recorded in the latest target file 307. That is, the test case "03" 3053 contains a test for logging in the application to be tested, but the logging fails due to logging timeout.
Meanwhile, in the second alternative method, a global variable "C" may be set in advance, and 1 may be added to the global variable "C" when the execution of each test case is finished. Thus, when the calculated variable "C" is equal to the number of test cases (equal to 3), all three test cases can be considered to be finished executing.
Thereafter, when it is detected that all of the three test cases are finished, as shown by reference numeral 307 in the figure, the latest target file 307 in which the relevant information of the execution processes of the three test cases is recorded may be transmitted to and stored in the database 308.
The method provided by the above embodiment of the present disclosure replaces the method for configuring the test parameters before the test case is executed, so as to obtain the total number of the test cases to be executed in the test. And then, the time point of the execution end of all the test cases can be determined according to the total number of the obtained cases to be tested. Therefore, the current latest target file can be timely stored when the execution of all test cases is finished, so that the situation that the target file is removed in the test for testing the application or in the resource recovery operation of a tool before the test is finished is avoided, namely, the resource waste is avoided, and the test efficiency is improved.
In addition, before the test cases are executed, the method for executing the test cases is replaced, so that the detailed information of the execution process of each test case is acquired. Compared with the simple test report (for example, only including the success number and failure number of the test cases) generated by the application or tool for testing the application in the prior art, the memory capacity of the acquired test information is effectively increased.
Then, according to the obtained more detailed test information, a technician can adjust the problems found in the current test of the application to be tested, and further can continue to test the adjusted application to be tested. Compared with the simple information that each test case can only be executed in a failed or successful mode in the prior art, more test information is obtained, so that the problem of the test can be solved more quickly, the problem repairing speed is increased, the next test speed is increased, the test period of the application to be tested can be effectively shortened, the test speed is increased, and the purpose that the test of the application to be tested is completed by using the resources as few as possible is achieved.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for transmitting information is shown. The process 400 of the method for transmitting information includes the steps of:
in response to detecting initialization of the test environment of the target application, replacing a first target method for configuring the test parameters with a first replacement method, and replacing a second target method for executing the test case with a second replacement method, step 401.
Step 402, executing a first alternative method to obtain the number of test cases to be executed.
Step 403, for a test case in the test cases to be executed, in response to detecting that the test case executes the second replacement method, recording relevant information of the execution process of the test case in the target file.
The specific implementation process of the steps 401, 402, and 403 may refer to the related descriptions of the steps 201, 202, and 203 in the corresponding embodiment of fig. 2, and will not be described herein again.
In response to detecting that the target application is flashed back, step 404, obtaining relevant information of the flashing back of the target application, and storing the relevant information of the flashing back of the target application in the latest target file.
In this embodiment, there are various reasons for the application to cause the flash back. For example, problems such as unstable network speed, lack of packets, insufficient storage space, etc. may result in application flash back.
Therefore, the flash back condition can be detected and relevant information can be recorded in the test process. Wherein, the information related to the flash back may include any information related to the flash back occurred. For example, the information about the flash back may include the reason for the flash back, the time when the flash back occurred, and the like.
Step 405, determining the execution time of the first alternative method as the test start time of the target application; determining the time of the execution end of a plurality of test cases of the test cases to be executed as the test end time of the target application; the test start time and the test end time are recorded in the latest object file.
In this embodiment, a time when the first alternative method starts to be executed may be taken as a test start time, and a time when all test cases are executed and ended may be taken as a test end time. Therefore, the test duration of the whole test can be known and recorded in the latest target file.
It should be appreciated that during the testing process, various information to be recorded is continuously generated, and thus, the contents of the target file are always updated.
And 406, determining whether the execution of the test cases to be executed is finished according to the number of the test cases to be executed.
The specific implementation process of step 406 may refer to the related description of step 204 in the corresponding embodiment of fig. 2, and is not repeated herein.
Step 407, in response to determining that the execution of the plurality of test cases to be executed is finished, sending the latest target file to the server to execute the following steps by the server: and analyzing the latest target file to obtain analysis result information and displaying the analysis result information.
In this embodiment, a server (e.g., the server 105 shown in fig. 1) may be communicatively coupled to the execution entity. When the server receives the latest target file, because the received target file records the detailed information of the test, the server can analyze the target file by using various analysis tools to obtain analysis result information. The specific parsing tool and parsing method may be set according to a format of a preset target file.
The analysis result information can be used for representing the problems existing in the test target application. Furthermore, the server can display the analysis result information, so that a user can intuitively know the problems of the target application conveniently. The display mode can be flexibly set according to different application scenes. For example, the location of the problematic test case may be highlighted.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for sending information in this embodiment may further record information related to flash back occurring during the test process and various information such as the execution start and end time, so as to further increase the storage amount of the obtained test information.
In addition, the flow 400 of the method for sending information in this embodiment also sends the latest target file to the server side when all test cases are finished. Therefore, the server analyzes the target file and displays the analysis result information, so that technicians can conveniently and visually know the analysis result information and position the position of the test with the problem, the speed of repairing the problem is further increased, the speed of next test is increased, the test period of the application to be tested can be effectively shortened, and the resource consumed by the whole test period is reduced.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an apparatus for sending information, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable in various electronic devices.
As shown in fig. 5, the apparatus 500 for transmitting information provided by the present embodiment includes a replacing unit 501, an acquiring unit 502, a recording unit 503, a determining unit 504, and a transmitting unit 505. Wherein the replacing unit 501 is configured to replace a first target method for configuring the test parameters with a first replacement method and replace a second target method for executing the test case with a second replacement method in response to detecting initialization of the test environment of the target application; the obtaining unit 502 is configured to execute a first alternative method to obtain the number of test cases to be executed, where the number of test cases to be executed represents the number of test cases for testing the target application; the recording unit 503 is configured to, for a test case of a plurality of test cases to be executed, in response to detecting that the test case executes the second alternative method, record relevant information of an execution process of the test case in the target file; the determining unit 504 is configured to determine whether the number of test cases to be executed is finished according to the number of test cases to be executed; the sending unit 505 is configured to send the latest target file in response to determining that the number of test cases to be executed ends.
In the present embodiment, in the apparatus 500 for transmitting information: the specific processing of the replacing unit 501, the obtaining unit 502, the recording unit 503, the determining unit 504 and the sending unit 505 and the technical effects thereof can refer to the related descriptions of step 201, step 202, step 203, step 204 and step 205 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of the present embodiment, the determining unit 504 is further configured to: for a test case in a plurality of test cases to be executed, in response to determining that the test case executes the second replacement method, reducing the number of the current test cases to be executed by one to update the number of the test cases to be executed; and responding to the fact that the latest test case number to be executed is zero, and determining that the test case number to be executed is executed and finished.
In some optional implementation manners of this embodiment, the relevant information of the execution process of the test case includes execution result information, where the execution result information includes information used to characterize the success of the test case execution or information used to characterize the failure reason of the test case execution failure.
In some optional implementations of this embodiment, the recording unit 503 is further configured to: in response to detecting that the target application is subjected to flash back, acquiring relevant information of the flash back of the target application, and storing the relevant information of the flash back of the target application in a latest target file.
In some optional implementations of this embodiment, the recording unit 503 is further configured to: determining the execution time of the first alternative method as the test start time of the target application; determining the time of the execution end of a plurality of test cases of the test cases to be executed as the test end time of the target application; the test start time and the test end time are recorded in the latest object file.
In some optional implementations of this embodiment, the sending unit 505 is further configured to: sending the latest target file to the server so as to be executed by the server as follows: and analyzing the latest target file to obtain analysis result information and displaying the analysis result information.
The apparatus provided by the above embodiment of the present disclosure, in response to detecting initialization of the test environment of the target application, replaces, by the replacement unit 501, the first target method for configuring the test parameters with the first replacement method, and replaces the second target method for executing the test case with the second replacement method; the obtaining unit 502 executes a first alternative method to obtain the number of test cases to be executed, where the number of test cases to be executed represents the number of test cases for testing the target application; for a test case in a plurality of test cases to be executed, the recording unit 503 records, in response to detecting that the test case executes the second replacement method, information related to the execution process of the test case in the target file; the determining unit 504 determines whether the execution of the test cases to be executed is finished according to the number of the test cases to be executed; the sending unit 505 is configured to send the latest target file in response to determining that the execution of a plurality of test cases to be executed is finished, so that the detailed information of the execution process of each test case can be recorded according to the application requirements. Meanwhile, the execution end time of the test case can be determined, so that the target file for recording the test related information can be sent in time for effective storage before the test is finished.
Therefore, after the test is finished, the place where the target application has problems can be timely adjusted according to the detailed test information recorded in the stored target file, and then the adjusted target application can be continuously tested. The method shortens the test period of the whole target application by increasing the storage capacity of the effective test information obtained by each test, thereby improving the test efficiency.
Referring now to fig. 6, shown is a schematic diagram of an electronic device (e.g., terminal device in fig. 1) 600 suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a PAD (tablet computer), and the like, and a stationary terminal such as a desktop computer, and the like. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the use range of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure.
It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: in response to detecting initialization of a test environment of the target application, replacing a first target method for configuring test parameters with a first replacement method and replacing a second target method for executing test cases with a second replacement method; executing a first replacement method to obtain the number of test cases to be executed, wherein the number of test cases to be executed represents the number of test cases for testing the target application; for a test case in a plurality of test cases to be executed, responding to the detection that the test case executes a second replacement method, and recording relevant information of the execution process of the test case in a target file; determining whether the execution of the test cases to be executed is finished or not according to the number of the test cases to be executed; and responding to the fact that the execution of the plurality of test cases to be executed is finished, and sending the latest target file.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a replacement unit, an acquisition unit, a recording unit, a determination unit, and a transmission unit. The names of the units do not constitute a limitation to the unit itself in some cases, and for example, the sending unit may also be described as a "unit sending the latest target file in response to determining that the execution of a number of test cases to be executed ends".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A method for transmitting information, comprising:
in response to detecting that an XCTest framework for testing a target application executes a Load method to complete initialization of a test environment of the target application, replacing a first target method for configuring test parameters with a first replacement method and replacing a second target method for executing a test case with a second replacement method, wherein the first replacement method implements the first target method and functions other than the functions implemented by the first target method, and the second replacement method implements the second target method and functions other than the functions implemented by the second target method, wherein the first target method is a testSuiteForTestConsfiguration method and the second target method is an InvokeTektest method;
executing the first alternative method to obtain the number of test cases to be executed, wherein the number of test cases to be executed represents the number of test cases for testing the target application;
for a test case in a plurality of test cases to be executed, responding to the detection that the test case executes the second replacement method, and recording relevant information of the execution process of the test case in a target file;
determining whether the execution of the test cases to be executed is finished or not according to the number of the test cases to be executed;
and sending the latest target file in response to the fact that the execution of the test cases to be executed is determined to be finished.
2. The method of claim 1, wherein the determining whether the number of test cases to be executed is finished according to the number of test cases to be executed comprises:
for the test case in the test cases to be executed, in response to determining that the test case executes the second replacement method, reducing the number of the current test cases to be executed by one to update the number of the test cases to be executed;
and determining that the execution of the test cases to be executed is finished in response to determining that the latest test case number to be executed is zero.
3. The method according to claim 1, wherein the information related to the execution process of the test case includes execution result information, and wherein the execution result information includes information for characterizing the success of the test case execution or information for characterizing the failure reason of the test case execution failure.
4. The method of claim 1, wherein the method further comprises:
and in response to the detection that the target application is subjected to flash back, acquiring relevant information of the flash back of the target application, and storing the relevant information of the flash back of the target application in a latest target file.
5. The method of claim 1, wherein the method further comprises:
determining an execution time of the first alternative method as a test start time of the target application;
determining the time of the execution end of a plurality of test cases of the test case to be executed as the test end time of the target application;
and recording the test starting time and the test ending time in the latest target file.
6. The method of claim 1, wherein said transmitting the latest target file comprises:
sending the latest target file to a server so as to execute the following steps by the server: and analyzing the latest target file to obtain analysis result information, and displaying the analysis result information.
7. An apparatus for transmitting information, comprising:
a replacing unit configured to, in response to detecting that an XCTest framework for testing a target application executes a Load method to complete initialization of a test environment of the target application, replace a first target method for configuring test parameters using a first replacement method, and replace a second target method for executing a test case using a second replacement method, wherein the first replacement method implements a first target method and a function other than a function implemented by the first target method, and the second replacement method implements a second target method and a function other than a function implemented by the second target method, wherein the first target method is a testSuiteForTestConsfiguration method and the second target method is an InveTest method;
an obtaining unit configured to execute the first alternative method to obtain a number of test cases to be executed, wherein the number of test cases to be executed represents a number of test cases for testing the target application;
the recording unit is configured to record relevant information of an execution process of a test case in a target file for the test case in a plurality of test cases to be executed in response to detecting that the test case executes the second replacement method;
the determining unit is configured to determine whether the execution of the test cases to be executed is finished according to the number of the test cases to be executed;
and the sending unit is configured to send the latest target file in response to the fact that the execution of the test cases to be executed is determined to be finished.
8. The apparatus of claim 7, wherein the determination unit is further configured to:
for the test case in the test cases to be executed, in response to determining that the test case executes the second replacement method, reducing the number of the current test cases to be executed by one to update the number of the test cases to be executed;
and determining that the execution of the test cases to be executed is finished in response to determining that the latest test case number to be executed is zero.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
10. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
CN201910264557.9A 2019-04-03 2019-04-03 Method and apparatus for transmitting information Active CN110022244B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910264557.9A CN110022244B (en) 2019-04-03 2019-04-03 Method and apparatus for transmitting information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910264557.9A CN110022244B (en) 2019-04-03 2019-04-03 Method and apparatus for transmitting information

Publications (2)

Publication Number Publication Date
CN110022244A CN110022244A (en) 2019-07-16
CN110022244B true CN110022244B (en) 2020-08-28

Family

ID=67190437

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910264557.9A Active CN110022244B (en) 2019-04-03 2019-04-03 Method and apparatus for transmitting information

Country Status (1)

Country Link
CN (1) CN110022244B (en)

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7320096B2 (en) * 2003-05-09 2008-01-15 Hewlett-Packard Development Company, L.P. System and method for testing memory at full bandwidth
US20070168734A1 (en) * 2005-11-17 2007-07-19 Phil Vasile Apparatus, system, and method for persistent testing with progressive environment sterilzation
CN104699598B (en) * 2013-12-09 2017-09-29 腾讯科技(深圳)有限公司 Automated testing method, device, equipment and system
US9263157B2 (en) * 2013-12-23 2016-02-16 International Business Machines Corporation Detecting defective connections in stacked memory devices
CN104794050B (en) * 2014-01-21 2018-09-18 腾讯科技(深圳)有限公司 The test method of application program, apparatus and system
US9916475B2 (en) * 2014-08-11 2018-03-13 North Carolina State University Programmable interface for extending security of application-based operating system
CN104951400B (en) * 2015-07-13 2019-02-22 百度在线网络技术(北京)有限公司 The method and apparatus that product is tested
CN105005532B (en) * 2015-08-05 2017-11-24 广东欧珀移动通信有限公司 A kind of system and method for automatic test application programming interfaces stability
CN106919489B (en) * 2016-08-02 2020-03-10 阿里巴巴集团控股有限公司 Method and device for monitoring abnormal exit of application interface of application program
CN106484622B (en) * 2016-10-18 2019-02-22 网易(杭州)网络有限公司 Test method, apparatus and system
CN106569949A (en) * 2016-11-03 2017-04-19 北京奇鱼时代科技有限公司 Method and device used for executing test case
CN106557424B (en) * 2016-11-18 2019-12-10 腾讯科技(深圳)有限公司 Memory test method, tested terminal, test client and system
CN107861862A (en) * 2017-06-27 2018-03-30 陆金所(上海)科技服务有限公司 UI automated testing methods, device and computer-readable recording medium
CN107704395B (en) * 2017-10-24 2020-07-07 武大吉奥信息技术有限公司 Cloud platform automation test implementation method and system based on Openstack
CN108153672A (en) * 2017-12-25 2018-06-12 苏州蜗牛数字科技股份有限公司 The automatization test system and test method of a kind of mobile application
CN108829585A (en) * 2018-05-24 2018-11-16 广东睿江云计算股份有限公司 A kind of case management system test data automatic generation method and device
CN109376074A (en) * 2018-09-14 2019-02-22 浙江口碑网络技术有限公司 Obtain method and device, the storage medium, electronic device of log

Also Published As

Publication number Publication date
CN110022244A (en) 2019-07-16

Similar Documents

Publication Publication Date Title
CN108196915B (en) Code processing method and device based on application container engine and storage medium
US9584364B2 (en) Reporting performance capabilities of a computer resource service
KR20200022329A (en) Method and device for determining response time
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
CN107644075B (en) Method and device for collecting page information
CN110647332A (en) Software deployment method and device based on container cloud
CN107045475B (en) Test method and device
CN112015654A (en) Method and apparatus for testing
CN113485918A (en) Test method, test device, electronic equipment and storage medium
CN114584480A (en) Method and apparatus for service degradation handling
CN111258607B (en) Split-flow-based version upgrading method, device, equipment and storage medium
CN109828830B (en) Method and apparatus for managing containers
CN115167874B (en) Automatic driving software mirror image deployment method and device, electronic equipment and readable medium
CN110022244B (en) Method and apparatus for transmitting information
CN111324480A (en) Large host transaction fault positioning system and method
CN109873731B (en) Test method, device and system
CN111488268A (en) Dispatching method and dispatching device for automatic test
CN111290873B (en) Fault processing method and device
CN109960659B (en) Method and device for detecting application program
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium
CN115996179A (en) Service node testing method and device, readable medium and electronic equipment
CN112084114A (en) Method and apparatus for testing an interface
CN113760631A (en) Page loading duration determination method, device, equipment and storage medium
CN111382058A (en) Service testing method and device, server and storage medium
CN111314457B (en) Method and device for setting virtual private cloud

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: Tiktok vision (Beijing) Co.,Ltd.