CN107357725B - Application testing method and device - Google Patents

Application testing method and device Download PDF

Info

Publication number
CN107357725B
CN107357725B CN201710530975.9A CN201710530975A CN107357725B CN 107357725 B CN107357725 B CN 107357725B CN 201710530975 A CN201710530975 A CN 201710530975A CN 107357725 B CN107357725 B CN 107357725B
Authority
CN
China
Prior art keywords
interface
control
test
contact surface
tested
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710530975.9A
Other languages
Chinese (zh)
Other versions
CN107357725A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710530975.9A priority Critical patent/CN107357725B/en
Publication of CN107357725A publication Critical patent/CN107357725A/en
Application granted granted Critical
Publication of CN107357725B publication Critical patent/CN107357725B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Tests Of Electronic Circuits (AREA)

Abstract

The invention discloses a kind of application testing method and devices, belong to field of terminal technology.This method includes:Determine the control in the current interface of application;Based on the correspondence between control mark in the application interface feature value recorded during the test and interface, if there is no do not test control in current interface, second contact surface is determined from least one first interface, first interface refers to the presence of the interface for not testing control in applying, and interface feature value identifies to obtain according to the control of each control in interface;Control corresponding with second contact surface in current interface is triggered, second contact surface is jumped to;Control of not testing in second contact surface is tested.Present invention can ensure that always not testing control using institute's control to be tested in test process, so as to traverse all controls in application, it avoids control from being missed simultaneously, decreases the repetition situation multiple to same components testing, improve testing efficiency.

Description

Application testing method and device
Technical field
The present invention relates to field of terminal technology, more particularly to a kind of application testing method and device.
Background technology
With the development of terminal technology, the memory of terminal greatly promotes, and the application integrated is also more and more.And in order to protect Card application in actual use can normal operation, often application reach the standard grade before to application test.
For the prior art in test application, terminal can generate users' thing such as click event, key-press event or gesture event Part carrys out analog subscriber to the clicking operation of control, button operation or gesture operation etc. in application, and terminal is based on the user received Event can randomly trigger the control in application, to be controlled by the control in simulation process test application, and based on test The operation information applied after part carrys out the operation conditions of test application.
In the implementation of the present invention, the inventor finds that the existing technology has at least the following problems:
A large amount of controls are generally included in one application, are likely to the same control using the test mode of random test control Part repetitive operation is multiple, and some controls may be missed, and causes testing efficiency low.
Invention content
In order to solve problems in the prior art, an embodiment of the present invention provides a kind of application testing method and devices.It is described Technical solution is as follows:
In a first aspect, a kind of application testing method is provided, the method includes:
Determine the control in the current interface of application;
Based on it is described apply the interface feature value that is recorded during the test and in interface it is corresponding between control mark Relationship determines second contact surface if there is no control is not tested in the current interface from least one first interface, described First interface refers to the presence of the interface for not testing control in the application, and the interface feature value is according to each control in the interface The control of part identifies to obtain;
Control corresponding with the second contact surface in the current interface is triggered, the second contact surface is jumped to;
Control of not testing in the second contact surface is tested.
Second aspect, provide it is a kind of applying test device, described device includes:
First determining module, the control in current interface for determining application;
Second determining module, for applying the interface feature value recorded during the test to be controlled with interface based on described Correspondence between part mark does not test control, from least one first interface if be not present in the current interface Determine that second contact surface, first interface refer to the presence of the interface for not testing control, the interface feature value root in the application It identifies to obtain according to the control of each control in the interface;
Jump module jumps to described for triggering control corresponding with the second contact surface in the current interface Second interface;
Test module, for testing the control of not testing in the second contact surface.
The third aspect provides a kind of computer readable storage medium, is stored in the computer readable storage medium At least one instruction, described instruction are loaded by processor and are executed to realize such as the application test of any one of above-mentioned first aspect Method.
Fourth aspect provides a kind of terminal, and the terminal includes processor and memory, is stored in the memory At least one instruction, described instruction are loaded by the processor and are executed to realize such as the application of any one of above-mentioned first aspect Test method.
The embodiment of the present invention by interface feature value come interface identification, can be based on the boundary recorded in application test process Correspondence in region feature value and interface between control mark determines in current interface with the presence or absence of not testing control, and In the case of not testing control, it can jump to and continue test process in the presence of in the interface for not testing control so that answer Control is not always tested with institute's control to be tested in test process, so as to traverse all controls in application, is avoided Control is missed simultaneously, decreases the repetition situation multiple to same components testing, improves testing efficiency.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings Attached drawing.
Fig. 1 is a kind of implementation environment schematic diagram of application test provided in an embodiment of the present invention;
Fig. 2 is a kind of flow chart of application testing method provided in an embodiment of the present invention;
Fig. 3 is a kind of interface feature value schematic diagram provided in an embodiment of the present invention;
Fig. 4 is the schematic diagram that a kind of interface provided in an embodiment of the present invention redirects record;
Fig. 5 A are provided in an embodiment of the present invention a kind of using test flow chart;
Fig. 5 B are a kind of application test result figures provided in an embodiment of the present invention;
Fig. 6 is a kind of block diagram using test device provided in an embodiment of the present invention;
Fig. 7 is a kind of block diagram using test device provided in an embodiment of the present invention;
Fig. 8 is a kind of terminal structure schematic diagram provided in an embodiment of the present invention.
Specific implementation mode
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
Fig. 1 is a kind of implementation environment schematic diagram of application test provided in an embodiment of the present invention, referring to Fig. 1, the implementation ring May include in border:
At least one server 101 and at least one terminal 102.Wherein, server 101 is used to provide clothes for terminal 102 Business, such as social interaction server, game services or Video service, specifically, server 101 can be answered by what terminal 102 was installed It is serviced with providing the terminal with.The terminal 102 is used for the application that runtime server 101 is provided, and tests the application. In practical application scene, the embodiment of the present invention does not limit the opportunity of application test.For example, terminal 102 is either test The test terminal that personnel hold, then the test terminal can application reach the standard grade before to application survey;The terminal 102 can also be The terminal that user holds, then the terminal application can be tested according to existing configuration timing, or according to server 101 Instruction is tested to real time down to test application.When terminal 102 is carried out using test, can will apply in test process Obtained application operation information reporting is to server 101 so that server 101 can be applied according to application operation information analysis Operation conditions formulates the migration efficiency of application, improves the various problems etc. of application.
In addition, the server 101 can also configure at least one database, and e.g., test database, customer data base etc. Deng.The test database is used to store the application operation information using in test process, and the customer data base is for storing the clothes The personal data such as the username and password of user that business device 101 is serviced.
Fig. 2 is a kind of flow chart of application testing method provided in an embodiment of the present invention, and referring to Fig. 2, this method can answer For terminal, specifically include:
201, the control in the current interface of application is determined.
Wherein, which can refer to any application that terminal is installed, for example, game application, social networking application or video Using etc..Control refers to the basic element constituted using median surface, is interacted for user and application, is not limited to button control Part, Input, notification bar control etc..When terminal is received to the trigger event of a certain control on interface, may jump Another interface is gone to, for example, when the control is button control, it, can be with when terminal receives the click event to button control Jump to the corresponding wicket interface of button control;When the control is notification bar control, when terminal is received to notification bar control Slip event when, can show the corresponding notification bar interface of the notification bar control.
In the step, terminal can obtain the application code or web page code of current interface, for the webpage of current interface Code can be inquired in web page code based on configured control keyword, be got on control key position Control identifies.For the application code of current interface, terminal can directly invoke the control according to configured control output function Part output function, and control mark is got according to the output valve of control output function.Wherein, control mark is for uniquely marking Know a control, is not limited to use the either tables such as control title, control path or the control cryptographic Hash obtained according to control information Show form.In actual application scenarios, it is contemplated that certain controls may be blocked by other controls or in current screen range It does not show inside, and the control that user can trigger is usually the visible control in current interface, therefore, to make test process more force The scene of true simulation user's trigger control, terminal can also determine all controls in current interface, based on each control Control location screens out the invisible control in current screen, and is determined as the remaining control in current interface to work as prezone Control in face, by screening out the invisible control in current screen, it is possible to reduce to be tested using being needed in test process Control quantity, further improves testing efficiency.
Certainly, in order to simplify the retest applied in test process to same class control, to improve test speed, eventually End can screen out the similar control of any control in current interface;Remaining control in current interface is determined as current interface In control.Wherein, the similar control of the control refers to the control for having identity function with the control, and the embodiment of the present invention is to phase It is not specifically limited like the method for determination of control.Usually, has similar control mark between control control similar to its Know, therefore, terminal can be identified based on the control of each control, determine the control between each control and the control in current interface Part identifies similarity;The control that control mark similarity is more than to predetermined threshold value is determined as the similar control of the control.
202, obtain the interface feature value that is recorded during the test of application and in interface it is corresponding between control mark Relationship, interface feature value identify to obtain according to the control of each control in the interface.
In actual application scenarios, test process would generally constantly redirect interface with the control triggered, in order to subtract Few number to the same control retest can be based on interface to efficiently carry out test process with test process Interface feature value interface is not tested into control or tested control associates with therein with control mark in interface, as The reference data of follow-up test process.Wherein, the form of the correspondence in the interface feature value and interface between control mark It is not limited to:The interface feature value at interface corresponds to the control mark for not testing control in the interface, or does not test the control of control Mark corresponds to the interface feature value at interface where this does not test control.Wherein, the interface feature value at interface is used for unique mark one A interface, specifically, the interface feature value can the control of each control identifies in interface according to cryptographic Hash, the boundary The cryptographic Hash in face such as -768500201.For example, Fig. 3 is a kind of interface feature value schematic diagram provided in an embodiment of the present invention, such as Fig. 3 In (a) figure show current interface;In Fig. 3 shown in (b) figure, TouchElem indicates control, and there are four controls altogether in current interface Part, close button, 3 option of 1 option of information, 2 option of information and information in respectively Fig. 3 in (a) figure;The value of scene indicates The scene title of control in the application, the value of element indicate the control path of control, then control mark can be by the field of control Scape title and control path are constituted.
In the step, terminal can obtain the interface feature value of current interface, according to the interface feature value of current interface, obtain Get the correspondence between control mark in the interface feature value and current interface of current interface.For example, obtaining each control Control mark, according to configured Hash calculation formula, the control for obtaining each control identifies corresponding cryptographic Hash as should The interface feature value of current interface.
By the test process with for python programming languages, terminal can be according to specific in python programming languages Data mode:" first ancestral (scene title, control path) ", each element obtains the Kazakhstan of the control in first ancestral based on a control Uncommon value, when calculating cryptographic Hash, the hash function of python programming language self-configurings may be used in terminal.Wherein, scene title It is character string with control path.In turn, interface feature value can also be based on the hash function, and will be each in the interface The cryptographic Hash of control is calculated as input parameter, for example, being carried out based on " first ancestral's (cryptographic Hash of each control in interface) " Hash calculation obtains the interface feature value at the interface.
203, based on corresponding between the application interface feature value recorded during the test and control mark in interface Relationship judges with the presence or absence of control is not tested in current interface, if so, being surveyed to the control of not testing in current interface Examination, if not, executing step 204.
Wherein, based on the correspondence between control mark in various forms of interface feature values and interface, terminal can be with Different judgment modes is taken to carry out the above-mentioned judgement for not testing control.The embodiment of the present invention uses following two judgment modes It illustrates:
The form of correspondence in judgment mode 1, interface feature value and interface between control mark is the interface at interface Characteristic value corresponds to the control mark for not testing control in the interface, then terminal can obtain the interface feature value pair of the current interface The control mark for not testing control answered, if obtained successfully, it is determined that exist in current interface and do not test control, can select Any control of not testing therein is tested, if obtaining failure, it is determined that there is no control is not tested in current interface, hold Row step 204.Certainly, due to usually there are multiple controls in each interface, which is a boundary The interface identification in face corresponds to the control mark of multiple controls.
Interface feature value of the judgment mode 1 based on current interface can be inquired directly in current interface with the presence or absence of not Control is tested, therefore testing efficiency can be further increased.
The form of correspondence in judgment mode 2, interface feature value and interface between control mark is not test control Control mark it is corresponding this do not test control where interface interface feature value, then terminal be based in current interface it is identified often The control of a control identifies, the current interface in the correspondence corresponding to control mark of the inquiry with the presence or absence of the control Interface feature value does not test control if it is, determining and existing in current interface, is not deposited in current interface if it is not, then determining Control is not being tested, executes step 204.
Corresponding this of control mark that the judgment mode 2 does not test control based on each does not test interface where control Interface feature value, it can be determined that go out the test case of each control in current interface, and then determine the test feelings of current interface Condition is further able to comprehensively express the test case to current interface.
In fact, in addition to the shape of the correspondence between control mark in two kinds of interface feature values of the example above and interface Formula can also have other forms, for example, the form of the correspondence in interface feature value and interface between control mark is interface Interface feature value correspond in the interface be tested control control mark, then interface feature value of the terminal based on this kind of form with Correspondence in interface between control mark, can be according to the control in fixed current interface, if tested control Control quantity it is identical as the control quantity in current interface, it is determined that there is no not testing control in current interface, execute step Rapid 204, if the control quantity of tested control is less than the control quantity in current interface, terminal can will be in current interface Control mark identifies different controls from the control of tested control and is determined as not testing control, and does not test this control progress Test.The judgment mode can directly be judged that not only method is easy but also makes according to the control quantity for being tested control Judging efficiency higher.
In the embodiment of the present invention, with the progress of test process, terminal every time to not testing after control tests, To update the correspondence in interface feature value and interface between control mark.It is identified with control in interface feature value and interface Between correspondence form be interface interface feature value correspond to do not tested in the interface control control mark for, tool Body update mode may refer to following deletion process or adding procedure:
Deletion process:After testing not testing control, terminal control in interface feature value and interface identifies it Between correspondence in delete be tested control record.
During the deletion, after testing not testing control, terminal can be according to interface where tested control Interface feature value, the interface feature value based on interface where tested control inquired, the tested control that will be inquired The control mark of part is deleted.Certainly, if the concrete form of the correspondence in interface feature value and interface between control mark Control mark not test control in interface corresponds to the interface feature value at interface where this does not test control, then terminal can root It is identified according to the control of tested control, the quilt is inquired in the correspondence in interface feature value and interface between control mark Control is tested, and deletes a record of the tested control and the interface feature value at interface where it.
The deletion process is by not testing after control tests, deleting the record of the tested control, it is ensured that Where jumping to the tested control again during the test when interface, determine that the tested control has been tested, to keep away Exempt from, to being tested control retest with this, to improve testing efficiency.
Adding procedure:When to it is any do not test control and test after, if jumping to non-test interface, terminal is at interface Each record for not testing control in non-test interface is added in correspondence in characteristic value and interface between control mark.
In the adding procedure, when to it is any do not test control and test after, if terminal jumps to another interface, eventually End can obtain the interface feature value for redirecting rear interface, and will redirect the interface feature value at rear interface at interface feature value and interface Correspondence between middle control mark is inquired, if inquiring this redirects rear interface, terminal determination jumps to tested Examination interface (referring to the interface that there is tested control);If not inquiring this redirects rear interface, terminal determination jumps to not Test interface, and determine the control in the non-test interface, the corresponding pass between interface feature value and control mark in interface This is added in system and does not test control and each correspondence for not testing control therein, as record.
The adding procedure is by adding each record for not testing control when jumping to non-test interface, it is ensured that When jumping to the tested interface in test process again, it can be tested the existing record in interface according to this and tested, from And avoid multiple to same control retest, improve testing efficiency.
It should be noted that not testing control if existed in current interface, terminal can also use other test modes It is tested, can also improve testing efficiency.For example, terminal is based on corresponding between interface feature value and control mark in interface Relationship redirects if the control quantity of not testing in current interface does not test control quantity less than in any third interface It is tested to the third interface, and to the control of not testing in the third interface.In the citing, terminal can analyze each boundary Control quantity is not tested in face, and is jumped to and is not tested the most interface of control quantity and tested, so as to efficiently time Go through each interface into application.
If 204, determining second contact surface from least one first interface there is no control is not tested in current interface, First interface refers to the presence of the interface for not testing control in applying.
In the step, if repeated to same tested control there is no control is not tested in order to reduce in current interface The number of test, improve testing efficiency, terminal can based in interface feature value and interface control mark between correspondence, Determine the control mark for not testing control, and interface where this not tested to control is determined as the first interface, in turn, terminal can be with Determine a second contact surface at random from determining at least one first interface.Certainly, if not can determine that any one first boundary Face illustrates that the control in application is tested, then terminal can determine that test is completed.
It should be noted that the step is the optional step of the embodiment of the present invention.In fact, in addition to above-mentioned determination at random Other than mode, terminal can also determine second contact surface by other methods of determination, for example, terminal is based on interface feature value and currently Correspondence in interface between control mark, if determining each first interface there is no control is not tested in current interface In the quantity for not testing control;There will be do not test the first most interface of control quantity to be determined as second contact surface.
In the method for determination, to make test process orderly carry out, each interface in application is efficiently traversed, further Testing efficiency is improved, if there is no do not test control, the interface spy that terminal can be based on each first interface in current interface Value indicative is inquired in first interface and does not test control in the correspondence in interface feature value and interface between control mark Part determines the quantity for not testing control in first interface, and the number to not testing control in identified each first interface Amount is ranked up, and there will be do not test the first most interface of control quantity to be determined as second contact surface.
205, control corresponding with second contact surface in current interface is triggered, second contact surface is jumped to.
In the step, terminal can redirect record according to the interface of application, determine corresponding with second contact surface in current interface Control, and trigger the control, jump to second contact surface.Wherein, the interface of application redirect record can be according to the survey of the application Examination process obtains.It refers to the record that any interface jumps to another interface based on control in the interface that the interface, which redirects record, should The generating process that interface redirects record can be specially:After testing not testing control, if terminal jump to it is any Interface, the then interface that interface where adding tested control is tested control with interface based on this redirect record.
In the generating process, in the form of interface redirects record as the interface feature value at interface, control control mark with For correspondence between the interface feature value at another interface, if terminal jumps to any interface, the interface can be obtained Interface feature value, and based on the interface feature value at interface where the control of tested control mark and the tested control, The interface of the interface feature value at interface, the control mark of tested control and the interface is special where the tested control of addition one Correspondence between value indicative.
In actual application scenarios, interface can be redirected the summation of record as an interface topological relation by terminal, Then the interface topological relation can express in the application redirects relationship between each interface.Referring to Fig. 4, the embodiment of the present invention carries A kind of interface has been supplied to redirect the schematic diagram of record.(a) figure, which is shown, in Fig. 4 redirects front interface, and (b) figure is shown in Fig. 4 Rear interface is redirected, based on the close button in (a) figure in figure (4), terminal is redirected, in Fig. 4 shown in (c) figure, Edge tables Show that interface redirects record, first Viewplayer expression redirects front interface, and the hash in bracket indicates that this redirects front interface Interface cryptographic Hash, the value of the elem num in bracket indicates to redirect the control quantity in front interface;Second Viewplayer expressions redirect rear interface, and the hash in bracket indicates that this redirects the interface cryptographic Hash at rear interface, in bracket The value of elem num indicate to redirect control quantity in rear interface;Entry expressions, which redirect front interface and jump to this, redirects rear boundary The path that face is passed through;TouchElem expressions redirect front interface and jump to the control triggered for redirecting rear interface, in bracket The value of element indicate that the control path of the control, the value of the scene in bracket indicate the scene name of control in the application Claim.
Specifically, in control corresponding with second contact surface in determining current interface, terminal can be according to current interface Interface feature value, inquiry are to redirect the interface of front interface to redirect record, and the interface that determination inquires redirects record with the interface In redirect rear interface interface feature value it is whether identical as the interface feature value of second contact surface, if it is, triggering this interface The control redirected in record identifies corresponding control, if it is not, then redirecting redirecting in record according to any interface inquired The interface feature value at interface afterwards continues to inquire redirecting rear interface using this and redirect record as the interface for redirecting front interface, and determines The interface inquired again redirect record in redirect rear interface interface feature value whether the interface feature value phase with second contact surface Together, until determining that interface redirects based on certain query process redirects interface feature value and the boundary of second contact surface at rear interface in record Until region feature value is identical, according to inquiry order, current interface is jumped to the second contact surface, the control triggered is needed to carry out Record, obtains one and redirects path, and in turn, terminal can trigger this and redirect control in path successively, jump to second boundary Face.
In fact, terminal, which is likely to be obtained one or more, redirects path, in order to improve testing efficiency, terminal is based on application Interface redirects record, it may be determined that current interface jumps at least one of second contact surface and redirects path, one redirect path by Current interface jumps to second contact surface and at least one control triggered is needed to constitute;It is redirected from least one and determines target in path Path is redirected, it refers to needing one of the control minimum number triggered to redirect path that target, which redirects path, and target redirects in path Including control corresponding with second contact surface in current interface;Triggering target redirects the control in path, jumps to second contact surface.
Where it is assumed that it is to jump to interface 3 by interface 1 that one, which redirects path, then the form that this redirects path can be In 1 characteristic value of interface, interface 1 in the control mark of control, interface 2 between the control mark and 3 characteristic value of interface of control Correspondence.In the jump procedure, terminal can determine that every redirects the control quantity for needing to trigger in path, and will at least one Item redirects the control quantity triggered as required in path and is ranked up, it would be desirable to which one of the control minimum number of triggering redirects road Diameter redirects path as target, and triggers the target successively and redirect control in path, jumps to second contact surface.
According to the interface topological relation recorded, the shortest path that current interface is jumped to second contact surface by terminal determines Path is redirected for target, and path is redirected based on the target and goes to the second contact surface, without the time is wasted in one by one On the test of control is attempted, and then improve testing efficiency.
206, the control of not testing in second contact surface is tested.
In the step, after jumping to second contact surface, terminal can be recorded according to the components testing of second contact surface, selection In the second contact surface control is not tested tested for one.Certainly, after not testing this control and testing, terminal can also The correspondence between control mark in interface feature value and interface is updated, alternatively, if being jumped to based on the tested control Another interface, then terminal can also update interface and redirect record.Moreover, after carrying out to not testing the test of control, terminal can To continue to carry out using test based on step 201-206.
In actual application scenarios, terminal can also record the operation information of application, the operation letter of the application in real time Breath is not limited to the response delay of application, using whether collapsing or the application messages such as network state apply, to be applied for analysis Operation conditions make data basis.
Based on above application test process, referring to Fig. 5 A, test flow chart is applied an embodiment of the present invention provides a kind of.It should In flow chart, terminal judges, using whether being currently running, if it is not, then running the application, whether locate if it is, judging to apply In front stage operation;If the application is not at front stage operation, terminal can be by the application switching to front stage operation, such as to current The application execution of front stage operation returns to operation etc., if the application is in front stage operation, what terminal can determine application works as prezone The control in face, and the similar control of any control is screened out, based on the control after being screened in current interface, obtain current interface Interface feature value jumps to current interface if it is by triggering the control in a upper interface, can also update interface and redirect Relationship.In turn, terminal can be determined with the presence or absence of control is not tested in current interface, if so, control can not be tested to this It is tested, and update components testing record after a test;If not, can be identified according to control in interface feature value and interface Between correspondence determine to exist in application and do not test the most interface of control and redirect pass as second contact surface, and according to interface System jumps to the interface.
The embodiment of the present invention by interface feature value come interface identification, can be based on the boundary recorded in application test process Correspondence in region feature value and interface between control mark determines in current interface with the presence or absence of not testing control, and In the case of not testing control, it can jump to and continue test process in the presence of in the interface for not testing control so that answer Control is not always tested with institute's control to be tested in test process, so as to traverse all controls in application, is avoided Control is missed simultaneously, decreases the repetition situation multiple to same components testing, improves testing efficiency.Moreover, phase The prior art for writing regression test code than needing to put into a large amount of human costs, the embodiment of the present invention pass through during the test Components testing record is obtained, and is tested according to components testing record, human cost is also saved.
Test process, inventor is applied to apply test side using the embodiment of the present invention respectively based on the embodiment of the present invention Method and application testing method in the prior art based on Monkey strategies are tested application 1 and application 2, two tests Components testing number set by process is 300, and concrete application test result figure is as shown in Figure 5:(a) figure is shown in Fig. 5 B Based on the embodiment of the present invention to the test result figure of application 1, as (b) figure is shown based on Monkey (monkey) strategies in Fig. 5 B Application testing method is to the test result figure using 1, as (c) figure is shown based on the embodiment of the present invention to application 2 in Fig. 5 B Test result figure, (d) figure show test result of the application testing method based on Monkey strategies to application 2 in Fig. 5 B Figure.Can be seen that the corresponding test curve of the embodiment of the present invention always by the test result figure applied to two is in carry steadily The trend of liter, and the corresponding test curve of Monkey strategies tends to be constant in one section of subsequent test process, more directly, leads to The coordinate value crossed in test result figure can be seen that in identical 300 control test process, either test control quantity Or number of interfaces is accessed, the test number of the embodiment of the present invention is both significantly higher than the test number of Monkey strategies, therefore this It is highly efficient to invent the test process implemented.
In addition to test result figure as shown in Figure 5 B, test of the above two application testing method to application 1 is additionally provided As a result table 1 and the test result table 2 to application 2:
Table 1
Table 2
It can be seen that in same 300 control test process by above-mentioned test result, the survey of the embodiment of the present invention Examination control quantity has increased separately 25% and 82%, accesses number of interfaces and has increased separately 39% and 45%, is promoted with obvious effects.
Fig. 6 is a kind of block diagram using test device provided in an embodiment of the present invention.Referring to Fig. 6, which specifically includes:
First determining module 601, the control in current interface for determining application;
Second determining module 602, the interface feature value for being recorded during the test based on application are controlled with interface Correspondence between part mark, if determined from least one first interface in current interface there is no control is not tested Second contact surface, the first interface refer to the presence of the interface for not testing control in applying, and interface feature value is according to each control in interface Control identify to obtain;
Jump module 603 jumps to second contact surface for triggering control corresponding with second contact surface in current interface;
Test module 604, for testing the control of not testing in second contact surface.
The embodiment of the present invention by interface feature value come interface identification, can be based on the boundary recorded in application test process Correspondence in region feature value and interface between control mark determines in current interface with the presence or absence of not testing control, and In the case of not testing control, it can jump to and continue test process in the presence of in the interface for not testing control so that answer Control is not always tested with institute's control to be tested in test process, so as to traverse all controls in application, is avoided Control is missed simultaneously, decreases the repetition situation multiple to same components testing, improves testing efficiency.
In a kind of possible realization method, the second determining module 602 is used for:
Based on the correspondence between control mark in interface feature value and interface, if there is no do not survey in current interface Control is tried, determines the quantity for not testing control in each first interface;
There will be do not test the first most interface of control quantity to be determined as second contact surface.
In a kind of possible realization method, jump module 603 is used for:
Interface based on application redirects record, determines that current interface jumps at least one of second contact surface and redirects path, One redirects path and jumps to second contact surface by current interface at least one control for triggering is needed to constitute, and interface redirects record root It is obtained according to the test process of application;
It is redirected from least one and determines that target redirects path in path, it refers to the control number for needing to trigger that target, which redirects path, It measures minimum one and redirects path, it includes control corresponding with second contact surface in current interface that target, which redirects path,;
Triggering target redirects the control in path, jumps to second contact surface.
In a kind of possible realization method, the first determining module 601 is used for:
Screen out the similar control of any control in current interface;
Remaining control in current interface is determined as the control in current interface.
In a kind of possible realization method, the device composition based on Fig. 6, referring to Fig. 7, which further includes:
Add module 605, for when to it is any do not test control and test after, if jumping to non-test interface, That adds in non-test interface in the correspondence in interface feature value and interface between control mark each does not test control Record;And/or
Removing module 606, for after testing not testing control, control to identify in interface feature value and interface Between correspondence in delete be tested control record;And/or
Add module 605, for after testing not testing control, if jumping to any interface, addition to be tested Interface where examination control redirects record with interface of the interface based on tested control.
The alternative embodiment that any combination forms the present invention may be used, herein no longer in above-mentioned all optional technical solutions It repeats one by one.
It should be noted that:The application test device that above-described embodiment provides is in test application, only with above-mentioned each function The division progress of module, can be as needed and by above-mentioned function distribution by different function moulds for example, in practical application Block is completed, i.e., the internal structure of device is divided into different function modules, to complete all or part of work(described above Energy.In addition, the application test device that above-described embodiment provides belongs to same design with application testing method embodiment, it is specific real Existing process refers to embodiment of the method, and which is not described herein again.
Fig. 8 is a kind of terminal structure schematic diagram provided in an embodiment of the present invention, and referring to Fig. 8, which can be used for holding Application testing method in the above-mentioned each embodiment of row, the terminal 800 include:
Terminal 800 may include RF (Radio Frequency, radio frequency) circuit 110, include one or more meters The memory 120 of calculation machine readable storage medium storing program for executing, input unit 130, display unit 140, sensor 150, voicefrequency circuit 160, WiFi (Wireless Fidelity, Wireless Fidelity) module 170, include there are one or more than one processing core processing The components such as device 180 and power supply 190.It will be understood by those skilled in the art that terminal structure shown in Fig. 8 is not constituted pair The restriction of terminal may include either combining certain components or different component cloth than illustrating more or fewer components It sets.Wherein:
RF circuits 110 can be used for receiving and sending messages or communication process in, signal sends and receivees, particularly, by base station After downlink information receives, one or the processing of more than one processor 180 are transferred to;In addition, the data for being related to uplink are sent to Base station.In general, RF circuits 110 include but not limited to antenna, at least one amplifier, tuner, one or more oscillators, use Family identity module (SIM) card, transceiver, coupler, LNA (Low Noise Amplifier, low-noise amplifier), duplex Device etc..In addition, RF circuits 110 can also be communicated with network and other equipment by radio communication.The wireless communication can make With any communication standard or agreement, and including but not limited to GSM (Global System of Mobile communication, entirely Ball mobile communcations system), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), LTE (Long Term Evolution, long term evolution), Email, SMS (Short Messaging Service, short message service) etc..
Memory 120 can be used for storing software program and module, and processor 180 is stored in memory 120 by operation Software program and module, to perform various functions application and data processing.Memory 120 can include mainly storage journey Sequence area and storage data field, wherein storing program area can storage program area, the application program (ratio needed at least one function Such as sound-playing function, image player function) etc.;Storage data field can be stored uses created number according to terminal 800 According to (such as audio data, phone directory etc.) etc..In addition, memory 120 may include high-speed random access memory, can also wrap Include nonvolatile memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts. Correspondingly, memory 120 can also include Memory Controller, to provide processor 180 and input unit 130 to memory 120 access.
Input unit 130 can be used for receiving the number or character information of input, and generate and user setting and function Control related keyboard, mouse, operating lever, optics or the input of trace ball signal.Specifically, input unit 130 may include touching Sensitive surfaces 131 and other input equipments 132.Touch sensitive surface 131, also referred to as touch display screen or Trackpad are collected and are used Family on it or neighbouring touch operation (such as user using any suitable object or attachment such as finger, stylus in touch-sensitive table Operation on face 131 or near touch sensitive surface 131), and corresponding attachment device is driven according to preset formula.It is optional , touch sensitive surface 131 may include both touch detecting apparatus and touch controller.Wherein, touch detecting apparatus detection is used The touch orientation at family, and the signal that touch operation is brought is detected, transmit a signal to touch controller;Touch controller is from touch Touch information is received in detection device, and is converted into contact coordinate, then gives processor 180, and can receive processor 180 The order sent simultaneously is executed.Furthermore, it is possible to using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves Realize touch sensitive surface 131.In addition to touch sensitive surface 131, input unit 130 can also include other input equipments 132.Specifically, Other input equipments 132 can include but is not limited to physical keyboard, function key (such as volume control button, switch key etc.), It is one or more in trace ball, mouse, operating lever etc..
Display unit 140 can be used for showing information input by user or the information and terminal 800 that are supplied to user Various graphical user interface, these graphical user interface can be made of figure, text, icon, video and its arbitrary combination. Display unit 140 may include display panel 141, optionally, LCD (Liquid Crystal Display, liquid crystal may be used Show device), the forms such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) configure display panel 141.Further, touch sensitive surface 131 can cover display panel 141, when touch sensitive surface 131 detects on it or neighbouring touches After touching operation, processor 180 is sent to determine the type of touch event, is followed by subsequent processing type of the device 180 according to touch event Corresponding visual output is provided on display panel 141.Although in fig. 8, touch sensitive surface 131 and display panel 141 are conducts Two independent components realize input and input function, but in some embodiments it is possible to by touch sensitive surface 131 and display Panel 141 is integrated and realizes and outputs and inputs function.
Terminal 800 may also include at least one sensor 150, such as optical sensor, motion sensor and other sensings Device.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 141, and proximity sensor can close display when terminal 800 is moved in one's ear Panel 141 and/or backlight.As a kind of motion sensor, gravity accelerometer can detect in all directions (generally Three axis) acceleration size, size and the direction of gravity are can detect that when static, can be used to identify mobile phone posture application (ratio Such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap);Extremely In other sensors such as gyroscope, barometer, hygrometer, thermometer, the infrared sensors that terminal 800 can also configure, herein It repeats no more.
Voicefrequency circuit 160, loud speaker 161, microphone 162 can provide the audio interface between user and terminal 800.Audio The transformed electric signal of the audio data received can be transferred to loud speaker 161 by circuit 160, and sound is converted to by loud speaker 161 Sound signal exports;On the other hand, the voice signal of collection is converted to electric signal by microphone 162, after being received by voicefrequency circuit 160 Audio data is converted to, then by after the processing of audio data output processor 180, through RF circuits 110 to be sent to such as another end End, or audio data is exported to memory 120 to be further processed.Voicefrequency circuit 160 is also possible that earphone jack, To provide the communication of peripheral hardware earphone and terminal 800.
WiFi belongs to short range wireless transmission technology, and terminal 800 can help user's transceiver electronics by WiFi module 170 Mail, browsing webpage and access streaming video etc., it has provided wireless broadband internet to the user and has accessed.Although Fig. 8 is shown WiFi module 170, but it is understood that, and it is not belonging to must be configured into for terminal 800, completely it can exist as needed Do not change in the range of the essence of invention and omits.
Processor 180 is the control centre of terminal 800, utilizes each portion of various interfaces and connection whole mobile phone Point, by running or execute the software program and/or module that are stored in memory 120, and calls and be stored in memory 120 Interior data execute the various functions and processing data of terminal 800, to carry out integral monitoring to mobile phone.Optionally, processor 180 may include one or more processing cores;Preferably, processor 180 can integrate application processor and modem processor, Wherein, the main processing operation system of application processor, user interface and application program etc., modem processor mainly handles nothing Line communicates.It is understood that above-mentioned modem processor can not also be integrated into processor 180.
Terminal 800 further includes the power supply 190 (such as battery) powered to all parts, it is preferred that power supply can pass through electricity Management system and processor 180 are logically contiguous, to realize management charging, electric discharge and power consumption by power-supply management system The functions such as management.Power supply 190 can also include one or more direct current or AC power, recharging system, power supply event Hinder the random components such as detection circuit, power supply changeover device or inverter, power supply status indicator.
Although being not shown, terminal 800 can also include camera, bluetooth module etc., and details are not described herein.Specifically in this reality It applies in example, the display unit of terminal is touch-screen display, and terminal further includes having memory and one or more than one Program, either more than one program is stored in memory and is configured to by one or more than one processing for one of them Device executes.The one or more programs include instructions for performing the following operations:Determine the current interface of application In control;The components testing record of current interface is obtained, the components testing of current interface records the test according to current interface Process obtains;Components testing record based on current interface, tests the control of not testing in application.
In the exemplary embodiment, it includes the computer readable storage medium instructed to additionally provide a kind of, such as including referring to The memory of order, above-metioned instruction can be executed by the processor in terminal to complete the application testing method in above-described embodiment.Example Such as, computer readable storage medium can be that ROM, random access memory (RAM), CD-ROM, tape, floppy disk and light data are deposited Store up equipment etc..
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely the present invention alternative embodiment, be not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.

Claims (12)

1. a kind of application testing method, which is characterized in that the method includes:
With in interface feature value of the test process based on interface and interface, interface is not tested control by control mark with therein Or tested control associates;The form of correspondence in the interface feature value and interface between control mark includes interface Interface feature value correspond to do not tested in the interface control control mark;
Determine the control in the current interface of application;
Correspondence between being identified based on control in the application interface feature value recorded during the test and interface, Control is not tested if be not present in the current interface, the determining second contact surface from least one first interface, described first Interface refers to the presence of the interface for not testing control in the application, and the interface feature value is according to each control in the interface Control identifies to obtain;
Control corresponding with the second contact surface in the current interface is triggered, the second contact surface is jumped to;
Control of not testing in the second contact surface is tested.
2. according to the method described in claim 1, it is characterized in that, described during the test recorded based on described apply Correspondence in interface feature value and interface between control mark does not test control if be not present in the current interface, Second contact surface is determined from least one first interface, including:
Based on the correspondence between control mark in the interface feature value and interface, if be not present in the current interface Control is not tested, determines the quantity for not testing control in each first interface;
There will be do not test the first most interface of control quantity to be determined as the second contact surface.
3. according to the method described in claim 1, it is characterized in that, in the triggering current interface with the second contact surface Corresponding control jumps to the second contact surface, including:
Interface based on the application redirects record, determines that the current interface jumps at least one of the second contact surface and jumps Turn path, one redirects path and jumps at least one control structure that the second contact surface needs trigger by the current interface At the interface redirects record and obtained according to the test process of the application;
It is redirected from described at least one and determines that target redirects path in path, it refers to the control for needing to trigger that the target, which redirects path, One of part minimum number redirects path, the target redirect path include in the current interface with the second contact surface pair The control answered;
It triggers the target and redirects control in path, jump to the second contact surface.
4. according to the method described in claim 1, it is characterized in that, control in the current interface of the determining application, including:
Screen out the similar control of any control in the current interface;
The control remaining control in the current interface being determined as in the current interface.
5. according to the described method of any one of claim 1-4, which is characterized in that the method further includes:
When to it is any do not test control and test after, if jumping to non-test interface, at the interface feature value and interface Each record for not testing control in the non-test interface is added in correspondence between middle control mark;And/or
When to it is described do not test control and test after, in the interface feature value and corresponding between control mark is closed in interface The record for being tested control is deleted in system;And/or
When to it is described do not test control and test after, if jumping to any interface, add interface where being tested control with Interface of the interface based on the tested control redirects record.
6. a kind of applying test device, which is characterized in that described device is used for interface feature of the test process based on interface Interface is not tested control or tested control associates by value with control mark in interface with therein;The interface feature value with The form of correspondence in interface between control mark includes that the interface feature value at interface corresponds in the interface and do not test control Control mark;
Described device includes:
First determining module, the control in current interface for determining application;
Second determining module, for applying the interface feature value recorded during the test and control mark in interface based on described Correspondence between knowledge, if determined from least one first interface in the current interface there is no control is not tested Second contact surface, first interface refer to the presence of the interface for not testing control in the application, and the interface feature value is according to institute The control for stating each control in interface identifies to obtain;
Jump module jumps to second boundary for triggering control corresponding with the second contact surface in the current interface Face;
Test module, for testing the control of not testing in the second contact surface.
7. device according to claim 6, which is characterized in that second determining module is used for:
Based on the correspondence between control mark in the interface feature value and interface, if be not present in the current interface Control is not tested, determines the quantity for not testing control in each first interface;
There will be do not test the first most interface of control quantity to be determined as the second contact surface.
8. device according to claim 6, which is characterized in that the jump module is used for:
Interface based on the application redirects record, determines that the current interface jumps at least one of the second contact surface and jumps Turn path, one redirects path and jumps at least one control structure that the second contact surface needs trigger by the current interface At the interface redirects record and obtained according to the test process of the application;
It is redirected from described at least one and determines that target redirects path in path, it refers to the control for needing to trigger that the target, which redirects path, One of part minimum number redirects path, the target redirect path include in the current interface with the second contact surface pair The control answered;
It triggers the target and redirects control in path, jump to the second contact surface.
9. device according to claim 6, which is characterized in that first determining module is used for:
Screen out the similar control of any control in the current interface;
The control remaining control in the current interface being determined as in the current interface.
10. according to the device described in any one of claim 6-9, which is characterized in that described device further includes:
Add module, for when to it is any do not test control and test after, if jumping to non-test interface, at the interface That adds in the non-test interface in the correspondence in characteristic value and interface between control mark each does not test control Record;And/or
Removing module, for when to it is described do not test control and test after, the control mark in the interface feature value and interface The record for being tested control is deleted in correspondence between knowledge;And/or
The add module, for when to it is described do not test control and test after, if jumping to any interface, addition is tested Interface where examination control redirects record with interface of the interface based on the tested control.
11. a kind of computer readable storage medium, which is characterized in that be stored at least one in the computer readable storage medium Item instructs, and described instruction is loaded by processor and executed to realize such as side according to any one of claims 1 to 5 Method.
12. a kind of terminal, which is characterized in that the terminal includes processor and memory, is stored at least in the memory One instruction, described instruction are loaded by the processor and are executed to realize such as any one of claim 1 to claim 5 institute The method stated.
CN201710530975.9A 2017-06-29 2017-06-29 Application testing method and device Active CN107357725B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710530975.9A CN107357725B (en) 2017-06-29 2017-06-29 Application testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710530975.9A CN107357725B (en) 2017-06-29 2017-06-29 Application testing method and device

Publications (2)

Publication Number Publication Date
CN107357725A CN107357725A (en) 2017-11-17
CN107357725B true CN107357725B (en) 2018-09-04

Family

ID=60291649

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710530975.9A Active CN107357725B (en) 2017-06-29 2017-06-29 Application testing method and device

Country Status (1)

Country Link
CN (1) CN107357725B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108038059A (en) * 2017-12-22 2018-05-15 广州酷狗计算机科技有限公司 Interface traversal method and device
CN108399124B (en) * 2018-02-07 2021-04-13 深圳壹账通智能科技有限公司 Application testing method and device, computer equipment and storage medium
CN110232019A (en) * 2019-05-20 2019-09-13 平安普惠企业管理有限公司 Page test method and Related product
CN110580221A (en) * 2019-08-21 2019-12-17 东软集团股份有限公司 Control testing method and device, storage medium and electronic equipment
CN111817916B (en) * 2020-07-02 2022-06-03 浙江同花顺智能科技有限公司 Test method, device, equipment and storage medium based on mobile terminal cluster
CN111694753B (en) * 2020-07-30 2023-04-11 北京字节跳动网络技术有限公司 Application program testing method and device and computer storage medium
CN111694755B (en) * 2020-07-31 2023-07-18 抖音视界有限公司 Application program testing method and device, electronic equipment and medium
CN112784194B (en) * 2021-01-28 2022-06-21 济南大学 Automatic traversal method and system for Android application page
CN113032268B (en) * 2021-03-30 2022-02-22 深圳市腾讯信息技术有限公司 Software testing method, device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744056A (en) * 2004-09-04 2006-03-08 华为技术有限公司 Automatic test method of application
CN104915290A (en) * 2015-05-28 2015-09-16 小米科技有限责任公司 Application testing method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2892261A1 (en) * 2005-10-17 2007-04-20 France Telecom METHOD AND SYSTEM FOR MANAGING APPLICATIONS OF A MOBILE TERMINAL

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744056A (en) * 2004-09-04 2006-03-08 华为技术有限公司 Automatic test method of application
CN104915290A (en) * 2015-05-28 2015-09-16 小米科技有限责任公司 Application testing method and device

Also Published As

Publication number Publication date
CN107357725A (en) 2017-11-17

Similar Documents

Publication Publication Date Title
CN107357725B (en) Application testing method and device
CN105320598B (en) Method for testing software and device
US10656785B2 (en) Method and user equipment for managing application programs
CN105278937B (en) A kind of method and device showing pop-up box message
CN104636047B (en) The method, apparatus and touch screen terminal operated to the object in list
CN104427074B (en) A kind of methods, devices and systems for showing incoming information
CN106126411B (en) The method and apparatus that a kind of pair of tested program code is tested
CN106547844B (en) A kind for the treatment of method and apparatus of user interface
CN104077211B (en) A kind of test method and test system of mobile terminal software
CN107276602B (en) Radio frequency interference processing method, device, storage medium and terminal
CN105740145B (en) The method and device of element in orient control
CN105530239B (en) Multi-medium data acquisition methods and device
CN104298686B (en) The method and apparatus for modifying server profile
CN104699501B (en) A kind of method and device for running application program
CN106533917B (en) Relation chain processing method, apparatus and system
CN105526944B (en) Information cuing method and device
US10298590B2 (en) Application-based service providing method, apparatus, and system
CN103399706B (en) Page interaction, device and terminal
CN105807908B (en) A kind of method and apparatus of switching working mode
CN107608725A (en) A kind of information processing method and terminal
CN105005529B (en) A kind of method and device that application program is tested
CN106484615B (en) The method and apparatus of record log
CN106708500B (en) Unload the display methods and device at interface
CN105302589B (en) A kind of method and device obtaining unloading information
CN109947520A (en) Processing method, device, equipment and the storage medium of webpage control

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant