[go: up one dir, main page]

CN103064785B - A kind of detection method of terminal capabilities and device - Google Patents

A kind of detection method of terminal capabilities and device Download PDF

Info

Publication number
CN103064785B
CN103064785B CN201210513257.8A CN201210513257A CN103064785B CN 103064785 B CN103064785 B CN 103064785B CN 201210513257 A CN201210513257 A CN 201210513257A CN 103064785 B CN103064785 B CN 103064785B
Authority
CN
China
Prior art keywords
test case
test
class
execution
full
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.)
Expired - Fee Related
Application number
CN201210513257.8A
Other languages
Chinese (zh)
Other versions
CN103064785A (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201210513257.8A priority Critical patent/CN103064785B/en
Publication of CN103064785A publication Critical patent/CN103064785A/en
Application granted granted Critical
Publication of CN103064785B publication Critical patent/CN103064785B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

本发明公开了一种终端性能的检测方法和装置,其中的方法具体包括:创建测试信息基类和测试执行基类;其中,所述测试信息基类用于描述测试用例的信息,所述测试执行基类用于执行测试用例;针对测试用例,从所述测试信息基类派生出对应的测试用例信息类,及,从所述测试执行基类派生出对应的测试用例执行类;其中,所述测试用例信息类在构造函数中传递的参数包括当前测试用例的测试用例执行类名称;对所述测试用例信息类进行实例化得到相应的测试用例对象;针对所述测试用例对象,依据其对应的测试用例执行类名称获取对应的测试用例执行类,并调用所获取的测试用例执行类执行相应的测试用例。本发明能够降低产品的开发周期,提高产品的开发效率。

The invention discloses a terminal performance detection method and device, wherein the method specifically includes: creating a test information base class and a test execution base class; wherein, the test information base class is used to describe the information of a test case, and the test The execution base class is used to execute the test case; for the test case, the corresponding test case information class is derived from the test information base class, and the corresponding test case execution class is derived from the test execution base class; wherein, the The parameters passed by the test case information class in the constructor include the test case execution class name of the current test case; the test case information class is instantiated to obtain the corresponding test case object; for the test case object, according to its corresponding The name of the test case execution class obtains the corresponding test case execution class, and calls the obtained test case execution class to execute the corresponding test case. The invention can reduce the product development period and improve the product development efficiency.

Description

一种终端性能的检测方法和装置Method and device for detecting terminal performance

技术领域technical field

本发明涉及测试技术领域,具体涉及一种终端性能的检测方法和装置。The invention relates to the technical field of testing, in particular to a method and device for detecting terminal performance.

背景技术Background technique

随着移动互联网的兴起,智能手机等移动终端已经逐渐成为人们日常生活中不可缺少的工具之一。然而,目前,各个不同的厂家开发生产的移动终端各有不同,因而也无法直接对各不同厂家的不同移动终端进行比对分析,无法对各不同厂家的不同移动终端的性能做评估并进行选型。With the rise of the mobile Internet, mobile terminals such as smart phones have gradually become one of the indispensable tools in people's daily life. However, at present, the mobile terminals developed and produced by different manufacturers are different, so it is impossible to directly compare and analyze the different mobile terminals of different manufacturers, and it is impossible to evaluate and select the performance of different mobile terminals of different manufacturers. type.

针对上述问题,现有一些测试软件能够比较全面地对移动终端的性能进行测试,便于对各不同厂家的不同移动终端的性能进行比对评估。目前能够测试的移动终端的性能具体可以包括:CPU整数性能、CPU浮点性能、2D(二维,TwoDimensions)绘图性能、3D(三维,ThreeDimensions)绘图性能、数据库性能、SD卡(安全数码卡,SecureDigitalMemoryCard)速度等等。In view of the above problems, some existing testing software can test the performance of mobile terminals more comprehensively, which is convenient for comparing and evaluating the performance of different mobile terminals from different manufacturers. At present, the performance of mobile terminals that can be tested can specifically include: CPU integer performance, CPU floating point performance, 2D (two-dimensional, TwoDimensions) drawing performance, 3D (three-dimensional, ThreeDimensions) drawing performance, database performance, SD card (secure digital card, SecureDigitalMemoryCard) speed and more.

由于一种终端性能通常对应一个测试用例,故终端性能的测试往往需要进行多个测试用例的测试。现有终端性能的检测方法通常为,针对一个测试用例编写相应的代码段,其中测试用例之间的代码段具有一定的关联(如下一测试用例的代码段需要依赖于上一测试用例的执行结果等等)。Since one type of terminal performance usually corresponds to one test case, testing of terminal performance often requires testing of multiple test cases. Existing detection methods for terminal performance are usually to write corresponding code segments for a test case, wherein the code segments between test cases have a certain correlation (for example, the code segment of the next test case needs to depend on the execution result of the previous test case etc).

采用现有终端性能的检测方法,如果测试需求发生了变化则检测流程所需的众多步骤很有可能都需要改动,这就涉及到整体的代码段改动。例如,如果需要调整多个测试用例的执行顺序,则需要调整相关联测试用例的多个代码段的位置,比较容易出错;又如,如果需要增加新的测试用例,则需要重新编写一个完整测试流程所对应的代码段,而一个完整测试流程涉及的操作非常多,例如可以包括初始化、时间控制、界面控制、测评算法等等。总之,现有终端性能的检测方法具有不灵活和扩展性差的问题,这样,如果在产品开发过程中应用现有终端性能的检测方法,则容易增加产品的开发周期,降低产品的开发效率。With the existing terminal performance detection method, if the test requirements change, many steps required for the detection process may need to be modified, which involves the overall code segment modification. For example, if you need to adjust the execution order of multiple test cases, you need to adjust the positions of multiple code segments of the associated test cases, which is more error-prone; for another example, if you need to add a new test case, you need to rewrite a complete test The code segment corresponding to the process, and a complete test process involves many operations, such as initialization, time control, interface control, evaluation algorithm, etc. In short, the existing terminal performance detection method has the problems of inflexibility and poor scalability, so if the existing terminal performance detection method is applied in the product development process, it is easy to increase the product development cycle and reduce the product development efficiency.

总之,需要本领域技术人员迫切解决的一个技术问题就是:如何能够降低产品的开发周期,提高产品的开发效率。In short, a technical problem that needs to be solved urgently by those skilled in the art is: how to reduce the product development cycle and improve the product development efficiency.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的一种终端性能的检测方法和装置。In view of the above problems, the present invention is proposed to provide a terminal performance detection method and device that overcome the above problems or at least partially solve the above problems.

依据本发明的一个方面,提供了一种终端性能的检测方法,包括:According to one aspect of the present invention, a method for detecting terminal performance is provided, including:

创建测试信息基类和测试执行基类;其中,所述测试信息基类用于描述测试用例的信息,所述测试执行基类用于执行测试用例;Create a test information base class and a test execution base class; wherein, the test information base class is used to describe the information of the test case, and the test execution base class is used to execute the test case;

针对测试用例,从所述测试信息基类派生出对应的测试用例信息类,及,从所述测试执行基类派生出对应的测试用例执行类;其中,所述测试用例信息类在构造函数中传递的参数包括当前测试用例的测试用例执行类名称;For the test case, derive the corresponding test case information class from the test information base class, and derive the corresponding test case execution class from the test execution base class; wherein, the test case information class is in the constructor The passed parameters include the test case execution class name of the current test case;

对所述测试用例信息类进行实例化得到相应的测试用例对象;Instantiate the test case information class to obtain a corresponding test case object;

针对所述测试用例对象,依据其对应的测试用例执行类名称获取对应的测试用例执行类,并调用所获取的测试用例执行类执行相应的测试用例。For the test case object, obtain the corresponding test case execution class according to the corresponding test case execution class name, and call the obtained test case execution class to execute the corresponding test case.

可选地,所述方法还包括:Optionally, the method also includes:

将实例化得到的测试用例对象添加至列表,所述列表中测试用例对象的初始执行标志为未执行;The test case object obtained by instantiation is added to the list, and the initial execution mark of the test case object in the list is not executed;

从所述列表中获取执行标志为未执行的测试用例对象;Obtain the test case object whose execution flag is not executed from the list;

针对所述未执行的测试用例对象,依据其所关联的测试用例执行类名称获取对应的测试用例执行类,并调用所获取的测试用例执行类执行相应的测试用例;执行完成的测试用例对象对应的执行标志为已执行。For the unexecuted test case object, obtain the corresponding test case execution class according to its associated test case execution class name, and call the obtained test case execution class to execute the corresponding test case; the execution of the completed test case object corresponds to The execution flag is executed.

可选地,所述测试执行基类包括:用于执行全屏测试用例的全屏测试基类和用于执行非全屏测试用例的非全屏测试基类;其中,所述全屏测试基类由Android系统的Activity类派生而来;Optionally, the test execution base class includes: a full-screen test base class for executing a full-screen test case and a non-full-screen test base class for performing a non-full-screen test case; wherein, the full-screen test base class consists of the Android system The Activity class is derived from;

则所述测试用例执行类包括:从所述全屏测试基类派生出的全屏测试用例执行类和从所述非全屏测试基类派生出的非全屏测试用例执行类。Then the test case execution class includes: a full screen test case execution class derived from the full screen test base class and a non-full screen test case execution class derived from the non-full screen test base class.

所述测试用例的信息中包括有当前测试用例是否为全屏测试用例的检测方法;The information of the test case includes a detection method whether the current test case is a full-screen test case;

则所述调用所获取的测试用例执行类执行终端性能的测试的步骤,包括:Then the steps of calling the obtained test case execution class to execute the test of terminal performance include:

通过调用所述测试用例对象中当前测试用例是否为全屏测试用例的检测方法,检测所述测试用例对象对应测试用例是否为全屏测试用例;By calling the detection method of whether the current test case in the test case object is a full screen test case, detect whether the test case corresponding to the test case object is a full screen test case;

在所述测试用例对象对应测试用例为全屏测试用例时,调用对应的全屏测试用例执行类执行相应的测试用例;When the test case corresponding to the test case object is a full-screen test case, call the corresponding full-screen test case execution class to execute the corresponding test case;

在所述测试用例对象对应测试用例为非全屏测试用例时,调用对应的非全屏测试用例执行类执行相应的测试用例。When the test case corresponding to the test case object is a non-full-screen test case, the corresponding non-full-screen test case execution class is invoked to execute the corresponding test case.

可选地,所述调用对应的全屏测试用例执行类执行终端性能的测试的步骤,包括:Optionally, the step of calling the corresponding full-screen test case execution class to execute the terminal performance test includes:

从当前活动创建并启动一个全屏测试类的对象,由该全屏测试类的对象执行相应的测试用例,并返回相应的测试结果给当前活动;Create and start an object of a full-screen test class from the current activity, execute the corresponding test case by the object of the full-screen test class, and return the corresponding test result to the current activity;

当前活动获取该新全屏测试类的对象返回的测试结果。The current activity gets the test results returned by an object of this new fullscreen test class.

可选地,所述调用对应的非全屏测试用例执行类执行终端性能的测试,包括:Optionally, the invocation of the corresponding non-full-screen test case execution class executes a test of terminal performance, including:

对所述非全屏测试用例执行类进行实例化得到相应的非全屏测试用例对象;Instantiate the non-full-screen test case execution class to obtain a corresponding non-full-screen test case object;

创建后台测试线程,将所述非全屏测试用例对象传递进该后台测试线程;Create a background test thread, and pass the non-full-screen test case object into the background test thread;

启动该后台测试线程执行相应的测试用例。Start the background test thread to execute the corresponding test case.

可选地,所述测试执行基类的成员函数包括:用于描述测试流程的测试流程函数;从所述测试执行基类派生出的测试用例执行类覆盖所述测试流程函数以执行相应测试用例的测试流程。Optionally, the member functions of the test execution base class include: a test process function for describing the test process; a test case execution class derived from the test execution base class covers the test process function to execute the corresponding test case testing process.

可选地,所述测试执行基类的成员函数包括如下测试属性函数中的一项或多项:用于描述执行当前测试用例前需要等待的时间的第一等待函数,用于描述当前测试用例的执行轮数的轮数函数,及,用于描述执行每轮当前测试用例前需要等待的时间的第二等待函数;Optionally, the member functions of the test execution base class include one or more of the following test attribute functions: the first waiting function used to describe the time to wait before executing the current test case, used to describe the current test case The round number function of the number of execution rounds, and the second waiting function used to describe the time to wait before executing each round of the current test case;

从所述测试执行基类派生出的测试用例执行类覆盖所述测试属性函数以执行相应测试用例的测试属性。The test case execution class derived from the test execution base class overrides the test attribute function to execute the test attribute of the corresponding test case.

依据本发明的另一个方面,提供了一种终端性能的检测装置,包括:According to another aspect of the present invention, a device for detecting terminal performance is provided, including:

基类创建模块,适于创建测试信息基类和测试执行基类;其中,所述测试信息基类用于描述测试用例的信息,所述测试执行基类用于执行测试用例;The base class creation module is adapted to create a test information base class and a test execution base class; wherein, the test information base class is used to describe the information of the test case, and the test execution base class is used to execute the test case;

派生模块,适于针对测试用例,从所述测试信息基类派生出对应的测试用例信息类,及,从所述测试执行基类派生出对应的测试用例执行类;其中,所述测试用例信息类在构造函数中传递的参数包括当前测试用例的测试用例执行类名称;The derivation module is adapted to derive a corresponding test case information class from the test information base class for a test case, and derive a corresponding test case execution class from the test execution base class; wherein, the test case information The parameters passed by the class in the constructor include the test case execution class name of the current test case;

实例化模块,适于对所述测试用例信息类进行实例化得到相应的测试用例对象;An instantiation module, adapted to instantiate the test case information class to obtain a corresponding test case object;

对象执行类获取模块,适于针对所述测试用例对象,依据其对应的测试用例执行类名称获取对应的测试用例执行类;及The object execution class acquisition module is suitable for obtaining the corresponding test case execution class according to the corresponding test case execution class name for the test case object; and

对象测试用例执行模块,适于调用所获取的测试用例执行类执行相应的测试用例。The object test case execution module is suitable for invoking the acquired test case execution class to execute corresponding test cases.

本发明的一种终端性能的检测方法和装置具有如下有益效果:A terminal performance detection method and device of the present invention have the following beneficial effects:

本发明通过采用面向对象的方法,依据终端性能的检测属性抽象得到用于描述测试用例的信息的测试信息基类,及用于执行测试用例的测试执行基类;这样,只需针对测试用例配合使用所述测试信息基类的派生类和测试执行基类的派生类的实例化对象即可执行任意的测试用例,而多个测试用例的调度只需调度对应所述测试信息基类的派生类的实例化对象即可;因此,采用本发明的方案,如果测试需求发生了变化,则只需改动相应的实例化对象即可。例如,如果需要调整多个测试用例的执行顺序,只需调整多个测试用例对应所述测试信息基类的派生类的实例化对象的执行顺序即可,而无需调整具体的代码段,也就能够避免出现代码段出错的现象;又如,如果需要增加新测试用例,只需针对该新测试用例配合使用所述测试信息基类的派生类和测试执行基类的派生类的实例化对象即可,而无需重新编写一个完整测试流程所对应的代码段;总之,本发明终端性能的测试方案,能够灵活地进行多个测试用例,以及,能够方便地适应测试用例的任意增加、删除或顺序调整,总之,本发明能够提高终端性能测试的灵活性和扩展性。The present invention obtains the test information base class used to describe the information of the test case and the test execution base class used to execute the test case according to the detection attribute abstraction of the terminal performance by adopting an object-oriented method; Any test case can be executed by using the derived class of the test information base class and the instantiated object of the derived class of the test execution base class, and the scheduling of multiple test cases only needs to schedule the derived class corresponding to the test information base class Therefore, if the test requirement changes with the solution of the present invention, only the corresponding instantiated object needs to be changed. For example, if it is necessary to adjust the execution order of multiple test cases, it is only necessary to adjust the execution order of the instantiated objects of the derived classes of the test information base class corresponding to the multiple test cases without adjusting the specific code segments. Can avoid the phenomenon that the code section goes wrong; Another example, if you need to add a new test case, you only need to use the derived class of the test information base class and the instantiated object of the derived class of the test execution base class for the new test case. Yes, without rewriting the code segment corresponding to a complete test process; in a word, the terminal performance test scheme of the present invention can flexibly carry out multiple test cases, and can easily adapt to any addition, deletion or order of test cases Adjustment, in a word, the present invention can improve the flexibility and expansibility of the terminal performance test.

在产品开发过程中应用本发明终端性能的检测方法,则能够降低产品的开发周期,提高产品的开发效率。Applying the detection method of the terminal performance of the present invention in the product development process can reduce the product development cycle and improve the product development efficiency.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:

图1示出了根据本发明一个实施例的一种终端性能的检测方法的流程图;FIG. 1 shows a flowchart of a method for detecting terminal performance according to an embodiment of the present invention;

图2示出了根据本发明一个实施例的一种终端性能的检测方法的流程图;FIG. 2 shows a flowchart of a method for detecting terminal performance according to an embodiment of the present invention;

图3示出了根据本发明一个实施例的一种终端性能的检测方法的流程图;FIG. 3 shows a flow chart of a method for detecting terminal performance according to an embodiment of the present invention;

图4示出了根据本发明一个实施例的一种终端性能的检测装置的结构图;FIG. 4 shows a structural diagram of an apparatus for detecting terminal performance according to an embodiment of the present invention;

图5示出了根据本发明一个实施例的一种终端性能的检测结果显示方法的流程图;FIG. 5 shows a flowchart of a method for displaying a terminal performance detection result according to an embodiment of the present invention;

图6示出了根据本发明一个实施例的一种终端性能检测结果的展现方法示意图;FIG. 6 shows a schematic diagram of a method for presenting a terminal performance detection result according to an embodiment of the present invention;

图7示出了根据本发明一个实施例的一种终端性能检测结果的展现方法示意图;以及FIG. 7 shows a schematic diagram of a display method of a terminal performance detection result according to an embodiment of the present invention; and

图8示出了根据本发明一个实施例的一种终端性能检测结果的展现装置的结构图。Fig. 8 shows a structural diagram of an apparatus for displaying a terminal performance detection result according to an embodiment of the present invention.

具体实施方式detailed description

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

参照图1,示出了根据本发明一个实施例的一种终端性能的检测方法的流程图,具体可以包括:Referring to FIG. 1 , it shows a flow chart of a method for detecting terminal performance according to an embodiment of the present invention, which may specifically include:

步骤101、创建测试信息基类和测试执行基类;其中,所述测试信息基类用于描述测试用例的信息,所述测试执行基类用于执行测试用例;Step 101, create a test information base class and a test execution base class; wherein, the test information base class is used to describe the information of the test case, and the test execution base class is used to execute the test case;

步骤102、针对测试用例,从所述测试信息基类派生出对应的测试用例信息类,及,从所述测试执行基类派生出对应的测试用例执行类;其中,所述测试用例信息类在构造函数中传递的参数具体可以包括有当前测试用例的测试用例执行类名称;Step 102, for the test case, derive the corresponding test case information class from the test information base class, and derive the corresponding test case execution class from the test execution base class; wherein, the test case information class is in The parameters passed in the constructor can specifically include the name of the test case execution class of the current test case;

步骤103、对所述测试用例信息类进行实例化得到相应的测试用例对象;Step 103, instantiate the test case information class to obtain a corresponding test case object;

步骤104、针对所述测试用例对象,依据其对应的测试用例执行类名称获取对应的测试用例执行类,并调用所获取的测试用例执行类执行相应的测试用例。Step 104, for the test case object, obtain the corresponding test case execution class according to the corresponding test case execution class name, and call the obtained test case execution class to execute the corresponding test case.

本发明实施例可以应用于智能手机、平板电脑、笔记本电脑、PDA(个人数字助理,PersonalDigitalAssistant)等移动终端性能的检测,也可以应用于台式电脑等固定终端性能的检测,本发明实施例对具体的终端不加以限制。The embodiments of the present invention can be applied to the detection of the performance of mobile terminals such as smart phones, tablet computers, notebook computers, and PDAs (Personal Digital Assistants), and can also be applied to the detection of the performance of fixed terminals such as desktop computers. The terminal is not restricted.

现有终端性能的检测方法采用的是面向过程的设计,这里的面向过程就是分析出解决问题所需要的步骤,然后用函数把这些步骤一步一步实现,使用的时候一个一个依次调用就可以了。对于终端性能的检测,这样的行为在面向过程的设计中分散在了众多步骤中,有利于设计人员依据实际情况进行各种各样的简化,但是具有扩展性和灵活性差的缺点,具体表现在:如果测试需求发生了变化,则检测流程所需的众多步骤很有可能都需要改动,这就涉及到整体的代码段改动等等,而整体的代码段改动容易增加产品的开发周期,降低产品的开发效率。Existing terminal performance testing methods adopt a process-oriented design. The process-oriented design here is to analyze the steps needed to solve the problem, and then use functions to implement these steps step by step. When using them, they can be called one by one. For the detection of terminal performance, such behavior is scattered in many steps in the process-oriented design, which is beneficial for designers to make various simplifications according to the actual situation, but it has the disadvantages of poor scalability and flexibility, specifically shown in : If the test requirements change, many steps required for the detection process may need to be changed, which involves the overall code segment changes, etc., and the overall code segment changes are likely to increase the product development cycle and reduce product quality. development efficiency.

而本发明终端性能的检测方法采用的是面向对象的设计,这里的面向对象是把构成问题事务分解成各个对象,建立对象的目的不是为了完成一个步骤,而是为了描叙某个事物在整个解决问题的步骤中的行为。在面向对象的设计中,终端性能的检测这样的行为只可能在其实例化对象中出现,故如果测试需求发生了变化,则只需改动相应的实例化对象即可,改动只是局部的。However, the detection method of the terminal performance of the present invention adopts an object-oriented design. The object-oriented design here is to decompose the constituent problem affairs into each object. The purpose of establishing an object is not to complete a step, but to describe the overall Behavior in the steps to solve the problem. In the object-oriented design, the behavior of terminal performance detection can only appear in its instantiated object, so if the test requirements change, you only need to change the corresponding instantiated object, and the change is only partial.

在具体实现中,本发明通过采用面向对象的抽象方法,依据终端性能的检测属性抽象得到用于描述测试用例的信息的测试信息基类,及用于执行测试用例的测试执行基类;这样,通过采用面向对象的继承方法,只需针对测试用例配合使用所述测试信息基类的派生类和测试执行基类的派生类的实例化对象即可执行任意的测试用例。In the specific implementation, the present invention obtains the test information base class used to describe the information of the test case and the test execution base class used to execute the test case according to the detection attribute abstraction of the terminal performance by adopting an object-oriented abstract method; thus, By adopting the object-oriented inheritance method, any test case can be executed by using the derived class of the test information base class and the instantiated object of the derived class of the test execution base class in conjunction with the test case.

其中,对于抽象得到的测试信息基类,可以通过使用成员变量和成员函数来描述测试用例的信息;对于抽象得到的测试执行基类,可以通过使用成员变量和成员函数来描述测试用例的执行信息,这里测试用例的执行信息中可以包括具体的测试流程,例如,一个完整的测试流程具体可以包括:初始化、时间控制、界面控制、测评算法、释放空间等等。Among them, for the abstracted test information base class, the information of the test case can be described by using member variables and member functions; for the abstracted test execution base class, the execution information of the test case can be described by using member variables and member functions , where the execution information of the test case may include a specific test process, for example, a complete test process may specifically include: initialization, time control, interface control, evaluation algorithm, release space, and so on.

在本发明的一种优选实施例中,所述测试执行基类的成员函数具体可以包括:用于描述测试流程的测试流程函数;从所述测试执行基类派生出的测试用例执行类覆盖所述测试流程函数以执行相应测试用例的测试流程。In a preferred embodiment of the present invention, the member functions of the test execution base class may specifically include: a test process function used to describe the test process; a test case execution class derived from the test execution base class covers all Describe the test flow function to execute the test flow of the corresponding test case.

依据继承机制,对于从所述测试信息基类派生出对应的测试用例信息类,其可以自动继承所述测试信息基类的成员变量和成员函数,并且,其还可以通过构造函数来传递相应测试用例的参数;这里,测试用例的参数具体可以包括有当前测试用例的测试用例执行类名称。According to the inheritance mechanism, for the corresponding test case information class derived from the test information base class, it can automatically inherit the member variables and member functions of the test information base class, and it can also pass the corresponding test case through the constructor The parameters of the test case; here, the parameters of the test case may specifically include the name of the test case execution class of the current test case.

另外,可以理解,依据继承机制,测试用例信息类和测试用例执行类作为子类,在派生时,可以根据需要覆盖父类的成员函数来实现相应测试用例的私有信息,例如,测试用例执行类可以在测试流程函数中执行对应测试用例的评测流程算法等等。In addition, it can be understood that according to the inheritance mechanism, the test case information class and the test case execution class are used as subclasses. When deriving, the member functions of the parent class can be overwritten to realize the private information of the corresponding test case. For example, the test case execution class The evaluation process algorithm corresponding to the test case, etc. can be executed in the test process function.

由于测试用例信息类是从所述测试信息基类派生,测试用例执行类是从所述测试执行基类派生而来,这样,配合使用所述测试用例信息类和测试用例执行类的实例化对象即可执行任意的测试用例。Since the test case information class is derived from the test information base class, the test case execution class is derived from the test execution base class, so that the instantiated objects of the test case information class and the test case execution class are used in conjunction Any test case can be executed.

本发明具有如下优点:The present invention has the following advantages:

采用本发明的方案,如果测试需求发生了变化,则只需改动相应的实例化对象即可。With the solution of the present invention, if the test requirement changes, only the corresponding instantiated object needs to be changed.

例如,如果需要调整多个测试用例的执行顺序,只需调整多个测试用例对应所述测试信息基类的派生类的实例化对象的执行顺序即可,而无需调整具体的代码段,也就能够避免出现代码段出错的现象;For example, if it is necessary to adjust the execution order of multiple test cases, it is only necessary to adjust the execution order of the instantiated objects of the derived classes of the test information base class corresponding to the multiple test cases without adjusting the specific code segments. It can avoid the phenomenon of code segment errors;

又如,如果需要增加新测试用例,只需针对该新测试用例配合使用所述测试信息基类的派生类和测试执行基类的派生类的实例化对象即可,而无需重新编写一个完整测试流程所对应的代码段;As another example, if you need to add a new test case, you only need to use the derived class of the test information base class and the instantiated object of the derived class of the test execution base class for the new test case, without rewriting a complete test The code segment corresponding to the process;

总之,本发明终端性能的测试方案,能够灵活地进行多个测试用例,以及,能够方便地适应测试用例的任意增加、删除或顺序调整,总之,本发明能够提高终端性能测试的灵活性和扩展性。In a word, the test scheme of the terminal performance of the present invention can flexibly carry out multiple test cases, and can easily adapt to any addition, deletion or order adjustment of test cases. In a word, the present invention can improve the flexibility and expansion of the terminal performance test sex.

参照图2,示出了根据本发明一个实施例的一种终端性能的检测方法的流程图,具体可以包括:Referring to FIG. 2 , it shows a flow chart of a method for detecting terminal performance according to an embodiment of the present invention, which may specifically include:

步骤201、创建测试信息基类和测试执行基类;其中,所述测试信息基类用于描述测试用例的信息,所述测试执行基类用于执行测试用例;Step 201, create a test information base class and a test execution base class; wherein, the test information base class is used to describe the information of the test case, and the test execution base class is used to execute the test case;

步骤202、针对测试用例,从所述测试信息基类派生出对应的测试用例信息类,及,从所述测试执行基类派生出对应的测试用例执行类;其中,所述测试用例信息类在构造函数中传递的参数具体可以包括有当前测试用例的测试用例执行类名称;Step 202, for the test case, derive the corresponding test case information class from the test information base class, and derive the corresponding test case execution class from the test execution base class; wherein, the test case information class is in The parameters passed in the constructor can specifically include the name of the test case execution class of the current test case;

步骤203、对所述测试用例信息类进行实例化得到相应的测试用例对象;Step 203, instantiate the test case information class to obtain a corresponding test case object;

步骤204、将实例化得到的测试用例对象添加至列表,所述列表中测试用例对象的初始执行标志为未执行;Step 204, adding the instantiated test case object to the list, and the initial execution flag of the test case object in the list is not executed;

步骤205、从所述列表中获取执行标志为未执行的测试用例对象;Step 205, obtaining the test case object whose execution flag is not executed from the list;

步骤206、针对所述未执行的测试用例对象,依据其所关联的测试用例执行类名称获取对应的测试用例执行类,并调用所获取的测试用例执行类执行相应的测试用例;执行完成的测试用例对象对应的执行标志为已执行。Step 206, for the unexecuted test case object, obtain the corresponding test case execution class according to its associated test case execution class name, and call the obtained test case execution class to execute the corresponding test case; execute the completed test The execution flag corresponding to the use case object is executed.

本发明实施例将所有的测试用例对象添加至列表,在终端性能的检测过程中,只需逐一获取未执行的测试用例对象,并针对所获取的测试用例对象找到对应的测试用例执行类,就可以通过执行相应的测试用例得到想要的终端性能检测结果。在具体实现中,可以通过遍历列表的方式获取所述列表中获取执行标志为未执行的测试用例对象。并且,可以理解,可以在执行完一个测试用例对象后,将其执行标志修改为已执行。In the embodiment of the present invention, all test case objects are added to the list. In the detection process of the terminal performance, it is only necessary to obtain the unexecuted test case objects one by one, and find the corresponding test case execution class for the obtained test case objects. The desired terminal performance detection result can be obtained by executing the corresponding test case. In a specific implementation, test case objects whose execution flags are not executed in the list may be obtained by traversing the list. Moreover, it can be understood that after executing a test case object, its execution flag can be modified to have been executed.

参照图3,示出了根据本发明一个实施例的一种终端性能的检测方法的流程图,具体可以包括:Referring to FIG. 3 , it shows a flow chart of a method for detecting terminal performance according to an embodiment of the present invention, which may specifically include:

步骤301、创建测试信息基类和测试执行基类;其中,所述测试信息基类用于描述测试用例的信息,所述测试执行基类用于执行测试用例;所述测试执行基类具体可以包括:用于执行全屏测试用例的全屏测试基类和用于执行非全屏测试用例的非全屏测试基类;其中,所述全屏测试基类由Android系统的Activity类派生而来;所述测试用例的信息中具体可以包括有当前测试用例是否为全屏测试用例的检测方法;Step 301, create a test information base class and a test execution base class; wherein, the test information base class is used to describe the information of the test case, and the test execution base class is used to execute the test case; the test execution base class can specifically be Including: a full-screen test base class for performing a full-screen test case and a non-full-screen test base class for performing a non-full-screen test case; wherein, the full-screen test base class is derived from the Activity class of the Android system; the test case The specific information can include the detection method of whether the current test case is a full-screen test case;

步骤302、针对测试用例,从所述测试信息基类派生出对应的测试用例信息类,及,从所述测试执行基类派生出对应的测试用例执行类;其中,所述测试用例信息类在构造函数中传递的参数具体可以包括有当前测试用例的测试用例执行类名称;所述测试用例执行类具体可以包括:从所述全屏测试基类派生出的全屏测试用例执行类和从所述非全屏测试基类派生出的非全屏测试用例执行类;Step 302, for the test case, derive the corresponding test case information class from the test information base class, and derive the corresponding test case execution class from the test execution base class; wherein, the test case information class is in The parameters passed in the constructor can specifically include the test case execution class name of the current test case; the test case execution class can specifically include: the full screen test case execution class derived from the full screen test base class and the non- The non-full-screen test case execution class derived from the full-screen test base class;

步骤303、对所述测试用例信息类进行实例化得到相应的测试用例对象;Step 303, instantiate the test case information class to obtain the corresponding test case object;

步骤304、针对所述测试用例对象,依据其对应的测试用例执行类名称获取对应的测试用例执行类;Step 304, for the test case object, obtain the corresponding test case execution class according to its corresponding test case execution class name;

步骤305、通过调用所述测试用例对象中当前测试用例是否为全屏测试用例的检测方法,检测所述测试用例对象对应测试用例是否为全屏测试用例;Step 305: Detect whether the test case corresponding to the test case object is a full-screen test case by invoking the detection method of whether the current test case in the test case object is a full-screen test case;

步骤306、在所述测试用例对象对应测试用例为全屏测试用例时,调用对应的全屏测试用例执行类执行相应的测试用例;Step 306, when the test case corresponding to the test case object is a full-screen test case, call the corresponding full-screen test case execution class to execute the corresponding test case;

步骤307、在所述测试用例对象对应测试用例为非全屏测试用例时,调用对应的非全屏测试用例执行类执行相应的测试用例。Step 307, when the test case corresponding to the test case object is a non-full screen test case, call the corresponding non-full screen test case execution class to execute the corresponding test case.

目前的移动终端大多使用Android操作系统,首先对Android操作系统中Activity(活动)的原理进行说明。Android操作系统中,一个Activity是一个应用程序组件,其可用于提供一个屏幕,其还可用于交互以完成某项任务,例如拨号、拍照、发送email、看地图等;通常,每一个Activity被给予一个窗口,在该窗口上面可以绘制用户接口,窗口通常充满屏幕,但也可以小于屏幕而浮于其它窗口之上。Most of the current mobile terminals use the Android operating system. Firstly, the principle of Activity in the Android operating system will be described. In the Android operating system, an Activity is an application component that can be used to provide a screen, and it can also be used to interact to complete a certain task, such as dialing, taking pictures, sending emails, viewing maps, etc.; usually, each Activity is given A window on which the user interface can be drawn. The window usually fills the screen, but it can also be smaller than the screen and float on top of other windows.

目前能够测试的移动终端的性能具体可以包括:CPU整数性能、CPU浮点性能、2D绘图性能、3D绘图性能、数据库性能、存储系统等等。其中,2D绘图性能、3D绘图性能的测试属于前台全屏的测试,前台全屏的测试需要在自己的Activity中运行;而CPU整数性能、CPU浮点性能、数据库、存储系统等性能的测试属于后台非全屏的测试,后台非全屏的测试不需要在自己的Activity中运行。Currently, the performance of the mobile terminal that can be tested specifically may include: CPU integer performance, CPU floating-point performance, 2D drawing performance, 3D drawing performance, database performance, storage system, and the like. Among them, the tests of 2D drawing performance and 3D drawing performance belong to the full-screen test of the foreground. Full-screen tests and non-full-screen tests in the background do not need to be run in their own Activity.

因此,本发明实施例依据终端性能的测试属性,抽象出用于执行全屏测试用例的全屏测试基类和用于执行非全屏测试用例的非全屏测试基类;并且,由于全屏测试基类需要在自己的Activity中运行,故需要由Android系统的Activity类派生而来;另外,还可以针对测试用例,从全屏测试基类和非全屏测试基类派出对应的全屏测试用例执行类和非全屏测试用例执行类,并对其进行调用以执行相应的测试用例。Therefore, the embodiment of the present invention abstracts a full-screen test base class for executing full-screen test cases and a non-full-screen test base class for executing non-full-screen test cases according to the test attributes of terminal performance; It runs in its own Activity, so it needs to be derived from the Activity class of the Android system; in addition, for test cases, the corresponding full-screen test case execution class and non-full-screen test case can be dispatched from the full-screen test base class and non-full-screen test base class Execute the class, and call it to execute the corresponding test case.

需要说明的是,由于所述测试信息基类可以通过使用成员变量和成员函数来描述测试用例的信息,故在实际应用中,可以采用成员函数来描述当前测试用例是否为全屏测试用例的检测方法。例如,在本发明的一种应用示例中,可以采用成员函数publicBooleanisBackground()来检测当前测试用例是否为全屏测试用例,若是,则返回false,表示是全屏测试用例,否则返回true,表示是非全屏测试用例。这样,步骤305便可以使用所述测试用例对象的指针调用该成员函数,并返回相应的结果。It should be noted that since the test information base class can describe the information of the test case by using member variables and member functions, in practical applications, member functions can be used to describe the detection method of whether the current test case is a full-screen test case . For example, in an application example of the present invention, the member function publicBooleanisBackground() can be used to detect whether the current test case is a full-screen test case, if so, return false, indicating that it is a full-screen test case, otherwise return true, indicating that it is a non-full-screen test Example. In this way, step 305 can use the pointer of the test case object to call the member function and return the corresponding result.

在本发明的一种优选实施例中,所述调用对应的全屏测试用例执行类执行终端性能的测试的步骤306,具体可以包括:In a preferred embodiment of the present invention, the step 306 of calling the corresponding full-screen test case execution class to execute the terminal performance test may specifically include:

步骤S101、从当前活动创建并启动一个全屏测试类的对象,由该全屏测试类的对象执行相应的测试用例,并返回相应的测试结果给当前活动;Step S101, create and start an object of the full-screen test class from the current activity, execute the corresponding test case by the object of the full-screen test class, and return the corresponding test result to the current activity;

步骤S102、当前活动获取该新全屏测试类的对象返回的测试结果。Step S102, the current activity obtains the test result returned by the object of the new full-screen test class.

这里,当前活动用于表示全屏测试用例执行类的调用者,该当前活动一般表现为用于显示测试界面的主窗口;在全屏测试用例执行类的调用过程中,该当前活动主要用于通过创建并启动一个全屏测试类的对象来启动全屏测试所需的Activity,并且,等待该全屏测试类的对象返回相应的测试结果。Here, the current activity is used to indicate the caller of the full-screen test case execution class, and the current activity generally appears as the main window for displaying the test interface; during the calling process of the full-screen test case execution class, the current activity is mainly used to create And start an object of the full-screen test class to start the activity required by the full-screen test, and wait for the object of the full-screen test class to return the corresponding test result.

在具体实现中,可以通过startActivityForResult(Intentintent,intrequestCode)从当前活动创建并启动一个全屏测试类的对象。其中,Intent为Android的意图类,intent是意图类的一个对象,其用于传递启动一个全屏测试类的对象所需的参数,该参数中指定有需要启动的全屏测试类的对象的类名(该类名也即步骤304中测试用例执行类名);requestCode的值是自定义的,可用于识别需要启动的全屏测试类的对象。In a specific implementation, an object of a full-screen test class can be created and started from the current activity through startActivityForResult(Intentintent, intrequestCode). Among them, Intent is the intent class of Android, and intent is an object of the intent class, which is used to pass the parameters required to start an object of a full-screen test class, which specifies the class name of the object of the full-screen test class that needs to be started ( The class name is also the test case execution class name in step 304); the value of requestCode is self-defined and can be used to identify the object of the full-screen test class that needs to be started.

对于全屏测试类而言,由于其针对测试用例从所述全屏测试基类派生得到,故其描述有具体的测试流程;该全屏测试类的对象可依据全屏测试类实例化得到,其可以依据所描述的测试流程,执行相应的测试用例。For the full-screen test class, because it derives from the full-screen test base class for the test case, it describes a specific test process; the object of the full-screen test class can be instantiated according to the full-screen test class, and it can be obtained according to the full-screen test class. Describe the test process and execute the corresponding test cases.

在具体实现中,该全屏测试类的对象可以通过setResult(intresultCode,Intentdata)保存测试结果,并通过调用当前活动的onActivityResult(intrequestCode,intresultCode,Intentdata)来返回所保存的测试结果。其中,如果该全屏测试类的对象可能有几种不同的测试结果返回,可以用resultCode参数予以识别区分,data用于表示返回的数据,onActivityResult(intrequestCode,intresultCode,Intentdata)为当前活动的回调函数。In a specific implementation, the object of the full-screen test class can save the test result through setResult(intresultCode, Intentdata), and return the saved test result by calling onActivityResult(intrequestCode, intresultCode, Intentdata) of the current activity. Among them, if the object of the full-screen test class may have several different test results returned, the resultCode parameter can be used to identify and distinguish, data is used to indicate the returned data, and onActivityResult(intrequestCode, intresultCode, Intentdata) is the callback function of the current activity.

进一步,当前活动可以依据resultCode参数和data参数,获取该新全屏测试类的对象返回的测试结果。Further, the current activity can obtain the test result returned by the object of the new full-screen test class according to the resultCode parameter and the data parameter.

在本发明的另一种优选实施例中,所述调用对应的非全屏测试用例执行类执行终端性能的测试的步骤307,具体可以包括:In another preferred embodiment of the present invention, the step 307 of calling the corresponding non-full-screen test case execution class to execute the terminal performance test may specifically include:

步骤S201、对所述非全屏测试用例执行类进行实例化得到相应的非全屏测试用例对象;Step S201, instantiate the non-full-screen test case execution class to obtain a corresponding non-full-screen test case object;

步骤S202、创建后台测试线程,将所述非全屏测试用例对象传递进该后台测试线程;Step S202, creating a background test thread, and passing the non-full-screen test case object into the background test thread;

步骤S203、启动该后台测试线程执行相应的测试用例。Step S203, start the background test thread to execute the corresponding test case.

假设所述非全屏测试用例执行类的名称为BackgroundTest,当前测试用例对象的指针为pointer,则步骤S201可以通过BackgroundTestertester=pointer.getBackgroundTester(intent)来实现,其中,intent负责对应用中一次操作的动作、动作涉及数据、附加数据进行描述;Assuming that the name of the non-full-screen test case execution class is BackgroundTest, and the pointer of the current test case object is pointer, then step S201 can be realized by BackgroundTestertester=pointer.getBackgroundTester(intent), wherein the intent is responsible for the action of an operation in the application , Action related data, additional data for description;

由于非全屏测试是在后台运行,为了不影响前台界面更新,,所以需要一个后台测试线程来完成,在本发明的一种应用示例中,步骤S202可以通过BackgroundTestThreadthread=newBackgroundTestThread(tester)来实现。其中,BackgroundTestThread为从Thread类派生出的线程类,并且,在实例化BackgroundTestThread的对象thread的过程中,可以在BackgroundTestThread的构造函数中传递所述非全屏测试用例对象,由所述非全屏测试用例对象在run()方法中进行测试,并通知前台界面;这里,run()方法在一种循环下,使线程一直运行,直到不满足条件为止。Since the non-full-screen test is running in the background, in order not to affect the update of the foreground interface, a background test thread is needed to complete. In an application example of the present invention, step S202 can be realized by BackgroundTestThreadthread=newBackgroundTestThread(tester). Wherein, BackgroundTestThread is a thread class derived from the Thread class, and, in the process of instantiating the object thread of BackgroundTestThread, the non-full-screen test case object can be passed in the constructor of BackgroundTestThread, by the non-full-screen test case object Test in the run() method and notify the foreground interface; here, the run() method keeps the thread running in a loop until the condition is not met.

步骤S203可以通过thread.start()来实现,在执行thread.start()后,thread会自动执行run()方法;可以理解,在执行thread.start()之前,还可以通过thread.setPriority(Thread.MAX_PRIORITY)将thread的优先级设置为最大,使其优先执行。Step S203 can be realized by thread.start(). After executing thread.start(), thread will automatically execute the run() method; it can be understood that before executing thread.start(), thread.setPriority(Thread .MAX_PRIORITY) sets the priority of the thread to the maximum, making it execute first.

在上述方法实施例中,对各个方法实施例的描述都各有侧重,某个方法实施例中没有详述的部分,可以参见其他方法实施例的相关描述即可。In the above method embodiments, the description of each method embodiment has its own emphases, and for the part not described in detail in a certain method embodiment, you can refer to the relevant descriptions of other method embodiments.

并且,本领域技术人员易于想到的是:上述方法实施例的任意组合应用都是可行的,但是由于篇幅限制,本说明书在此就不一一详述了。Moreover, those skilled in the art can readily imagine that any combination of the above method embodiments is feasible, but due to space limitations, this specification will not describe them in detail here.

最后,需要补充的是,在本发明的一种优选实施例中,所述测试执行基类的成员函数具体可以包括如下测试属性函数中的一项或多项:用于描述执行当前测试用例前需要等待的时间的第一等待函数,用于描述当前测试用例的执行轮数的轮数函数,及,用于描述执行每轮当前测试用例前需要等待的时间的第二等待函数;Finally, it needs to be added that, in a preferred embodiment of the present invention, the member functions of the test execution base class may specifically include one or more of the following test attribute functions: The first waiting function of the time to wait is used to describe the round number function of the number of execution rounds of the current test case, and the second waiting function is used to describe the time to wait before executing each round of the current test case;

从所述测试执行基类派生出的测试用例执行类覆盖所述测试属性函数以执行相应测试用例的测试属性。The test case execution class derived from the test execution base class overrides the test attribute function to execute the test attribute of the corresponding test case.

在实际应用中,一个测试用例可能需要测试多轮。以CPU浮点性能的测试为例,为了使测试结果更稳定,就需要多执行几轮;也即,本发明实施例中,执行轮数针对的是同一个测试用例;第二等待函数也就是每轮测试用例之间的等待时间;In practical applications, a test case may require multiple rounds of testing. Taking the test of CPU floating-point performance as an example, in order to make the test result more stable, it is necessary to perform several more rounds; that is, in the embodiment of the present invention, the number of execution rounds is aimed at the same test case; the second waiting function is The waiting time between each round of test cases;

另外,由于测试用例的个性,可能需要一定时间来做准备工作,如测试流程中的初始化和释放空间等工作都算准备工作,因此,为了提高测试结果的稳定性,第一等待函数可用于表示不同测试用例之间的等待时间。In addition, due to the individuality of the test case, it may take a certain amount of time to do the preparatory work, such as the initialization and release of space in the test process are considered as the preparatory work. Therefore, in order to improve the stability of the test results, the first waiting function can be used to represent Waiting time between different test cases.

可以理解,本领域技术人员可以根据时间需要,设置所述第一等待函数和第二等待时间对应的时间数值,本发明对此不加以限制。It can be understood that those skilled in the art can set the time values corresponding to the first waiting function and the second waiting time according to time requirements, which is not limited in the present invention.

另外,为了便于测试人员对于测试的监控,在本发明的另一种优选实施例中,所述测试用例的信息中还可以包括有当前测试用例的描述信息;In addition, in order to facilitate testers to monitor the test, in another preferred embodiment of the present invention, the information of the test case may also include description information of the current test case;

则所述方法还可以包括:Then described method can also comprise:

步骤S301、获取所述测试用例对象对应的测试用例的描述信息;Step S301, obtaining description information of a test case corresponding to the test case object;

步骤S302、将所述测试用例对象对应的测试用例的描述信息显示到测试界面上;Step S302, displaying the description information of the test case corresponding to the test case object on the test interface;

步骤S303、更新所述测试界面上的进度信息。Step S303, updating the progress information on the test interface.

假设测试信息基类的成员函数getTitle()用于返回测试用例描述,假设当前测试用例对象的指针为pointer,那么,步骤S301可以通过Stringtag=pointer.getTitle()来实现,步骤302可以通过txtItem.setText(String.format(strProgressArg,tag,index,list.size()))来实现,步骤S303可以通过benchHandler.post(progressUpdater)来实现。其中,Assuming that the member function getTitle() of the test information base class is used to return the test case description, and assuming that the pointer of the current test case object is pointer, then step S301 can be realized through Stringtag=pointer.getTitle(), and step 302 can be realized through txtItem. setText(String.format(strProgressArg,tag,index,list.size())), step S303 can be realized through benchHandler.post(progressUpdater). in,

txtItem是一个TextView控件;txtItem is a TextView control;

setText()用于设置欲要显示的文字;setText() is used to set the text to be displayed;

benchHandler是一个消息处理Handler,因为非UI(用户界面,UserInterface)线程中不能更新UI控件,所以必须通过消息来处理;benchHandler is a message processing Handler, because UI controls cannot be updated in non-UI (user interface, UserInterface) threads, so they must be processed through messages;

post()用于发送一个消息;post() is used to send a message;

progressUpdater是一个UpdateProgressHandler,它派生自Runnable,是Java线程的另一种实现方式,post()需要一个Runnable对象作为参数,它的具体作用就是通知benchHandler来更新界面。progressUpdater is an UpdateProgressHandler, which is derived from Runnable and is another implementation of Java threads. post() requires a Runnable object as a parameter, and its specific function is to notify benchHandler to update the interface.

本优选实施例通过在测试界面上显示测试用例的描述信息及测试用例的执行进度信息,以实现测试的监控。In this preferred embodiment, the test monitoring is realized by displaying the description information of the test case and the execution progress information of the test case on the test interface.

为使本领域技术人员更好地理解本发明,在此提供根据本发明一个实施例的一种终端性能的检测方法的示例,具体可以包括:In order for those skilled in the art to better understand the present invention, an example of a terminal performance detection method according to an embodiment of the present invention is provided here, which may specifically include:

步骤S401、创建测试信息基类和测试执行基类;其中,所述测试信息基类用于描述测试用例的信息,所述测试执行基类用于执行测试用例;所述测试执行基类具体可以包括:用于执行全屏测试用例的全屏测试基类和用于执行非全屏测试用例的非全屏测试基类;其中,所述全屏测试基类由Android系统的Activity类派生而来;所述测试用例的信息中具体可以包括有当前测试用例是否为全屏测试用例的检测方法;Step S401, create a test information base class and a test execution base class; wherein, the test information base class is used to describe the information of the test case, and the test execution base class is used to execute the test case; the test execution base class can specifically be Including: a full-screen test base class for performing a full-screen test case and a non-full-screen test base class for performing a non-full-screen test case; wherein, the full-screen test base class is derived from the Activity class of the Android system; the test case The specific information can include the detection method of whether the current test case is a full-screen test case;

参照表1,示出了根据本发明一个实施例的一种测试信息基类Case的成员变量的示例。Referring to Table 1, it shows an example of member variables of a test information base class Case according to an embodiment of the present invention.

表1Table 1

成员变量名称member variable name 成员变量类型member variable type 成员变量描述Member variable description Tagtag StringString 测试用例名称test case name Packagepackage StringString 测试用例包名Test case package name BACKGROUNDTESTERBackground Tester BackgroundTesterBackground Tester BackgroundTester的对象Object of BackgroundTester testertester TesterTester Tester的对象Object of Tester mRepeatNowmRepeatNow IntegerInteger 重复测试次数Number of repeated tests Intentintent Intentintent 用于保存传递的参数Used to save the passed parameters contextcontext ContextContext 上下文the context

参照表2,示出了根据本发明一个实施例的一种测试信息基类Case的成员函数的示例。Referring to Table 2, it shows an example of member functions of a test information base class Case according to an embodiment of the present invention.

表2Table 2

参照表3,示出了根据本发明一个实施例的一种全屏测试基类和非全屏测试基类的成员函数的示例。Referring to Table 3, it shows an example of member functions of a full-screen test base class and a non-full-screen test base class according to an embodiment of the present invention.

表3table 3

成员函数名称member function name 成员函数名称类型member function name type 成员函数描述Member function description getTag()getTag() StringString 设置评测用例TagSet the evaluation use case Tag sleepBeforeStart()sleepBeforeStart() intint 第一等待函数first wait function sleepBetweenRoundsleepBetweenRound intint 第二等待函数second wait function oneRound()oneRound() voidvoid 测试流程函数Test process function

步骤S402、针对测试用例,从所述测试信息基类派生出对应的测试用例信息类,从所述全屏测试基类派生出对应的全屏测试用例执行类,及,从所述全屏测试基类派生出对应的全屏测试用例执行类;其中,所述测试用例信息类在构造函数中传递的参数具体可以包括有当前测试用例的测试用例执行类名称;Step S402, for the test case, derive the corresponding test case information class from the test information base class, derive the corresponding full screen test case execution class from the full screen test base class, and derive from the full screen test base class Go out corresponding full-screen test case execution class; Wherein, the parameter that described test case information class transmits in the constructor can specifically include the test case execution class name of current test case;

下面分别以2D性能和CPU整数的测试用例为例,说明从所述测试信息基类派生出对应的测试用例信息类的实现过程:The following takes the test cases of 2D performance and CPU integer as examples to illustrate the implementation process of deriving the corresponding test case information class from the test information base class:

测试信息基类派生1、Test information base class derivation 1,

新建一个Case2D类,用于描述2D性能对应测试用例的信息,该类派生于测试信息基类Case。Create a new Case2D class to describe the information of the 2D performance corresponding to the test case, which is derived from the test information base class Case.

测试信息基类派生2、Test information base class derivation 2,

新建一个CaseCPUInteger类,用于描述CPU整数性能对应测试用例的信息,该类派生于测试信息基类Case。Create a new CaseCPUInteger class to describe the information of the CPU integer performance corresponding to the test case. This class is derived from the test information base class Case.

假设全屏测试基类为Tester,下面以2D性能对应测试用例为例,说明从所述全屏测试基类派生出对应的全屏测试用例执行类OpenGLTest的示例,由于是全屏测试用例,所以OpenGLTest从Tester类派生并实现了父类Tester和祖父类Activity的对应接口:Assuming that the full-screen test base class is Tester, the following uses the 2D performance corresponding test case as an example to illustrate the example of deriving the corresponding full-screen test case execution class OpenGLTest from the full-screen test base class. Since it is a full-screen test case, OpenGLTest derives from the Tester class Derived and implemented the corresponding interface of parent class Tester and grandparent class Activity:

假设非全屏测试基类为BackgroundTester,下面以CPU整数性能对应测试用例为例,说明从所述非全屏测试基类派生出对应的非全屏测试用例执行类TesterCPUInteger的示例:Assuming that the non-full-screen test base class is BackgroundTester, the following takes the test case corresponding to the CPU integer performance as an example to illustrate an example of deriving the corresponding non-full-screen test case execution class TesterCPUInteger from the non-full-screen test base class:

步骤S403、对所述测试用例信息类进行实例化得到相应的测试用例对象;Step S403, instantiate the test case information class to obtain a corresponding test case object;

在此,以2D性能和CPU整数性能对应测试用例信息类的实例化为例进行说明:Here, take the instantiation of the test case information class corresponding to 2D performance and CPU integer performance as an example for illustration:

Casegraphics2d=newCase2D(this);Casegraphics2d = newCase2D(this);

Casecpuint=newCaseCPUInteger(this);Casecpuint=newCaseCPUInteger(this);

也即,graphics2d和cpuint分别为2D性能和CPU整数性能对应的测试用例对象。That is, graphics2d and cpuint are test case objects corresponding to 2D performance and CPU integer performance respectively.

步骤S404、将实例化得到的测试用例对象添加至列表,所述列表中测试用例对象的初始执行标志为未执行;Step S404, adding the instantiated test case object to the list, and the initial execution flag of the test case object in the list is not executed;

步骤S405、从所述列表中获取执行标志为未执行的测试用例对象;Step S405, obtaining test case objects whose execution flags are not executed from the list;

步骤S406、针对所述未执行的测试用例对象,依据其所关联的测试用例执行类名称获取对应的测试用例执行类;Step S406, for the unexecuted test case object, obtain the corresponding test case execution class according to the associated test case execution class name;

需要说明的是,由于在实例化对象时调用类的构造函数,以Case2D的实例化为例,其构造函数如下:It should be noted that since the constructor of the class is called when the object is instantiated, taking the instantiation of Case2D as an example, its constructor is as follows:

Case2D(Contextcontext){Case2D(Context context){

super(context,"Case2D","OpenGLTest",1,1);super(context,"Case2D","OpenGLTest",1,1);

}}

其中,context,"Case2D","OpenGLTest",1,1均为在构造函数中传递的参数,其中,"Case2D"为测试用例的名称,"OpenGLTest"为测试用例执行类名称,故可以获取对应的测试用例执行类。Among them, context, "Case2D", "OpenGLTest", 1, 1 are the parameters passed in the constructor, where "Case2D" is the name of the test case, and "OpenGLTest" is the name of the test case execution class, so you can get the corresponding The test case execution class.

步骤S407、利用所述未执行的测试用例对象的指针,获取所述测试用例对象对应的测试用例的描述信息,将所述测试用例对象对应的测试用例的描述信息显示到测试界面上,并更新所述测试界面上的进度信息;Step S407, using the pointer of the unexecuted test case object to obtain the description information of the test case corresponding to the test case object, display the description information of the test case corresponding to the test case object on the test interface, and update Progress information on the test interface;

步骤S408、利用所述未执行的测试用例对象的指针,调用所述测试用例对象中当前测试用例是否为全屏测试用例的检测方法,检测所述未执行的测试用例对象对应测试用例是否为全屏测试用例;Step S408, using the pointer of the unexecuted test case object, calling the detection method of whether the current test case in the test case object is a full-screen test case, and detecting whether the test case corresponding to the unexecuted test case object is a full-screen test Example;

步骤S409、在所述未执行的测试用例对象对应测试用例为全屏测试用例时,调用对应的全屏测试用例执行类执行相应的测试用例;Step S409, when the test case corresponding to the unexecuted test case object is a full-screen test case, call the corresponding full-screen test case execution class to execute the corresponding test case;

步骤S410、在所述未执行的测试用例对象对应测试用例为非全屏测试用例时,调用对应的非全屏测试用例执行类执行相应的测试用例。Step S410, when the test case corresponding to the unexecuted test case object is a non-full-screen test case, call the corresponding non-full-screen test case execution class to execute the corresponding test case.

步骤S408-步骤S410的相关代码示例如下:The relevant code examples of step S408-step S410 are as follows:

参照图4,示出了根据本发明一个实施例的一种终端性能的检测装置的结构图,具体可以包括:Referring to FIG. 4 , it shows a structural diagram of an apparatus for detecting terminal performance according to an embodiment of the present invention, which may specifically include:

基类创建模块401,适于创建测试信息基类和测试执行基类;其中,所述测试信息基类用于描述测试用例的信息,所述测试执行基类用于执行测试用例;The base class creation module 401 is adapted to create a test information base class and a test execution base class; wherein, the test information base class is used to describe the information of the test case, and the test execution base class is used to execute the test case;

派生模块402,适于针对测试用例,从所述测试信息基类派生出对应的测试用例信息类,及,从所述测试执行基类派生出对应的测试用例执行类;其中,所述测试用例信息类在构造函数中传递的参数包括当前测试用例的测试用例执行类名称;The derivation module 402 is adapted to derive a corresponding test case information class from the test information base class for a test case, and derive a corresponding test case execution class from the test execution base class; wherein, the test case The parameters passed in the constructor of the information class include the test case execution class name of the current test case;

实例化模块403,适于对所述测试用例信息类进行实例化得到相应的测试用例对象;The instantiation module 403 is adapted to instantiate the test case information class to obtain a corresponding test case object;

对象执行类获取模块404,适于针对所述测试用例对象,依据其对应的测试用例执行类名称获取对应的测试用例执行类;及The object execution class acquisition module 404 is adapted to obtain the corresponding test case execution class according to the corresponding test case execution class name for the test case object; and

对象测试用例执行模块405,适于调用所获取的测试用例执行类执行相应的测试用例。The object test case execution module 405 is adapted to call the obtained test case execution class to execute the corresponding test case.

在本发明的一种优选实施例中,所述装置还可以包括:In a preferred embodiment of the present invention, the device may also include:

对象添加模块,适于将实例化得到的测试用例对象添加至列表,所述列表中测试用例对象的初始执行标志为未执行;The object adding module is adapted to add the instantiated test case object to the list, and the initial execution flag of the test case object in the list is not executed;

未执行对象获取模块,适于从所述列表中获取执行标志为未执行的测试用例对象;An unexecuted object acquisition module, adapted to acquire the test case object whose execution flag is unexecuted from the list;

未执行对象执行模块,适于针对所述未执行的测试用例对象,依据其所关联的测试用例执行类名称获取对应的测试用例执行类,并调用所获取的测试用例执行类执行相应的测试用例。The unexecuted object execution module is suitable for obtaining the corresponding test case execution class according to the associated test case execution class name for the unexecuted test case object, and calling the obtained test case execution class to execute the corresponding test case .

在本发明的另一种优选实施例中,所述测试执行基类具体可以包括:用于执行全屏测试用例的全屏测试基类和用于执行非全屏测试用例的非全屏测试基类;其中,所述全屏测试基类由Android系统的Activity类派生而来;In another preferred embodiment of the present invention, the test execution base class may specifically include: a full-screen test base class for executing a full-screen test case and a non-full-screen test base class for executing a non-full-screen test case; wherein, The full-screen test base class is derived from the Activity class of the Android system;

则所述测试用例执行类具体可以包括:从所述全屏测试基类派生出的全屏测试用例执行类和从所述非全屏测试基类派生出的非全屏测试用例执行类。The test case execution class may specifically include: a full-screen test case execution class derived from the full-screen test base class and a non-full-screen test case execution class derived from the non-full-screen test base class.

所述测试用例的信息中还可以包括有当前测试用例是否为全屏测试用例的检测方法;The information of the test case can also include a detection method of whether the current test case is a full-screen test case;

则所述对象测试用例执行模块405具体可以包括:Then the object test case execution module 405 may specifically include:

全屏检测子模块,适于通过调用所述测试用例对象中当前测试用例是否为全屏测试用例的检测方法,检测所述测试用例对象对应测试用例是否为全屏测试用例;The full-screen detection submodule is adapted to detect whether the test case corresponding to the test case object is a full-screen test case by calling a detection method whether the current test case in the test case object is a full-screen test case;

全屏调用子模块,适于在所述测试用例对象对应测试用例为全屏测试用例时,调用对应的全屏测试用例执行类执行相应的测试用例;The full-screen call submodule is suitable for calling the corresponding full-screen test case execution class to execute the corresponding test case when the test case corresponding to the test case object is a full-screen test case;

非全屏调用子模块,适于在所述测试用例对象对应测试用例为非全屏测试用例时,调用对应的非全屏测试用例执行类执行相应的测试用例。The non-full-screen calling submodule is suitable for invoking the corresponding non-full-screen test case execution class to execute the corresponding test case when the test case corresponding to the test case object is a non-full-screen test case.

在本发明的再一种优选实施例中,所述全屏调用子模块具体可以包括:In yet another preferred embodiment of the present invention, the full-screen calling submodule may specifically include:

对象创建单元,适于从当前活动创建并启动一个全屏测试类的对象,由该全屏测试类的对象执行相应的测试用例,并返回相应的测试结果给当前活动;及The object creation unit is adapted to create and start an object of a full-screen test class from the current activity, execute corresponding test cases by the object of the full-screen test class, and return corresponding test results to the current activity; and

结果获取单元,适于当前活动获取该新全屏测试类的对象返回的测试结果。The result acquisition unit is suitable for the current activity to acquire the test result returned by the object of the new full-screen test class.

在本发明的一种优选实施例中,所述非全屏调用子模块具体可以包括:In a preferred embodiment of the present invention, the non-full screen calling submodule may specifically include:

非全屏实例化单元,适于对所述非全屏测试用例执行类进行实例化得到相应的非全屏测试用例对象;A non-full-screen instantiation unit, adapted to instantiate the non-full-screen test case execution class to obtain a corresponding non-full-screen test case object;

线程创建传递单元,适于创建后台测试线程,将所述非全屏测试用例对象传递进该后台测试线程;及A thread creation transfer unit is adapted to create a background test thread, and transfer the non-full-screen test case object into the background test thread; and

线程启动单元,适于启动该后台测试线程执行相应的测试用例。The thread starting unit is suitable for starting the background test thread to execute corresponding test cases.

在本发明的另一种优选实施例中,所述测试执行基类的成员函数具体可以包括:用于描述测试流程的测试流程函数;从所述测试执行基类派生出的测试用例执行类覆盖所述测试流程函数以执行相应测试用例的测试流程。In another preferred embodiment of the present invention, the member functions of the test execution base class may specifically include: a test process function used to describe the test process; a test case execution class derived from the test execution base class to cover The test process function is used to execute the test process of the corresponding test case.

在本发明的再一种优选实施例中,所述测试执行基类的成员函数具体可以包括如下测试属性函数中的一项或多项:用于描述执行当前测试用例前需要等待的时间的第一等待函数,用于描述当前测试用例的执行轮数的轮数函数,及,用于描述执行每轮当前测试用例前需要等待的时间的第二等待函数;In yet another preferred embodiment of the present invention, the member functions of the test execution base class may specifically include one or more of the following test attribute functions: the first parameter used to describe the waiting time before executing the current test case A waiting function, which is used to describe the number of rounds function of the number of execution rounds of the current test case, and the second waiting function used to describe the time to wait before executing each round of the current test case;

则在具体实现中,可以从所述测试执行基类派生出的测试用例执行类覆盖所述测试属性函数以执行相应测试用例的测试属性。Then in a specific implementation, the test case execution class derived from the test execution base class may override the test attribute function to execute the test attribute of the corresponding test case.

参照图5,示出了根据本发明一个实施例的一种终端性能的检测结果显示方法的流程图,具体可以包括:Referring to FIG. 5 , it shows a flow chart of a method for displaying a terminal performance detection result according to an embodiment of the present invention, which may specifically include:

步骤501、创建测试信息基类和测试执行基类;其中,所述测试信息基类用于描述测试用例的信息,所述测试执行基类用于执行测试用例;Step 501, create a test information base class and a test execution base class; wherein, the test information base class is used to describe the information of the test case, and the test execution base class is used to execute the test case;

步骤502、针对测试用例,从所述测试信息基类派生出对应的测试用例信息类,及,从所述测试执行基类派生出对应的测试用例执行类;其中,所述测试用例信息类在构造函数中传递的参数包括当前测试用例的测试用例执行类名称;Step 502, for the test case, derive the corresponding test case information class from the test information base class, and derive the corresponding test case execution class from the test execution base class; wherein, the test case information class is in The parameters passed in the constructor include the test case execution class name of the current test case;

步骤503、对所述测试用例信息类进行实例化得到相应的测试用例对象;Step 503, instantiate the test case information class to obtain the corresponding test case object;

步骤504、针对所述测试用例对象,依据其对应的测试用例执行类名称获取对应的测试用例执行类,并调用所获取的测试用例执行类执行相应的测试用例,得到相应的终端性能检测结果;Step 504, for the test case object, obtain the corresponding test case execution class according to its corresponding test case execution class name, and call the obtained test case execution class to execute the corresponding test case, and obtain the corresponding terminal performance detection result;

步骤505、依据用户界面上的终端性能检测结果触发的请求,展现所述终端性能检测结果。Step 505: Present the terminal performance detection result according to the request triggered by the terminal performance detection result on the user interface.

在本发明的一种应用示例中,可以依据用户界面上的终端性能检测结果的触发请求,将所述终端性能检测结果展现于当前终端的UI之上,以供用户查看;用户依据所述展现的所述终端性能检测结果可以获知当前终端的性能,例如,当前终端的所述终端性能检测结果可以作为用户是否购买当前终端的因素之一,或者,多个终端的所述终端性能检测结果可以作为多个终端性能的比较因素之一。总之,本发明可以通过展现终端性能检测结果,以向用户显示反馈一个比较真实的终端性能检测结果。In an application example of the present invention, according to the trigger request of the terminal performance detection result on the user interface, the terminal performance detection result can be displayed on the UI of the current terminal for the user to view; The terminal performance detection result of the current terminal can know the performance of the current terminal, for example, the terminal performance detection result of the current terminal can be used as one of the factors for the user to purchase the current terminal, or the terminal performance detection results of multiple terminals can be As one of the comparison factors for the performance of multiple terminals. In a word, the present invention can display and feed back a relatively real terminal performance detection result to the user by displaying the terminal performance detection result.

需要说明的是,用户界面上的终端性能检测结果触发的请求可以通过鼠标、键盘、触摸手势等用户操作产生,该用户操作具体可以针对用户界面上的按钮等具有触发功能的界面元素得到。It should be noted that the request triggered by the terminal performance detection result on the user interface may be generated through user operations such as mouse, keyboard, and touch gestures, and the user operation may specifically be obtained for an interface element with a trigger function such as a button on the user interface.

参照图6,示出了根据本发明一个实施例的一种终端性能检测结果的展现方法示意图,其中,用户可以通过界面上的“开始评分”按钮发出数据库性能检测触发的请求,那么本发明实施可以依据该请求执行步骤601-604所涉及的终端性能的检测,同时在界面上显示终端性能的检测进度,其中87%就是检测进度的一个示例。在发出该请求后,界面上的“开始评分”按钮变为“停止评分”按钮,可以理解,用户可以通过点击“停止评分”按钮来停止当前的数据库性能的检测。另外,在检测进度达到100%后,本发明可以自动显示相应的终端性能检测结果,或者,本发明可以依据用户界面上的终端性能检测结果触发的请求(如点击除“开始评分”按钮或“停止评分”按钮之外的其它按钮),展现相应的终端性能检测结果,如在检测进度达到100%后,界面上的“停止评分”按钮变为“查看评分”按钮,可以理解,用户可以通过点击“查看评分”按钮来触发终端性能检测结果的展现。Referring to FIG. 6 , it shows a schematic diagram of a method for displaying terminal performance test results according to an embodiment of the present invention, wherein the user can send a request for database performance test trigger through the "Start Scoring" button on the interface, then the present invention implements The terminal performance detection involved in steps 601-604 may be performed according to the request, and at the same time, the detection progress of the terminal performance is displayed on the interface, 87% of which is an example of the detection progress. After the request is sent, the "start scoring" button on the interface becomes a "stop scoring" button. It can be understood that the user can stop the current database performance detection by clicking the "stop scoring" button. In addition, after the detection progress reaches 100%, the present invention can automatically display the corresponding terminal performance detection result, or, the present invention can trigger a request based on the terminal performance detection result on the user interface (such as clicking the button other than "start scoring" or " button other than the "Stop Scoring" button) to display the corresponding terminal performance testing results. For example, after the testing progress reaches 100%, the "Stop Scoring" button on the interface changes to the "View Scoring" button. It is understandable that the user can pass Click the "View Score" button to trigger the display of the terminal performance test results.

可以理解,所述终端性能检测结果可以单独展现某个终端性能的检测结果,也可以展现多个终端性能的检测结果;或者,在先后执行多个终端性能对应测试用例时,也可以先后展现该多个终端性能的检测结果;总之,本发明对具体的展现方式不加以限制。It can be understood that the terminal performance detection result may display the detection result of a certain terminal performance alone, or may display the detection results of multiple terminal performances; The detection results of multiple terminal performances; in short, the present invention does not limit the specific presentation manner.

参照图7,示出了根据本发明一个实施例的一种终端性能检测结果的展现方法示意图,其将终端性能的检测结果以得分的形式展现,展现的终端性能具体可以包括:CPU整数性能、CPU浮点性能、2D绘图性能、3D绘图性能、数据库IO(输入输出,Input/output)性能、SD卡写入速度、SD卡读取速度等性能的得分,以及终端性能的总分(总体性能的得分)。Referring to FIG. 7 , it shows a schematic diagram of a display method of a terminal performance detection result according to an embodiment of the present invention, which displays the detection result of the terminal performance in the form of scores, and the displayed terminal performance may specifically include: CPU integer performance, CPU floating-point performance, 2D drawing performance, 3D drawing performance, database IO (input/output) performance, SD card writing speed, SD card reading speed and other performance scores, as well as the total score of terminal performance (overall performance score).

在本发明的一些实施例中,检测客户端可以将当前终端的终端性能检测结果上报给检测服务器,并且,检测服务器还可以将多种终端样本的终端性能检测结果下发给检测客户端,由检测客户端展现给用户,以方便用户获知当前移动终端的终端性能检测结果在多种终端样本中的排名等等。In some embodiments of the present invention, the detection client can report the terminal performance detection results of the current terminal to the detection server, and the detection server can also send the terminal performance detection results of various terminal samples to the detection client, by The detection client is presented to the user, so that the user can know the ranking of the terminal performance detection results of the current mobile terminal among various terminal samples, and the like.

可以理解,本领域技术人员可以采用各种展现方式将所述终端性能检测结果于各种位置,本发明实施例对所述终端性能检测结果的展现位置与具体的展现方式不加以限制。It can be understood that those skilled in the art may display the terminal performance detection result at various locations in various display manners, and the embodiment of the present invention does not limit the display location and specific display manner of the terminal performance detection result.

参照图8,示出了根据本发明一个实施例的一种终端性能的检测结果显示装置的结构图,具体可以包括:Referring to FIG. 8 , it shows a structural diagram of an apparatus for displaying a detection result of terminal performance according to an embodiment of the present invention, which may specifically include:

基类创建模块801,适于创建测试信息基类和测试执行基类;其中,所述测试信息基类用于描述测试用例的信息,所述测试执行基类用于执行测试用例;The base class creation module 801 is adapted to create a test information base class and a test execution base class; wherein, the test information base class is used to describe the information of the test case, and the test execution base class is used to execute the test case;

派生模块802,适于针对测试用例,从所述测试信息基类派生出对应的测试用例信息类,及,从所述测试执行基类派生出对应的测试用例执行类;其中,所述测试用例信息类在构造函数中传递的参数包括当前测试用例的测试用例执行类名称;The derivation module 802 is adapted to derive a corresponding test case information class from the test information base class for a test case, and derive a corresponding test case execution class from the test execution base class; wherein, the test case The parameters passed in the constructor of the information class include the test case execution class name of the current test case;

实例化模块803,适于对所述测试用例信息类进行实例化得到相应的测试用例对象;The instantiation module 803 is adapted to instantiate the test case information class to obtain a corresponding test case object;

对象执行类获取模块804,适于针对所述测试用例对象,依据其对应的测试用例执行类名称获取对应的测试用例执行类;The object execution class acquisition module 804 is adapted to obtain the corresponding test case execution class according to the corresponding test case execution class name for the test case object;

对象测试用例执行模块805,适于调用所获取的测试用例执行类执行相应的测试用例;及The object test case execution module 805 is suitable for invoking the obtained test case execution class to execute the corresponding test case; and

结果展现模块806,用于依据用户界面上的终端性能检测结果触发的请求,展现所述终端性能检测结果。The result display module 806 is configured to display the terminal performance detection result according to a request triggered by the terminal performance detection result on the user interface.

在具体实现中,基类创建模块801、派生模块802、实例化模块803、对象执行类获取模块804和对象测试用例执行模块805可以位于各种计算机系统或服务器端,该三个模块配合完成数据库性能的检测;结果展现模块806可以位于各种显示器中,用于展现所述数据库性能检测结果;其中,所述计算机系统或显示器可以位于智能手机、平板电脑、笔记本电脑、PDA等移动终端之上,也可以位于台式电脑等固定终端之上。In a specific implementation, the base class creation module 801, the derivation module 802, the instantiation module 803, the object execution class acquisition module 804 and the object test case execution module 805 can be located in various computer systems or server ends, and these three modules cooperate to complete the database Performance detection; the result display module 806 can be located in various displays for displaying the performance detection results of the database; wherein, the computer system or display can be located on mobile terminals such as smart phones, tablet computers, notebook computers, and PDAs , and can also be located on a fixed terminal such as a desktop computer.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings), as well as any method or method so disclosed, may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in the device according to the embodiments of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

Claims (12)

1. A method for detecting terminal performance is characterized by comprising the following steps:
creating a test information base class and a test execution base class; the test information base class is used for describing information of a test case, and the test execution base class is used for executing the test case;
for the test case, deriving a corresponding test case information class from the test information base class, and deriving a corresponding test case execution class from the test execution base class; the parameters of the test case information class transferred in the constructor comprise the name of the test case execution class of the current test case;
instantiating the test case information class to obtain a corresponding test case object;
aiming at the test case object, acquiring a corresponding test case execution class according to a corresponding test case execution class name, and calling the acquired test case execution class to execute a corresponding test case;
wherein the test execution base class includes: the full screen test base class is used for executing a full screen test case and the non-full screen test base class is used for executing a non-full screen test case; the full screen testing base class is derived from an Activity Activity class of an Android system;
the test case execution class includes: a full screen test case execution class derived from the full screen test base class and a non-full screen test case execution class derived from the non-full screen test base class;
the information of the test case comprises a detection method for detecting whether the current test case is a full-screen test case;
the step of calling the obtained test case execution class to execute the corresponding test case includes:
detecting whether the test case corresponding to the test case object is a full-screen test case or not by calling a detection method for judging whether the current test case in the test case object is a full-screen test case or not;
when the test case corresponding to the test case object is a full-screen test case, calling a corresponding full-screen test case execution class to execute the corresponding test case;
and when the test case corresponding to the test case object is a non-full-screen test case, calling the corresponding non-full-screen test case execution class to execute the corresponding test case.
2. The method of claim 1, further comprising:
adding the test case object obtained by instantiation to a list, wherein the initial execution mark of the test case object in the list is unexecuted;
acquiring the test case object with the execution mark as unexecuted from the list;
aiming at the unexecuted test case object, acquiring a corresponding test case execution class according to the test case execution class name associated with the unexecuted test case object, and calling the acquired test case execution class to execute a corresponding test case; and the execution mark corresponding to the test case object after execution is executed.
3. The method of claim 1, wherein the step of invoking the corresponding full-screen test case execution class to execute the corresponding test case comprises:
creating and starting a full screen test class object from the current activity, executing a corresponding test case by the full screen test class object, and returning a corresponding test result to the current activity;
and acquiring the test result returned by the object of the full screen test class in the current activity.
4. The method of claim 1, wherein the step of invoking the corresponding non-full screen test case execution class to execute the corresponding test case comprises:
instantiating the non-full screen test case execution class to obtain a corresponding non-full screen test case object;
creating a background testing thread, and transmitting the non-full screen test case object to the background testing thread;
and starting the background testing thread to execute the corresponding testing case.
5. The method of claim 1, wherein testing member functions of an execution base class comprises: a test flow function for describing a test flow; and the test case execution class derived from the test execution base class covers the test flow function to execute the test flow of the corresponding test case.
6. The method of claim 1, wherein the member functions of the test execution base class include one or more of the following test attribute functions: the test system comprises a first waiting function, a round number function and a second waiting function, wherein the first waiting function is used for describing the waiting time required before the current test case is executed;
and the test case execution class derived from the test execution base class covers the test attribute function to execute the test attribute of the corresponding test case.
7. An apparatus for detecting terminal performance, comprising:
the base class creating module is suitable for creating a test information base class and a test execution base class; the test information base class is used for describing information of a test case, and the test execution base class is used for executing the test case;
the derivation module is suitable for deriving a corresponding test case information class from the test information base class and deriving a corresponding test case execution class from the test execution base class aiming at the test case; the parameters of the test case information class transferred in the constructor comprise the name of the test case execution class of the current test case;
the instantiation module is suitable for instantiating the test case information class to obtain a corresponding test case object;
the object execution class acquisition module is suitable for acquiring a corresponding test case execution class according to a corresponding test case execution class name of the test case object; and
the object test case execution module is suitable for calling the obtained test case execution class to execute the corresponding test case;
wherein the test execution base class includes: the full screen test base class is used for executing a full screen test case and the non-full screen test base class is used for executing a non-full screen test case; the full screen testing base class is derived from an Activity Activity class of an Android system;
the test case execution class includes: a full screen test case execution class derived from the full screen test base class and a non-full screen test case execution class derived from the non-full screen test base class;
the information of the test case also comprises a detection method for detecting whether the current test case is a full-screen test case;
the object test case execution module includes:
the full-screen detection sub-module is suitable for detecting whether the test case corresponding to the test case object is a full-screen test case or not by calling a detection method for judging whether the current test case in the test case object is a full-screen test case or not;
the full screen calling sub-module is suitable for calling the corresponding full screen test case execution class to execute the corresponding test case when the test case corresponding to the test case object is the full screen test case;
and the non-full screen calling sub-module is suitable for calling the corresponding non-full screen test case execution class to execute the corresponding test case when the test case corresponding to the test case object is a non-full screen test case.
8. The apparatus of claim 7, further comprising:
the object adding module is suitable for adding the test case object obtained by instantiation to a list, and the initial execution mark of the test case object in the list is not executed;
the unexecuted object acquisition module is suitable for acquiring the test case object with the unexecuted execution mark from the list;
the unexecuted object execution module is suitable for acquiring a corresponding test case execution class according to the test case execution class name associated with the unexecuted test case object and calling the acquired test case execution class to execute a corresponding test case; and the execution mark corresponding to the test case object after execution is executed.
9. The apparatus of claim 7, wherein the full screen invocation sub-module comprises:
the object creating unit is suitable for creating and starting an object of a full screen test class from the current activity, executing a corresponding test case by the object of the full screen test class and returning a corresponding test result to the current activity;
and the result acquisition unit is suitable for acquiring the test result returned by the object of the full screen test class in the current activity.
10. The apparatus of claim 7, wherein the non-full screen invocation sub-module comprises:
the non-full screen instantiation unit is suitable for instantiating the non-full screen test case execution class to obtain a corresponding non-full screen test case object;
the thread creating and transmitting unit is suitable for creating a background testing thread and transmitting the non-full screen test case object to the background testing thread;
and the thread starting unit is suitable for starting the background testing thread to execute the corresponding test case.
11. The apparatus of claim 7, wherein testing member functions of the execution base class comprises: a test flow function for describing a test flow; and the test case execution class derived from the test execution base class covers the test flow function to execute the test flow of the corresponding test case.
12. The apparatus of claim 7, wherein the member functions of the test execution base class comprise one or more of the following test attribute functions: the test system comprises a first waiting function, a round number function and a second waiting function, wherein the first waiting function is used for describing the waiting time required before the current test case is executed;
and the test case execution class derived from the test execution base class covers the test attribute function to execute the test attribute of the corresponding test case.
CN201210513257.8A 2012-12-04 2012-12-04 A kind of detection method of terminal capabilities and device Expired - Fee Related CN103064785B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210513257.8A CN103064785B (en) 2012-12-04 2012-12-04 A kind of detection method of terminal capabilities and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210513257.8A CN103064785B (en) 2012-12-04 2012-12-04 A kind of detection method of terminal capabilities and device

Publications (2)

Publication Number Publication Date
CN103064785A CN103064785A (en) 2013-04-24
CN103064785B true CN103064785B (en) 2016-03-30

Family

ID=48107418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210513257.8A Expired - Fee Related CN103064785B (en) 2012-12-04 2012-12-04 A kind of detection method of terminal capabilities and device

Country Status (1)

Country Link
CN (1) CN103064785B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933517A (en) * 2017-12-19 2019-06-25 成都鼎桥通信技术有限公司 Test method, device and equipment based on android system
CN112256532A (en) * 2020-11-10 2021-01-22 深圳壹账通创配科技有限公司 Test interface generation method and device, computer equipment and readable storage medium
CN115827428A (en) * 2022-09-23 2023-03-21 杭州至千哩科技有限公司 Universal test method and device for automatic test equipment, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1677365A (en) * 2004-03-31 2005-10-05 微软公司 Test case inheritance controlled via attributes
CN101635645A (en) * 2009-08-28 2010-01-27 中兴通讯股份有限公司 Method and device for managing network topology
CN101984416A (en) * 2010-11-02 2011-03-09 中兴通讯股份有限公司 Method and device for generating test case

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101019210B1 (en) * 2007-04-25 2011-03-04 이화여자대학교 산학협력단 Embedded software test device using emulation and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1677365A (en) * 2004-03-31 2005-10-05 微软公司 Test case inheritance controlled via attributes
CN101635645A (en) * 2009-08-28 2010-01-27 中兴通讯股份有限公司 Method and device for managing network topology
CN101984416A (en) * 2010-11-02 2011-03-09 中兴通讯股份有限公司 Method and device for generating test case

Also Published As

Publication number Publication date
CN103064785A (en) 2013-04-24

Similar Documents

Publication Publication Date Title
US10620920B2 (en) Automatic graphical user interface generation from notification data
CN103019900B (en) The testing result display packing of terminal capabilities and device
US9058193B2 (en) Methods and systems for providing compatibility of applications with multiple versions of an operating system
JP6440828B2 (en) Visibility detection of digital content
CN108476257A (en) Electronic device and method for managing applications thereof
US9772861B2 (en) Accessing operating system elements via a tag cloud
US11561808B2 (en) System and method of providing access to and managing virtual desktops
CN103995722B (en) Open the method and apparatus of multiple windows simultaneously on screen
WO2021137971A1 (en) Computer resource leak detection
WO2022052677A1 (en) Interface display method and electronic device
US9699247B2 (en) User experience monitoring for application remoting
CN110647459A (en) Application testing method and device
CN111158820A (en) Control click event processing method and device, electronic equipment and storage medium
CN103064785B (en) A kind of detection method of terminal capabilities and device
US11520473B2 (en) Switch control for animations
US20120284735A1 (en) Interaction-Based Interface to a Logical Client
US9747005B1 (en) Adaptive user interface
CN111708533B (en) Method and device for setting mouse display state in application thin client
WO2012078480A2 (en) Change notifications from an updated data representation
CN112905931B (en) Page information display method and device, electronic equipment and storage medium
CN113312050B (en) Content display method, device, equipment and medium
CN114510334A (en) Class instance calling method and device, electronic equipment and automatic driving vehicle
CN112988265A (en) Applet processing method, applet processing apparatus, device, medium and product
CN114513736B (en) Acoustic testing method, equipment, terminal and storage medium for earphone
CN106020839A (en) Method for displaying test data, development terminal and graphical user interface

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220725

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160330