Embodiment
Exemplary embodiment of the present disclosure is described below with reference to accompanying drawings in more detail.Although shown exemplary embodiment of the present disclosure in the accompanying drawing, yet should be appreciated that and to realize the disclosure and the embodiment that should do not set forth limits here with various forms.On the contrary, it is in order to understand the disclosure more thoroughly that these embodiment are provided, and can with the scope of the present disclosure complete convey to those skilled in the art.
With reference to Fig. 1, show according to an embodiment of the invention a kind of process flow diagram of detection method of terminal capabilities, specifically can comprise:
Step 101, establishment detecting information base class and test execution base class; Wherein, described detecting information base class is used for describing the information of test case, and described test execution base class is used for implementation of test cases;
Step 102, for test case, derive corresponding test case info class from described detecting information base class, and, derive corresponding test case from described test execution base class and carry out class; Wherein, the parameter transmitted in constructed fuction of the described test case info class test case that specifically can include current test case is carried out the class title;
Step 103, described test case info class is carried out instantiation obtain corresponding test case object;
Step 104, for described test case object, carry out test case corresponding to class name acquiring according to its corresponding test case and carry out class, and call the test case of obtaining and carry out class and carry out corresponding test case.
The embodiment of the invention can be applied to smart mobile phone, panel computer, notebook computer, PDA(personal digital assistant, Personal DigitalAssistant) detection of mobile terminal performance such as, can be applied to the detection of the fixed terminal performances such as desktop computer, the embodiment of the invention is not limited concrete terminal yet.
What the detection method of existing terminal capabilities adopted is processor-oriented design, and the procedure-oriented here analyzes the needed step of dealing with problems exactly, then with function these steps is realized step by step, calls successively one by one just passable in the time of use.Detection for terminal capabilities, such behavior has been dispersed in numerous steps in processor-oriented design, be conducive to the designer and carry out various simplification according to actual conditions, but the shortcoming with extendability and very flexible, be in particular in: if variation has occured testing requirement, then the required numerous steps of testing process probably all need to change, this just relates to whole code segment and changes etc., and whole code segment is changed the construction cycle that increases easily product, reduces the development efficiency of product.
And the employing of the detection method of terminal capabilities of the present invention is OO design, the object-oriented here is to resolve into each object consisting of problem transaction, the purpose of setting up object is not in order to finish a step, but in order to describe the behavior of certain things in whole step of dealing with problems.In OO design, the such behavior of the detection of terminal capabilities only may occur in example object, so if variation has occured testing requirement, then only need to change corresponding instance object and get final product, it is local changing.
In specific implementation, the present invention according to the abstract detecting information base class that obtains for the information of describing test case of the detection attribute of terminal capabilities, reaches the test execution base class that is used for implementation of test cases by adopting OO abstract method; Like this, by adopting OO inheritance method, the instance object that only needs to be used the derived class of the derived class of described detecting information base class and test execution base class for test case can be carried out arbitrarily test case.
Wherein, for the abstract detecting information base class that obtains, can be by describe the information of test case with member variable and member function; For the abstract test execution base class that obtains, can be by describe the execution information of test case with member variable and member function, here can comprise concrete testing process in the execution information of test case, for example, a complete testing process specifically can comprise: initialization, time control, interface control, detecting and evaluating algorithms, Free up Memory etc.
In a preferred embodiment of the present invention, the member function of described test execution base class specifically can comprise: the testing process function that is used for describing testing process; Carry out class from the derivative test case of described test execution base class and cover described testing process function to carry out the testing process of corresponding test case.
According to inheritance mechanism, for derive corresponding test case info class from described detecting information base class, it can inherit member variable and the member function of described detecting information base class automatically, and it can also transmit by constructed fuction the parameter of corresponding test case; Here, the parameter of test case specifically can include the test case execution class title of current test case.
In addition, be appreciated that, according to inheritance mechanism, test case info class and test case are carried out class as subclass, when deriving from, the member function that can cover as required parent is realized the private information of corresponding test case, and for example, test case is carried out class can carry out evaluation and test flow algorithm of corresponding test case etc. in the testing process function.
Because the test case info class is to derive from from described detecting information base class, it is to derive from from described test execution base class that test case is carried out class, like this, the instance object that is used described test case info class and test case execution class can be carried out arbitrarily test case.
The present invention has following advantage:
Adopt the solution of the present invention, if variation has occured testing requirement, then only need to change corresponding instance object and get final product.
For example, if need to adjust the execution sequence of a plurality of test cases, only the execution sequence of the instance object of the derived class of the corresponding described detecting information base class of a plurality of test cases of need adjustment gets final product, and need not to adjust concrete code segment, also just can avoid occurring the phenomenon that code segment is made mistakes;
And for example, if need to increase new test case, the instance object that only needs to be used the derived class of the derived class of described detecting information base class and test execution base class for this new test case gets final product, and need not again to write a corresponding code segment of complete testing process;
In a word, the testing scheme of terminal capabilities of the present invention can carry out a plurality of test cases neatly, and, easily any increase of adaptive testing use-case, deletion or order are adjusted, and in a word, the present invention can improve dirigibility and the extendability of terminal capabilities test.
With reference to Fig. 2, show according to an embodiment of the invention a kind of process flow diagram of detection method of terminal capabilities, specifically can comprise:
Step 201, establishment detecting information base class and test execution base class; Wherein, described detecting information base class is used for describing the information of test case, and described test execution base class is used for implementation of test cases;
Step 202, for test case, derive corresponding test case info class from described detecting information base class, and, derive corresponding test case from described test execution base class and carry out class; Wherein, the parameter transmitted in constructed fuction of the described test case info class test case that specifically can include current test case is carried out the class title;
Step 203, described test case info class is carried out instantiation obtain corresponding test case object;
Step 204, the test case object that instantiation is obtained are added into tabulation, and the original execution of test case object is not masked as and carries out in the described tabulation;
Step 205, to obtain execute flag from described tabulation be unenforced test case object;
Step 206, for described unenforced test case object, carry out test case corresponding to class name acquiring according to its associated test case and carry out class, and call the test case of obtaining and carry out class and carry out corresponding test case; The execute flag that complete test case object is corresponding is executed.
The embodiment of the invention is added into tabulation with all test case objects, in the testing process of terminal capabilities, only need obtain one by one unenforced test case object, and find corresponding test case to carry out class, the terminal capabilities testing result that just can obtain wanting by carrying out corresponding test case for the test case object that obtains.In specific implementation, can obtain by the mode of traversal of lists that to obtain execute flag in the described tabulation be unenforced test case object.And, be appreciated that and can after executing a test case object, its execute flag be revised as executed.
With reference to Fig. 3, show according to an embodiment of the invention a kind of process flow diagram of detection method of terminal capabilities, specifically can comprise:
Step 301, establishment detecting information base class and test execution base class; Wherein, described detecting information base class is used for describing the information of test case, and described test execution base class is used for implementation of test cases; Described test execution base class specifically can comprise: the non-full frame test base class that is used for carrying out the full frame test base class of full frame test case and is used for carrying out non-full frame test case; Wherein, described full frame test base class is derived from by the Activity class of Android system; Whether specifically can include current test case in the information of described test case is the detection method of full frame test case;
Step 302, for test case, derive corresponding test case info class from described detecting information base class, and, derive corresponding test case from described test execution base class and carry out class; Wherein, the parameter transmitted in constructed fuction of the described test case info class test case that specifically can include current test case is carried out the class title; Described test case is carried out class and specifically can be comprised: carry out class and carry out class from the derivative non-full frame test case of described non-full frame test base class from the derivative full frame test case of described full frame test base class;
Step 303, described test case info class is carried out instantiation obtain corresponding test case object;
Step 304, for described test case object, carry out test case corresponding to class name acquiring according to its corresponding test case and carry out class;
Step 305, whether current test case is the detection method of full frame test case in the described test case object by calling, and detects whether the corresponding test case of described test case object is full frame test case;
Step 306, when the corresponding test case of described test case object is full frame test case, call corresponding full frame test case and carry out class and carry out corresponding test case;
Step 307, when the corresponding test case of described test case object is non-full frame test case, call corresponding non-full frame test case and carry out class and carry out corresponding test case.
Present portable terminal uses Android operating system mostly, and is at first movable to Activity(in the Android operating system) principle describe.In the Android operating system, an Activity is an application component, and it can be used for providing a screen, and it also can be used for alternately to finish a certain task, such as the email that dials, takes pictures, sends, see map etc.; Usually, each Activity is given a window, can draw user interface at this above the window, and window is full of screen usually, but also can float on less than screen on other window.
The performance of the portable terminal that can test at present specifically can comprise: CPU integer performance, CPU floating-point performance, 2D drawing performance, 3D drawing performance, database performance, storage system etc.Wherein, the test of 2D drawing performance, 3D drawing performance belongs to the full frame test in foreground, and the full frame test in foreground need to move in the Activity of oneself; And the performance tests such as CPU integer performance, CPU floating-point performance, database, storage system belong to the non-full frame test in backstage, and the non-full frame test in backstage need to not move in the Activity of oneself.
Therefore, the embodiment of the invention takes out be used to the full frame test base class of carrying out full frame test case with for the non-full frame test base class of carrying out non-full frame test case according to the testing attribute of terminal capabilities; And, owing to full frame test base class need to move in the Activity of oneself, so need to be derived from by the Activity class of Android system; In addition, can also for test case, send corresponding full frame test case to carry out class and non-full frame test case execution class from full frame test base class and non-full frame test base class, and it is called to carry out corresponding test case.
Need to prove, because described detecting information base class can be by describing the information of test case with member variable and member function, so whether in actual applications, can adopt member function to describe current test case is the detection method of full frame test case.For example, in a kind of application example of the present invention, whether can adopt member function public Boolean isBackground () to detect current test case is full frame test case, if, then return false, expression is full frame test case, otherwise returns true, the full frame test case of expression right and wrong.Like this, step 305 just can use the pointer of described test case object to call this member function, and returns corresponding result.
In a preferred embodiment of the present invention, the described step 306 of calling the test of corresponding full frame test case execution class execution terminal capabilities specifically can comprise:
Step S101, create and start the object of a full frame test class from current active, carry out corresponding test case by the object of this full frame test class, and return corresponding test result to current active;
Step S 102, current active are obtained the test result that the object of this new full frame test class returns.
Here, current active is used for representing the caller of full frame test case execution class, and this current activity generally shows as for the main window that shows test interface; Carry out in the invoked procedure of class in full frame test case, this current activity is mainly used in starting the required Activity of full frame test by the object that creates and start a full frame test class, and, wait for that the object of this full frame test class returns corresponding test result.
In specific implementation, can pass through startActivityForResult (Intent intent, int requestCode) created and started a full frame test class from current active object.Wherein, Intent is the intention class of Android, intent is an object of intention class, it is used for transmitting the required parameter of object that starts a full frame test class, specifies the class name (this class name also is that test case is carried out class name in the step 304) of the object that the full frame test class that need to start is arranged in this parameter; The value of requestCode is self-defining, can be used for identifying the object of the full frame test class that needs start.
For full frame test class, because deriving from from described full frame test base class for test case, it obtains, so its description has concrete testing process; The object of this full frame test class can obtain according to full frame test class instantiation, and it can according to described testing process, carry out corresponding test case.
In specific implementation, the object of this full frame test class can pass through setResult (int resultCode, Intent data) preserves test result, and onActivityResult (the int requestCode by calling current active, int resultCode, Intent data) returns the test result of preserving.Wherein, if the object of this full frame test class may have several different test results to return, can be identified differentiation with the resultCode parameter, data is used for the data that expression is returned, onActivityResult (int requestCode, int resultCode, Intent data) be the call back function of current active.
Further, current active can be according to resultCode parameter and data parameter, obtains the test result that the object of this new full frame test class returns.
In another kind of preferred embodiment of the present invention, the described step 307 of calling the test of corresponding non-full frame test case execution class execution terminal capabilities specifically can comprise:
Step S201, described non-full frame test case is carried out class carry out instantiation and obtain corresponding non-full frame test case object;
Step S202, establishment background test thread advance this background test thread with described non-full frame test case object transfer;
Step S203, start the corresponding test case of this background test thread execution.
Suppose that the name that described non-full frame test case is carried out class is called BackgroundTest, the pointer of current test case object is pointer, then step S201 can realize by BackgroundTester tester=pointer.getBackgroundTester (intent), wherein, intent be responsible for to single job in using action, action relates to data, additional data is described;
Because non-full frame test is at running background, in order to upgrade at the not influencing front stage interface, so needing a background test thread finishes, in a kind of application example of the present invention, step S202 can realize by BackgroundTestThread thread=newBackgroundTestThread (tester).Wherein, BackgroundTestThread is from the derivative thread class of Thread class, and, in the process of the object thread of instantiation BackgroundTestThread, can in the constructed fuction of BackgroundTestThread, transmit described non-full frame test case object, tested in run () method by described non-full frame test case object, and notice interface, foreground; Here, run () method moves thread under a kind of circulation always, until do not satisfy condition.
Step S203 can realize that by thread.start () after carrying out thread.start (), thread can automatically perform run () method; Be appreciated that carrying out thread.start () before, can also be set to maximum by the priority of thread.setPriority (Thread.MAX_PRIORITY) thread, make its preferential execution.
In said method embodiment, the description of each embodiment of the method is all emphasized particularly on different fields, there is not the part that describes in detail in certain embodiment of the method, can get final product referring to the associated description of additive method embodiment.
And what those skilled in the art were easy to expect is: it all is feasible that the combination in any of said method embodiment is used, but this instructions has not just described in detail one by one at this as space is limited.
At last, what need to replenish is, in a preferred embodiment of the present invention, the member function of described test execution base class specifically can comprise one or more in the following testing attribute function: be used for describing carrying out and need before the current test case first of time of waiting for to wait for function, wheel for the execution wheel number of describing current test case is counted function, and be used for to describe carrying out every the wheel needs before the current test case second of time of waiting for to wait for function;
Carry out class from the derivative test case of described test execution base class and cover described testing attribute function to carry out the testing attribute of corresponding test case.
In actual applications, a test case may need to test many wheels.Take the test of CPU floating-point performance as example, more stable in order to make test result, just need several wheels of carrying out more; Also namely, in the embodiment of the invention, carry out the wheel number for be same test case; The second wait function is every stand-by period of taking turns between the test case namely;
In addition, because the individual character of test case, may need certain hour to do homework, all calculate standby work accurately such as work such as the initialization in the testing process and Free up Memories, therefore, in order to improve the stability of test result, first waits for that function can be used for representing the stand-by period between the different test cases.
Be appreciated that those skilled in the art can arrange described first and wait for function and time numerical value corresponding to the second stand-by period according to the time needs, the present invention is not limited this.
In addition, for the ease of the monitoring of tester for test, in another kind of preferred embodiment of the present invention, can also include the descriptor of current test case in the information of described test case;
Then described method can also comprise:
Step S301, obtain the descriptor of test case corresponding to described test case object;
The descriptor of step S302, test case that described test case object is corresponding is shown on the test interface;
Progress msg on step S303, the described test interface of renewal.
The member function getTitle () that supposes the detecting information base class is used for returning the test case description, the pointer of supposing current test case object is pointer, so, step S301 can realize by String tag=pointer.getTitle (), step 302 can be passed through txtItem.setText (String.format (strProgressArg, tag, index, list.size ())) realize that step S303 can realize by benchHandler.post (progressUpdater).Wherein,
TxtItem is a TextView control;
SetText () is used for arranging the literal that wish will show;
BenchHandler is a Message Processing Handler, because non-UI(user interface, User Interface) can not upgrade the UI control in the thread, so must process by message;
Post () is used for sending a message;
ProgressUpdater is a UpdateProgressHandler, it derives from from Runnable, be the another kind of implementation of Java thread, post () needs a Runnable object as parameter, and its concrete effect is exactly to notify benchHandler to upgrade the interface.
This preferred embodiment is by showing the descriptor of test case and the implementation progress information of test case at test interface, to realize the monitoring of test.
For making those skilled in the art understand better the present invention, provide according to an embodiment of the invention a kind of example of detection method of terminal capabilities at this, specifically can comprise:
Step S401, establishment detecting information base class and test execution base class; Wherein, described detecting information base class is used for describing the information of test case, and described test execution base class is used for implementation of test cases; Described test execution base class specifically can comprise: the non-full frame test base class that is used for carrying out the full frame test base class of full frame test case and is used for carrying out non-full frame test case; Wherein, described full frame test base class is derived from by the Activity class of Android system; Whether specifically can include current test case in the information of described test case is the detection method of full frame test case;
With reference to table 1, show the example of the member variable of a kind of according to an embodiment of the invention detecting information base class Case.
Table 1
The member variable title |
The member variable type |
Member variable is described |
Tag |
String |
The test case title |
Package |
String |
Test case bag name |
BACKGROUNDTESTER |
BackgroundTester |
The object of BackgroundTester |
tester |
Tester |
The object of Tester |
mRepeatNow |
Integer |
The repeated test number of times |
Intent |
Intent |
Be used for preserving the parameter of transmitting |
context |
Context |
Context |
With reference to table 2, show the example of the member function of a kind of according to an embodiment of the invention detecting information base class Case.
Table 2
With reference to table 3, show the example of the member function of a kind of according to an embodiment of the invention full frame test base class and non-full frame test base class.
Table 3
The member function title |
The member function name type |
Member function is described |
getTag() |
String |
Evaluation and test use-case Tag is set |
sleepBeforeStart() |
int |
First waits for function |
sleepBetweenRound |
int |
Second waits for function |
oneRound() |
void |
The testing process function |
Step S402, for test case, derive corresponding test case info class from described detecting information base class, derive corresponding full frame test case from described full frame test base class and carry out class, and, derive corresponding full frame test case from described full frame test base class and carry out class; Wherein, the parameter transmitted in constructed fuction of the described test case info class test case that specifically can include current test case is carried out the class title;
The below illustrates the implementation procedure that derives corresponding test case info class from described detecting information base class respectively take the test case of 2D performance and CPU integer as example:
Detecting information base class derivation 1,
A newly-built Case2D class, for the information of describing the corresponding test case of 2D performance, such derives from detecting information base class Case.
Detecting information base class derivation 2,
A newly-built CaseCPUInteger class, for the information of describing the corresponding test case of CPU integer performance, such derives from detecting information base class Case.
Suppose that full frame test base class is Tester, the below is take the corresponding test case of 2D performance as example, explanation derives the example that corresponding full frame test case is carried out class OpenGLTest from described full frame test base class, owing to be full frame test case, OpenGLTest derives from and has realized the corresponding interface of parent Tester and grandfather's class Activity from the Tester class:
Suppose that non-full frame test base class is BackgroundTester, the below illustrates from described non-full frame test base class to derive the example that corresponding non-full frame test case is carried out class TesterCPUInteger take the corresponding test case of CPU integer performance as example:
Step S403, described test case info class is carried out instantiation obtain corresponding test case object;
At this, describe with the example that is instantiated as of the corresponding test case info class of 2D performance and CPU integer performance:
Case?graphics2d=new?Case2D(this);
Case?cpuint=new?CaseCPUInteger(this);
Also namely, graphics2d and cpuint are respectively 2D performance and test case object corresponding to CPU integer performance.
Step S404, the test case object that instantiation is obtained are added into tabulation, and the original execution of test case object is not masked as and carries out in the described tabulation;
Step S405, to obtain execute flag from described tabulation be unenforced test case object;
Step S406, for described unenforced test case object, carry out test case corresponding to class name acquiring according to its associated test case and carry out class;
Need to prove that owing to call the constructed fuction of class when instance object, with the example that is instantiated as of Case2D, its constructed fuction is as follows:
Case2D(Context?context){
super(context,"Case2D","OpenGLTest",1,1);
}
Wherein, context, " Case2D ", " OpenGLTest ", 1,1 is the parameter of transmitting in constructed fuction, wherein, " Case2D " is the title of test case, and " OpenGLTest " carries out the class title for test case, carries out class so can obtain corresponding test case.
Step S407, utilize the pointer of described unenforced test case object, obtain the descriptor of test case corresponding to described test case object, the descriptor of the test case that described test case object is corresponding is shown on the test interface, and upgrades the progress msg on the described test interface;
Step S408, utilize the pointer of described unenforced test case object, call whether current test case is the detection method of full frame test case in the described test case object, detect whether the corresponding test case of described unenforced test case object is full frame test case;
Step S409, when the corresponding test case of described unenforced test case object is full frame test case, call corresponding full frame test case and carry out class and carry out corresponding test case;
Step S410, when the corresponding test case of described unenforced test case object is non-full frame test case, call corresponding non-full frame test case and carry out class and carry out corresponding test case.
The correlative code example of step S408-step S410 is as follows:
With reference to Fig. 4, show according to an embodiment of the invention a kind of structural drawing of pick-up unit of terminal capabilities, specifically can comprise:
Base class creation module 401 is suitable for creating detecting information base class and test execution base class; Wherein, described detecting information base class is used for describing the information of test case, and described test execution base class is used for implementation of test cases;
Derive from module 402, be suitable for for test case, derive corresponding test case info class from described detecting information base class, and, derive corresponding test case from described test execution base class and carry out class; Wherein, the parameter transmitted in constructed fuction of described test case info class comprises that the test case of current test case carries out the class title;
Instantiation module 403 is suitable for that described test case info class is carried out instantiation and obtains corresponding test case object;
Object is carried out class acquisition module 404, is suitable for for described test case object, carries out test case corresponding to class name acquiring according to its corresponding test case and carries out class; And
Object test case execution module 405 is suitable for calling the test case execution class of obtaining and carries out corresponding test case.
In a preferred embodiment of the present invention, described device can also comprise:
Object adds module, and the test case object that is suitable for instantiation is obtained is added into tabulation, and the original execution of test case object is not masked as and carries out in the described tabulation;
Do not carry out the object acquisition module, being suitable for obtaining from described tabulation execute flag is unenforced test case object;
Do not carry out the object execution module, be suitable for for described unenforced test case object, carry out test case corresponding to class name acquiring according to its associated test case and carry out class, and call the test case execution class of obtaining and carry out corresponding test case.
In another kind of preferred embodiment of the present invention, described test execution base class specifically can comprise: the non-full frame test base class that is used for carrying out the full frame test base class of full frame test case and is used for carrying out non-full frame test case; Wherein, described full frame test base class is derived from by the Activity class of Android system;
Then described test case execution class specifically can comprise: carry out class and carry out class from the derivative non-full frame test case of described non-full frame test base class from the derivative full frame test case of described full frame test base class.
Whether can also include current test case in the information of described test case is the detection method of full frame test case;
Then described object test case execution module 405 specifically can comprise:
Full frame detection sub-module is suitable for whether current test case is the detection method of full frame test case in the described test case object by calling, and detects whether the corresponding test case of described test case object is full frame test case;
The full frame submodule that calls is suitable for when the corresponding test case of described test case object is full frame test case, calls corresponding full frame test case execution class and carries out corresponding test case;
The non-full frame submodule that calls is suitable for when the corresponding test case of described test case object is non-full frame test case, calls corresponding non-full frame test case execution class and carries out corresponding test case.
In another preferred embodiment of the present invention, the described full frame submodule that calls specifically can comprise:
The Object Creation unit is suitable for creating and starting from current active the object of a full frame test class, carries out corresponding test case by the object of this full frame test class, and returns corresponding test result to current active; And
Acquiring unit is suitable for current active and obtains the test result that the object of this new full frame test class returns as a result.
In a preferred embodiment of the present invention, the described non-full frame submodule that calls specifically can comprise:
Non-full frame instantiation unit is suitable for that described non-full frame test case execution class is carried out instantiation and obtains corresponding non-full frame test case object;
The thread creation transfer unit is suitable for creating the background test thread, and described non-full frame test case object transfer is advanced this background test thread; And
The thread start unit is suitable for starting the corresponding test case of this background test thread execution.
In another kind of preferred embodiment of the present invention, the member function of described test execution base class specifically can comprise: the testing process function that is used for describing testing process; Carry out class from the derivative test case of described test execution base class and cover described testing process function to carry out the testing process of corresponding test case.
In another preferred embodiment of the present invention, the member function of described test execution base class specifically can comprise one or more in the following testing attribute function: be used for describing carrying out and need before the current test case first of time of waiting for to wait for function, wheel for the execution wheel number of describing current test case is counted function, and be used for to describe carrying out every the wheel needs before the current test case second of time of waiting for to wait for function;
Then in specific implementation, can carry out class from the derivative test case of described test execution base class and cover described testing attribute function to carry out the testing attribute of corresponding test case.
With reference to Fig. 5, show according to an embodiment of the invention a kind of process flow diagram of testing result display packing of terminal capabilities, specifically can comprise:
Step 501, establishment detecting information base class and test execution base class; Wherein, described detecting information base class is used for describing the information of test case, and described test execution base class is used for implementation of test cases;
Step 502, for test case, derive corresponding test case info class from described detecting information base class, and, derive corresponding test case from described test execution base class and carry out class; Wherein, the parameter transmitted in constructed fuction of described test case info class comprises that the test case of current test case carries out the class title;
Step 503, described test case info class is carried out instantiation obtain corresponding test case object;
Step 504, for described test case object, carry out test case corresponding to class name acquiring according to its corresponding test case and carry out class, and call the test case execution class of obtaining and carry out corresponding test case, obtain corresponding terminal capabilities testing result;
The request of the terminal capabilities detection triggers on step 505, the User interface represents described terminal capabilities testing result.
In a kind of application example of the present invention, the trigger request of the terminal capabilities testing result on can the User interface represents described terminal capabilities testing result on the UI of current terminal, checks for the user; The user can be known the performance of current terminal according to the described described terminal capabilities testing result that represents, for example, the described terminal capabilities testing result of current terminal can be used as the user and whether buys one of factor of current terminal, perhaps, the described terminal capabilities testing result of a plurality of terminals can be used as one of comparison factor of a plurality of terminal capabilities.In a word, the present invention can be by representing the terminal capabilities testing result, to show more real terminal capabilities testing result of feedback to the user.
Need to prove, the request of the terminal capabilities detection triggers on the user interface can operate generation by users such as mouse, keyboard, touch gestures, and this user operates specifically and can obtain for the interface element that button on the user interface etc. has a Trigger Function.
With reference to Fig. 6, show a kind of according to an embodiment of the invention exhibiting method synoptic diagram of terminal capabilities testing result, wherein, the user can send database performance by " beginning scoring " button on the interface and detect the request that triggers, the invention process can be asked according to this detection of the related terminal capabilities of execution in step 601-604 so, the detection progress of while display terminal performance on the interface, wherein 87% is exactly an example that detects progress.After sending this request, " beginning scoring " button on the interface becomes " stopping scoring " button, is appreciated that the user can stop the detection of current database performance by clicking " stopping scoring " button.In addition, after the detection progress reaches 100%, the present invention can show corresponding terminal capabilities testing result automatically, perhaps, the request (as clicking other button except " beginning scoring " button or " stopping to mark " button) of the terminal capabilities detection triggers of the present invention on can the User interface, represent corresponding terminal capabilities testing result, after reaching 100% in the detection progress, " stopping scoring " button on the interface becomes " checking scoring " button, be appreciated that the user can come representing of triggering terminal performance test results by clicking " checking scoring " button.
Be appreciated that described terminal capabilities testing result can represent separately the testing result of certain terminal capabilities, also can represent the testing result of a plurality of terminal capabilities; Perhaps, when successively carrying out the corresponding test case of a plurality of terminal capabilities, also can successively represent the testing result of these a plurality of terminal capabilities; In a word, the present invention is not limited concrete ways of presentation.
With reference to Fig. 7, show a kind of according to an embodiment of the invention exhibiting method synoptic diagram of terminal capabilities testing result, it represents the testing result of the terminal capabilities form with score, the terminal capabilities that represents specifically can comprise: CPU integer performance, CPU floating-point performance, 2D drawing performance, 3D drawing performance, database IO(input and output, Input/output) score of the performances such as performance, SD card writing speed, SD card reading speed, and the total points of terminal capabilities (score of overall performance).
In some embodiments of the invention, detect client and the terminal capabilities testing result of current terminal can be reported the detection server, and, detect server and the terminal capabilities testing result of multiple terminal sample can also be handed down to the detection client, represent to the user by detecting client, know terminal capabilities testing result rank in the multiple terminal sample of current mobile terminal etc. to make things convenient for the user.
Be appreciated that those skilled in the art can adopt various ways of presentation with described terminal capabilities testing result in various positions, the embodiment of the invention to described terminal capabilities testing result represent the position and concrete ways of presentation is not limited.
With reference to Fig. 8, show according to an embodiment of the invention a kind of structural drawing of testing result display device of terminal capabilities, specifically can comprise:
Base class creation module 801 is suitable for creating detecting information base class and test execution base class; Wherein, described detecting information base class is used for describing the information of test case, and described test execution base class is used for implementation of test cases;
Derive from module 802, be suitable for for test case, derive corresponding test case info class from described detecting information base class, and, derive corresponding test case from described test execution base class and carry out class; Wherein, the parameter transmitted in constructed fuction of described test case info class comprises that the test case of current test case carries out the class title;
Instantiation module 803 is suitable for that described test case info class is carried out instantiation and obtains corresponding test case object;
Object is carried out class acquisition module 804, is suitable for for described test case object, carries out test case corresponding to class name acquiring according to its corresponding test case and carries out class;
Object test case execution module 805 is suitable for calling the test case execution class of obtaining and carries out corresponding test case; And
Result presentation module 806 is used for the request of the terminal capabilities detection triggers on the User interface, represents described terminal capabilities testing result.
In specific implementation, base class creation module 801, derivation module 802, instantiation module 803, object execution class acquisition module 804 and object test case execution module 805 can be positioned at various computer systems or server end, and these three modules cooperate the detection of finishing database performance; Result presentation module 806 can be arranged in various displays, is used for representing described database performance testing result; Wherein, described computer system or display can be positioned on the portable terminals such as smart mobile phone, panel computer, notebook computer, PDA, also can be positioned on the fixed terminals such as desktop computer.
Intrinsic not relevant with any certain computer, virtual system or miscellaneous equipment with demonstration at this algorithm that provides.Various general-purpose systems also can be with using based on the teaching at this.According to top description, it is apparent constructing the desired structure of this type systematic.In addition, the present invention is not also for any certain programmed language.Should be understood that and to utilize various programming languages to realize content of the present invention described here, and the top description that language-specific is done is in order to disclose preferred forms of the present invention.
In the instructions that provides herein, a large amount of details have been described.Yet, can understand, embodiments of the invention can be put into practice in the situation of these details not having.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand one or more in each inventive aspect, in the description to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes in the above.Yet the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires the more feature of feature clearly put down in writing than institute in each claim.Or rather, as following claims reflected, inventive aspect was to be less than all features of the disclosed single embodiment in front.Therefore, follow claims of embodiment and incorporate clearly thus this embodiment into, wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and can adaptively change and they are arranged in one or more equipment different from this embodiment the module in the equipment among the embodiment.Can be combined into a module or unit or assembly to the module among the embodiment or unit or assembly, and can be divided into a plurality of submodules or subelement or sub-component to them in addition.In such feature and/or process or unit at least some are mutually repelling, and can adopt any combination to disclosed all features in this instructions (comprising claim, summary and the accompanying drawing followed) and so all processes or the unit of disclosed any method or equipment make up.Unless in addition clearly statement, disclosed each feature can be by providing identical, being equal to or the alternative features of similar purpose replaces in this instructions (comprising claim, summary and the accompanying drawing followed).
In addition, those skilled in the art can understand, although embodiment more described herein comprise some feature rather than further feature included among other embodiment, the combination of the feature of different embodiment means and is within the scope of the present invention and forms different embodiment.For example, in the following claims, the one of any of embodiment required for protection can be used with array mode arbitrarily.
All parts embodiment of the present invention can realize with hardware, perhaps realizes with the software module of moving at one or more processor, and perhaps the combination with them realizes.It will be understood by those of skill in the art that and to use in practice microprocessor or digital signal processor (DSP) to realize according to some or all some or repertoire of parts in the equipment of the embodiment of the invention.The present invention can also be embodied as be used to part or all equipment or the device program (for example, computer program and computer program) of carrying out method as described herein.Such realization program of the present invention can be stored on the computer-readable medium, perhaps can have the form of one or more signal.Such signal can be downloaded from internet website and obtain, and perhaps provides at carrier signal, perhaps provides with any other form.
It should be noted above-described embodiment the present invention will be described rather than limit the invention, and those skilled in the art can design alternative embodiment in the situation of the scope that does not break away from claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and is not listed in element or step in the claim.Being positioned at word " " before the element or " one " does not get rid of and has a plurality of such elements.The present invention can realize by means of the hardware that includes some different elements and by means of the computing machine of suitably programming.In having enumerated the unit claim of some devices, several in these devices can be to come imbody by same hardware branch.The use of word first, second and C grade does not represent any order.Can be title with these word explanations.