CN107657026B - User interface unit testing method and device, readable storage medium and equipment - Google Patents

User interface unit testing method and device, readable storage medium and equipment Download PDF

Info

Publication number
CN107657026B
CN107657026B CN201710891009.XA CN201710891009A CN107657026B CN 107657026 B CN107657026 B CN 107657026B CN 201710891009 A CN201710891009 A CN 201710891009A CN 107657026 B CN107657026 B CN 107657026B
Authority
CN
China
Prior art keywords
target object
list
data set
original
matching
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
CN201710891009.XA
Other languages
Chinese (zh)
Other versions
CN107657026A (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710891009.XA priority Critical patent/CN107657026B/en
Publication of CN107657026A publication Critical patent/CN107657026A/en
Priority to PCT/CN2018/082348 priority patent/WO2019062067A1/en
Application granted granted Critical
Publication of CN107657026B publication Critical patent/CN107657026B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9014Indexing; Data structures therefor; Storage structures hash tables

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Debugging And Monitoring (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to the technical field of software testing, in particular to a method, a device, a readable storage medium and equipment for testing a user interface unit, wherein the method comprises the following steps: obtaining the hash value of an input search data object; searching elements matched with the hash value in a list binding data set, and determining the searched elements matched with the hash value as target objects; matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set to obtain a matching result, wherein the list binding data set is a data set obtained by cloning the original list data set; and outputting the matching result as a user interface unit test result. The method and the device can effectively solve the problem of matching dislocation of the RecyclerView due to the fact that no clear index value exists, and improve matching accuracy.

Description

User interface unit testing method and device, readable storage medium and equipment
Technical Field
The invention relates to the technical field of software testing, in particular to a method and a device for testing a user interface unit, a readable storage medium and equipment.
Background
The unit test of an Android (Android) system comprises a User Interface (UI) unit test and a Java unit test. The UI unit test needs to be performed on a real machine because the UI unit test depends on a screen pressure sensor, and the Java unit test only needs to be performed on a virtual machine (JVM) because the Java unit test runs pure Java code and does not depend on any other component.
For UI element testing, the list-type UI element testing accounts for approximately 30% of the total UI element testing. Currently, the test operations of the list-type UI unit test include: single Click (Single Click), Double Click (Double Click), long press (LongPress), and slide (slide), which are the objects of operation, must be specified, i.e., List items (List items), and therefore, how to accurately and quickly find the List items is a technical difficulty in the UI unit test of the List control.
However, in the prior art, for the list-type control UI unit test, Item matching rules are mainly specified by a Matcher (Matcher) provided by the system, and the principle is as follows: firstly, providing a list index value (index) corresponding to an Item, and then performing lookup by a mather according to the index to further implement a matching test, however, for a recoverable list control (cycleview), since the Item of the list has no clear index value, if the method is applied to the cycleview, a problem of mismatching will occur.
Disclosure of Invention
In view of the above, the present invention has been made to provide a user interface unit testing method, apparatus, readable storage medium and device that overcome the above problems or at least partially solve the above problems.
The embodiment of the invention provides a user interface unit testing method, which comprises the following steps:
obtaining the hash value of an input search data object;
searching elements matched with the hash value in a list binding data set, and determining the searched elements matched with the hash value as target objects;
matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set to obtain a matching result, wherein the list binding data set is a data set obtained by cloning the original list data set;
and outputting the matching result as a user interface unit test result.
Preferably, after the found element matching the hash value is determined as the target object, and before the original set data of the target object in the original list data set is matched with the binding data of the target object in the list binding data set, the method further includes:
judging whether the type of the target object is the same as that of the list binding data set or not;
and if the type of the target object is the same as that of the list binding data set, executing the step of matching the original set data of the target object in the original list data set with the binding data of the target object in the list binding data set, otherwise, outputting the matching failure as the test result of the user interface unit.
Preferably, after the found element matching the hash value is determined as the target object, and before the original set data of the target object in the original list data set is matched with the binding data of the target object in the list binding data set, the method further includes:
judging whether the layout identification of the target object is legal or not;
if the layout identifier of the target object is legal, traversing the layout identifier constant file, and judging whether a layout identifier which is the same as the layout identifier of the target object exists or not;
if the target object exists, determining a list corresponding to the target object based on a list layout identifier corresponding to the target object, and performing the step of matching the original set data of the target object in the original list data set with the binding data of the target object in the list binding data set based on the list corresponding to the target object;
if not, directly executing the step of matching the original set data of the target object in the original list data set with the binding data of the target object in the list binding data set;
and if the layout identification of the target object is illegal, outputting the matching failure as the test result of the user interface unit.
Preferably, the determining whether the layout identifier of the target object is legal includes:
judging whether the layout identification of the target object belongs to 8-bit hexadecimal integer;
if the layout identifier of the target object belongs to 8-bit hexadecimal integer, the layout identifier of the target object is legal, and if the layout identifier of the target object does not belong to 8-bit hexadecimal integer, the layout identifier of the target object is illegal.
Preferably, the searching for the element matching the hash value in the list binding dataset includes:
and taking the position of the middle element of the list binding data set as an initial searching position, expanding the elements on two sides of the list binding data set, and searching the elements matched with the hash value.
Preferably, the matching the original set data of the target object in the original list data set with the binding data of the target object in the list binding data set includes:
and matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set by utilizing a CFPM algorithm.
An embodiment of the present invention further provides a user interface unit testing apparatus, where the apparatus includes:
the acquisition module is used for acquiring the hash value of the input search data object;
the searching module is used for searching the elements matched with the hash value in the list binding data set and determining the searched elements matched with the hash value as target objects;
the matching module is used for matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set to obtain a matching result, wherein the list binding data set is a data set obtained by cloning the original list data set;
and the output module is used for outputting the matching result as a test result of the user interface unit.
Preferably, the apparatus further comprises:
the first judgment module is used for judging whether the type of the target object is the same as that of the list binding data set or not;
and the first execution module is used for executing the step of matching the original set data of the target object in the original list data set with the binding data of the target object in the list binding data set if the type of the target object is the same as the type of the list binding data set, and otherwise, outputting the matching failure as the test result of the user interface unit.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following steps:
obtaining the hash value of an input search data object;
searching elements matched with the hash value in a list binding data set, and determining the searched elements matched with the hash value as target objects;
matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set to obtain a matching result, wherein the list binding data set is a data set obtained by cloning the original list data set;
and outputting the matching result as a user interface unit test result.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and when the processor executes the computer program, the following steps are implemented:
obtaining the hash value of an input search data object;
searching elements matched with the hash value in a list binding data set, and determining the searched elements matched with the hash value as target objects;
matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set to obtain a matching result, wherein the list binding data set is a data set obtained by cloning the original list data set;
and outputting the matching result as a user interface unit test result.
One or more technical solutions in the embodiments of the present invention have at least the following technical effects or advantages:
according to the method and the device, the hash value of the input search data object is used as a query input condition, the element matched with the hash value is searched in the list binding data set, the searched element matched with the hash value is determined as the target object, the original set data of the target object in the original list data set is matched with the binding data of the target object in the list binding data set, the matching result is output as a user interface unit test result, due to the uniqueness of the hash value, the problem of mismatching of the RecyclerView due to the fact that no clear index value exists can be effectively solved, and the matching accuracy is improved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 illustrates a flow chart of a user interface unit testing method in an embodiment of the invention;
FIG. 2 shows a block diagram of a user interface unit testing apparatus in an embodiment of the invention;
fig. 3 shows a physical structure diagram of a computer device in the embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the application provides a user interface unit testing method, which can be applied to an Android system, and the coding language of the method can be Java. As shown in fig. 1, the method includes:
step 101: and obtaining the hash value of the input search data object.
Step 102: and searching elements matched with the hash value in the list binding data set, and determining the searched elements matched with the hash value as target objects.
For step 101 and step 102, the present application takes the hash value of the input lookup data object as the only input condition, and first, HashCode is obtained according to the hash value of the input lookup data objectTAs a matching value, a HashCode is searched in a list binding data set (AdapterCollection) by using an improved fast search Algorithm (AQS)TThe same elements and the searched HashCodeTThe same element is determined as the target object. After the target object is determined, the target object may be output, and the Index value Index0 of the target object in the list binding data set may be output while the target object is output.
Further, in the process of searching for the element matched with the hash value in the list binding data set, the position of the middle element of the list binding data set is used as an initial searching position, the elements on the two sides of the list binding data set are expanded, and the element matched with the hash value is searched. For example, if the list binding data set is [ a, b, c, d, e ], taking the location of the element c as the initial search location, respectively determining whether the hash value of the element c is the same as the hash value of the searched data object, if not, determining whether the hash values of the element b and the element d are the same as the hash value of the searched data object, and so on. By the searching method, the searching efficiency can be improved, and further the testing efficiency can be improved.
Further, in order to prevent the subsequent element data comparison from being abnormal, before the target object is output, the non-null judgment can be performed on the member variables contained in the target object one by one.
After step 102 is completed, step 103 is performed: and matching the original set data of the target object in an original list data set with the binding data of the target object in the list binding data set to obtain a matching result, wherein the list binding data set is a data set obtained by cloning the original list data set.
After step 103 is completed, step 104 is performed: and outputting the matching result as a user interface unit test result.
For steps 103 and 104, the matching can be performed using the CFPM algorithm. Specifically, the CFPM algorithm is a pattern matching algorithm based on character frequency, and its principle is to align key characters one by one with the positions of the characters to be matched, and perform bidirectional matching. For the present application, all field values inside the data object use a string type, so all fields inside can be spliced into a long string, as shown in table 1 below.
Field 0 Field 1 Field 2 Field 3 Field 4 Field 5
TABLE 1
According to the method, the fields contained in the target object are spliced into the long character strings, the characters of all the fields of the target object are spliced according to default letter sequencing in the splicing process, then the long character strings are arranged according to letter occurrence frequency, and an English letter frequency table is as follows 2:
Figure BDA0001421164000000071
the finally arranged and output character String is the contrast character String for subsequent matching searchMFurther, with StringMFor comparing character strings, using the binding data of target object in the list binding data set as query condition, reading field values in the binding data one by one, and starting from StringMThe middle character position carries out the inquiry and matching of the field character along the left and right directions, if the first character appears in StringMIf not, the query is directly terminated, if the query is matched, the query of the next character is carried out, and when the characters of all fields of the binding data are in StringMCan be queried, and the number of accumulated queries is StringMIf the matching fails, the matching result is finally output as the test result of the user interface unit.
The method and the device realize matching through the CFPM algorithm, and effectively improve the matching query speed.
In this application, to avoid that the target object and the list binding data set do not correspond to each other, after step 102 and before step 103, the method further includes:
judging whether the type of the target object is the same as that of the list binding data set or not;
if the type of the target object is the same as that of the list binding data set, executing step 103, otherwise, outputting the matching failure as the test result of the user interface unit.
In the specific implementation process, due to the multi-inheritance characteristic of Java, the type of a target object may not be consistent with the type of a list binding data set, and therefore, whether the type of the target object is the same as the type of the list binding data set needs to be judged.
In the present application, to improve the matching accuracy, after step 102 and before step 103, the method further includes:
judging whether the layout identification of the target object is legal or not;
if the layout identifier of the target object is legal, traversing the layout identifier constant file, and judging whether a layout identifier which is the same as the layout identifier of the target object exists or not;
if yes, determining a list corresponding to the target object based on the list layout identifier corresponding to the target object, and executing step 103 based on the determined list corresponding to the target object;
if not, directly executing step 103;
and if the layout identification of the target object is illegal, outputting the matching failure as a test result of the user interface unit.
Specifically, there may be a situation where layout Identifiers (IDs) are multiplexed, for example, there are two lists, namely, list a and list B, where list a is overlaid on list B, and the data sets bound by list a and list B are the same, and in this case, the problem of matching and misalignment between list a and list B is likely to occur. If the layout ID of the target object is illegal, outputting the matching failure as the test result of the user interface unit, if the layout ID of the target object is legal, traversing the layout identification constant file, judging whether the same layout ID exists, and if the same layout ID exists, determining a real list corresponding to the target object based on the list layout ID corresponding to the target object, thereby realizing the technical effect of determining the only corresponding list from the multiplexed layout ID of the target object. Further, after determining the list corresponding to the target object, the step 103 is continued. If the same layout ID does not exist, step 103 is directly performed.
Based on the same inventive concept, an embodiment of the present invention further provides a user interface unit testing apparatus, as shown in fig. 2, the apparatus includes:
an obtaining module 201, configured to obtain a hash value of an input lookup data object;
a searching module 202, configured to search for an element matching the hash value in a list binding dataset, and determine the searched element matching the hash value as a target object;
a matching module 203, configured to match original set data of the target object in an original list data set with binding data of the target object in the list binding data set to obtain a matching result, where the list binding data set is a data set obtained after cloning the original list data set;
and the output module 204 is configured to output the matching result as a user interface unit test result.
Preferably, the apparatus further comprises:
the first judgment module is used for judging whether the type of the target object is the same as that of the list binding data set or not;
and the first execution module is used for executing the step of matching the original set data of the target object in the original list data set with the binding data of the target object in the list binding data set if the type of the target object is the same as the type of the list binding data set, and otherwise, outputting the matching failure as the test result of the user interface unit.
Preferably, the apparatus further comprises:
the second judgment module is used for judging whether the layout identifier of the target object is legal or not;
a third judging module, configured to traverse the layout identifier constant file and judge whether a layout identifier identical to the layout identifier of the target object exists if the layout identifier of the target object is legal;
a second executing module, configured to determine, if the target object exists, a list corresponding to the target object based on the list layout identifier corresponding to the target object, and execute, based on the list corresponding to the target object, the step of matching original set data of the target object in an original list data set with binding data of the target object in a list binding data set;
a third executing module, configured to directly execute the step of matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set if the original set data does not exist;
and the fourth execution module is used for outputting the matching failure as the test result of the user interface unit if the layout identification of the target object is illegal.
Preferably, the second determining module is specifically configured to:
judging whether the layout identification of the target object belongs to 8-bit hexadecimal integer;
if the layout identifier of the target object belongs to 8-bit hexadecimal integer, the layout identifier of the target object is legal, and if the layout identifier of the target object does not belong to 8-bit hexadecimal integer, the layout identifier of the target object is illegal.
Preferably, the search module is specifically configured to:
and taking the position of the middle element of the list binding data set as an initial searching position, expanding the elements on two sides of the list binding data set, and searching the elements matched with the hash value.
Preferably, the matching module is specifically configured to:
and matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set by utilizing a CFPM algorithm.
Based on the same inventive concept, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the following steps:
obtaining the hash value of an input search data object;
searching elements matched with the hash value in a list binding data set, and determining the searched elements matched with the hash value as target objects;
matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set to obtain a matching result, wherein the list binding data set is a data set obtained by cloning the original list data set;
and outputting the matching result as a user interface unit test result.
Fig. 3 is a schematic diagram of a computer device, which is shown for convenience of illustration, and only shows a part related to the embodiment of the present invention, and details of the specific technology are not disclosed, please refer to the method part of the embodiment of the present invention. The computer device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, etc., taking the computer device as the mobile phone as an example:
fig. 3 is a block diagram illustrating a partial structure associated with a computer device provided by an embodiment of the present invention. Referring to fig. 3, the computer apparatus includes: a memory 301 and a processor 302. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 3 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The following describes the components of the computer device in detail with reference to fig. 3:
the memory 301 may be used to store software programs and modules, and the processor 302 executes various functional applications and data processing by operating the software programs and modules stored in the memory 301. The memory 301 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.), and the like. Further, the memory 301 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 302 is a control center of the computer device, and performs various functions and processes data by operating or executing software programs and/or modules stored in the memory 301 and calling data stored in the memory 301. Alternatively, processor 302 may include one or more processing units; preferably, the processor 302 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications.
In an embodiment of the present invention, the processor 302 included in the computer device may have the following functions:
obtaining the hash value of an input search data object;
searching elements matched with the hash value in a list binding data set, and determining the searched elements matched with the hash value as target objects;
matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set to obtain a matching result, wherein the list binding data set is a data set obtained by cloning the original list data set;
and outputting the matching result as a user interface unit test result.
In a word, the method and the device use the input hash value of the data object to be searched as the query input condition, search the elements matched with the hash value in the list binding data set, determine the searched elements matched with the hash value as the target object, match the original set data of the target object in the original list data set with the binding data of the target object in the list binding data set, and output the matching result as the test result of the user interface unit.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of a gateway, proxy server, system according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words second, third, etc. do not denote any order. These words may be interpreted as names.

Claims (9)

1. A user interface unit testing method, the method comprising:
obtaining the hash value of an input search data object;
searching elements matched with the hash value in a list binding data set, and determining the searched elements matched with the hash value as target objects;
judging whether the layout identification of the target object is legal or not;
if the layout identification of the target object is illegal, outputting the matching failure as the test result of the user interface unit;
if the layout identifier of the target object is legal, traversing the layout identifier constant file, and judging whether a layout identifier which is the same as the layout identifier of the target object exists or not;
if the target object exists, determining a list corresponding to the target object based on a list layout identifier corresponding to the target object, and matching original set data of the target object in an original list data set with binding data of the target object in a list binding data set based on the list corresponding to the target object, wherein the list binding data set is a data set obtained by cloning the original list data set;
if not, directly matching the original set data of the target object in the original list data set with the binding data of the target object in the list binding data set;
matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set to obtain a matching result;
and outputting the matching result as a user interface unit test result.
2. The method of claim 1, wherein after said determining the located element that matches the hash value as a target object and prior to said matching original set data of the target object in an original list data set with bound data of the target object in the list bound data set, the method further comprises:
judging whether the type of the target object is the same as that of the list binding data set or not;
and if the type of the target object is the same as that of the list binding data set, executing the step of matching the original set data of the target object in the original list data set with the binding data of the target object in the list binding data set, otherwise, outputting the matching failure as the test result of the user interface unit.
3. The method of claim 1, wherein said determining whether the layout identity of the target object is legitimate comprises:
judging whether the layout identification of the target object belongs to 8-bit hexadecimal integer;
if the layout identifier of the target object belongs to 8-bit hexadecimal integer, the layout identifier of the target object is legal, and if the layout identifier of the target object does not belong to 8-bit hexadecimal integer, the layout identifier of the target object is illegal.
4. The method of claim 1, wherein finding the element in the list binding dataset that matches the hash value comprises:
and taking the position of the middle element of the list binding data set as an initial searching position, expanding the elements on two sides of the list binding data set, and searching the elements matched with the hash value.
5. The method of claim 1, wherein said matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set comprises:
and matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set by utilizing a CFPM algorithm.
6. A user interface unit testing apparatus, the apparatus comprising:
the acquisition module is used for acquiring the hash value of the input search data object;
the searching module is used for searching the elements matched with the hash value in the list binding data set and determining the searched elements matched with the hash value as target objects;
the matching module is used for matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set to obtain a matching result, wherein the list binding data set is a data set obtained by cloning the original list data set;
the output module is used for outputting the matching result as a test result of the user interface unit;
the second judgment module is used for judging whether the layout identifier of the target object is legal or not;
a third judging module, configured to traverse the layout identifier constant file and judge whether a layout identifier identical to the layout identifier of the target object exists if the layout identifier of the target object is legal;
a second executing module, configured to determine, if the target object exists, a list corresponding to the target object based on the list layout identifier corresponding to the target object, and execute, based on the list corresponding to the target object, the step of matching original set data of the target object in an original list data set with binding data of the target object in a list binding data set;
a third executing module, configured to directly execute the step of matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set if the original set data does not exist;
and the fourth execution module is used for outputting the matching failure as the test result of the user interface unit if the layout identification of the target object is illegal.
7. The apparatus of claim 6, wherein the apparatus further comprises:
the first judgment module is used for judging whether the type of the target object is the same as that of the list binding data set or not;
and the first execution module is used for executing the step of matching the original set data of the target object in the original list data set with the binding data of the target object in the list binding data set if the type of the target object is the same as the type of the list binding data set, and otherwise, outputting the matching failure as the test result of the user interface unit.
8. A computer-readable storage medium, on which a computer program is stored, which program, when executed by a processor, carries out the steps of:
obtaining the hash value of an input search data object;
searching elements matched with the hash value in a list binding data set, and determining the searched elements matched with the hash value as target objects;
judging whether the layout identification of the target object is legal or not;
if the layout identification of the target object is illegal, outputting the matching failure as a test result of the user interface unit;
if the layout identifier of the target object is legal, traversing the layout identifier constant file, and judging whether a layout identifier which is the same as the layout identifier of the target object exists or not;
if the target object exists, determining a list corresponding to the target object based on a list layout identifier corresponding to the target object, and matching original set data of the target object in an original list data set with binding data of the target object in a list binding data set based on the list corresponding to the target object, wherein the list binding data set is a data set obtained by cloning the original list data set;
if not, directly matching the original set data of the target object in the original list data set with the binding data of the target object in the list binding data set;
matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set to obtain a matching result, wherein the list binding data set is a data set obtained by cloning the original list data set;
and outputting the matching result as a user interface unit test result.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of:
obtaining the hash value of an input search data object;
searching elements matched with the hash value in a list binding data set, and determining the searched elements matched with the hash value as target objects;
judging whether the layout identification of the target object is legal or not;
if the layout identification of the target object is illegal, outputting the matching failure as a test result of the user interface unit;
if the layout identifier of the target object is legal, traversing the layout identifier constant file, and judging whether a layout identifier which is the same as the layout identifier of the target object exists or not;
if the target object exists, determining a list corresponding to the target object based on a list layout identifier corresponding to the target object, and matching original set data of the target object in an original list data set with binding data of the target object in a list binding data set based on the list corresponding to the target object, wherein the list binding data set is a data set obtained by cloning the original list data set;
if not, directly matching the original set data of the target object in the original list data set with the binding data of the target object in the list binding data set;
matching original set data of the target object in an original list data set with binding data of the target object in the list binding data set to obtain a matching result, wherein the list binding data set is a data set obtained by cloning the original list data set;
and outputting the matching result as a user interface unit test result.
CN201710891009.XA 2017-09-27 2017-09-27 User interface unit testing method and device, readable storage medium and equipment Active CN107657026B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710891009.XA CN107657026B (en) 2017-09-27 2017-09-27 User interface unit testing method and device, readable storage medium and equipment
PCT/CN2018/082348 WO2019062067A1 (en) 2017-09-27 2018-04-09 User interface unit test method and apparatus, readable storage medium and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710891009.XA CN107657026B (en) 2017-09-27 2017-09-27 User interface unit testing method and device, readable storage medium and equipment

Publications (2)

Publication Number Publication Date
CN107657026A CN107657026A (en) 2018-02-02
CN107657026B true CN107657026B (en) 2020-05-12

Family

ID=61116297

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710891009.XA Active CN107657026B (en) 2017-09-27 2017-09-27 User interface unit testing method and device, readable storage medium and equipment

Country Status (2)

Country Link
CN (1) CN107657026B (en)
WO (1) WO2019062067A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107657026B (en) * 2017-09-27 2020-05-12 武汉斗鱼网络科技有限公司 User interface unit testing method and device, readable storage medium and equipment
CN109992580A (en) * 2018-11-08 2019-07-09 深圳壹账通智能科技有限公司 Processing method and processing device, storage medium, the computer equipment of table data

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105760292A (en) * 2014-12-18 2016-07-13 阿里巴巴集团控股有限公司 Assertion verification method and device for unit testing

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8549320B2 (en) * 2006-11-02 2013-10-01 Red Hat, Inc. Verifying loaded module during debugging
CN106354622B (en) * 2015-07-14 2019-09-20 北京国双科技有限公司 Test the methods of exhibiting and device of webpage
CN105828200A (en) * 2016-03-22 2016-08-03 乐视网信息技术(北京)股份有限公司 Program menu updating method and device
CN107657026B (en) * 2017-09-27 2020-05-12 武汉斗鱼网络科技有限公司 User interface unit testing method and device, readable storage medium and equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105760292A (en) * 2014-12-18 2016-07-13 阿里巴巴集团控股有限公司 Assertion verification method and device for unit testing

Also Published As

Publication number Publication date
CN107657026A (en) 2018-02-02
WO2019062067A1 (en) 2019-04-04

Similar Documents

Publication Publication Date Title
WO2018149292A1 (en) Object clustering method and apparatus
JP5992622B2 (en) Malicious application diagnostic apparatus and method
CN107967135B (en) Calculation engine implementation method, electronic device and storage medium
CN107563201B (en) Associated sample searching method and device based on machine learning and server
CN109814524B (en) Vehicle diagnosis method, device and system
US11036479B2 (en) Devices, systems, and methods of program identification, isolation, and profile attachment
CN106534268B (en) Data sharing method and device
WO2018149138A1 (en) Wireless fidelity (wi-fi) connection method and related product
CN107657026B (en) User interface unit testing method and device, readable storage medium and equipment
US20180247152A1 (en) Method and apparatus for distance measurement
CN112052413B (en) URL fuzzy matching method, device and system
CN111149106A (en) Apparatus and method for key authentication using multiple device certificates
CN116366338B (en) Risk website identification method and device, computer equipment and storage medium
CN107577943B (en) Sample prediction method and device based on machine learning and server
CN112015806A (en) Method and device for storing data by block chain
CN111241546B (en) Malicious software behavior detection method and device
CN110652728B (en) Game resource management method and device, electronic equipment and storage medium
CN114900546A (en) Data processing method, device and equipment and readable storage medium
CN109284590B (en) Method, equipment, storage medium and device for access behavior security protection
CN107153692B (en) Method and equipment for matching character strings
CN105653540B (en) Method and device for processing file attribute information
CN106599637A (en) Method and device for inputting verification code into verification interface
KR102415494B1 (en) Emulation based security analysis method for embedded devices
CN105302439A (en) Shortcut operation method and terminal
CN106250440B (en) Document management method and device

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