CN113360398B - Hybrid application program testing method, device, equipment and medium - Google Patents

Hybrid application program testing method, device, equipment and medium Download PDF

Info

Publication number
CN113360398B
CN113360398B CN202110724838.5A CN202110724838A CN113360398B CN 113360398 B CN113360398 B CN 113360398B CN 202110724838 A CN202110724838 A CN 202110724838A CN 113360398 B CN113360398 B CN 113360398B
Authority
CN
China
Prior art keywords
interface
event
time
page jump
tested
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
CN202110724838.5A
Other languages
Chinese (zh)
Other versions
CN113360398A (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.)
Shenzhen Lian Intellectual Property Service Center
Xi'an Tiantianbang Information Technology Co ltd
Original Assignee
Xi'an Tiantianbang Information 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 Xi'an Tiantianbang Information Technology Co ltd filed Critical Xi'an Tiantianbang Information Technology Co ltd
Priority to CN202110724838.5A priority Critical patent/CN113360398B/en
Publication of CN113360398A publication Critical patent/CN113360398A/en
Application granted granted Critical
Publication of CN113360398B publication Critical patent/CN113360398B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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 invention relates to the field of testing, and provides a method, a device, equipment and a medium for testing a hybrid application program, which can acquire a simulated click script and insert the hybrid application to be tested, run the simulated click script, automatically simulate clicking on the hybrid application to be tested without manual operation of a user, release manpower, automatically run by a machine, simultaneously improve the efficiency, automatically record time based on a pre-packaged method, provide a reliable data base for testing, generate a test report, automatically realize the test of the response speed of page jump, independently test the performance of each interface and test the overall performance of all interfaces of the hybrid application to be tested by simulating clicking and automatically record the time, avoid the manpower consumption caused by manual testing and errors caused by manual operation, and improve the efficiency and accuracy of the testing. In addition, the present invention relates to blockchain techniques in which test reports may be stored in blockchain nodes.

Description

Hybrid application program testing method, device, equipment and medium
Technical Field
The present invention relates to the field of testing technologies, and in particular, to a method, an apparatus, a device, and a medium for testing a hybrid application.
Background
Currently, in order to provide more usage functions for users, more applications are being developed in a hybrid manner, such as applications that use H5 (HTML 5), reactNative, weex, flutter, etc. technologies in combination with native applications. Although the mixed development brings certain benefits, certain disadvantages exist.
Hybrid developed applications are likely to not have the application response of native development as fast, and the benefits of hybrid development are that resources can be loaded more flexibly and deployment is more convenient, but both rendering and loading of pages can be somewhat slower than native developed applications. Moreover, if the data of the page and the interface of the request network are relatively more, the response time of the hybrid developed application program to the page request is likely to be relatively longer, and the experience is poor for the user.
In order to avoid the occurrence of the above, a large number of tests need to be performed in advance before the application program developed in a hybrid manner is formally used, wherein the test for response time is particularly important. However, the traditional testing mode mainly depends on manual clicking, time is counted, a large amount of manpower is consumed for testing operation, testing efficiency is low, errors caused by manual operation are easily introduced, and testing accuracy is affected.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a method, an apparatus, a device, and a medium for testing a hybrid application, which can automatically implement a test for a response speed of a page jump, a separate test for performance of each interface, and a test for overall performance of all interfaces of the hybrid application to be tested by simulating automatic recording of clicking and time, so as to avoid human consumption caused by manual testing and errors caused by manual operation, and improve efficiency and accuracy of the test.
A hybrid application testing method, the hybrid application testing method comprising:
responding to a mixed application program test instruction, and determining a mixed application to be tested according to the mixed application program test instruction;
obtaining a pre-written simulated click script, inserting the simulated click script into the mixed application to be tested, and running the simulated click script on the mixed application to be tested;
monitoring a page jump event and an interface call event in the process of running the simulated click script;
recording the starting time of each page jump event and the ending time of each page jump event based on a pre-packaging method for each page jump event in the page jump events;
Testing the response speed of each page jump event according to the starting time of each page jump event and the ending time of each page jump event;
recording the starting time of each interface calling event and the ending time of each interface calling event based on the pre-packaged method for each interface calling event in the interface calling events;
testing the performance of each interface and the overall performance of all interfaces of the mixed application to be tested according to the starting time of each interface calling event and the ending time of each interface calling event;
and generating a test report according to the response speed of the page jump event, the performance of each interface and the overall performance of all interfaces of the hybrid application to be tested.
According to a preferred embodiment of the invention, the method further comprises:
writing each click event of the simulated click script into a method respectively by each interface associated with the mixed application to be tested;
packaging the writing method to obtain the pre-packaging method;
the time nodes associated with each click event are recorded using the pre-packaged method, and the time nodes associated with each interface are recorded.
According to a preferred embodiment of the present invention, the recording the start time of each page jump event and the end time of each page jump event based on the pre-encapsulation method includes:
when the creation of the container of the mixed application to be tested is monitored, determining a page jump event corresponding to the created container as a target page jump event;
acquiring a timestamp when the container of the hybrid application to be tested is monitored to be created based on the pre-packaging method, and determining the acquired timestamp as the starting time of the target page jump event;
when the page rendering of the target page jump event is monitored to be finished, acquiring a time stamp when the page rendering is monitored to be finished, and determining the acquired time stamp as the finishing time of the target page jump event.
According to a preferred embodiment of the present invention, the testing the response speed of each page jump event according to the start time of the page jump event and the end time of the page jump event includes:
acquiring the total number of the page jump events as a first total amount;
calculating the difference between the ending time of each page jump event and the starting time of each page jump event as the response time of each page jump event;
Calculating the accumulated sum of the response time of each page jump event as the total response time of the page jump event;
calculating the quotient of the total response time of the page jump event and the first total amount as the average response time of the page jump event;
acquiring a pre-configured page jump time threshold;
when the average response time of the page jump event is larger than the page jump time threshold, determining that the response speed of the page jump event fails the test; or alternatively
And when the average response time of the page jump event is smaller than or equal to the page jump time threshold value, determining that the response speed of the page jump event passes the test.
According to a preferred embodiment of the present invention, the recording the start time of each interface call event and the end time of each interface call event based on the pre-packaged method includes:
when monitoring that an interface is called, determining the called interface as a target interface, and determining an interface calling event corresponding to the target interface as a target interface calling event;
acquiring the time of requesting data through the target interface based on the pre-packaged method as the starting time of the target interface calling event;
And acquiring the time when the data of the target interface returns based on the pre-packaged method as the ending time of the calling event of the target interface.
According to a preferred embodiment of the present invention, the testing the performance of each interface and the overall performance of all interfaces of the hybrid application to be tested according to the start time of each interface call event and the end time of each interface call event includes:
calculating the difference value between the ending time of each interface calling event and the starting time of each interface calling event as the response time of each interface calling event;
dividing the events belonging to the same interface in the interface calling events into a group, and calculating the average value of the response time of the events in each group according to the response time of each interface calling event to be used as the average response time of the interfaces corresponding to each group;
acquiring configuration response time of each interface;
when the average response time of the detected interface is larger than the corresponding configuration response time, determining that the performance of the detected interface fails the test;
when the average response time of the detected interface is smaller than or equal to the corresponding configuration response time, determining that the performance of the detected interface passes the test;
Acquiring an interface which is called for the first time from the interface calling event as an initial interface, and acquiring an interface which is called for the last time as an end interface;
acquiring the starting time of an interface calling event corresponding to the initial interface and the ending time of the interface calling event corresponding to the ending interface;
calculating the difference between the ending time of the interface calling event corresponding to the ending interface and the starting time of the interface calling event corresponding to the initial interface as the interface response total time of all interfaces of the mixed application to be tested;
acquiring the total number of the interface calling events as a second total number;
calculating the quotient of the interface response total time and the second total amount as the average response time of the interface calling event;
acquiring a preconfigured interface calling time threshold;
when the average response time of the interface calling event is larger than the interface calling time threshold, determining that the overall performance of all interfaces of the hybrid application to be tested fails the test; or alternatively
And when the average response time of the interface calling event is smaller than or equal to the interface calling time threshold, determining that the overall performance of all interfaces of the mixed application to be tested passes the test.
According to a preferred embodiment of the invention, the method further comprises:
when the test report shows that the response speed of the page jump event fails the test, and/or the performance of the interface fails the test, and/or the overall performance of all interfaces of the mixed application to be tested fails the test, acquiring a pre-configured abnormal comparison table, wherein the abnormal comparison table stores the corresponding relation between the abnormality and the reason causing the abnormality;
searching an abnormal reason matched with the response speed of the page jump event and/or the performance of an interface from the abnormal comparison table;
and sending the acquired reasons and the test report to the appointed terminal equipment.
A hybrid application testing device, the hybrid application testing device comprising:
the determining unit is used for responding to the mixed application program testing instruction and determining the mixed application to be tested according to the mixed application program testing instruction;
the running unit is used for acquiring a pre-written simulated click script, inserting the simulated click script into the mixed application to be tested, and running the simulated click script on the mixed application to be tested;
The monitoring unit is used for monitoring page jump events and interface call events in the process of running the simulated click script;
the recording unit is used for recording the starting time of each page jump event and the ending time of each page jump event based on a pre-packaging method for each page jump event in the page jump events;
the testing unit is used for testing the response speed of each page jump event according to the starting time of each page jump event and the ending time of each page jump event;
the recording unit is further configured to record, for each interface call event in the interface call events, a start time of each interface call event and an end time of each interface call event based on the pre-packaged method;
the test unit is further used for testing the performance of each interface and the overall performance of all interfaces of the mixed application to be tested according to the starting time of each interface calling event and the ending time of each interface calling event;
and the generating unit is used for generating a test report according to the response speed of the page jump event, the performance of each interface and the overall performance of all interfaces of the hybrid application to be tested.
A computer device, the computer device comprising:
a memory storing at least one instruction; a kind of electronic device with high-pressure air-conditioning system
And the processor executes the instructions stored in the memory to realize the hybrid application program testing method.
A computer-readable storage medium having stored therein at least one instruction for execution by a processor in a computer device to implement the hybrid application testing method.
According to the technical scheme, the method can respond to the test instruction of the mixed application program, determine the mixed application to be tested according to the test instruction of the mixed application program, acquire a pre-written simulated click script, insert the simulated click script into the mixed application to be tested, and run the simulated click script on the mixed application to be tested without manual operation of a user, so that the method automatically operates by a machine, the efficiency is improved, in the process of running the simulated click script, the page jump event and the interface call event are monitored, the starting time of each page jump event and the ending time of each page jump event are recorded based on a pre-packaged method, the response speed of the page jump event is tested according to the starting time of each page jump event and the ending time of each page jump event, the interface call event is recorded based on the pre-packaged method, the starting time of each interface call event and the ending time of each interface call event are recorded, the overall response speed of each interface call event is recorded according to the overall test performance of the interface, the performance of each interface is further recorded, the performance of each interface is further tested according to the overall test performance of the interface is recorded, the test performance of each interface is further recorded, the method and the device automatically realize the test of the response speed of page jump, the independent test of the performance of each interface and the test of the overall performance of all interfaces of the mixed application to be tested, avoid the manpower consumption caused by manual test and the error caused by manual operation, and improve the efficiency and the accuracy of the test.
Drawings
FIG. 1 is a flow chart of a hybrid application testing method according to a preferred embodiment of the present invention.
FIG. 2 is a functional block diagram of a hybrid application testing apparatus according to a preferred embodiment of the present invention.
FIG. 3 is a schematic diagram of a computer device implementing a hybrid application testing method according to a preferred embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of a hybrid application testing method according to a preferred embodiment of the present invention. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs.
The hybrid application test method is applied to one or more computer devices, wherein the computer device is a device capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware comprises, but is not limited to, a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, an ASIC), a programmable gate array (Field-Programmable Gate Array, an FPGA), a digital processor (Digital Signal Processor, a DSP), an embedded device and the like.
The computer device may be any electronic product that can interact with a user in a human-computer manner, such as a personal computer, tablet computer, smart phone, personal digital assistant (Personal Digital Assistant, PDA), game console, interactive internet protocol television (Internet Protocol Television, IPTV), smart wearable device, etc.
The computer device may also include a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network server, a server group composed of a plurality of network servers, or a Cloud based Cloud Computing (Cloud Computing) composed of a large number of hosts or network servers.
The network in which the computer device is located includes, but is not limited to, the internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), and the like.
And S10, responding to the mixed application program test instruction, and determining the mixed application to be tested according to the mixed application program test instruction.
In this embodiment, the hybrid application test instruction may be triggered by an associated worker, such as a tester, developer, etc.
In at least one embodiment of the present invention, the determining the hybrid application to be tested according to the hybrid application test instruction includes:
Analyzing the mixed application program test instruction to obtain information carried by the mixed application program test instruction;
acquiring a preset label;
constructing a regular expression according to the preset label;
traversing information carried by the test instruction of the hybrid application program by using the regular expression, and determining the traversed information matched with the preset label as the identification of the hybrid application to be tested;
and determining the mixed application to be tested according to the identification of the mixed application to be tested.
The preset label can be configured in a self-defined manner, corresponds to the identification of the application program, and can uniquely determine an application program through the identification of the application program.
For example: when the preset label is AppID, the constructed regular expression is AppID (), and the information carried by the test instruction of the mixed application program is traversed by using the regular expression AppID (), so that the information matched with the regular expression AppID () can be obtained as the identification of the mixed application to be tested, and the mixed application to be tested is further determined.
By the method, the mixed application to be tested can be rapidly and accurately determined based on the labels and the regular expressions.
S11, obtaining a pre-written simulated click script, inserting the simulated click script into the to-be-tested mixed application, and running the simulated click script on the to-be-tested mixed application.
In at least one embodiment of the present invention, the writing manner of the simulated click script may include, but is not limited to, any one of the following manners:
(1) Testing an Instrumentation framework by using an Android unit;
(2) By utilizing the accessibilitiyService auxiliary function class, the focus, window, button click and the like of the intelligent terminal such as a mobile phone and the like can be monitored, and only the corresponding permission of the auxiliary function is required to be given, and the root permission is not required;
(3) The realization of a sendent command is realized, a parameter device path name, an event type, an event code and an event value are transmitted to the command, and a getent command can be used for checking which device is a touch screen drive and needs root authority realization;
(4) The method is realized by codes, data is directly written into the equipment file through ioctl, and root authorities are required to be used;
(5) Find a node in the process from the start of the device driver file to the display of UI (User Interface) and construct a click event entry.
Of course, in other embodiments, the simulated click script may be written in other ways, and the invention is not limited in this regard.
Furthermore, after the simulated click script is obtained through compiling, the simulated click script can be inserted into the mixed application to be tested, and the simulated click script is operated on the mixed application to be tested, so that the click on the mixed application to be tested can be automatically simulated without manual operation of a user, the manpower is released, the mixed application to be tested is automatically operated by a machine, and meanwhile, the efficiency is also improved.
And S12, monitoring a page jump event and an interface call event in the process of running the simulated click script.
In at least one embodiment of the present invention, click events are generated continuously during the running of the simulated click script.
Specifically, when the click event corresponds to a physical key, a virtual key, or the like similar to a hyperlink, a page jump is performed, that is, the page jump event is formed.
Further, in the process of page skip, if the currently skipped page calls an interface, the interface call event is formed.
S13, recording the starting time of each page jump event and the ending time of each page jump event based on a pre-packaging method for each page jump event in the page jump events.
In at least one embodiment of the invention, the method further comprises:
writing each click event of the simulated click script into a method respectively by each interface associated with the mixed application to be tested;
packaging the writing method to obtain the pre-packaging method;
the time nodes associated with each click event are recorded using the pre-packaged method, and the time nodes associated with each interface are recorded.
By the implementation mode, each clicking event of the simulated clicking script and each interface associated with the mixed application to be tested can be written into the method respectively, and the time of occurrence of the event is recorded before the interface is called or after the clicking is finished in the method, so that the subsequent direct viewing is facilitated, and the time calculation efficiency is effectively improved.
In at least one embodiment of the present invention, the recording the start time of each page jump event and the end time of each page jump event based on the pre-packaged method includes:
when the creation of the container of the mixed application to be tested is monitored, determining a page jump event corresponding to the created container as a target page jump event;
acquiring a timestamp when the container of the hybrid application to be tested is monitored to be created based on the pre-packaging method, and determining the acquired timestamp as the starting time of the target page jump event;
When the page rendering of the target page jump event is monitored to be finished, acquiring a time stamp when the page rendering is monitored to be finished, and determining the acquired time stamp as the finishing time of the target page jump event.
According to the embodiment, the time stamp of each page jump event can be recorded based on the pre-packaging method, the method is adopted to automatically record when each page jump event occurs and ends, error time recording is avoided, response is more timely, and recording time is more accurate.
S14, testing the response speed of the page jump event according to the starting time of each page jump event and the ending time of each page jump event.
In at least one embodiment of the present invention, the testing the response speed of each page jump event according to the start time of the page jump event and the end time of the page jump event includes:
acquiring the total number of the page jump events as a first total amount;
calculating the difference between the ending time of each page jump event and the starting time of each page jump event as the response time of each page jump event;
calculating the accumulated sum of the response time of each page jump event as the total response time of the page jump event;
Calculating the quotient of the total response time of the page jump event and the first total amount as the average response time of the page jump event;
acquiring a pre-configured page jump time threshold;
when the average response time of the page jump event is larger than the page jump time threshold, determining that the response speed of the page jump event fails the test; or alternatively
And when the average response time of the page jump event is smaller than or equal to the page jump time threshold value, determining that the response speed of the page jump event passes the test.
By the embodiment, the automatic test of the page jump response speed can be realized.
In this embodiment, the page jump time threshold may be configured in a user-defined manner according to actual requirements, or may be calculated based on an application program that meets the requirements.
For example: in the application program meeting the requirement of the page jump response time, 10 page jumps are preset, so that the time of the 10 page jumps can be acquired through the script, and the average time of the 10 page jumps is calculated and used as the page jump time threshold.
S15, for each interface call event in the interface call events, recording the starting time of each interface call event and the ending time of each interface call event based on the pre-packaged method.
In at least one embodiment of the present invention, the recording the start time of each interface call event and the end time of each interface call event based on the pre-packaged method includes:
when monitoring that an interface is called, determining the called interface as a target interface, and determining an interface calling event corresponding to the target interface as a target interface calling event;
acquiring the time of requesting data through the target interface based on the pre-packaged method as the starting time of the target interface calling event;
and acquiring the time when the data of the target interface returns based on the pre-packaged method as the ending time of the calling event of the target interface.
It can be understood that, through the target interface, data can be requested from a corresponding server, the recording time can be started at this time and used as the starting time of the calling event of the target interface, further, when the corresponding server is monitored to feed back data to the target interface, that is, when the target interface is monitored to have data returned, the recording time is ended at this time, and the current time is used as the ending time of the calling event of the target interface.
By the implementation mode, the starting time and the ending time of each interface calling event can be automatically recorded, and a reliable data base is provided for the performance of the subsequent test interface.
S16, testing the performance of each interface and the overall performance of all interfaces of the mixed application to be tested according to the starting time of each interface calling event and the ending time of each interface calling event.
In at least one embodiment of the present invention, the testing the performance of each interface and the overall performance of all interfaces of the hybrid application to be tested according to the start time of each interface call event and the end time of each interface call event includes:
calculating the difference value between the ending time of each interface calling event and the starting time of each interface calling event as the response time of each interface calling event;
dividing the events belonging to the same interface in the interface calling events into a group, and calculating the average value of the response time of the events in each group according to the response time of each interface calling event to be used as the average response time of the interfaces corresponding to each group;
acquiring configuration response time of each interface;
when the average response time of the detected interface is larger than the corresponding configuration response time, determining that the performance of the detected interface fails the test;
When the average response time of the detected interface is smaller than or equal to the corresponding configuration response time, determining that the performance of the detected interface passes the test;
acquiring an interface which is called for the first time from the interface calling event as an initial interface, and acquiring an interface which is called for the last time as an end interface;
acquiring the starting time of an interface calling event corresponding to the initial interface and the ending time of the interface calling event corresponding to the ending interface;
calculating the difference between the ending time of the interface calling event corresponding to the ending interface and the starting time of the interface calling event corresponding to the initial interface as the interface response total time of all interfaces of the mixed application to be tested;
acquiring the total number of the interface calling events as a second total number;
calculating the quotient of the interface response total time and the second total amount as the average response time of the interface calling event;
acquiring a preconfigured interface calling time threshold;
when the average response time of the interface calling event is larger than the interface calling time threshold, determining that the overall performance of all interfaces of the hybrid application to be tested fails the test; or alternatively
And when the average response time of the interface calling event is smaller than or equal to the interface calling time threshold, determining that the overall performance of all interfaces of the mixed application to be tested passes the test.
The configuration response time of each interface and the interface calling time threshold may be configured in a customized manner according to actual requirements, which is not described herein.
Through the embodiment, the independent test of the performance of each interface and the test of the overall performance of all interfaces of the mixed application to be tested can be automatically realized, the manpower consumption caused by manual test is avoided, and the test efficiency and accuracy are improved.
And S17, generating a test report according to the response speed of the page jump event, the performance of each interface and the overall performance of all interfaces of the hybrid application to be tested.
In the above embodiment, the generated test report includes the response speed of the page jump event, the performance of each interface, and the overall performance of all interfaces of the hybrid application to be tested, so that the user can more intuitively see the test result of the hybrid application to be tested.
Further, the test report may be sent to a terminal device of a designated contact, such as a terminal device of a developer, so that the developer can timely know the performance of the hybrid application to be tested.
In at least one embodiment of the invention, the method further comprises:
when the test report shows that the response speed of the page jump event fails the test, and/or the performance of the interface fails the test, and/or the overall performance of all interfaces of the mixed application to be tested fails the test, acquiring a pre-configured abnormal comparison table, wherein the abnormal comparison table stores the corresponding relation between the abnormality and the reason causing the abnormality;
searching an abnormal reason matched with the response speed of the page jump event and/or the performance of an interface from the abnormal comparison table;
and sending the acquired reasons and the test report to the appointed terminal equipment.
For example: when the exception is that the performance of the interface fails the test, the reasons corresponding to the exception comparison table may include: poor performance of the terminal, etc.; when the abnormality is that the response speed of the page jump event fails the test, the reasons corresponding to the abnormality comparison table may include: unreasonable layout, incorrect rendering, etc.
In this embodiment, the designated terminal device may be a terminal device of a related worker, such as a terminal device of a developer.
Through the embodiment, related personnel can be timely reminded to process the abnormality, and reasons possibly causing the abnormality are provided at the same time, so that the related personnel can be assisted to quickly judge the reasons of the abnormality, and the abnormality processing efficiency is improved.
It should be noted that, in order to further improve the security of the data and avoid the data from being tampered maliciously, the test report may be stored in the blockchain node.
According to the technical scheme, the method can respond to the test instruction of the mixed application program, determine the mixed application to be tested according to the test instruction of the mixed application program, acquire a pre-written simulated click script, insert the simulated click script into the mixed application to be tested, and run the simulated click script on the mixed application to be tested without manual operation of a user, so that the method automatically operates by a machine, the efficiency is improved, in the process of running the simulated click script, the page jump event and the interface call event are monitored, the starting time of each page jump event and the ending time of each page jump event are recorded based on a pre-packaged method, the response speed of the page jump event is tested according to the starting time of each page jump event and the ending time of each page jump event, the interface call event is recorded based on the pre-packaged method, the starting time of each interface call event and the ending time of each interface call event are recorded, the overall response speed of each interface call event is recorded according to the overall test performance of the interface, the performance of each interface is further recorded, the performance of each interface is further tested according to the overall test performance of the interface is recorded, the test performance of each interface is further recorded, the method and the device automatically realize the test of the response speed of page jump, the independent test of the performance of each interface and the test of the overall performance of all interfaces of the mixed application to be tested, avoid the manpower consumption caused by manual test and the error caused by manual operation, and improve the efficiency and the accuracy of the test.
FIG. 2 is a functional block diagram of a hybrid application testing apparatus according to a preferred embodiment of the present invention. The hybrid application testing device 11 includes a determining unit 110, an operating unit 111, a monitoring unit 112, a recording unit 113, a testing unit 114, and a generating unit 115. The module/unit referred to in the present invention refers to a series of computer program segments capable of being executed by the processor 13 and of performing a fixed function, which are stored in the memory 12. In the present embodiment, the functions of the respective modules/units will be described in detail in the following embodiments.
In response to the hybrid application test instruction, the determination unit 110 determines the hybrid application to be tested according to the hybrid application test instruction.
In this embodiment, the hybrid application test instruction may be triggered by an associated worker, such as a tester, developer, etc.
In at least one embodiment of the present invention, the determining unit 110 determines, according to the hybrid application program test instruction, that the hybrid application to be tested includes:
analyzing the mixed application program test instruction to obtain information carried by the mixed application program test instruction;
acquiring a preset label;
Constructing a regular expression according to the preset label;
traversing information carried by the test instruction of the hybrid application program by using the regular expression, and determining the traversed information matched with the preset label as the identification of the hybrid application to be tested;
and determining the mixed application to be tested according to the identification of the mixed application to be tested.
The preset label can be configured in a self-defined manner, corresponds to the identification of the application program, and can uniquely determine an application program through the identification of the application program.
For example: when the preset label is AppID, the constructed regular expression is AppID (), and the information carried by the test instruction of the mixed application program is traversed by using the regular expression AppID (), so that the information matched with the regular expression AppID () can be obtained as the identification of the mixed application to be tested, and the mixed application to be tested is further determined.
By the method, the mixed application to be tested can be rapidly and accurately determined based on the labels and the regular expressions.
The operation unit 111 obtains a pre-written simulated click script, inserts the simulated click script into the to-be-tested hybrid application, and operates the simulated click script on the to-be-tested hybrid application.
In at least one embodiment of the present invention, the writing manner of the simulated click script may include, but is not limited to, any one of the following manners:
(1) Testing an Instrumentation framework by using an Android unit;
(2) By utilizing the accessibilitiyService auxiliary function class, the focus, window, button click and the like of the intelligent terminal such as a mobile phone and the like can be monitored, and only the corresponding permission of the auxiliary function is required to be given, and the root permission is not required;
(3) The realization of a sendent command is realized, a parameter device path name, an event type, an event code and an event value are transmitted to the command, and a getent command can be used for checking which device is a touch screen drive and needs root authority realization;
(4) The method is realized by codes, data is directly written into the equipment file through ioctl, and root authorities are required to be used;
(5) Find a node in the process from the start of the device driver file to the display of UI (User Interface) and construct a click event entry.
Of course, in other embodiments, the simulated click script may be written in other ways, and the invention is not limited in this regard.
Furthermore, after the simulated click script is obtained through compiling, the simulated click script can be inserted into the mixed application to be tested, and the simulated click script is operated on the mixed application to be tested, so that the click on the mixed application to be tested can be automatically simulated without manual operation of a user, the manpower is released, the mixed application to be tested is automatically operated by a machine, and meanwhile, the efficiency is also improved.
In the process of running the simulated click script, the monitoring unit 112 monitors a page jump event and an interface call event.
In at least one embodiment of the present invention, click events are generated continuously during the running of the simulated click script.
Specifically, when the click event corresponds to a physical key, a virtual key, or the like similar to a hyperlink, a page jump is performed, that is, the page jump event is formed.
Further, in the process of page skip, if the currently skipped page calls an interface, the interface call event is formed.
For each of the page-skip events, the recording unit 113 records a start time of each page-skip event and an end time of each page-skip event based on a pre-packaged method.
In at least one embodiment of the present invention, each click event of the simulated click script and each interface associated with the hybrid application to be tested are written into a method respectively;
packaging the writing method to obtain the pre-packaging method;
the time nodes associated with each click event are recorded using the pre-packaged method, and the time nodes associated with each interface are recorded.
By the implementation mode, each clicking event of the simulated clicking script and each interface associated with the mixed application to be tested can be written into the method respectively, and the time of occurrence of the event is recorded before the interface is called or after the clicking is finished in the method, so that the subsequent direct viewing is facilitated, and the time calculation efficiency is effectively improved.
In at least one embodiment of the present invention, the recording unit 113 records a start time of each page jump event and an end time of each page jump event based on a pre-packaged method, including:
when the creation of the container of the mixed application to be tested is monitored, determining a page jump event corresponding to the created container as a target page jump event;
acquiring a timestamp when the container of the hybrid application to be tested is monitored to be created based on the pre-packaging method, and determining the acquired timestamp as the starting time of the target page jump event;
when the page rendering of the target page jump event is monitored to be finished, acquiring a time stamp when the page rendering is monitored to be finished, and determining the acquired time stamp as the finishing time of the target page jump event.
According to the embodiment, the time stamp of each page jump event can be recorded based on the pre-packaging method, the method is adopted to automatically record when each page jump event occurs and ends, error time recording is avoided, response is more timely, and recording time is more accurate.
The test unit 114 tests the response speed of each page-skip event according to the start time of the page-skip event and the end time of the page-skip event.
In at least one embodiment of the present invention, the testing unit 114 tests the response speed of each page jump event according to the start time of the page jump event and the end time of the page jump event, including:
acquiring the total number of the page jump events as a first total amount;
calculating the difference between the ending time of each page jump event and the starting time of each page jump event as the response time of each page jump event;
calculating the accumulated sum of the response time of each page jump event as the total response time of the page jump event;
calculating the quotient of the total response time of the page jump event and the first total amount as the average response time of the page jump event;
Acquiring a pre-configured page jump time threshold;
when the average response time of the page jump event is larger than the page jump time threshold, determining that the response speed of the page jump event fails the test; or alternatively
And when the average response time of the page jump event is smaller than or equal to the page jump time threshold value, determining that the response speed of the page jump event passes the test.
By the embodiment, the automatic test of the page jump response speed can be realized.
In this embodiment, the page jump time threshold may be configured in a user-defined manner according to actual requirements, or may be calculated based on an application program that meets the requirements.
For example: in the application program meeting the requirement of the page jump response time, 10 page jumps are preset, so that the time of the 10 page jumps can be acquired through the script, and the average time of the 10 page jumps is calculated and used as the page jump time threshold.
For each of the interface call events, the recording unit 113 records a start time of each interface call event and an end time of each interface call event based on the pre-packaged method.
In at least one embodiment of the present invention, the recording unit 113 records a start time of each interface call event and an end time of each interface call event based on the pre-packaged method includes:
when monitoring that an interface is called, determining the called interface as a target interface, and determining an interface calling event corresponding to the target interface as a target interface calling event;
acquiring the time of requesting data through the target interface based on the pre-packaged method as the starting time of the target interface calling event;
and acquiring the time when the data of the target interface returns based on the pre-packaged method as the ending time of the calling event of the target interface.
It can be understood that, through the target interface, data can be requested from a corresponding server, the recording time can be started at this time and used as the starting time of the calling event of the target interface, further, when the corresponding server is monitored to feed back data to the target interface, that is, when the target interface is monitored to have data returned, the recording time is ended at this time, and the current time is used as the ending time of the calling event of the target interface.
By the implementation mode, the starting time and the ending time of each interface calling event can be automatically recorded, and a reliable data base is provided for the performance of the subsequent test interface.
The test unit 114 tests the performance of each interface and the overall performance of all interfaces of the hybrid application to be tested according to the start time of each interface call event and the end time of each interface call event.
In at least one embodiment of the present invention, the testing unit 114 tests the performance of each interface and the overall performance of all interfaces of the hybrid application to be tested according to the start time of each interface call event and the end time of each interface call event, including:
calculating the difference value between the ending time of each interface calling event and the starting time of each interface calling event as the response time of each interface calling event;
dividing the events belonging to the same interface in the interface calling events into a group, and calculating the average value of the response time of the events in each group according to the response time of each interface calling event to be used as the average response time of the interfaces corresponding to each group;
acquiring configuration response time of each interface;
When the average response time of the detected interface is larger than the corresponding configuration response time, determining that the performance of the detected interface fails the test;
when the average response time of the detected interface is smaller than or equal to the corresponding configuration response time, determining that the performance of the detected interface passes the test;
acquiring an interface which is called for the first time from the interface calling event as an initial interface, and acquiring an interface which is called for the last time as an end interface;
acquiring the starting time of an interface calling event corresponding to the initial interface and the ending time of the interface calling event corresponding to the ending interface;
calculating the difference between the ending time of the interface calling event corresponding to the ending interface and the starting time of the interface calling event corresponding to the initial interface as the interface response total time of all interfaces of the mixed application to be tested;
acquiring the total number of the interface calling events as a second total number;
calculating the quotient of the interface response total time and the second total amount as the average response time of the interface calling event;
acquiring a preconfigured interface calling time threshold;
when the average response time of the interface calling event is larger than the interface calling time threshold, determining that the overall performance of all interfaces of the hybrid application to be tested fails the test; or alternatively
And when the average response time of the interface calling event is smaller than or equal to the interface calling time threshold, determining that the overall performance of all interfaces of the mixed application to be tested passes the test.
The configuration response time of each interface and the interface calling time threshold may be configured in a customized manner according to actual requirements, which is not described herein.
Through the embodiment, the independent test of the performance of each interface and the test of the overall performance of all interfaces of the mixed application to be tested can be automatically realized, the manpower consumption caused by manual test is avoided, and the test efficiency and accuracy are improved.
The generating unit 115 generates a test report according to the response speed of the page jump event, the performance of each interface, and the overall performance of all interfaces of the hybrid application to be tested.
In the above embodiment, the generated test report includes the response speed of the page jump event, the performance of each interface, and the overall performance of all interfaces of the hybrid application to be tested, so that the user can more intuitively see the test result of the hybrid application to be tested.
Further, the test report may be sent to a terminal device of a designated contact, such as a terminal device of a developer, so that the developer can timely know the performance of the hybrid application to be tested.
In at least one embodiment of the present invention, when the test report indicates that the response speed of the page jump event fails the test, and/or the performance of the interface fails the test, and/or the overall performance of all interfaces of the hybrid application to be tested fails the test, a pre-configured exception comparison table is obtained, where a correspondence between an exception and a cause of the exception is stored in the exception comparison table;
searching an abnormal reason matched with the response speed of the page jump event and/or the performance of an interface from the abnormal comparison table;
and sending the acquired reasons and the test report to the appointed terminal equipment.
For example: when the exception is that the performance of the interface fails the test, the reasons corresponding to the exception comparison table may include: poor performance of the terminal, etc.; when the abnormality is that the response speed of the page jump event fails the test, the reasons corresponding to the abnormality comparison table may include: unreasonable layout, incorrect rendering, etc.
In this embodiment, the designated terminal device may be a terminal device of a related worker, such as a terminal device of a developer.
Through the embodiment, related personnel can be timely reminded to process the abnormality, and reasons possibly causing the abnormality are provided at the same time, so that the related personnel can be assisted to quickly judge the reasons of the abnormality, and the abnormality processing efficiency is improved.
It should be noted that, in order to further improve the security of the data and avoid the data from being tampered maliciously, the test report may be stored in the blockchain node.
According to the technical scheme, the method can respond to the test instruction of the mixed application program, determine the mixed application to be tested according to the test instruction of the mixed application program, acquire a pre-written simulated click script, insert the simulated click script into the mixed application to be tested, and run the simulated click script on the mixed application to be tested without manual operation of a user, so that the method automatically operates by a machine, the efficiency is improved, in the process of running the simulated click script, the page jump event and the interface call event are monitored, the starting time of each page jump event and the ending time of each page jump event are recorded based on a pre-packaged method, the response speed of the page jump event is tested according to the starting time of each page jump event and the ending time of each page jump event, the interface call event is recorded based on the pre-packaged method, the starting time of each interface call event and the ending time of each interface call event are recorded, the overall response speed of each interface call event is recorded according to the overall test performance of the interface, the performance of each interface is further recorded, the performance of each interface is further tested according to the overall test performance of the interface is recorded, the test performance of each interface is further recorded, the method and the device automatically realize the test of the response speed of page jump, the independent test of the performance of each interface and the test of the overall performance of all interfaces of the mixed application to be tested, avoid the manpower consumption caused by manual test and the error caused by manual operation, and improve the efficiency and the accuracy of the test.
FIG. 3 is a schematic diagram of a computer device for implementing a hybrid application testing method according to a preferred embodiment of the present invention.
The computer device 1 may comprise a memory 12, a processor 13 and a bus, and may further comprise a computer program, such as a hybrid application test program, stored in the memory 12 and executable on the processor 13.
It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the computer device 1 and does not constitute a limitation of the computer device 1, the computer device 1 may be a bus type structure, a star type structure, the computer device 1 may further comprise more or less other hardware or software than illustrated, or a different arrangement of components, for example, the computer device 1 may further comprise an input-output device, a network access device, etc.
It should be noted that the computer device 1 is only used as an example, and other electronic products that may be present in the present invention or may be present in the future are also included in the scope of the present invention by way of reference.
The memory 12 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 12 may in some embodiments be an internal storage unit of the computer device 1, such as a removable hard disk of the computer device 1. The memory 12 may in other embodiments also be an external storage device of the computer device 1, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the computer device 1. Further, the memory 12 may also include both an internal storage unit and an external storage device of the computer device 1. The memory 12 may be used not only for storing application software installed in the computer device 1 and various types of data, such as code of a hybrid application test program, etc., but also for temporarily storing data that has been output or is to be output.
The processor 13 may be comprised of integrated circuits in some embodiments, for example, a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, a combination of various control chips, and the like. The processor 13 is a Control Unit (Control Unit) of the computer device 1, connects the respective components of the entire computer device 1 using various interfaces and lines, executes programs or modules stored in the memory 12 (for example, executes a hybrid application test program or the like), and invokes data stored in the memory 12 to perform various functions of the computer device 1 and process data.
The processor 13 executes the operating system of the computer device 1 and various types of applications installed. The processor 13 executes the application program to implement the steps of the various hybrid application test method embodiments described above, such as the steps shown in fig. 1.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules/units may be a series of computer readable instruction segments capable of performing the specified functions, which instruction segments describe the execution of the computer program in the computer device 1. For example, the computer program may be divided into a determining unit 110, an operating unit 111, a monitoring unit 112, a recording unit 113, a testing unit 114, a generating unit 115.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional module is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a computer device, or a network device, etc.) or a processor (processor) to execute portions of the hybrid application testing method according to the embodiments of the present invention.
The modules/units integrated in the computer device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on this understanding, the present invention may also be implemented by a computer program for instructing a relevant hardware device to implement all or part of the procedures of the above-mentioned embodiment method, where the computer program may be stored in a computer readable storage medium and the computer program may be executed by a processor to implement the steps of each of the above-mentioned method embodiments.
Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory, or the like.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The bus may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one straight line is shown in fig. 3, but not only one bus or one type of bus. The bus is arranged to enable a connection communication between the memory 12 and at least one processor 13 or the like.
Although not shown, the computer device 1 may further comprise a power source (such as a battery) for powering the various components, preferably the power source may be logically connected to the at least one processor 13 via a power management means, whereby the functions of charge management, discharge management, and power consumption management are achieved by the power management means. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The computer device 1 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described in detail herein.
Further, the computer device 1 may also comprise a network interface, optionally comprising a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used for establishing a communication connection between the computer device 1 and other computer devices.
The computer device 1 may optionally further comprise a user interface, which may be a Display, an input unit, such as a Keyboard (Keyboard), or a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the computer device 1 and for displaying a visual user interface.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
Fig. 3 shows only a computer device 1 with components 12-13, it being understood by those skilled in the art that the structure shown in fig. 3 is not limiting of the computer device 1 and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
In connection with fig. 1, the memory 12 in the computer device 1 stores a plurality of instructions to implement a hybrid application testing method, the processor 13 being executable to implement:
responding to a mixed application program test instruction, and determining a mixed application to be tested according to the mixed application program test instruction;
obtaining a pre-written simulated click script, inserting the simulated click script into the mixed application to be tested, and running the simulated click script on the mixed application to be tested;
monitoring a page jump event and an interface call event in the process of running the simulated click script;
recording the starting time of each page jump event and the ending time of each page jump event based on a pre-packaging method for each page jump event in the page jump events;
Testing the response speed of each page jump event according to the starting time of each page jump event and the ending time of each page jump event;
recording the starting time of each interface calling event and the ending time of each interface calling event based on the pre-packaged method for each interface calling event in the interface calling events;
testing the performance of each interface and the overall performance of all interfaces of the mixed application to be tested according to the starting time of each interface calling event and the ending time of each interface calling event;
and generating a test report according to the response speed of the page jump event, the performance of each interface and the overall performance of all interfaces of the hybrid application to be tested.
Specifically, the specific implementation method of the above instructions by the processor 13 may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. The units or means stated in the invention may also be implemented by one unit or means, either by software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (9)

1. A hybrid application testing method, the hybrid application testing method comprising:
responding to a mixed application program test instruction, and determining a mixed application to be tested according to the mixed application program test instruction;
obtaining a pre-written simulated click script, inserting the simulated click script into the mixed application to be tested, and running the simulated click script on the mixed application to be tested;
monitoring a page jump event and an interface call event in the process of running the simulated click script, wherein the interface call event is formed if the currently-jumped page calls an interface in the process of page jump;
Recording the starting time of each page jump event and the ending time of each page jump event based on a pre-packaging method for each page jump event in the page jump events;
testing the response speed of each page jump event according to the starting time of each page jump event and the ending time of each page jump event;
recording the starting time of each interface calling event and the ending time of each interface calling event based on the pre-packaged method for each interface calling event in the interface calling events;
testing the performance of each interface and the overall performance of all interfaces of the mixed application to be tested according to the starting time of each interface calling event and the ending time of each interface calling event;
generating a test report according to the response speed of the page jump event, the performance of each interface and the overall performance of all interfaces of the hybrid application to be tested;
the testing the performance of each interface and the overall performance of all interfaces of the to-be-tested hybrid application according to the starting time of each interface calling event and the ending time of each interface calling event comprises:
Calculating the difference value between the ending time of each interface calling event and the starting time of each interface calling event as the response time of each interface calling event;
dividing the events belonging to the same interface in the interface calling events into a group, and calculating the average value of the response time of the events in each group according to the response time of each interface calling event to be used as the average response time of the interfaces corresponding to each group;
acquiring configuration response time of each interface;
when the average response time of the detected interface is larger than the corresponding configuration response time, determining that the performance of the detected interface fails the test;
when the average response time of the detected interface is smaller than or equal to the corresponding configuration response time, determining that the performance of the detected interface passes the test;
acquiring an interface which is called for the first time from the interface calling event as an initial interface, and acquiring an interface which is called for the last time as an end interface;
acquiring the starting time of an interface calling event corresponding to the initial interface and the ending time of the interface calling event corresponding to the ending interface;
calculating the difference between the ending time of the interface calling event corresponding to the ending interface and the starting time of the interface calling event corresponding to the initial interface as the interface response total time of all interfaces of the mixed application to be tested;
Acquiring the total number of the interface calling events as a second total number;
calculating the quotient of the interface response total time and the second total amount as the average response time of the interface calling event;
acquiring a preconfigured interface calling time threshold;
when the average response time of the interface calling event is larger than the interface calling time threshold, determining that the overall performance of all interfaces of the hybrid application to be tested fails the test; or alternatively
And when the average response time of the interface calling event is smaller than or equal to the interface calling time threshold, determining that the overall performance of all interfaces of the mixed application to be tested passes the test.
2. The hybrid application testing method of claim 1, wherein the method further comprises:
writing each click event of the simulated click script into a method respectively by each interface associated with the mixed application to be tested;
packaging the writing method to obtain the pre-packaging method;
the time nodes associated with each click event are recorded using the pre-packaged method, and the time nodes associated with each interface are recorded.
3. The hybrid application testing method as set forth in claim 1, wherein the recording of the start time of each page jump event and the end time of each page jump event based on the pre-packaged method includes:
When the creation of the container of the mixed application to be tested is monitored, determining a page jump event corresponding to the created container as a target page jump event;
acquiring a timestamp when the container of the hybrid application to be tested is monitored to be created based on the pre-packaging method, and determining the acquired timestamp as the starting time of the target page jump event;
when the page rendering of the target page jump event is monitored to be finished, acquiring a time stamp when the page rendering is monitored to be finished, and determining the acquired time stamp as the finishing time of the target page jump event.
4. The hybrid application testing method as set forth in claim 1, wherein the testing the response speed of each page jump event according to the start time of the page jump event and the end time of the page jump event comprises:
acquiring the total number of the page jump events as a first total amount;
calculating the difference between the ending time of each page jump event and the starting time of each page jump event as the response time of each page jump event;
calculating the accumulated sum of the response time of each page jump event as the total response time of the page jump event;
Calculating the quotient of the total response time of the page jump event and the first total amount as the average response time of the page jump event;
acquiring a pre-configured page jump time threshold;
when the average response time of the page jump event is larger than the page jump time threshold, determining that the response speed of the page jump event fails the test; or alternatively
And when the average response time of the page jump event is smaller than or equal to the page jump time threshold value, determining that the response speed of the page jump event passes the test.
5. The hybrid application testing method of claim 1, wherein the recording a start time of each interface call event and an end time of each interface call event based on the pre-packaged method comprises:
when monitoring that an interface is called, determining the called interface as a target interface, and determining an interface calling event corresponding to the target interface as a target interface calling event;
acquiring the time of requesting data through the target interface based on the pre-packaged method as the starting time of the target interface calling event;
and acquiring the time when the data of the target interface returns based on the pre-packaged method as the ending time of the calling event of the target interface.
6. The hybrid application testing method of claim 1, wherein the method further comprises:
when the test report shows that the response speed of the page jump event fails the test, and/or the performance of the interface fails the test, and/or the overall performance of all interfaces of the mixed application to be tested fails the test, acquiring a pre-configured abnormal comparison table, wherein the abnormal comparison table stores the corresponding relation between the abnormality and the reason causing the abnormality;
searching an abnormal reason matched with the response speed of the page jump event and/or the performance of an interface from the abnormal comparison table;
and sending the acquired reasons and the test report to the appointed terminal equipment.
7. A hybrid application testing device, the hybrid application testing device comprising:
the determining unit is used for responding to the mixed application program testing instruction and determining the mixed application to be tested according to the mixed application program testing instruction;
the running unit is used for acquiring a pre-written simulated click script, inserting the simulated click script into the mixed application to be tested, and running the simulated click script on the mixed application to be tested;
The monitoring unit is used for monitoring a page jump event and an interface call event in the process of running the simulated click script, wherein the interface call event is formed if the currently-jumped page calls an interface in the process of page jump;
the recording unit is used for recording the starting time of each page jump event and the ending time of each page jump event based on a pre-packaging method for each page jump event in the page jump events;
the testing unit is used for testing the response speed of each page jump event according to the starting time of each page jump event and the ending time of each page jump event;
the recording unit is further configured to record, for each interface call event in the interface call events, a start time of each interface call event and an end time of each interface call event based on the pre-packaged method;
the test unit is further used for testing the performance of each interface and the overall performance of all interfaces of the mixed application to be tested according to the starting time of each interface calling event and the ending time of each interface calling event;
the generation unit is used for generating a test report according to the response speed of the page jump event, the performance of each interface and the overall performance of all interfaces of the hybrid application to be tested;
The testing the performance of each interface and the overall performance of all interfaces of the to-be-tested hybrid application according to the starting time of each interface calling event and the ending time of each interface calling event comprises:
calculating the difference value between the ending time of each interface calling event and the starting time of each interface calling event as the response time of each interface calling event;
dividing the events belonging to the same interface in the interface calling events into a group, and calculating the average value of the response time of the events in each group according to the response time of each interface calling event to be used as the average response time of the interfaces corresponding to each group;
acquiring configuration response time of each interface;
when the average response time of the detected interface is larger than the corresponding configuration response time, determining that the performance of the detected interface fails the test;
when the average response time of the detected interface is smaller than or equal to the corresponding configuration response time, determining that the performance of the detected interface passes the test;
acquiring an interface which is called for the first time from the interface calling event as an initial interface, and acquiring an interface which is called for the last time as an end interface;
acquiring the starting time of an interface calling event corresponding to the initial interface and the ending time of the interface calling event corresponding to the ending interface;
Calculating the difference between the ending time of the interface calling event corresponding to the ending interface and the starting time of the interface calling event corresponding to the initial interface as the interface response total time of all interfaces of the mixed application to be tested;
acquiring the total number of the interface calling events as a second total number;
calculating the quotient of the interface response total time and the second total amount as the average response time of the interface calling event;
acquiring a preconfigured interface calling time threshold;
when the average response time of the interface calling event is larger than the interface calling time threshold, determining that the overall performance of all interfaces of the hybrid application to be tested fails the test; or alternatively
And when the average response time of the interface calling event is smaller than or equal to the interface calling time threshold, determining that the overall performance of all interfaces of the mixed application to be tested passes the test.
8. A computer device, the computer device comprising:
a memory storing at least one instruction; a kind of electronic device with high-pressure air-conditioning system
A processor executing instructions stored in the memory to implement the hybrid application testing method of any one of claims 1 to 6.
9. A computer-readable storage medium, characterized by: the computer readable storage medium having stored therein at least one instruction for execution by a processor in a computer device to implement the hybrid application testing method of any one of claims 1 to 6.
CN202110724838.5A 2021-06-29 2021-06-29 Hybrid application program testing method, device, equipment and medium Active CN113360398B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110724838.5A CN113360398B (en) 2021-06-29 2021-06-29 Hybrid application program testing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110724838.5A CN113360398B (en) 2021-06-29 2021-06-29 Hybrid application program testing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN113360398A CN113360398A (en) 2021-09-07
CN113360398B true CN113360398B (en) 2023-09-01

Family

ID=77536985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110724838.5A Active CN113360398B (en) 2021-06-29 2021-06-29 Hybrid application program testing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN113360398B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103955428A (en) * 2014-04-30 2014-07-30 百度在线网络技术(北京)有限公司 Method and equipment for testing response speed of application
US9274935B1 (en) * 2013-01-15 2016-03-01 Google Inc. Application testing system with application programming interface
CN107562610A (en) * 2017-09-21 2018-01-09 上海谦问万答吧云计算科技有限公司 Obtain method, apparatus, terminal and the medium of page load time
CN107783898A (en) * 2017-07-24 2018-03-09 平安科技(深圳)有限公司 The method of testing and test equipment of Mobile solution
CN107797904A (en) * 2017-09-12 2018-03-13 福建天晴数码有限公司 A kind of method and terminal for measuring the response time
CN108415847A (en) * 2018-05-08 2018-08-17 平安普惠企业管理有限公司 Performance test methods, device, computer equipment and storage medium
CN110888812A (en) * 2019-11-26 2020-03-17 国核自仪系统工程有限公司 System and method for testing response time of terminal page

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10289525B2 (en) * 2017-08-21 2019-05-14 Amadeus S.A.S. Multi-layer design response time calculator
US11249889B2 (en) * 2019-01-22 2022-02-15 Salesforce.Com, Inc. Anomaly feedback monitoring and detection system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9274935B1 (en) * 2013-01-15 2016-03-01 Google Inc. Application testing system with application programming interface
CN103955428A (en) * 2014-04-30 2014-07-30 百度在线网络技术(北京)有限公司 Method and equipment for testing response speed of application
CN107783898A (en) * 2017-07-24 2018-03-09 平安科技(深圳)有限公司 The method of testing and test equipment of Mobile solution
CN107797904A (en) * 2017-09-12 2018-03-13 福建天晴数码有限公司 A kind of method and terminal for measuring the response time
CN107562610A (en) * 2017-09-21 2018-01-09 上海谦问万答吧云计算科技有限公司 Obtain method, apparatus, terminal and the medium of page load time
CN108415847A (en) * 2018-05-08 2018-08-17 平安普惠企业管理有限公司 Performance test methods, device, computer equipment and storage medium
CN110888812A (en) * 2019-11-26 2020-03-17 国核自仪系统工程有限公司 System and method for testing response time of terminal page

Also Published As

Publication number Publication date
CN113360398A (en) 2021-09-07

Similar Documents

Publication Publication Date Title
EP3616066B1 (en) Human-readable, language-independent stack trace summary generation
CN112015663B (en) Test data recording method, device, equipment and medium
CN113468049B (en) Configurable interface-based test method, device, equipment and medium
CN113238929B (en) Code testing method and device based on Mock data, electronic equipment and storage medium
CN112527664A (en) Method and device for generating test case, electronic equipment and storage medium
CN112579475A (en) Code testing method, device, equipment and readable storage medium
CN112579452A (en) Software automation test method, device, equipment and storage medium
CN113360398B (en) Hybrid application program testing method, device, equipment and medium
CN114116488A (en) Method, device and equipment for acquiring test coverage rate information and storage medium
CN113392090A (en) Data verification method, device, equipment and medium based on database migration
CN114036068A (en) Update detection method, device, equipment and storage medium based on privacy security
CN114510400A (en) Task execution method and device, electronic equipment and storage medium
CN113240351A (en) Business data consistency checking method and device, electronic equipment and medium
CN112181485A (en) Script execution method and device, electronic equipment and storage medium
CN110348984B (en) Automatic credit card data input method and related equipment under different transaction channels
CN112667244A (en) Data verification method and device, electronic equipment and computer readable storage medium
CN113032543A (en) Dialog diagnosis method, device, equipment and medium based on stack structure
CN113469649A (en) Project progress analysis method and device, electronic equipment and storage medium
CN113505079A (en) Application program testing method, device, equipment and medium
CN115328812B (en) UI (user interface) testing method, device, equipment and medium based on web crawler
CN111538770B (en) Data monitoring method and device, electronic equipment and readable storage medium
CN113419916B (en) Wind control inspection program uninterrupted operation method, device, equipment and storage medium
CN112947974B (en) Desktop icon updating method, device and equipment and computer readable storage medium
CN110716939B (en) Data management method, electronic device, system and medium
CN117830010A (en) Order state consistency detection method, device, equipment 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
TA01 Transfer of patent application right

Effective date of registration: 20230807

Address after: Room 11803, Building B, Baihualin International, No. 16 Wenjing Road, Xi'an Economic and Technological Development Zone, Shaanxi Province, 710000

Applicant after: Xi'an Tiantianbang Information Technology Co.,Ltd.

Address before: 518000 Room 202, block B, aerospace micromotor building, No.7, Langshan No.2 Road, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: Shenzhen LIAN intellectual property service center

Effective date of registration: 20230807

Address after: 518000 Room 202, block B, aerospace micromotor building, No.7, Langshan No.2 Road, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen LIAN intellectual property service center

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant before: PING AN PUHUI ENTERPRISE MANAGEMENT Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant