CN113821431A - Method and device for acquiring test result, electronic equipment and storage medium - Google Patents

Method and device for acquiring test result, electronic equipment and storage medium Download PDF

Info

Publication number
CN113821431A
CN113821431A CN202011617301.0A CN202011617301A CN113821431A CN 113821431 A CN113821431 A CN 113821431A CN 202011617301 A CN202011617301 A CN 202011617301A CN 113821431 A CN113821431 A CN 113821431A
Authority
CN
China
Prior art keywords
application program
test
sending
test result
specified application
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.)
Pending
Application number
CN202011617301.0A
Other languages
Chinese (zh)
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.)
Jingdong Technology Holding Co Ltd
Original Assignee
Jingdong Technology Holding 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 Jingdong Technology Holding Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN202011617301.0A priority Critical patent/CN113821431A/en
Publication of CN113821431A publication Critical patent/CN113821431A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

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

Abstract

The application provides a method and a device for acquiring a test result, electronic equipment and a storage medium, wherein the method comprises the following steps: the method comprises the steps of testing a designated application program by combining a random event stream, automatically obtaining a system log of the android device after the testing is finished, inquiring a first content segment with a preset line number from a target position to the front and inquiring whether a packet name of the designated application program exists in a second content segment with the preset line number from the target position to the back according to the target position of a preset keyword in the system log, and forming a testing result report and sending the testing result report to a designated contact according to the preset keyword, the first content segment and the second content segment under the condition that the packet name exists in an inquiry result. Therefore, the test result report is generated by automatically analyzing the data in the system log, so that a user can obtain the test result of the application program quickly without analyzing the test data, the test efficiency is improved, and the experience degree of testers is improved.

Description

Method and device for acquiring test result, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for obtaining a test result, an electronic device, and a storage medium.
Background
In the related art, before an application program is released, in order to enable the application program to provide stable service, the application program is generally required to be tested, the application program is developed based on an android system, in the related art, a testing tool is generally adopted to test the application program of the android system, however, in the process of testing the application program of the android system by adopting the testing tool, test data is generally required to be analyzed in a manual mode to determine whether the application program is abnormal, and the mode is time-consuming to check, affects testing efficiency and affects testing experience of a user.
Disclosure of Invention
The application provides a method and a device for obtaining a test result, electronic equipment and a storage medium.
An embodiment of one aspect of the present application provides a method for obtaining a test result, including: testing a designated application program on the android device according to the random event stream; after the test is detected to be finished, acquiring a system log of the android device; under the condition that a preset keyword exists in the system log, according to a target position of the preset keyword in the system log, inquiring a first content segment with a preset line number from the target position to the front and inquiring a second content segment with a preset line number from the target position to the back to obtain an inquiry result; determining that the specified application program is abnormal under the condition that the package name of the specified application program exists in the query result, and forming a test result report of the specified application program according to the preset keyword, the first content segment and the second content segment; and sending the test result report to a designated contact person.
In an embodiment of the application, the obtaining the system log of the android device includes: sending a log grabbing instruction to the android device; and receiving the system log returned by the android device aiming at the log grabbing instruction.
In an embodiment of the present application, the testing a specified application on an android device according to a random event stream includes: sending a test instruction aiming at the specified application program through a control script; generating the random event stream in response to the test instruction; and sending the random event stream to a specified application program on the android device so as to test the specified application program.
In an embodiment of the present application, the sending the random event stream to a specified application program on the android device to implement testing of the specified application program includes: and sending the random event stream to an android debugging bridge, so that the random event stream is sent to the android equipment through the android debugging bridge, and the specified application program is tested.
In an embodiment of the application, the sending the test result report to a designated contact includes: and acquiring the mailbox address of the designated contact person, and sending the test result report to the mailbox address.
According to the method for obtaining the test result, in the process of testing the specified application program on the android device, the specified application program is tested by combining random event streams, after the test is finished, the system log of the android device is automatically obtained, whether preset keywords exist in the system log or not is detected, whether the packet name of the specified application program exists in the first content segment of the preset line number from the target position to the front or not and whether the packet name of the specified application program exists in the second content segment of the preset line number from the target position to the back or not are inquired according to the target position where the preset keywords exist in the system log, and under the condition that the packet name exists in the inquiry result, a test result report of the specified application program is formed according to the preset keywords, the first content segment and the second content segment, and the test result report is sent to the specified contact person. Therefore, the test result report of the designated application program can be determined by automatically analyzing the data in the system log, and the test result report is directly sent to the designated contact person, so that the user can obtain the test result of the application program quickly without analyzing the test data, the test efficiency is improved, and the experience degree of the tester can be improved.
An embodiment of another aspect of the present application provides an apparatus for obtaining a test result, including: the testing module is used for testing the appointed application program on the android device according to the random event stream; the acquisition module is used for acquiring the system log of the android device after the test is detected to be finished; the query module is used for querying a first content segment with a preset line number from the target position to the front and querying a second content segment with a preset line number from the target position to the back according to the target position of the preset keyword in the system log under the condition that the preset keyword exists in the system log, so as to obtain a query result; the determining module is used for determining that the specified application program is abnormal under the condition that the package name of the specified application program exists in the query result, and forming a test result report of the specified application program according to the preset keyword, the first content segment and the second content segment; and the sending module is used for sending the test result report to the appointed contact person.
In an embodiment of the present application, the obtaining module is specifically configured to: sending a log grabbing instruction to the android device; and receiving the system log returned by the android device aiming at the log grabbing instruction.
In one embodiment of the present application, the test module includes: the first sending unit is used for sending a test instruction aiming at the specified application program through a control script; a generating unit, configured to generate the random event stream in response to the test instruction; and the second sending unit is used for sending the random event stream to a specified application program on the android device so as to test the specified application program.
In an embodiment of the application, the second sending unit is specifically configured to: and sending the random event stream to an android debugging bridge, so that the random event stream is sent to the android equipment through the android debugging bridge, and the specified application program is tested.
In an embodiment of the present application, the sending module is specifically configured to: and acquiring the mailbox address of the designated contact person, and sending the test result report to the mailbox address.
The device for obtaining the test result of the embodiment of the application tests the specified application program in combination with the random event stream in the process of testing the specified application program on the android device, automatically obtains the system log of the android device after the test is finished, detects whether the system log has the preset keyword or not, inquires whether a first content segment with a preset line number from a target position to the front or not and inquires whether a packet name of the specified application program exists or not in a second content segment with a preset line number from the target position to the back according to the target position where the preset keyword in the system log is located, forms a test result report of the specified application program according to the preset keyword, the first content segment and the second content segment under the condition that the inquiry result is that the packet name exists, and sends the test result report to the specified contact person. Therefore, the test result report of the designated application program can be determined by automatically analyzing the data in the system log, and the test result report is directly sent to the designated contact person, so that the user can obtain the test result of the application program quickly without analyzing the test data, the test efficiency is improved, and the experience degree of the tester can be improved.
An embodiment of another aspect of the present application provides an electronic device, including: a memory, a processor; the memory stores computer instructions, and when the computer instructions are executed by the processor, the method for obtaining the test result of the embodiment of the application is realized.
Another embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method for obtaining a test result disclosed in the embodiment of the present application.
Another embodiment of the present application provides a computer program product, and when executed by an instruction processor in the computer program product, the method for obtaining a test result in the embodiment of the present application is implemented.
Other effects of the above-described alternative will be described below with reference to specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
fig. 1 is a schematic flowchart of a test result obtaining method according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating a method for obtaining a test result according to another embodiment of the present application.
Fig. 3 is a schematic structural diagram of a test result acquisition device according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of a test result acquisition device according to another embodiment of the present application.
FIG. 5 is a block diagram of an electronic device according to one embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
The following describes a method, an apparatus, and an electronic device for obtaining a test result according to an embodiment of the present application with reference to the drawings.
Fig. 1 is a schematic flowchart of a test result obtaining method according to an embodiment of the present application. It should be noted that the execution subject of the method for obtaining a test result provided in this embodiment is a device for obtaining a test result, where the device for obtaining a test result may be implemented in a software and/or hardware manner, and the device for obtaining a test result in this embodiment may be configured in an electronic device, and the electronic device in this embodiment may include a terminal device, a server, and other devices.
As shown in fig. 1, the method for obtaining the test result may include:
step 101, testing a designated application program on the android device according to the random event stream.
The android device is a device based on an android operating system, and the android device may be a mobile phone, a portable device, a computer, and the like based on the android system, and the android device is not specifically limited in this embodiment.
And step 102, acquiring a system log of the android device after the test is detected to be finished.
In this embodiment, the test subprocess corresponding to the specified application program is detected, the return value of the test subprocess is obtained, whether the test for the specified application program is finished is judged according to the return value, and if the test for the specified application program is determined to be finished according to the return value, the system log of the android device is obtained. Specifically, the system log of the android system can be obtained by communicating with the android device.
For example, when the return value of the test subprocess is set to 1 in advance, the test is determined to be ended. In the process of testing the specified application program through the testing subprocess, the current return value of the testing subprocess can be acquired for detection, and when the current return value is determined to be 1, the test for the specified application program is determined to be finished.
In an embodiment of the present application, a possible implementation manner of obtaining a system log of an android device is as follows: sending a log grabbing instruction to the android device; and receiving a system log returned by the android device aiming at the log grabbing instruction.
Step 103, under the condition that the preset keyword exists in the system log, according to the target position of the preset keyword in the system log, inquiring a first content segment with a preset line number from the target position to the front and inquiring a second content segment with a preset line number from the target position to the back to obtain an inquiry result.
The preset keywords are preset keywords in the test result acquisition device, and whether the corresponding application program is abnormal or not can be determined through the preset keywords. For example, the preset keyword may be a keyword such as crash, NAR, exception, and the like.
In this embodiment, when it is detected that the preset keyword exists in the system log, according to a target position where the preset keyword exists in the system log, a first content segment with a preset line number from the target position to the front is queried, and whether a packet name of a specified application program exists in a second content segment with a preset line number from the target position to the back is queried, so as to obtain a query result.
Wherein the query result may be one of the following: the first content segment comprises a package name of a specified application program, the second content segment comprises a package name of the specified application program, and the first content segment and the second content segment do not comprise the package name of the application program and both comprise the package name of the application program.
And 104, determining that the specified application program is abnormal under the condition that the package name of the specified application program exists in the query result, and forming a test result report of the specified application program according to the preset keyword, the first content segment and the second content segment.
The preset line number is a line number preset in the test result acquisition device, and in practical application, a value of the preset line number can be preset in the test result acquisition device according to actual service requirements.
For example, the preset number of lines may be 20, specifically, it may be determined whether a packet name of the specified application program exists in the upper 20 lines and the lower 20 lines of the line according to the line where the preset keyword is located in the system log, and if so, it is determined that the specified application program tested this time has an exception. At this time, the corresponding log may be stored in the report generation queue, and after the traversal of the system log is completed, a test result report for the specified application may be generated based on the data in the report generation queue.
In this embodiment, the exception type of the specified application program may be determined according to the preset keyword, and the specified test result report may be formed according to the exception type, the first content segment, and the second content segment.
In some embodiments, the system log may be traversed, and after the traversal is completed, the number of exceptions of the specified application program, the type of each exception, and the detailed information of the corresponding exception type are determined according to the traversal condition.
In addition, in some embodiments, in order to obtain more information according to the test result report, the start time and the end time of the test may also be obtained.
And step 105, sending the test result report to the appointed contact person.
In an embodiment of the present application, a manner of sending the test result report to the designated contact may be set according to an actual service requirement, for example, the test result report may be sent by a mail, an instant messaging message, a short message, or the like.
According to the method for obtaining the test result, in the process of testing the specified application program on the android device, the specified application program is tested by combining random event streams, after the test is finished, the system log of the android device is automatically obtained, whether preset keywords exist in the system log or not is detected, whether the packet name of the specified application program exists in the first content segment of the preset line number from the target position to the front or not and whether the packet name of the specified application program exists in the second content segment of the preset line number from the target position to the back or not are inquired according to the target position where the preset keywords exist in the system log, and under the condition that the packet name exists in the inquiry result, a test result report of the specified application program is formed according to the preset keywords, the first content segment and the second content segment, and the test result report is sent to the specified contact person. Therefore, the test result report of the designated application program can be determined by automatically analyzing the data in the system log, and the test result report is directly sent to the designated contact person, so that the user can obtain the test result of the application program quickly without analyzing the test data, the test efficiency is improved, and the experience degree of the tester can be improved.
Fig. 2 is a flowchart illustrating a method for obtaining a test result according to another embodiment of the present application. This embodiment is a further refinement or optimization of the above-described embodiments.
As shown in fig. 2, the method further comprises:
step 201, sending a test instruction aiming at a specified application program through a control script.
Step 202, generating a random event stream in response to the test instruction.
In this embodiment, for test instructions, a stream of random events may be generated by the test tool.
The random event stream refers to a sequence of events occurring at random time.
And 203, sending the random event stream to a specified application program on the android device so as to test the specified application program.
In an embodiment of the application, the obtaining apparatus of the test result may include a testing tool, and an android debug bridge may be disposed between the testing tool and the android device. One possible implementation manner for sending the random event stream to the specified application program on the android device to test the specified application program is as follows: and sending the random event stream to an android debugging bridge, and sending the random event stream to android equipment through the android debugging bridge so as to test the specified application program.
It is understood that the above-mentioned testing tool may be a Monkey testing tool, and may also be other tools for testing an application program of the android system, and this embodiment is not particularly limited thereto.
For example, the test tool is a Monkey test tool, and the Monkey test tool can be started to execute the test by using a subprocess mode and a mode that a scripting language python calls a Monkey command.
The Monkey testing tool is a command line tool provided by an android package of an android system, can generate a random event stream, sends the random event stream to android equipment, and tests a specified application program in the android equipment through the random event stream. Wherein, whether the specified application program has no response, breakdown and the like can be tested.
It is understood that the execution of monkey command defines time, execution times, execution device information, and the like by the service itself.
And step 204, after the test is detected to be finished, acquiring a system log of the android device.
For a specific implementation manner of step 204, reference may be made to the related description in the foregoing embodiments.
Step 205, under the condition that the preset keyword is detected to exist in the system log, according to the target position where the preset keyword is located in the system log, querying a first content segment with a preset line number from the target position to the front and querying a second content segment with a preset line number from the target position to the back to obtain a query result.
And step 206, determining that the specified application program is abnormal under the condition that the package name of the specified application program exists in the query result, and forming a test result report of the specified application program according to the preset keyword, the first content segment and the second content segment.
And step 207, acquiring the mailbox address of the designated contact and sending a test result report to the mailbox address.
In an embodiment of the application, the designated contact of the designated application program may be obtained according to a pre-stored correspondence between the application program and the designated contact.
It should be understood that the designated contact may be a person who sets a test task for the designated application program, and may also be any other person who needs to obtain a test result report of the designated application program, which is not limited in this embodiment.
According to the method for obtaining the test result, in the process of testing the specified application program on the android device, the specified application program is tested by combining a random event stream, after the test is finished, the system log of the android device is automatically obtained, whether the system log has the preset keywords or not is detected, whether the packet name of the specified application program exists in the first content segment of the preset line number from the target position to the front or the second content segment of the preset line number from the target position to the back is inquired according to the target position where the preset keywords exist in the system log, and under the condition that the inquiry result is that the packet name exists, the test result report of the specified application program is formed according to the preset keywords, the first content segment and the second content segment, and the mailbox of the specified contact person is sent to the test result report. Therefore, the test result report of the designated application program can be determined by automatically analyzing the data in the system log, and the test result report is directly sent to the designated contact person, so that the user can obtain the test result of the application program quickly without analyzing the test data, the test efficiency is improved, and the experience degree of the tester can be improved.
Corresponding to the methods for obtaining test results provided in the foregoing several embodiments, an embodiment of the present application further provides a device for obtaining test results, and since the device for obtaining test results provided in the embodiment of the present application corresponds to the methods for obtaining test results provided in the foregoing several embodiments, the implementation manner of the method for obtaining test results is also applicable to the device for obtaining test results provided in the embodiment, and is not described in detail in the embodiment.
Fig. 3 is a schematic structural diagram of a test result acquisition device according to an embodiment of the present application.
As shown in fig. 3, the apparatus 300 for obtaining a test result includes a testing module 301, an obtaining module 302, an inquiring module 303, a determining module 304, and a sending module 305, wherein:
the testing module 301 is configured to test a specified application program on the android device according to the random event stream.
An obtaining module 302, configured to obtain a system log of the android device after detecting that the test is finished.
The query module 303 is configured to, when it is detected that the preset keyword exists in the system log, query, according to a target position where the preset keyword is located in the system log, a first content segment with a preset line number from the target position to the front and a second content segment with a preset line number from the target position to the back to obtain a query result.
The determining module 304 is configured to determine that the specified application program is abnormal when the query result indicates that the package name of the specified application program exists, and form a test result report of the specified application program according to a preset keyword, the first content segment, and the second content segment.
A sending module 305, configured to send the test result report to the designated contact.
In an embodiment of the present application, the obtaining module 302 is specifically configured to: and sending a log grabbing instruction to the android device. And receiving a system log returned by the android device aiming at the log grabbing instruction.
In an embodiment of the present application, based on the embodiment of the apparatus shown in fig. 3, as shown in fig. 4, the test module 301 includes:
a first sending unit 3011, configured to send a test instruction for a specific application program through the control script.
And the generating unit 3012 is configured to generate a random event stream in response to the test instruction.
And the second sending unit 3013 is configured to send the random event stream to a specified application on the android device, so as to implement testing on the specified application.
In an embodiment of the present application, the second sending unit 3013 is specifically configured to: and sending the random event stream to an android debugging bridge, and sending the random event stream to android equipment through the android debugging bridge so as to test the specified application program.
In an embodiment of the present application, the sending module 305 is specifically configured to: and acquiring the mailbox address of the designated contact person, and sending a test result report to the mailbox address.
The device for obtaining the test result of the embodiment of the application tests the specified application program in combination with the random event stream in the process of testing the specified application program on the android device, automatically obtains the system log of the android device after the test is finished, detects whether the system log has the preset keyword or not, inquires whether a first content segment with a preset line number from a target position to the front or not and inquires whether a packet name of the specified application program exists or not in a second content segment with a preset line number from the target position to the back according to the target position where the preset keyword in the system log is located, forms a test result report of the specified application program according to the preset keyword, the first content segment and the second content segment under the condition that the inquiry result is that the packet name exists, and sends the test result report to the specified contact person. Therefore, the test result report of the designated application program can be determined by automatically analyzing the data in the system log, and the test result report is directly sent to the designated contact person, so that the user can obtain the test result of the application program quickly without analyzing the test data, the test efficiency is improved, and the experience degree of the tester can be improved.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
FIG. 5 is a block diagram of an electronic device according to one embodiment of the present application.
As shown in fig. 5, the electronic device includes:
memory 501, processor 502, and computer instructions stored on memory 501 and executable on processor 502.
The processor 502, when executing the instructions, implements the test result acquisition methods provided in the embodiments described above.
Further, the electronic device further includes:
a communication interface 503 for communication between the memory 501 and the processor 502.
Memory 501 for storing computer instructions executable on processor 502.
The memory 501 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor 502 is configured to implement the method for obtaining the test result of the foregoing embodiment when executing the program.
If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
Optionally, in a specific implementation, if the memory 501, the processor 502, and the communication interface 503 are integrated on a chip, the memory 501, the processor 502, and the communication interface 503 may complete communication with each other through an internal interface.
The processor 502 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present Application.
The present application further provides a computer program product, which when executed by an instruction processor in the computer program product, implements the method for obtaining the test result according to the embodiment of the present application.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, and the program may be stored in a computer readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (12)

1. A method for obtaining a test result is characterized by comprising the following steps:
testing a designated application program on the android device according to the random event stream;
after the test is detected to be finished, acquiring a system log of the android device;
under the condition that a preset keyword exists in the system log, according to a target position of the preset keyword in the system log, inquiring a first content segment with a preset line number from the target position to the front and inquiring a second content segment with a preset line number from the target position to the back to obtain an inquiry result;
determining that the specified application program is abnormal under the condition that the package name of the specified application program exists in the query result, and forming a test result report of the specified application program according to the preset keyword, the first content segment and the second content segment;
and sending the test result report to a designated contact person.
2. The method of claim 1, wherein the obtaining the system log of the android device comprises:
sending a log grabbing instruction to the android device;
and receiving the system log returned by the android device aiming at the log grabbing instruction.
3. The method of claim 1, wherein the testing of the specified application on the android device according to the random event stream comprises:
sending a test instruction aiming at the specified application program through a control script;
generating the random event stream in response to the test instruction;
and sending the random event stream to a specified application program on the android device so as to test the specified application program.
4. The method of claim 3, wherein the sending the random event stream to a designated application on the android device to enable testing of the designated application comprises:
and sending the random event stream to an android debugging bridge, so that the random event stream is sent to the android equipment through the android debugging bridge, and the specified application program is tested.
5. The method of claim 1, wherein said sending the test result report to a designated contact comprises:
and acquiring the mailbox address of the designated contact person, and sending the test result report to the mailbox address.
6. An apparatus for obtaining a test result, comprising:
the testing module is used for testing the appointed application program on the android device according to the random event stream;
the acquisition module is used for acquiring the system log of the android device after the test is detected to be finished;
the query module is used for querying a first content segment with a preset line number from the target position to the front and querying a second content segment with a preset line number from the target position to the back according to the target position of the preset keyword in the system log under the condition that the preset keyword exists in the system log, so as to obtain a query result;
the determining module is used for determining that the specified application program is abnormal under the condition that the package name of the specified application program exists in the query result, and forming a test result report of the specified application program according to the preset keyword, the first content segment and the second content segment;
and the sending module is used for sending the test result report to the appointed contact person.
7. The apparatus of claim 6, wherein the obtaining module is specifically configured to:
sending a log grabbing instruction to the android device;
and receiving the system log returned by the android device aiming at the log grabbing instruction.
8. The apparatus of claim 6, wherein the test module comprises:
the first sending unit is used for sending a test instruction aiming at the specified application program through a control script;
a generating unit, configured to generate the random event stream in response to the test instruction;
and the second sending unit is used for sending the random event stream to a specified application program on the android device so as to test the specified application program.
9. The apparatus as claimed in claim 8, wherein said second sending unit is specifically configured to:
and sending the random event stream to an android debugging bridge, so that the random event stream is sent to the android equipment through the android debugging bridge, and the specified application program is tested.
10. The apparatus of claim 6, wherein the sending module is specifically configured to:
and acquiring the mailbox address of the designated contact person, and sending the test result report to the mailbox address.
11. An electronic device, comprising: a memory, a processor; the memory has stored therein computer instructions which, when executed by the processor, implement the method of obtaining test results of any of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing a computer to execute the method of acquiring a test result according to any one of claims 1 to 5.
CN202011617301.0A 2020-12-31 2020-12-31 Method and device for acquiring test result, electronic equipment and storage medium Pending CN113821431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011617301.0A CN113821431A (en) 2020-12-31 2020-12-31 Method and device for acquiring test result, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011617301.0A CN113821431A (en) 2020-12-31 2020-12-31 Method and device for acquiring test result, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113821431A true CN113821431A (en) 2021-12-21

Family

ID=78912325

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011617301.0A Pending CN113821431A (en) 2020-12-31 2020-12-31 Method and device for acquiring test result, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113821431A (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577313A (en) * 2012-07-27 2014-02-12 腾讯科技(深圳)有限公司 Mobile terminal application program testing method and device
US20140109063A1 (en) * 2012-10-12 2014-04-17 VMware. Inc. Capturing test data associated with error conditions in software item testing
CN104331373A (en) * 2014-11-28 2015-02-04 上海斐讯数据通信技术有限公司 Monkey test system and method
US20150128111A1 (en) * 2013-08-26 2015-05-07 Tencent Technology (Shenzhen) Company Limited Devices and Methods for Acquiring Abnormal Information
CN105760301A (en) * 2016-02-24 2016-07-13 惠州Tcl移动通信有限公司 Automatic testing method and system based on Monkey command
US20160283365A1 (en) * 2015-03-27 2016-09-29 International Business Machines Corporation Identifying severity of test execution failures by analyzing test execution logs
CN105988931A (en) * 2015-03-03 2016-10-05 阿里巴巴集团控股有限公司 Test method and device
CN108647148A (en) * 2018-05-15 2018-10-12 深圳市同维通信技术有限公司 Test method, device, equipment and the storage medium of mobile terminal application program
CN109828918A (en) * 2019-01-16 2019-05-31 深圳壹账通智能科技有限公司 Applied program testing method, device, computer equipment and storage medium
CN110069398A (en) * 2019-03-15 2019-07-30 平安普惠企业管理有限公司 Programmed pressure test control method, device, computer equipment and storage medium
CN110309039A (en) * 2019-05-16 2019-10-08 平安科技(深圳)有限公司 Automation obtains method, apparatus, equipment and the storage medium of application log
CN111078567A (en) * 2019-12-19 2020-04-28 广州品唯软件有限公司 Report generation method, terminal and storage medium of automatic test platform

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577313A (en) * 2012-07-27 2014-02-12 腾讯科技(深圳)有限公司 Mobile terminal application program testing method and device
US20140109063A1 (en) * 2012-10-12 2014-04-17 VMware. Inc. Capturing test data associated with error conditions in software item testing
US20150128111A1 (en) * 2013-08-26 2015-05-07 Tencent Technology (Shenzhen) Company Limited Devices and Methods for Acquiring Abnormal Information
CN104331373A (en) * 2014-11-28 2015-02-04 上海斐讯数据通信技术有限公司 Monkey test system and method
CN105988931A (en) * 2015-03-03 2016-10-05 阿里巴巴集团控股有限公司 Test method and device
US20160283365A1 (en) * 2015-03-27 2016-09-29 International Business Machines Corporation Identifying severity of test execution failures by analyzing test execution logs
CN105760301A (en) * 2016-02-24 2016-07-13 惠州Tcl移动通信有限公司 Automatic testing method and system based on Monkey command
CN108647148A (en) * 2018-05-15 2018-10-12 深圳市同维通信技术有限公司 Test method, device, equipment and the storage medium of mobile terminal application program
CN109828918A (en) * 2019-01-16 2019-05-31 深圳壹账通智能科技有限公司 Applied program testing method, device, computer equipment and storage medium
CN110069398A (en) * 2019-03-15 2019-07-30 平安普惠企业管理有限公司 Programmed pressure test control method, device, computer equipment and storage medium
CN110309039A (en) * 2019-05-16 2019-10-08 平安科技(深圳)有限公司 Automation obtains method, apparatus, equipment and the storage medium of application log
CN111078567A (en) * 2019-12-19 2020-04-28 广州品唯软件有限公司 Report generation method, terminal and storage medium of automatic test platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
罗自立, 薛质, 李建华: "基于Linux环境的主机日志自动审计技术", 信息安全与通信保密, no. 07 *

Similar Documents

Publication Publication Date Title
CN110908888B (en) Server testing method and device
CN107547299B (en) Test method and system
CN111045944A (en) Regression testing method, device and system and computer readable storage medium
CN110532174B (en) Method, device, computer equipment and storage medium for calculating increment code coverage rate
CN112559350A (en) Debugging method, device and equipment for front-end development page and storage medium
CN108009085B (en) Channel package testing method
CN110297767B (en) Automatic execution method, device, equipment and storage medium for test cases
EP4246152A1 (en) Vehicle detection method, apparatus and device
CN111045879A (en) Pressure test report generation method and device and storage medium
CN109992511B (en) Device and method for obtaining code test coverage rate
CN110825451B (en) Configuration and verification method and device for applet page address
CN113238935A (en) Application testing method, system, device, medium, and computer program product
CN111078558B (en) Log storage method and device for automatic test and computer readable storage medium
CN113821431A (en) Method and device for acquiring test result, electronic equipment and storage medium
CN116756037A (en) Abnormal code positioning system, method, equipment and computer readable storage medium
CN109947715B (en) Log alarm method and device
CN112486824B (en) Case code generation method, device, computer equipment and storage medium
CN110737549A (en) Application testing method, device, server and system
CN114398272A (en) Pressure measurement method and pressure measurement device for combination performance bottleneck positioning
CN115086214A (en) Nest plate detection system and method, electronic equipment and storage medium
CN113704114A (en) Automatic testing method, device, equipment and medium for functional interface
CN111881021A (en) Interface test method, device and system
CN111343042B (en) DNS analysis test method and test system
CN115599663A (en) Application compatibility detection method and device and electronic equipment
CN116125946A (en) Vehicle fault diagnosis method, system, electronic device and storage medium

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