WO2019037118A1 - 内存使用情况的测试方法与电子终端 - Google Patents

内存使用情况的测试方法与电子终端 Download PDF

Info

Publication number
WO2019037118A1
WO2019037118A1 PCT/CN2017/099153 CN2017099153W WO2019037118A1 WO 2019037118 A1 WO2019037118 A1 WO 2019037118A1 CN 2017099153 W CN2017099153 W CN 2017099153W WO 2019037118 A1 WO2019037118 A1 WO 2019037118A1
Authority
WO
WIPO (PCT)
Prior art keywords
control
interface
identifier
memory usage
kth
Prior art date
Application number
PCT/CN2017/099153
Other languages
English (en)
French (fr)
Inventor
彭少朋
Original Assignee
深圳传音通讯有限公司
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 深圳传音通讯有限公司 filed Critical 深圳传音通讯有限公司
Priority to PCT/CN2017/099153 priority Critical patent/WO2019037118A1/zh
Publication of WO2019037118A1 publication Critical patent/WO2019037118A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Definitions

  • the present application relates to an electronic terminal, and in particular to a test method and an electronic terminal for memory usage.
  • An electronic terminal can be understood as a terminal having a processor and a memory.
  • the processor reads the code in the memory and can execute a corresponding function.
  • the generated interface can be executed therein, and the interface has a control, and the triggering of the control is performed.
  • the corresponding preset function can be executed.
  • the single control in the interface can be automatically triggered repeatedly and recorded. The memory usage after each trigger to test a single control.
  • the invention provides a test method and an electronic terminal for memory usage to solve the cumbersome technical problem of the test process.
  • a method of testing memory usage comprising:
  • first control information in the first interface where the first control information includes a first identifier of each first control in the first interface
  • Each first control is sequentially triggered according to the first identifier to invoke a function corresponding to each first control, and the memory usage data is recorded in real time.
  • the first control is triggered according to the first identifier to invoke a function corresponding to each first control, including:
  • K Triggering the Kth first control to invoke a function corresponding to the Kth first control; wherein K is an integer greater than or equal to 1;
  • the (K+1)th first control is triggered to perform the function corresponding to the (K+1)th first control.
  • the determining that the function corresponding to the Kth first control is performed including: obtaining a completion identifier generated by the execution of the function, and determining, according to the completion identifier, function execution corresponding to the Kth first control Finished.
  • the method further includes: after the preset time ends, determining that the function corresponding to the Kth first control is completed.
  • the function of triggering the Kth first control call includes: invoking to expand a second interface, before: determining that the function corresponding to the Kth first control is performed, the method further includes:
  • the determining that the function corresponding to the Kth first control is performed includes: determining that the second interface is closed.
  • the real-time recording of the memory usage data includes: recording the current memory usage data in real time, and the interface identifier of the second interface corresponding to the current memory usage data and the second identifier of the second control currently triggered.
  • the triggering the Kth first control to invoke the function corresponding to the Kth first control including:
  • the L trigger mode triggers the Kth first control to invoke a function corresponding to each trigger mode; wherein L is an integer greater than or equal to 1.
  • the real-time recording of the memory usage data includes: recording the current memory usage data in real time, and the interface identifier of the first interface corresponding to the current memory usage data and the first identifier of the currently triggered first control .
  • an electronic terminal comprising:
  • Obtaining a module acquiring first control information in the first interface, where the first control information includes a first identifier of each first control in the first interface;
  • the calling module sequentially triggers each first control according to the first identifier to invoke a function corresponding to each first control, and records memory usage data in real time.
  • the calling module is specifically configured to:
  • K Triggering the Kth first control to call the function corresponding to the Kth first control; wherein K is greater than Or an integer equal to 1;
  • the (K+1)th first control is triggered to perform the function corresponding to the (K+1)th first control.
  • the calling module is specifically configured to: obtain a completion identifier generated by the execution of the function, and determine, according to the completion identifier, that the function corresponding to the Kth first space is completed.
  • the terminal further includes:
  • a determining module configured to determine, after the preset time ends, that the function corresponding to the Kth first control is completed.
  • the function of triggering the Kth first control call includes: calling a second interface, where the calling module is configured to: acquire the second control information in the second interface, The second control information includes a second identifier of each second control in the second interface;
  • the calling module is specifically configured to: determine that the second interface is closed.
  • the calling module is specifically configured to: record, in real time, an interface identifier of the second interface corresponding to the current memory usage data and a second identifier of the second control that is currently triggered.
  • the calling module is specifically configured to: trigger the Kth first control in the L triggering manner to invoke the A function corresponding to each trigger mode; wherein L is an integer greater than or equal to 1.
  • the calling module is specifically configured to: record current memory usage data in real time, and an interface identifier of the first interface corresponding to the current memory usage data and a first identifier of the currently triggered first control.
  • an electronic terminal comprising: a memory, a processor, and a computer program, wherein the computer program is stored in the memory, the processor running the computer program to perform the first aspect and The first aspect of the various possible methods.
  • a storage medium comprising: a readable storage medium and a computer program for implementing the first aspect and the various possible methods of the first aspect.
  • the method for testing a memory usage situation and the electronic terminal provided by the present invention, by acquiring first control information in the first interface, the first control information includes a first identifier of each first control in the first interface; : triggering each first control according to the first identifier to invoke a function corresponding to each first control, and recording in real time Memory usage data; based on the obtained first control information, the automatic triggering of the first control in the first interface is realized, which avoids the cumbersome process and improves the efficiency of the test.
  • FIG. 1 is a schematic diagram of an application scenario of the present invention
  • FIG. 2 is a schematic flow chart 1 of a test method for memory usage of the present invention
  • FIG. 3 is a second schematic diagram of a flow of a test method for memory usage according to the present invention.
  • FIG 4 is a schematic flow chart 1 of step S22 of Figure 3;
  • FIG. 5 is a second schematic diagram of the process of step S22 in Figure 3;
  • FIG. 6 is a schematic diagram of an interface of a first interface of the present invention.
  • FIG. 7 is a schematic diagram of an interface of a second interface of the present invention.
  • FIG. 8 is a schematic structural view 1 of an electronic terminal of the present invention.
  • FIG. 9 is a schematic structural view 2 of an electronic terminal according to the present invention.
  • FIG. 10 is a third schematic structural diagram of an electronic terminal according to the present invention.
  • FIG. 1 is a schematic diagram of an application scenario of the present invention; referring to FIG. 1, the present invention is applicable to testing a control 2 in an interface 1 of an electronic terminal.
  • Interface 1 can be understood as any interface for human-computer interaction.
  • the control 2 can be a component displayed on the interface 1 and capable of being triggered to implement a preset function.
  • the invention can be applied to the control 2 in the trigger interface 1, and then completes the test of the memory usage by recording the memory usage data after the trigger control 2.
  • FIG. 2 is a schematic flowchart 1 of a test method for a memory usage of the present invention. referring to FIG. 2, the method includes:
  • the first interface can be any interactive interface to be tested.
  • the first interface may be correspondingly provided with an interface identifier for identifying different interfaces, and may perform differential recording for memory usage under different interfaces.
  • the first control information includes a first identifier of each first control in the first interface, and the first identifier can be used to identify different first controls, and can be used for different memory usage after the first control is triggered. Make a distinction record.
  • the interface identifier and the first identifier can be used to design controls and interfaces.
  • S12 trigger each first control according to the first identifier to invoke a function corresponding to each first control, and record memory usage data in real time.
  • the first control is triggered in sequence according to the first identifier, so that any one of the first controls can be triggered only by the same trigger mode, and the first trigger can be guaranteed. Both are triggered.
  • the function corresponding to the first control may be any preset function, and the trigger mode of the first control may change according to the corresponding function.
  • Memory usage data can be understood as any data describing the memory usage.
  • the output can be presented to the user in any manner, such as a waveform diagram or the like.
  • the method for testing the memory usage situation obtains the first control information in the first interface,
  • the first control information includes a first identifier of each first control in the first interface; and: triggering each first control according to the first identifier to invoke a function corresponding to each first control, and real-time
  • the memory usage data is recorded; based on the obtained first control information, the automatic triggering of the first control in the first interface is realized, which avoids the cumbersome process and improves the testing efficiency.
  • FIG. 3 is a schematic flowchart 2 of a test method for a memory usage of the present invention. referring to FIG. 3, the method includes:
  • the first interface 300 can be any interactive interface to be tested.
  • the first interface 300 can be correspondingly provided with an interface identifier for identifying different interfaces, and can perform differential recording for memory usage under different interfaces.
  • FIG. 6 is a schematic diagram of an interface of a first interface of the present invention
  • a first control 301, a first control 302, a first control 303, and a first control 304 may be disposed in the first interface 300.
  • the manner in which the four first controls are arranged in the first interface 300 may not be limited to those shown in the figure.
  • the first control 301 and the first control 302 may be controls that are triggered by a click method.
  • the first control 302 may be a control that expands another second interface 400 by clicking.
  • the first control 303 can be a control triggered by sliding the slider.
  • any position of the sliding of the slider can be understood as a triggering manner.
  • triggering modes can be understood as that after the same control is triggered in different manners, multiple functions with different functions are respectively implemented, and the difference may be the opposite of the logic of the function implementation, such as the control of turning on the Bluetooth and turning off the Bluetooth; Controls with multiple options, such as language option controls; can be just different controls that quantize the data, such as controls that adjust the volume; or other controls that incorporate multiple unrelated features.
  • the first control 304 can be a control with a "whether" option.
  • the first control information includes a first identifier of each first control in the first interface 300, and the first identifier can be used to identify different first controls, and can be used for different first control after the memory usage is triggered. , to make a distinction record.
  • the interface identifier and the first identifier may be identifiers used when designing controls and interfaces.
  • S22 trigger each first control according to the first identifier to invoke a function corresponding to each first control, and record memory usage data in real time.
  • the trigger mode is triggered once to avoid repeated triggers. Since the identifier is pre-acquired, all the first controls can be guaranteed to be triggered.
  • FIG. 4 is a schematic flowchart 1 of step S22 in FIG. 3, and step S22 may include:
  • S221 triggering the Kth first control to invoke a function corresponding to the Kth first control; wherein K is an integer greater than or equal to 1.
  • the Kth first control may be any one of the first interfaces 300.
  • S223 Trigger the (K+1)th first control to perform the function corresponding to the (K+1)th first control.
  • the next control can be triggered after the function of one of the first controls is executed, thereby preventing the simultaneous triggering of the control or the simultaneous execution of the function. If the function is executed at the same time, the recorded memory usage cannot be performed. Corresponding to the case of the control, it is also possible that the corresponding function cannot be realized due to the mutual influence of the functions.
  • FIG. 5 is a schematic diagram 2 of the process of step S22 of FIG. 3;
  • FIG. 7 is a schematic diagram of an interface of a second interface of the present invention; referring to FIG. 5 and FIG. 7, the functions of triggering the Kth first control call include: When the function of the function of the Kth first control is completed, the method further includes:
  • S224 Acquire second control information in the second interface 400, where the second control information includes a second identifier of each second control in the second interface.
  • the second interface 300 can be any interactive interface to be tested.
  • the second interface 300 can be correspondingly provided with an interface identifier for identifying different interfaces, and can perform differential recording for memory usage under different interfaces.
  • FIG. 7 is a schematic diagram of an interface of a second interface of the present invention; a second control 401 and a second control 402 may be disposed in the second interface 400.
  • the layout mode, the number, and the control type of the second control in the second interface 400 are not limited to those shown in the figure. Specifically, the first control can be understood.
  • S225 trigger each second control according to the second identifier to perform a function corresponding to each second control
  • step S222 may specifically include: determining that the second interface 400 is closed.
  • the second control is triggered in sequence according to the second identifier, which can be understood as: any second control can be triggered only by the same triggering manner, and the repeated triggering is avoided, because the identifier is pre-acquired, Ensure that all second controls are triggered.
  • the method may include: obtaining a completion identifier generated after the function is executed, and determining, according to the completion identifier, that the corresponding function is completed. .
  • the completion flag can be used to determine the data that has been executed by the corresponding function. It can also have other functions at the same time, and is not only used to determine that the corresponding function is executed.
  • the end statement may be identified in the code to obtain the completed identifier, or the process of generating the completed identifier may be preset.
  • Determining the manner in which the corresponding function is performed is performed, and the method further includes: after the preset time ends, determining that the function corresponding to the Kth first control is completed.
  • the method may further include: if the completion identifier is not received within a preset time, the method further includes: after the preset time ends, determining that the function corresponding to the Kth first control is performed Finished.
  • the triggering the Kth first control to invoke the function corresponding to the Kth first control includes: The Kth first control is triggered in the L trigger mode to invoke a function corresponding to each trigger mode; where L is an integer greater than or equal to 1.
  • triggers can be implemented for different trigger modes, thereby respectively recording corresponding memory usage data, thereby more accurately determining the memory under each trigger mode. Usage.
  • the real-time recording of the memory usage data includes: recording the current memory usage data in real time, and the interface identifier of the first interface 300 corresponding to the current memory usage data and the first control currently triggered The first logo.
  • the method further includes: recording the current memory usage data in real time, and the interface identifier of the second interface 400 corresponding to the current memory usage data and the second identifier of the currently triggered second control. .
  • the memory usage data is recorded in real time, and may specifically include: recording the first control The first trigger identifier of the trigger mode of the component and/or the second trigger identifier of the trigger mode of the second control.
  • the method for testing the memory usage of the embodiment provides the first control information in the first interface, where the first control information includes a first identifier of each first control in the first interface; and: The first identifier sequentially triggers each first control to invoke a function corresponding to each first control, and records memory usage data in real time; and implements the first control in the first interface based on the acquired first control information. Automatic triggering avoids the cumbersome process and improves the efficiency of testing.
  • FIG. 8 is a schematic structural diagram 1 of an electronic terminal according to the present invention. referring to FIG. 8, the terminal includes:
  • the obtaining module 501 is configured to acquire first control information in the first interface, where the first control information includes a first identifier of each first control in the first interface;
  • the calling module 502 sequentially triggers each first control according to the first identifier to invoke a function corresponding to each first control, and records memory usage data in real time.
  • the first terminal information in the first interface is obtained by the electronic terminal provided by the embodiment, the first control information includes a first identifier of each first control in the first interface; and: according to the first The identifier sequentially triggers each first control to invoke the function corresponding to each first control, and records the memory usage data in real time; based on the obtained first control information, the automatic triggering of the first control in the first interface is avoided, thereby avoiding The cumbersome process has improved the efficiency of the test.
  • FIG. 9 is a schematic structural diagram 2 of an electronic terminal according to the present invention. referring to FIG. 9, the terminal includes:
  • the obtaining module 601 is configured to acquire first control information in the first interface, where the first control information includes a first identifier of each first control in the first interface;
  • the calling module 602 sequentially triggers each first control according to the first identifier to invoke a function corresponding to each first control, and records memory usage data in real time.
  • the calling module 602 is specifically configured to:
  • K Triggering the Kth first control to invoke a function corresponding to the Kth first control; wherein K is an integer greater than or equal to 1;
  • the (K+1)th first control is triggered to perform the function corresponding to the (K+1)th first control.
  • the calling module 602 is specifically configured to: obtain a completion identifier generated by the execution of the function, and determine, according to the completion identifier, that the function corresponding to the Kth first control is completed.
  • the terminal further includes:
  • the determining module 603 is configured to determine, after the preset time ends, that the function corresponding to the Kth first control is completed.
  • the calling module 602 is specifically configured to: acquire second control information in the second interface.
  • the second control information includes a second identifier of each second control in the second interface;
  • the calling module 602 is specifically configured to: determine that the second interface is closed.
  • the calling module 602 is specifically configured to: record, in real time, an interface identifier of the second interface corresponding to the current memory usage data and a second identifier of the second control that is currently triggered.
  • the calling module 602 is specifically configured to: trigger the Kth first control in the L triggering manner in sequence, to Calling the function corresponding to each trigger mode; where L is an integer greater than or equal to 1.
  • the calling module 602 is specifically configured to: record current memory usage data in real time, and an interface identifier of the first interface corresponding to the current memory usage data and a first identifier of the currently triggered first control. .
  • the first terminal information in the first interface is obtained by the electronic terminal provided by the embodiment, the first control information includes a first identifier of each first control in the first interface; and: according to the first The identifier sequentially triggers each first control to invoke the function corresponding to each first control, and records the memory usage data in real time; based on the obtained first control information, the automatic triggering of the first control in the first interface is avoided, thereby avoiding The cumbersome process has improved the efficiency of the test.
  • FIG. 10 is a schematic structural diagram 3 of an electronic terminal according to the present invention. referring to FIG. 10, the electronic terminal 70 includes: a processor 71 and a memory 72;
  • the memory 72 is configured to store a computer program, and the memory may also be a flash memory.
  • the processor 71 is configured to execute an execution instruction of the memory storage to implement each step in the foregoing method. For details, refer to the related description in the foregoing method embodiments.
  • the memory 72 can be either standalone or integrated with the processor 71.
  • the electronic terminal 70 may further include:
  • a bus 73 is provided for connecting the memory 72 and the processor 71.
  • the embodiment provides a readable storage medium.
  • the readable storage medium stores execution instructions.
  • the electronic terminal executes the methods provided by the various embodiments described above.
  • the embodiment provides a program product including an execution instruction stored in a readable storage medium.
  • At least one processor of the electronic terminal can read the execution instructions from a readable storage medium, and the at least one processor executes the execution instructions such that the electronic terminal implements the methods provided by the various embodiments described above.

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)
  • User Interface Of Digital Computer (AREA)
  • Telephone Function (AREA)

Abstract

一种内存使用情况的测试方法与电子终端,所述的方法,包括:获取第一界面中的第一控件信息(S11),所述第一控件信息包括所述第一界面中每个第一控件的第一标识;根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据(S12)。该方法以所获取的第一控件信息为依据,实现了第一界面中第一控件的自动触发,避免了过程的繁琐,提高了测试的效率。

Description

内存使用情况的测试方法与电子终端 技术领域
本申请涉及电子终端,尤其涉及一种内存使用情况的测试方法与电子终端。
背景技术
电子终端,可以理解为具有处理器和存储器的终端,处理器读取存储器中的代码,可以执行相应的功能,具体的,可以在其中执行产生界面,界面中具有控件,通过对控件的触发,可以执行对应的预设功能。
在控件设计完成后,需要对界面中控件的作用进行测试,其中,包括了触发控件后的内存使用情况的测试,现有的相关技术中,可以自动对界面中的单个控件重复触发,并记录下每次触发后的内存使用情况,以对单个控件进行测试。
然而,现有的方案仅能实现单个控件的重复触发,如若需要对另一控件进行触发,还需通过人工的介入,改变所触发的控件,这使得测试过程较为繁琐。
发明内容
本发明提供了内存使用情况的测试方法与电子终端,以解决测试过程繁琐的技术问题。
根据本发明的第一方面,提供了一种内存使用情况的测试方法,包括:
获取第一界面中的第一控件信息,所述第一控件信息包括所述第一界面中每个第一控件的第一标识;
根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据。
可选的,所述根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,包括:
触发第K个第一控件,以调用所述第K个第一控件对应的功能;其中,K为大于或等于1的整数;
确定所述第K个第一控件对应的功能执行完毕;
触发第(K+1)个第一控件,以执行所述第(K+1)个第一控件对应的功能。
可选的,所述确定所述第K个第一控件对应的功能执行完毕,包括:获取功能执行完毕产生的完毕标识,根据所述完毕标识确定所述第K个第一控件对应的功能执行完毕。
可选的,若在预设时间内未收到所述完毕标识,所述方法还包括:在所述预设时间结束后,确定所述第K个第一控件对应的功能执行完毕。
可选的,若触发所述第K个第一控件调用的功能包括:调用展开一第二界面,则:所述确定所述第K个第一控件对应的功能执行完毕之前,还包括:
获取所述第二界面中的第二控件信息,所述第二控件信息包括所述第二界面中每个第二控件的第二标识;
根据所述第二标识依次触发各第二控件,以执行各第二控件对应的功能;
确定所述第二界面中的M个第二控件对应的功能均已执行完毕;
关闭所述第二界面。
可选的,所述确定所述第K个第一控件对应的功能执行完毕,包括:确定所述第二界面已关闭。
可选的,所述实时记录内存使用数据,包括:实时记录当前的内存使用数据,以及当前的内存使用数据所对应的第二界面的界面标识以及当前被触发的第二控件的第二标识。
可选的,若所述第K个第一控件具有L种触发方式,则:所述触发第K个第一控件,以调用所述第K个第一控件对应的功能,包括:依次以所述L种触发方式触发所述第K个第一控件,以调用各触发方式对应的功能;其中,L为大于或等于1的整数。
可选的,所述实时记录内存使用数据,包括:实时记录当前的内存使用数据,以及所述当前的内存使用数据对应的第一界面的界面标识和当前被触发的第一控件的第一标识。
根据本发明的第二方面,提供了一种电子终端,包括:
获取模块,获取第一界面中的第一控件信息,所述第一控件信息包括所述第一界面中每个第一控件的第一标识;
调用模块,根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据。
可选的,所述调用模块,具体用于:
触发第K个第一控件,以调用所述第K个第一控件对应的功能;其中,K为大于 或等于1的整数;
确定所述第K个第一控件对应的功能执行完毕;
触发第(K+1)个第一控件,以执行所述第(K+1)个第一控件对应的功能。
可选的,所述调用模块,具体用于:获取功能执行完毕产生的完毕标识,根据所述完毕标识确定所述第K个第一空间对应的功能执行完毕。
可选的,若在预设时间内未收到所述完毕标识,所述终端还包括:
确定模块,用于在所述预设时间结束后,确定所述第K个第一控件对应的功能执行完毕。
可选的,若触发所述第K个第一控件调用的功能包括:调用展开一第二界面,则:所述调用模块,具体用于:获取所述第二界面中的第二控件信息,所述第二控件信息包括所述第二界面中每个第二控件的第二标识;
根据所述第二标识依次触发各第二控件,以执行各第二控件对应的功能;
确定所述第二界面中的M个第二控件对应的功能均已执行完毕;
关闭所述第二界面。
可选的,所述调用模块,具体用于:确定所述第二界面已关闭。
可选的,所述调用模块,具体用于:实时记录当前的内存使用数据所对应的第二界面的界面标识以及当前被触发的第二控件的第二标识。
可选的,若所述第K个第一控件具有L种触发方式,则:所述调用模块,具体用于:依次以所述L种触发方式触发所述第K个第一控件,以调用各触发方式对应的功能;其中,L为大于或等于1的整数。
可选的,所述调用模块,具体用于:实时记录当前的内存使用数据,以及所述当前的内存使用数据对应的第一界面的界面标识和当前被触发的第一控件的第一标识。
根据本发明的第三方面,提供了一种电子终端,包括:存储器、处理器以及计算机程序,所述计算机程序存储在所述存储器中,所述处理器运行所述计算机程序执行第一方面及第一方面各种可能的所述方法。
根据本发明的第四方面,本申请提供一种存储介质,包括:可读存储介质和计算机程序,所述计算机程序用于实现第一方面及第一方面各种可能的所述方法。
本发明提供的内存使用情况的测试方法与电子终端,通过获取第一界面中的第一控件信息,所述第一控件信息包括所述第一界面中每个第一控件的第一标识;以及:根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录 内存使用数据;以所获取的第一控件信息为依据,实现了第一界面中第一控件的自动触发,避免了过程的繁琐,提高了测试的效率。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本发明一应用场景的示意图;
图2是本发明一内存使用情况的测试方法的流程示意图一;
图3是本发明一内存使用情况的测试方法的流程示意图二;
图4是图3中步骤S22的流程示意图一;
图5是图3中步骤S22的流程示意图二;
图6是本发明一第一界面的界面示意图;
图7是本发明一第二界面的界面示意图;
图8是本发明一电子终端的结构示意图一;
图9是本发明一电子终端的结构示意图二;
图10是本发明一电子终端的结构示意图三。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例例如能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、***、产品或设备不必限于清楚地列出的那些步 骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
下面以具体地实施例对本发明的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。
图1是本发明一应用场景的示意图;请参考图1,本发明可应用于对电子终端的界面1中的控件2进行测试。
界面1,可以理解为任意用于人机交互的界面。
控件2,可以为显示于界面1,且能够被触发实现预设功能的部件。
本发明可应用于触发界面1中的控件2,进而通过记录触发控件2后的内存使用数据,完成对内存使用情况的测试。
实施例1
图2是本发明一内存使用情况的测试方法的流程示意图一;请参考图2,所述的方法,包括:
S11:获取第一界面中的第一控件信息。
第一界面,可以为任意待测的交互界面。对应的,第一界面可对应设置有界面标识,用于识别不同的界面,并可以针对不同界面下的内存使用情况,进行区分记录。
第一控件信息,包括所述第一界面中每个第一控件的第一标识,通过第一标识可以用于识别不同的第一控件,并可以针对不同第一控件触发后的内存使用情况,进行区分记录。
界面标识和第一标识,可以采用设计控件和界面时所采用的标识。
S12:根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据。
根据所述第一标识依次触发各第一控件,可以使得:任意一个第一控件仅被同一种触发方式触发一次,避免重复触发的同时,由于标识为预先获取的,还可以保障所有第一控件均得到触发。
第一控件对应的功能,可以为预设的任意功能,根据所对应的功能不同,第一控件的触发方式可能发生变化。
内存使用数据,可以理解为描述内存使用情况的任意数据。具体实施过程中,可以以任意方式向用户呈现输出,比如波形图等等。
本实施例提供的内存使用情况的测试方法,通过获取第一界面中的第一控件信息, 所述第一控件信息包括所述第一界面中每个第一控件的第一标识;以及:根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据;以所获取的第一控件信息为依据,实现了第一界面中第一控件的自动触发,避免了过程的繁琐,提高了测试的效率。
实施例2
图3是本发明一内存使用情况的测试方法的流程示意图二;请参考图3,所述的方法,包括:
S21:获取第一界面300中的第一控件信息。
第一界面300,可以为任意待测的交互界面。对应的,第一界面300可对应设置有界面标识,用于识别不同的界面,并可以针对不同界面下的内存使用情况,进行区分记录。
图6是本发明一第一界面的界面示意图;第一界面300中可以设有第一控件301、第一控件302、第一控件303和第一控件304。且四个第一控件在第一界面300的布局方式可以不限于图中所示。
第一控件301和第一控件302,可以为通过点击方式触发的控件。具体实施过程中,第一控件302可以为通过点击调用展开另一第二界面400的控件。
第一控件303,可以为通过滑动滑块触发的控件。具体的实施方式中,滑块滑动的任意一个位置均可理解为一种触发方式。
可见,不同的触发方式,可以理解为同一控件以不同的方式触发后,分别实现了具有差异的多个功能,该差异可以是功能实现的逻辑相反,例如打开蓝牙与关闭蓝牙的控件;可以是具有多个选项的控件,例如语言选项控件;可以只是量化数据的不同的控件,例如调整音量大小的控件;也可以为其他整合了多个无关功能的控件。
第一控件304,可以为具有“是否”选项的控件。
第一控件信息,包括所述第一界面300中每个第一控件的第一标识,通过第一标识可以用于识别不同的第一控件,并可以针对不同第一控件触发后的内存使用情况,进行区分记录。
界面标识和第一标识,可以为采用设计控件和界面时所采用的标识。
S22:根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据。
根据所述第一标识依次触发各第一控件,可以使得:任意一个第一控件仅被同一 种触发方式触发一次,避免重复触发的同时,由于标识为预先获取的,还可以保障所有第一控件均得到触发。
其中一种实施方式中,图4是图3中步骤S22的流程示意图一,步骤S22可以包括:
S221:触发第K个第一控件,以调用所述第K个第一控件对应的功能;其中,K为大于或等于1的整数。
第K个第一控件,可以为第一界面300中的任意一个控件。
S222:确定所述第K个第一控件对应的功能执行完毕。
S223:触发第(K+1)个第一控件,以执行所述第(K+1)个第一控件对应的功能。
通过以上实施方式,可以在其中一个第一控件的功能执行完毕后才触发下一个控件,从而避免控件同时触发或功能的同时执行,若发生功能的同时执行,会造成所记录的内存使用情况无法对应于控件的情况,同时还有可能因功能之间互相影响而无法实现对应的功能。
图5是图3中步骤S22的流程示意图二,;图7是本发明一第二界面的界面示意图;请参考图5和图7,若触发所述第K个第一控件调用的功能包括:调用展开一第二界面400,则:所述确定所述第K个第一控件对应的功能执行完毕之前,还包括:
S224:获取所述第二界面400中的第二控件信息,所述第二控件信息包括所述第二界面中每个第二控件的第二标识。
第二界面300,可以为任意待测的交互界面。对应的,第二界面300可对应设置有界面标识,用于识别不同的界面,并可以针对不同界面下的内存使用情况,进行区分记录。
图7是本发明一第二界面的界面示意图;第二界面400中可以设有第二控件401与第二控件402。且第二控件在第二界面400的布局方式、数量以及控件类型,可以不限于图中所示,具体的,可以参照第一控件理解。
S225:根据所述第二标识依次触发各第二控件,以执行各第二控件对应的功能;
S226:确定所述第二界面400中的M个第二控件对应的功能均已执行完毕;
S227:关闭所述第二界面400。
对应的,步骤S222可以具体包括:包括:确定所述第二界面400已关闭。
根据所述第二标识依次触发各第二控件,可以理解为:可以使得任意第二控件仅被同一种触发方式触发一次,避免重复触发的同时,由于标识为预先获取的,还可以 保障所有第二控件均得到触发。
此外,对于不同的控件,不论第一控件还是第二控件,确定其对应的功能执行完毕的方式,均可以包括:获取功能执行完毕产生的完毕标识,根据所述完毕标识确定对应的功能执行完毕。
完毕标识,可以为任意确定对应功能执行完毕的数据,其也可同时具备其他作用,而非仅用于确定对应功能执行完毕。具体实施过程中,可以通过在代码中识别结束语句,以得到所述完毕标识,也可以预设生成完毕标识的过程。
确定其对应的功能执行完毕的方式,还可以包括:在所述预设时间结束后,确定所述第K个第一控件对应的功能执行完毕。通过预设时间的设置,可以帮助获取稳定的内存使用数据,同时,执行过程相对简单。
进一步地,可以具体为:若在预设时间内未收到所述完毕标识,则所述方法还包括:在所述预设时间结束后,确定所述第K个第一控件对应的功能执行完毕。该实施方式可以同时适用于具有结束语句的实施方式和不具有结束语句的实施方式,有效拓展了本实施例适用的控件范围。
其中一种实施方式中,若所述第K个第一控件具有L种触发方式,则:所述触发第K个第一控件,以调用所述第K个第一控件对应的功能,包括:依次以所述L种触发方式触发所述第K个第一控件,以调用各触发方式对应的功能;其中,L为大于或等于1的整数。
通过以上实施方式,可以适用于具有多种触发方式的情况,且针对不同的触发方式,均可实施触发,从而分别记录其对应的内存使用数据,从而可以更精准地确定各触发方式下的内存使用情况。
其中一种实施方式中,所述实时记录内存使用数据,包括:实时记录当前的内存使用数据,以及所述当前的内存使用数据对应的第一界面300的界面标识和当前被触发的第一控件的第一标识。
在具有第二界面400的情况下,还可包括:实时记录当前的内存使用数据,以及当前的内存使用数据所对应的第二界面400的界面标识以及当前被触发的第二控件的第二标识。
通过以上实施方式,可以避免触发的重复或冲突,还可实现内存使用数据的精确记录。
为了进一步实现区分记录,实时记录内存使用数据,还可具体包括:记录第一控 件的触发方式的第一触发标识和/或记录第二控件的触发方式的第二触发标识。通过以上实施方式,可以实现更精准细致的记录。
S23:确定所述第一界面中的N个第一控件对应的功能均已执行完毕。
S24:输出所记录的内存占用数据。
本实施例提供的内存使用情况的测试方法,通过获取第一界面中的第一控件信息,所述第一控件信息包括所述第一界面中每个第一控件的第一标识;以及:根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据;以所获取的第一控件信息为依据,实现了第一界面中第一控件的自动触发,避免了过程的繁琐,提高了测试的效率。
实施例3
图8是本发明一电子终端的结构示意图一;请参考图8,所述的终端,包括:
获取模块501,获取第一界面中的第一控件信息,所述第一控件信息包括所述第一界面中每个第一控件的第一标识;
调用模块502,根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据。
本实施例提供的电子终端,通过获取第一界面中的第一控件信息,所述第一控件信息包括所述第一界面中每个第一控件的第一标识;以及:根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据;以所获取的第一控件信息为依据,实现了第一界面中第一控件的自动触发,避免了过程的繁琐,提高了测试的效率。
实施例4
图9是本发明一电子终端的结构示意图二;请参考图9,所述的终端,包括:
获取模块601,获取第一界面中的第一控件信息,所述第一控件信息包括所述第一界面中每个第一控件的第一标识;
调用模块602,根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据。
可选的,所述调用模块602,具体用于:
触发第K个第一控件,以调用所述第K个第一控件对应的功能;其中,K为大于或等于1的整数;
确定所述第K个第一控件对应的功能执行完毕;
触发第(K+1)个第一控件,以执行所述第(K+1)个第一控件对应的功能。
可选的,所述调用模块602,具体用于:获取功能执行完毕产生的完毕标识,根据所述完毕标识确定所述第K个第一控件对应的功能执行完毕。
可选的,若在预设时间内未收到所述完毕标识,所述终端还包括:
确定模块603,用于在所述预设时间结束后,确定所述第K个第一控件对应的功能执行完毕。
可选的,若触发所述第K个第一控件调用的功能包括:调用展开一第二界面,则:所述调用模块602,具体用于:获取所述第二界面中的第二控件信息,所述第二控件信息包括所述第二界面中每个第二控件的第二标识;
根据所述第二标识依次触发各第二控件,以执行各第二控件对应的功能;
确定所述第二界面中的M个第二控件对应的功能均已执行完毕;
关闭所述第二界面。
可选的,所述调用模块602,具体用于:确定所述第二界面已关闭。
可选的,所述调用模块602,具体用于:实时记录当前的内存使用数据所对应的第二界面的界面标识以及当前被触发的第二控件的第二标识。
可选的,若所述第K个第一控件具有L种触发方式,则:所述调用模块602,具体用于:依次以所述L种触发方式触发所述第K个第一控件,以调用各触发方式对应的功能;其中,L为大于或等于1的整数。
可选的,所述调用模块602,具体用于:实时记录当前的内存使用数据,以及所述当前的内存使用数据对应的第一界面的界面标识和当前被触发的第一控件的第一标识。
本实施例提供的电子终端,通过获取第一界面中的第一控件信息,所述第一控件信息包括所述第一界面中每个第一控件的第一标识;以及:根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据;以所获取的第一控件信息为依据,实现了第一界面中第一控件的自动触发,避免了过程的繁琐,提高了测试的效率。
实施例5
图10上本发明一电子终端的结构示意图三;请参考图10,该电子终端70包括:处理器71以及存储器72;其中
存储器72,用于存储计算机程序,该存储器还可以是flash(闪存)。
处理器71,用于执行存储器存储的执行指令,以实现上述方法中的各个步骤。具体可以参见前面方法实施例中的相关描述。
可选地,存储器72既可以是独立的,也可以跟处理器71集成在一起。
当所述存储器72是独立于处理器71之外的器件时,所述电子终端70还可以包括:
总线73,用于连接所述存储器72和处理器71。
实施例6
本实施例提供一种可读存储介质,可读存储介质中存储有执行指令,当电子终端的至少一个处理器执行该执行指令时,电子终端执行上述的各种实施方式提供的方法。
实施例7
本实施例提供一种程序产品,该程序产品包括执行指令,该执行指令存储在可读存储介质中。电子终端的至少一个处理器可以从可读存储介质读取该执行指令,至少一个处理器执行该执行指令使得电子终端实施上述的各种实施方式提供的方法。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (10)

  1. 一种内存使用情况的测试方法,其特征在于,包括:
    获取第一界面中的第一控件信息,所述第一控件信息包括所述第一界面中每个第一控件的第一标识;
    根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,包括:
    触发第K个第一控件,以调用所述第K个第一控件对应的功能;其中,K为大于或等于1的整数;
    确定所述第K个第一控件对应的功能执行完毕;
    触发第(K+1)个第一控件,以执行所述第(K+1)个第一控件对应的功能。
  3. 根据权利要求2所述的方法,其特征在于,所述确定所述第K个第一控件对应的功能执行完毕,包括:获取功能执行完毕产生的完毕标识,根据所述完毕标识确定所述第K个第一控件对应的功能执行完毕。
  4. 根据权利要求3所述的方法,其特征在于,若在预设时间内未收到所述完毕标识,所述方法还包括:在所述预设时间结束后,确定所述第K个第一控件对应的功能执行完毕。
  5. 根据权利要求2所述的方法,其特征在于,若触发所述第K个第一控件调用的功能包括:调用展开一第二界面,则:所述确定所述第K个第一控件对应的功能执行完毕之前,还包括:
    获取所述第二界面中的第二控件信息,所述第二控件信息包括所述第二界面中每个第二控件的第二标识;
    根据所述第二标识依次触发各第二控件,以执行各第二控件对应的功能;
    确定所述第二界面中的M个第二控件对应的功能均已执行完毕;其中,M为大于或等于1的整数;
    关闭所述第二界面。
  6. 根据权利要求5所述的方法,其特征在于,所述确定所述第K个第一控件对应的功能执行完毕,包括:确定所述第二界面已关闭。
  7. 根据权利要求4所述的方法,其特征在于,所述实时记录内存使用数据,包括: 实时记录当前的内存使用数据,以及当前的内存使用数据所对应的第二界面的界面标识以及当前被触发的第二控件的第二标识。
  8. 根据权利要求2至7任一项所述的方法,其特征在于,若所述第K个第一控件具有L种触发方式,则:所述触发第K个第一控件,以调用所述第K个第一控件对应的功能,包括:依次以所述L种触发方式触发所述第K个第一控件,以调用各触发方式对应的功能;其中,L为大于或等于1的整数。
  9. 根据权利要求1至6任一项所述的方法,其特征在于,所述实时记录内存使用数据,包括:实时记录当前的内存使用数据,以及所述当前的内存使用数据对应的第一界面的界面标识和当前被触发的第一控件的第一标识。
  10. 一种电子终端,其特征在于,包括:
    获取模块,获取第一界面中的第一控件信息,所述第一控件信息包括所述第一界面中每个第一控件的第一标识;
    调用模块,根据所述第一标识依次触发各第一控件,以调用各第一控件对应的功能,并实时记录内存使用数据。
PCT/CN2017/099153 2017-08-25 2017-08-25 内存使用情况的测试方法与电子终端 WO2019037118A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/099153 WO2019037118A1 (zh) 2017-08-25 2017-08-25 内存使用情况的测试方法与电子终端

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/099153 WO2019037118A1 (zh) 2017-08-25 2017-08-25 内存使用情况的测试方法与电子终端

Publications (1)

Publication Number Publication Date
WO2019037118A1 true WO2019037118A1 (zh) 2019-02-28

Family

ID=65438299

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/099153 WO2019037118A1 (zh) 2017-08-25 2017-08-25 内存使用情况的测试方法与电子终端

Country Status (1)

Country Link
WO (1) WO2019037118A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050076A (zh) * 2013-03-12 2014-09-17 阿里巴巴集团控股有限公司 移动终端上的应用软件测试方法、装置及***
CN105243003A (zh) * 2015-09-09 2016-01-13 浪潮(北京)电子信息产业有限公司 内存分配的监测方法及装置
CN105260301A (zh) * 2015-09-24 2016-01-20 努比亚技术有限公司 用户界面的视效比对测试装置及其实现方法
CN106598834A (zh) * 2015-10-19 2017-04-26 腾讯科技(深圳)有限公司 Ui测试方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050076A (zh) * 2013-03-12 2014-09-17 阿里巴巴集团控股有限公司 移动终端上的应用软件测试方法、装置及***
CN105243003A (zh) * 2015-09-09 2016-01-13 浪潮(北京)电子信息产业有限公司 内存分配的监测方法及装置
CN105260301A (zh) * 2015-09-24 2016-01-20 努比亚技术有限公司 用户界面的视效比对测试装置及其实现方法
CN106598834A (zh) * 2015-10-19 2017-04-26 腾讯科技(深圳)有限公司 Ui测试方法及装置

Similar Documents

Publication Publication Date Title
CN109670951B (zh) 一种区块链智能合约调试发布方法及***
CN108986821B (zh) 一种设置房间与设备关系的方法和设备
CN108170611A (zh) 自动化测试方法及装置、存储介质、电子设备
CN110851221B (zh) 一种智慧家居场景配置的方法及装置
CN108323239A (zh) 屏幕录像的录制、播放方法、录屏终端及播放终端
US10990510B2 (en) Associating attribute seeds of regression test cases with breakpoint value-based fingerprints
CN103049375A (zh) 一种摄像头在线调试方法
TW200825733A (en) Test device, method, application program, and computer readable medium for deriving a qualified test case plan from a test case database
US9652360B2 (en) Crawling for extracting a model of a GUI-based application
CN115146530B (zh) 构建焊接质量检测模型的方法、设备、介质及程序产品
CN109918302A (zh) 车载自动化测试方法、装置、车载多媒体***及汽车
US9733782B2 (en) Extracting a deterministic finite-state machine model of a GUI based application
CN106126414A (zh) 应用软件测试方法和***
CN106598834A (zh) Ui测试方法及装置
CN112905441A (zh) 测试用例生成方法、测试方法、装置及设备
CN109308236A (zh) 一种热插拔功能测试方法、装置及相关设备
CN109558297A (zh) 内存管理方法及装置
CN110380936A (zh) 测试方法和装置
CN110162730A (zh) 信息处理方法、装置、计算机设备及存储介质
CN109473121A (zh) 语音合成质量测试方法及装置
CN110889116B (zh) 一种广告拦截方法、装置及电子设备
CN108664392A (zh) 一种应用测试方法、装置、终端及存储介质
WO2019037118A1 (zh) 内存使用情况的测试方法与电子终端
CN105573746B (zh) 一种控件属性处理方法及装置
CN105589802A (zh) 软件测试方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17922285

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17922285

Country of ref document: EP

Kind code of ref document: A1