CN117435461A - Method, device and equipment for screening testing key points of interface test - Google Patents

Method, device and equipment for screening testing key points of interface test Download PDF

Info

Publication number
CN117435461A
CN117435461A CN202310930179.XA CN202310930179A CN117435461A CN 117435461 A CN117435461 A CN 117435461A CN 202310930179 A CN202310930179 A CN 202310930179A CN 117435461 A CN117435461 A CN 117435461A
Authority
CN
China
Prior art keywords
interface
node
interfaces
fault
test
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.)
Pending
Application number
CN202310930179.XA
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310930179.XA priority Critical patent/CN117435461A/en
Publication of CN117435461A publication Critical patent/CN117435461A/en
Pending legal-status Critical Current

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/3684Test management for test design, e.g. generating new test cases
    • 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
    • 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/3692Test management for test results analysis

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)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The embodiment of the specification relates to the technical field of automatic testing, relates to the field of software testing, and particularly relates to a test key screening method, device and equipment for interface testing. The method comprises the steps of obtaining a plurality of interfaces operated by a tester in the interface test process and a jump sequence among the interfaces; constructing an interface map according to the jump sequence among the interfaces; calculating the fault number and the doubt number of each interface in the interface map according to the test result of the interfaces and the jump sequence among the interfaces; and calculating the weight of the interface according to the number of doubts and the number of faults of the interface, and determining a testing key interface according to the weight. According to the embodiment of the specification, when the fault treatment of a plurality of fault interfaces is carried out, the interfaces needing priority and important treatment are determined according to the weights of the fault interfaces, and the problems that in the interface test, when a tester finds out that the interfaces are wrong, the interfaces needing important investigation are difficult to determine, so that the problem interfaces cannot be positioned quickly, and the interface test efficiency is low are solved.

Description

Method, device and equipment for screening testing key points of interface test
Technical Field
The embodiment of the specification relates to the technical field of automatic testing, relates to the field of software testing, and particularly relates to a test key screening method, device and equipment for interface testing.
Background
The interface test refers to an end-to-end automatic test based on a UI interface mode in the acceptance and adaptability stage, and is different from the traditional functional test, the interface test is to test an interface operation flow in a user angle, determine whether an interface with failure in return exists, and stop the test flow after failure in return. For example, when a user performs a payment service on a UI interface, relevant information is required to be input on the current UI interface or relevant function modules are clicked, the function on the current UI interface is completed, then the user jumps to the next UI interface, relevant information is input on the next UI interface or relevant function modules are clicked, finally after a plurality of UI interfaces are jumped, the payment service is completed, if a fault occurs after the user clicks the relevant modules on one interface, the fault is indicated (possibly the background processing logic fault corresponding to the interface is possible), the payment service is stopped, and the operation of the subsequent UI interface is not performed.
In the interface test process, a tester inputs or clicks on the corresponding interface according to the service logic, if one interface reports errors, the execution of the service is stopped, and then the error reporting interface is checked. However, since the error reporting of an interface may not be the background processing logic failure of the interface itself, but may also be the background processing logic failure of the previous interface, the error of the data (such as the data format error) transmitted to the interface may be caused, thereby causing the error reporting of the interface. Therefore, when a tester discovers that the interface is wrong, the page needing to be subjected to major investigation is difficult to determine, so that a problem page cannot be positioned quickly, and the interface testing efficiency is lower.
The method for screening the testing key points of the interface test is needed at present, so that the problem that the interface to be screened is difficult to determine when a tester finds that the interface is wrong in the interface test, and the problem interface cannot be quickly positioned, so that the interface test efficiency is low is solved.
Disclosure of Invention
In order to solve the problem that in interface test, when a tester finds out that an interface is wrong, a page needing to be subjected to major investigation is difficult to determine, so that a problem interface cannot be positioned quickly, and the interface test efficiency is low.
In order to solve any one of the above technical problems, the specific technical solutions of the embodiments of the present specification are as follows:
in one aspect, embodiments of the present disclosure provide a method for screening test emphasis for interface testing, including,
Acquiring a plurality of interfaces operated by a tester in an interface test process and a jump sequence among the interfaces, wherein intersections exist among the interfaces of the interface test operation;
constructing an interface map according to the interfaces and the jump sequence among the interfaces;
calculating the fault number and the doubt number of each interface in the interface map according to the test results of the interfaces and the jump sequence among the interfaces, wherein the fault number represents the total times that the test results of the interfaces are faults, and the doubt number represents the total times that the interfaces with jump relation with the interfaces in faults are regarded as the doubt interfaces due to the faults of the interfaces in the interface test executed once;
and calculating the weight of the interface according to the number of the doubts and the number of faults of the interface, and determining a testing key interface according to the weight.
Further, calculating the number of doubts and the number of faults of each interface in the interface map according to the test result of the interface and the jump sequence among the interfaces further comprises:
if the interface test result is failed, taking the interface with the test result being a fault as a fault interface, taking a node corresponding to the fault interface in the interface map as a fault node, and calculating the total number of faults of the fault node as the number of faults of the fault node;
And taking all nodes except the fault node, which have direct or indirect jump relations in the interface test with the test result of failed as the doubtful nodes, and calculating the total number of doubtful times of the doubtful nodes as the doubtful number.
Further, calculating the number of doubts and the number of faults of each interface in the interface map according to the test result of the interface and the jump sequence among the interfaces further comprises:
if the interface test result is passing, determining that the minimum number of doubts of all nodes except the last node in the jump is the minimum number of doubts;
calculating first difference values of the doubtful number and the minimum doubtful number of all nodes except the last node of the jump, and taking each first difference value as the doubtful number of the corresponding node;
judging whether the last node in the interface test has the fault number, if so, calculating a second difference value between the fault number of the last node in the interface test and the minimum doubt number, and taking the second difference value as the fault number of the last node in the interface test.
Further, calculating the weight of the interface according to the doubt number and the fault number of the interface further comprises:
Taking an interface of weight to be calculated as a target interface, and determining an upstream node set and a downstream node set of target nodes corresponding to the target interface in the interface map, wherein the upstream node and the downstream node in the upstream node set and the downstream node set have direct or indirect jump relations with the target nodes;
calculating the sum of the doubt numbers of a plurality of upstream nodes and downstream nodes in the upstream and downstream node set as the total doubt number of the upstream and downstream nodes;
and calculating the product of the fault number of the target node and the total doubt number of the upstream node and the downstream node as the weight of the target interface.
Further, determining the upstream and downstream node sets of the target nodes corresponding to the target interface in the interface map further includes:
determining at least one upstream node and at least one downstream node which have a direct jump relation with the target node in the interface map as a first upstream node and a first downstream node respectively;
respectively judging whether each first upstream node is in doubt number not being 0 and the fault number being 0; if the suspicious number of the first upstream node is not 0 and the fault number is 0, adding the first upstream node into the upstream and downstream node set; determining a second upstream node which has a direct jump relation with the first upstream node in the interface map; taking the second upstream node as the first upstream node; iterating the steps; if the suspicious number of the first upstream node is 0 or the failure number is not 0, stopping traversing the upstream node of the first upstream node;
Judging whether each first downstream node is in doubt number not being 0 and the fault number being 0; if the suspicious number of the first downstream node is not 0 and the failure number is 0, adding the first downstream node into the upstream and downstream node set; determining a second downstream node with a direct jump relation with the first downstream node in the interface map; taking the second downstream node as the first downstream node; repeatedly executing the steps of judging whether the first downstream node is the suspicious number which is not 0 and the failure number is 0; if the number of doubts of the first downstream node is 0 or the number of faults is not 0, stopping traversing the downstream node of the first downstream node.
Further, constructing an interface map according to the interfaces and the jump sequence between the interfaces further comprises:
taking the interfaces as nodes, and taking the jump sequence among the interfaces as the direction of the edges among the nodes;
and constructing the interface map according to the directions of the nodes and the edges.
Further, after obtaining the plurality of interfaces operated by the tester in the interface test process, the method further includes:
carrying out standardization processing on the interface to obtain the identification information of the interface;
Taking the interface as a node further comprises:
and taking the identification information as the node.
Further, the interface is an interface screenshot.
Further, the standardization processing is performed on the interface, and the obtaining of the identification information of the interface further includes:
identifying field names in a plurality of predetermined areas of the interface screenshot;
arranging field names of all the areas according to a preset sequence to obtain a text corresponding to the interface screenshot;
and calculating a hash value of the text, and taking the hash value as the identification information.
On the other hand, the embodiment of the specification also provides a testing focus screening device for interface testing, which comprises:
the interface acquisition unit is used for acquiring a plurality of interfaces operated by a tester in the interface test process and a jump sequence among the interfaces, wherein intersections exist among the interfaces of the interface test operation;
the interface map construction unit is used for constructing an interface map according to the interfaces and the jump sequence among the interfaces;
the fault number and doubt number calculation unit is used for calculating the fault number and the doubt number of each interface in the interface map according to the test results of the interfaces and the jump sequence among the interfaces, wherein the fault number represents the total times of faults of the test results of the interfaces, and the doubt number represents the total times of the interfaces which have jump relations with the interfaces of the faults and are caused by the faults of the interfaces in the interface test executed once and are regarded as the doubt interfaces;
And the interface weight calculation unit is used for calculating the weight of the interface according to the doubtful number and the fault number of the interface and determining a testing key interface according to the weight.
In another aspect, embodiments of the present disclosure further provide a computer device, including a memory, a processor, and a computer program stored on the memory, where the processor implements the method described above when executing the computer program.
In another aspect, the present description embodiment also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described method.
According to the embodiment of the specification, an intersection exists among a plurality of interfaces of a plurality of interface test operations, an interface map is constructed according to the interfaces and the jump sequence among the interfaces, the interfaces and the jump sequence among the interfaces are recorded in the interface map, then the fault number and the doubt number of each interface in the interface map are calculated according to the test results of each interface and the jump sequence among the interfaces, finally the weight of the interface is calculated according to the doubt number and the fault number of the interface, and a test key interface is determined according to the weight, so that when the fault treatment of the plurality of fault interfaces is carried out, the interface needing priority and key treatment is determined according to the weight of the fault interface, and the problem that when a tester finds out the fault of the interface, the interface needing key investigation is difficult to be determined, so that the interface cannot be positioned to a problem interface quickly, and the interface test efficiency is low is solved.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an implementation system of a test emphasis screening method for interface testing according to an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart of a method for screening test emphasis of interface test according to an embodiment of the present disclosure;
FIG. 3 shows a step of using the identification information of the interface as a node in the interface map in the embodiment of the present disclosure;
FIG. 4 shows a step of performing standardization processing on an interface to obtain identification information of the interface in the embodiment of the present disclosure;
FIG. 5 shows steps for constructing an interface map according to interfaces and jump sequences between the interfaces in an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of an interface map in an embodiment of the present disclosure;
FIGS. 7 and 8 illustrate steps for calculating the number of doubts and faults for each interface in the interface map in the embodiments of the present disclosure;
FIG. 9 shows the steps for calculating the weight of an interface according to the number of doubts and the number of faults of the interface in the embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of a test emphasis screening device for interface test in the embodiment of the present disclosure;
fig. 11 is a schematic diagram showing the structure of a computer device in the embodiment of the present specification.
[ reference numerals description ]:
101. an interface acquisition unit;
102. a processor;
1001. an interface acquisition unit;
1002. an interface map construction unit;
1003. a failure number in doubt number calculation unit;
1004. an interface weight calculation unit;
1102. a computer device;
1104. a processing device;
1106. storing the resource;
1108. a driving mechanism;
1110. an input/output module;
1112. an input device;
1114. an output device;
1116. a presentation device;
1118. a graphical user interface;
1120. a network interface;
1122. a communication link;
1124. a communication bus.
Detailed Description
The technical solutions of the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is apparent that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the embodiments of the present disclosure, are intended to be within the scope of the embodiments of the present disclosure.
It should be noted that the terms "first," "second," and the like in the description and the claims of the embodiments of the present specification and the above-described drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present description described herein may be capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or device.
It should be noted that, in the technical scheme of the application, the acquisition, storage, use, processing and the like of the data all conform to the relevant regulations of national laws and regulations.
Fig. 1 is a schematic diagram of an implementation system of a test emphasis screening method for interface testing in the embodiment of the present disclosure, which includes an interface obtaining unit 101 and a processor 102.
The interface test refers to that a tester inputs and/or clicks a certain function module of an interface, then a background program of the interface processes clicking and/or inputting of a user, then the tester clicks the designated function module, jumps to the next interface, and performs clicking and/or inputting operation on the next interface, meanwhile, the background program of the previous interface sends a result of processing the previous interface to the jumped next interface, and the background program of the next interface processes according to clicking and inputting of the user on the next interface and a processing result sent by the background program of the previous interface. After the tester jumps over the interfaces, the test is completed.
In the test process, a certain interface popup error may occur, and the error may be that the background program of the interface has an error in the processing process, and the error may be that the user clicks and/or inputs on the interface have errors, or that the processing result transmitted by the previous interface has errors. Therefore, after an error occurs in the test of a certain interface, whether the interface and the interface directly jumped or indirectly jumped before the interface are in error or not needs to be checked, that is, the interface involved in the interface test process is checked, and the checking range is larger. Because an intersection exists among a plurality of interfaces of each interface test operation, namely, an intersection exists among a plurality of links corresponding to the plurality of interface tests, the operation of other interface tests can be influenced by a certain interface fault in one interface test, and therefore, interface testers need to determine that the important interface is subjected to fault treatment preferentially.
In this embodiment of the present disclosure, the interface obtaining unit 101 obtains a plurality of interfaces and a skip sequence between the interfaces operated by a tester in the interface test process, then the interface obtaining unit 101 transmits the obtained interfaces and skip sequence to the processor 102, the processor 102 processes the interfaces and skip sequence, and calculates the weight of each fault interface, so as to determine a test key interface according to the weight, so that the tester can perform fault processing on the test key interface preferentially, thereby reducing the influence on the test of other interfaces.
In addition, it should be noted that, fig. 1 is only one application environment provided in the embodiment of the present disclosure, and in practical application, other application environments may also be included, which is not limited in the present disclosure.
Specifically, the embodiment of the specification provides a testing key screening method for interface testing, which constructs a knowledge graph according to the calling sequence of interfaces, marks the suspicious number and the fault number of each interface on the knowledge graph according to the error reporting times and the calling relation of each interface, and calculates the weight corresponding to the interface according to the suspicious number and the fault number of one interface, so that the interface needing key testing is screened according to the weight of each interface. Fig. 2 is a schematic flow chart of a test focus screening method for interface testing according to an embodiment of the present disclosure. The process of calculating the weights of the interfaces is described in this figure. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When a system or apparatus product in practice is executed, it may be executed sequentially or in parallel according to the method shown in the embodiments or the drawings. As shown in fig. 2 in particular, the method may be performed by the processor 102 and may include:
Step 201: acquiring a plurality of interfaces operated by a tester in an interface test process and a jump sequence among the interfaces, wherein intersections exist among the interfaces of the interface test operation;
step 202: constructing an interface map according to the interfaces and the jump sequence among the interfaces;
step 203: calculating the fault number and the doubt number of each interface in the interface map according to the test result of the interfaces and the jump sequence among the interfaces;
in the step, the fault number represents the total times that the test result of the interface is faults, and the doubtful number represents the total times that the interface with the jumping relation with the fault in the interface test executed once is regarded as the doubtful interface due to the faults of the interface;
step 204: and calculating the weight of the interface according to the number of the doubts and the number of faults of the interface, and determining a testing key interface according to the weight.
According to the embodiment of the specification, an intersection exists among a plurality of interfaces of a plurality of interface test operations, an interface map is constructed according to the interfaces and the jump sequence among the interfaces, the interfaces and the jump sequence among the interfaces are recorded in the interface map, then the fault number and the doubt number of each interface in the interface map are calculated according to the test results of each interface and the jump sequence among the interfaces, finally the weight of the interface is calculated according to the doubt number and the fault number of the interface, and a test key interface is determined according to the weight, so that when the fault treatment of the plurality of fault interfaces is carried out, the interface needing priority and key treatment is determined according to the weight of the fault interface, and the problem that when a tester finds out the fault of the interface, the interface needing key investigation is difficult to be determined, so that the interface cannot be positioned to a problem interface quickly, and the interface test efficiency is low is solved.
In the embodiment of the present disclosure, in the interface test process, if a certain interface operated by a tester reports errors, the interface test will also stop, and the last interface that is skipped in the interface test is the interface that reports errors, but because the error reporting of this interface may also be because the processing result that is transmitted by the interface that is skipped before is incorrect (such as a data type error, etc.), although this interface is a fault interface, the possibility that the processing result of the interface that is skipped before cannot be excluded is incorrect, so that the interface that is skipped before reporting errors is a doubtful interface, i.e., in the single interface test process, if a certain interface reports errors, the interface that appears errors is a fault interface, and all interfaces other than the fault interface that is involved in the interface test (that is, the interface that has been skipped before the fault interface) are doubtful interfaces. If the fault interface for the important processing is to be determined, the fault interface with the most suspicious interfaces or the most suspicious times with the direct or indirect jump relation needs to be selected.
Therefore, in the embodiment of the present disclosure, the weight of the fault interface is calculated according to the number of faults of the fault interface and the number of doubts of the suspected interface having a direct or indirect jump relationship with the fault interface, the fault interface may be a common interface of multiple interface test links, and the greater the weight of the fault interface is, the more the links of the related interface test are, the higher the fault influence is, the more the links affecting other interface tests are, and the fault processing should be performed first.
According to one embodiment of the present disclosure, a plurality of interfaces operated by a tester in an interface test process may be obtained by a screenshot manner, so as to obtain a plurality of interface shots, and record interface jumps in the interface test execution process, for example, the tester indicates a test execution operation by clicking a start test case and a node number test button, and after clicking an end test button, the user marks whether the execution is successful at the same time, so as to complete an interface test execution process.
Before clicking operation or keyboard input operation is carried out on the interface by a tester each time, screenshot is processed on the current interface, the current operation time, the cursor clicking position or the cursor position are recorded, and the interface screenshot is saved in a mode of executing the terminal equipment name and the timestamp.
It can be understood that, in this embodiment of the present disclosure, the screen capture is performed on the interface before the clicking operation or the keyboard input, so that in this embodiment of the present disclosure, the screen capture includes field names of each region of the interface, and is not a field value, and in this embodiment of the present disclosure, the field value output by the tester on the interface is not processed. If the field names are the same, then it is considered an interface. Before one interface screenshot is stored, the similarity comparison is carried out with the previous interface screenshot, if the areas of the two interface screenshots are the same and the field names are the same (namely, the two pictures are 100% identical), the two interface screenshots are considered to be the same interface, and the current interface screenshot is deleted. And finally, compressing the interface screenshot and storing the interface screenshot.
To facilitate building an interface map from an interface, according to one embodiment of the present disclosure, after obtaining a plurality of interfaces that a tester operates during an interface test, as shown in fig. 3, the method further includes:
step 301: carrying out standardization processing on the interface to obtain the identification information of the interface;
in this step, the normalization process means converting the image information of the interface into digital information, for example, a manner of extracting a construction vector for each pixel point of the interface, and converting the image information into digital information as identification information of the interface, the identification information being a unique identification of the interface.
Taking the interface as a node further comprises:
step 302: and taking the identification information as the node.
It can be understood that after the interface is standardized to obtain the digitized identification information, the identification information is used as the node in the interface map, so that when the node in the map is searched, the processing efficiency of the interface map is improved to a certain extent because the speed of searching the digitized identification information is relatively high.
Specifically, when the interface is an interface screenshot, according to an embodiment of the present disclosure, as shown in fig. 4, the normalizing process is performed on the interface, and obtaining the identification information of the interface further includes:
Step 401: identifying field names in a plurality of predetermined areas of the interface screenshot;
step 402: arranging field names of all the areas according to a preset sequence to obtain a text corresponding to the interface screenshot;
step 403: and calculating a hash value of the text, and taking the hash value as the identification information.
In this embodiment of the present disclosure, a plurality of regions may be divided in advance on the screenshot, and in each region, a field name may be identified by OCR recognition technology, and when a field name is identified, a specific symbol corresponding to each field name in the interface may be used to identify, where the drop-down selection box generally includes a "lower triangle" symbol, and a text preceding the "lower triangle" symbol is identified as the field name of the field corresponding to the "lower triangle" symbol.
And then arranging the field names of the areas according to a preset sequence, wherein the embodiment of the specification does not limit the specific arrangement sequence, and aims to obtain a text corresponding to the interface screenshot.
And then calculating a hash value of the text, and taking the obtained hash value as identification information as a node in the interface map.
In the embodiment of the present disclosure, the interface map includes a plurality of nodes and directed edges between the nodes, and specifically, the interface map may be a knowledge map, etc., which is not limited in the embodiment of the present disclosure.
According to one embodiment of the present disclosure, as shown in fig. 5, constructing an interface map according to the interface and a jump sequence between the interfaces further includes:
step 501: taking the interfaces as nodes, and taking the jump sequence among the interfaces as the direction of the edges among the nodes;
step 502: and constructing the interface map according to the directions of the nodes and the edges.
In the embodiment of the present specification, the hash value of the interface may be used as a node, the recorded jump sequence between the interfaces is used as the direction of the edges between the nodes, and then the interface map is constructed according to the directions of the nodes and the edges.
For example, as shown in fig. 6, the interface map may be shown in fig. 6, where a node corresponds to an interface, the value of the node is a hash value of the interface, a directed edge between nodes indicates a jump sequence of the interface corresponding to the node, and if no edge exists between two nodes, it indicates that there is no jump relationship between two interfaces corresponding to the two nodes, that is, in all links tested by the interfaces, no jump exists between the two interfaces.
In the interface map shown in fig. 6, the links tested by the interface may jump from the uppermost node to the next level node step by step until the nodes of the last layer. If a node has a jump relation with a plurality of nodes, the node is a common node of a plurality of interface test links, and if the node has a jump relation, the more the node has the jump relation, the more the interface test links affected by the node are.
It should be noted that, the interface map shown in fig. 6 is merely exemplary, and other types of interface maps may be set according to practical situations, and only include nodes and directed edges between the nodes, which is not limited in the embodiments of the present disclosure.
In the embodiment of the present disclosure, in an interface test process, if an interface fails, both the interface that directly and indirectly jumps behind the interface will not jump, i.e. the interface test is stopped, and the subsequent interface will not execute. For example, when browsing a web page, if a certain interface pops up wrong, browsing can only be stopped, so that in the interface map, among the nodes skipped by a link tested by a failed interface, the node skipped last by each link is usually the failed interface, and all the interfaces skipped previously in the link are suspicious interfaces.
Because a node in the interface map is a common node of a plurality of links tested by the interfaces, if the interface test of the link corresponding to the node fails, the number of doubts or the number of faults of the node is accumulated, and is usually higher than the number of doubts or the number of faults of other non-common nodes.
If an interface test fails, the failed node in the link of the interface test is the last node of the link in the interface map, the node which has been skipped before the failed node is the suspicious node, and when the interface test or other interface tests are executed again, the failed node in the link is not misplaced, but the node which is skipped after the failed node is misplaced, so that the suspicious node in the link of the interface test which is executed again is the failed node, and the suspicious number is increased.
Thus, according to one embodiment of the present disclosure, as shown in fig. 7, calculating the number of doubts and the number of faults of each interface in the interface map according to the test result of the interface and the jump sequence between the interfaces further includes:
step 701: if the interface test result is failed, taking the interface with the test result being a fault as a fault interface, taking a node corresponding to the fault interface in the interface map as a fault node, and calculating the total number of faults of the fault node as the number of faults of the fault node;
step 702: and taking all nodes except the fault node, which have direct or indirect jump relations in the interface test with the test result of failed as the doubtful nodes, and calculating the total number of doubtful times of the doubtful nodes as the doubtful number.
In the embodiment of the present disclosure, if the result of the interface test is failed, the test result is that the failed interface is taken as the failed interface, the node corresponding to the failed interface in the interface map is the failed node, the failed node is the last node in the interface map that is skipped on the link tested by the interface, and the failure number of the failed node is +1.
The node which has been jumped before the fault node on the link tested by the interface is the suspicious node, which indicates that the fault reporting of the fault node corresponding to the fault interface is possible because the background processing result of the interface which has been jumped before is wrong, and the fault interface is reported when processing wrong data. It cannot be excluded that the in doubt node must be free of errors.
Thus, the total number of doubts of each of the doubt nodes is calculated as the number of doubts of each of the doubt nodes, respectively. The nodes to be in doubt may be public nodes, so the number of in doubt may be different for each in doubt node.
In this embodiment of the present disclosure, as shown in fig. 8, calculating the number of doubts and the number of faults of each interface in the interface map according to the test result of the interface and the jump sequence between the interfaces further includes:
step 801: if the interface test result is passing, determining that the minimum number of doubts of all nodes except the last node in the jump is the minimum number of doubts;
step 802: calculating first difference values of the doubtful number and the minimum doubtful number of all nodes except the last node of the jump, and taking each first difference value as the doubtful number of the corresponding node;
Step 803: judging whether the last node in the interface test has the fault number, if so, calculating a second difference value between the fault number of the last node in the interface test and the minimum doubt number, and taking the second difference value as the fault number of the last node in the interface test.
In the embodiment of the present disclosure, if the interface test result is a pass, it indicates that all interfaces that are skipped in the link tested by the interface have no fault in the interface test, but the common node may have a fault or be in doubt in the links tested by other interfaces. Therefore, the doubt number generated by the test failure before the test result is the passing interface test needs to be cleared. Because the last node in the link of the interface test may be regarded as a fault node because the historical execution result of the interface test is failure, the minimum number of doubts of all nodes except the last node of the jump involved in the interface test is firstly determined as the minimum number of doubts, and then the minimum number of doubts is subtracted from the number of doubts of all the nodes, so that the number of doubts of at least one node in the link of the interface test is 0, which means that the link has no fault, and the nodes with other doubts not being 0 are public nodes, and the number of doubts is generated by other interface tests with execution failures.
For the last node in the link of the interface test which is passed by the result, firstly judging whether the node has the fault number, if so, indicating that the node has the fault before, which is possibly the fault recorded by the same interface test or the fault recorded by other interface tests. Therefore, if there is a failure number, the failure number of the node is subtracted by the minimum number of doubts. If the number of faults after subtracting the minimum number of doubts is not 0, the number of faults after subtracting the minimum number of doubts is the fault recorded by other interface tests, and the result is not the fault recorded by the interface test passed.
It should be noted that the last node is the suspicious node only caused by the failure of the node that jumps after it, so that the suspicious number of the last node can be recalculated only when the node is the suspicious node (i.e. calculated in the interface test that the node is not the last node).
According to one embodiment of the present disclosure, as shown in fig. 9, calculating the weight of the interface according to the number of doubts and the number of faults of the interface further includes:
step 901: taking an interface of weight to be calculated as a target interface, and determining an upstream node set and a downstream node set of target nodes corresponding to the target interface in the interface map, wherein the upstream node and the downstream node in the upstream node set and the downstream node set have direct or indirect jump relations with the target nodes;
Step 902: calculating the sum of the doubt numbers of a plurality of upstream nodes and downstream nodes in the upstream and downstream node set as the total doubt number of the upstream and downstream nodes;
step 903: and calculating the product of the fault number of the target node and the total doubt number of the upstream node and the downstream node as the weight of the target interface.
In this embodiment of the present disclosure, an interface of a weight to be calculated is first used as a target interface, and then an upstream node set and a downstream node set of target nodes corresponding to the target interface are determined in an interface map, where nodes in the upstream node set and the downstream node set have a direct or indirect skip relationship with the target nodes, that is, the nodes in the upstream node set and the downstream node set may belong to multiple links tested by different interfaces. And then calculating the sum of the doubt numbers of the upstream node and the downstream node as the total doubt number of the upstream node and the downstream node, and finally calculating the product of the fault number of the target node and the total doubt number of the upstream node and the downstream node as the weight of the target node.
It should be noted that, if the target node is not a fault node, that is, if the target node fails to report a fault, the fault number is 0, and the weight of the target node is equal to 0. It may be understood that, in the embodiment of the present disclosure, weights are calculated for the failed nodes, and the application scenario is to determine, from a plurality of failed nodes, a failed node that needs to be preferentially and mainly processed, so as to reduce the impact on other interface tests by the failed node.
Specifically, according to one embodiment of the present disclosure, determining, in the interface map, a set of upstream and downstream nodes of the target node corresponding to the target interface further includes:
determining at least one upstream node and at least one downstream node which have a direct jump relation with the target node in the interface map as a first upstream node and a first downstream node respectively;
respectively judging whether each first upstream node is in doubt number not being 0 and the fault number being 0; if the suspicious number of the first upstream node is not 0 and the fault number is 0, adding the first upstream node into the upstream and downstream node set; determining a second upstream node which has a direct jump relation with the first upstream node in the interface map; taking the second upstream node as the first upstream node; iterating the steps; if the suspicious number of the first upstream node is 0 or the failure number is not 0, stopping traversing the upstream node of the first upstream node;
judging whether each first downstream node is in doubt number not being 0 and the fault number being 0; if the suspicious number of the first downstream node is not 0 and the failure number is 0, adding the first downstream node into the upstream and downstream node set; determining a second downstream node with a direct jump relation with the first downstream node in the interface map; taking the second downstream node as the first downstream node; repeatedly executing the steps of judging whether the first downstream node is the suspicious number which is not 0 and the failure number is 0; if the number of doubts of the first downstream node is 0 or the number of faults is not 0, stopping traversing the downstream node of the first downstream node.
In the embodiment of the present disclosure, the number of doubts is not 0, which indicates that the node is a doubt node, the number of failures is not 0, which indicates that the node is a failure node, the number of doubts is 0, and the number of failures is 0, which indicates that the node is a normal node.
In some other embodiments of the present disclosure, a timer may be set, and when the timer time arrives, the number of faults and the number of doubts of each interface in the interface map are recalculated according to the test result of the interface and the jump sequence between the interfaces, and the weight of the fault interface is recalculated, so as to screen the testing key, improve the fault processing efficiency, and reduce the influence of the fault interface on the test of other interfaces.
Based on the same inventive concept, the embodiment of the present disclosure further provides a test focus screening device for interface test, as shown in fig. 10, including:
an interface obtaining unit 1001, configured to obtain a plurality of interfaces operated by a tester in an interface test process and a jump sequence between the interfaces, where intersections exist between the plurality of interfaces operated by the interface test;
An interface map construction unit 1002, configured to construct an interface map according to the interfaces and a jump sequence between the interfaces;
a failure number in doubt number calculation unit 1003, configured to calculate, according to a test result of the interface and a skip order between the interfaces, a failure number and an in doubt number of each interface in the interface map, where the failure number indicates a total number of times that the test result of the interface is a failure, and the in doubt number indicates a total number of times that an interface having a skip relation with the failed interface is used as an in doubt interface due to a failure of the interface in a single-time executed interface test;
and the interface weight calculation unit 1004 is configured to calculate the weight of the interface according to the number of doubts and the number of faults of the interface, and determine a testing key interface according to the weight.
Since the principle of the device for solving the problem is similar to that of the method, the implementation of the device can be referred to the implementation of the method, and the repetition is omitted.
Fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure, where an apparatus in the present disclosure may be the computer device in the present embodiment, and perform the method in the present disclosure. The computer device 1102 may include one or more processing devices 1104, such as one or more Central Processing Units (CPUs), each of which may implement one or more hardware threads. The computer device 1102 may also include any storage resources 1106 for storing any kind of information, such as code, settings, data, etc. For example, and without limitation, the storage resources 1106 may include any one or more of the following combinations: any type of RAM, any type of ROM, flash memory devices, hard disks, optical disks, etc. More generally, any storage resource may store information using any technology. Further, any storage resource may provide volatile or non-volatile retention of information. Further, any storage resources may represent fixed or removable components of computer device 1102. In one case, when the processing device 1104 executes associated instructions stored in any storage resource or combination of storage resources, the computer device 1102 may perform any of the operations of the associated instructions. The computer device 1102 also includes one or more drive mechanisms 1108, such as a hard disk drive mechanism, optical disk drive mechanism, and the like, for interacting with any storage resources.
The computer device 1102 may also include an input/output module 1110 (I/O) for receiving various inputs (via an input device 1112) and for providing various outputs (via an output device 1114). One particular output mechanism may include a presentation device 1116 and an associated Graphical User Interface (GUI) 1118. In other embodiments, input/output module 1110 (I/O), input device 1112, and output device 1114 may not be included, but merely as a computer device in a network. The computer device 1102 may also include one or more network interfaces 1120 for exchanging data with other devices via one or more communication links 1122. One or more communication buses 1124 couple together the components described above.
The communication link 1122 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the internet), a point-to-point connection, etc., or any combination thereof. Communication link 1122 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.
The present description embodiment also provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described method.
The present description also provides computer-readable instructions, wherein the program therein causes a processor to perform the above-described method when the processor executes the instructions.
It should be understood that, in various embodiments of the present disclosure, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation of the embodiments of the present disclosure.
It should also be understood that, in the embodiments of the present specification, the term "and/or" is merely one association relationship describing the association object, meaning that three relationships may exist. For example, a and/or B may represent: a exists alone, A and B exist together, and B exists alone. In the embodiment of the present specification, the character "/", generally indicates that the front and rear associated objects are in an "or" relationship.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the various illustrative elements and steps have been described above generally in terms of function in order to best explain the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments herein.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided in the embodiments of this specification, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purposes of the embodiments of the present description.
In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present specification is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present specification. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The principles and implementations of the embodiments of the present specification are explained by applying specific embodiments in the embodiments of the present specification, and the above explanation of the embodiments is only for helping to understand the methods of the embodiments of the present specification and the core ideas thereof; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope based on the ideas of the embodiments of the present specification, the contents of the present specification should not be construed as limiting the embodiments of the present specification in view of the above.

Claims (12)

1. The method for screening the testing key points of the interface test is characterized by comprising the following steps:
acquiring a plurality of interfaces operated by a tester in an interface test process and a jump sequence among the interfaces, wherein intersections exist among the interfaces of the interface test operation;
constructing an interface map according to the interfaces and the jump sequence among the interfaces;
calculating the fault number and the doubt number of each interface in the interface map according to the test results of the interfaces and the jump sequence among the interfaces, wherein the fault number represents the total times that the test results of the interfaces are faults, and the doubt number represents the total times that the interfaces with jump relation with the interfaces in faults are regarded as the doubt interfaces due to the faults of the interfaces in the interface test executed once;
And calculating the weight of the interface according to the number of the doubts and the number of faults of the interface, and determining a testing key interface according to the weight.
2. The method of claim 1, wherein calculating the number of doubts and faults for each interface in the interface map based on the test results for the interfaces and the jump sequence between the interfaces further comprises:
if the interface test result is failed, taking the interface with the test result being a fault as a fault interface, taking a node corresponding to the fault interface in the interface map as a fault node, and calculating the total number of faults of the fault node as the number of faults of the fault node;
and taking all nodes except the fault node, which have direct or indirect jump relations in the interface test with the test result of failed as the doubtful nodes, and calculating the total number of doubtful times of the doubtful nodes as the doubtful number.
3. The method of claim 2, wherein calculating the number of doubts and faults for each interface in the interface map based on the test results for the interfaces and the jump sequence between the interfaces further comprises:
If the interface test result is passing, determining that the minimum number of doubts of all nodes except the last node in the jump is the minimum number of doubts;
calculating first difference values of the doubtful number and the minimum doubtful number of all nodes except the last node of the jump, and taking each first difference value as the doubtful number of the corresponding node;
judging whether the last node in the interface test has the fault number, if so, calculating a second difference value between the fault number of the last node in the interface test and the minimum doubt number, and taking the second difference value as the fault number of the last node in the interface test.
4. The method of claim 1, wherein calculating the weight of the interface based on the number of doubts and the number of faults of the interface further comprises:
taking an interface of weight to be calculated as a target interface, and determining an upstream node set and a downstream node set of target nodes corresponding to the target interface in the interface map, wherein the upstream node and the downstream node in the upstream node set and the downstream node set have direct or indirect jump relations with the target nodes;
calculating the sum of the doubt numbers of a plurality of upstream nodes and downstream nodes in the upstream and downstream node set as the total doubt number of the upstream and downstream nodes;
And calculating the product of the fault number of the target node and the total doubt number of the upstream node and the downstream node as the weight of the target interface.
5. The method of claim 4, wherein determining in the interface map a set of upstream and downstream nodes of a target node corresponding to the target interface further comprises:
determining at least one upstream node and at least one downstream node which have a direct jump relation with the target node in the interface map as a first upstream node and a first downstream node respectively;
respectively judging whether each first upstream node is in doubt number not being 0 and the fault number being 0; if the suspicious number of the first upstream node is not 0 and the fault number is 0, adding the first upstream node into the upstream and downstream node set; determining a second upstream node which has a direct jump relation with the first upstream node in the interface map; taking the second upstream node as the first upstream node; iterating the steps; if the suspicious number of the first upstream node is 0 or the failure number is not 0, stopping traversing the upstream node of the first upstream node;
judging whether each first downstream node is in doubt number not being 0 and the fault number being 0; if the suspicious number of the first downstream node is not 0 and the failure number is 0, adding the first downstream node into the upstream and downstream node set; determining a second downstream node with a direct jump relation with the first downstream node in the interface map; taking the second downstream node as the first downstream node; repeatedly executing the steps of judging whether the first downstream node is the suspicious number which is not 0 and the failure number is 0; if the number of doubts of the first downstream node is 0 or the number of faults is not 0, stopping traversing the downstream node of the first downstream node.
6. The method of claim 1, wherein constructing an interface map from the interfaces and a jump sequence between the interfaces further comprises:
taking the interfaces as nodes, and taking the jump sequence among the interfaces as the direction of the edges among the nodes;
and constructing the interface map according to the directions of the nodes and the edges.
7. The method of claim 6, wherein after obtaining the plurality of interfaces operated by the tester during the interface testing, the method further comprises:
carrying out standardization processing on the interface to obtain the identification information of the interface;
taking the interface as a node further comprises:
and taking the identification information as the node.
8. The method of claim 7, wherein the interface is an interface screenshot.
9. The method of claim 8, wherein normalizing the interface to obtain the identification information of the interface further comprises:
identifying field names in a plurality of predetermined areas of the interface screenshot;
arranging field names of all the areas according to a preset sequence to obtain a text corresponding to the interface screenshot;
And calculating a hash value of the text, and taking the hash value as the identification information.
10. A test emphasis screening device for interface testing, the device comprising:
the interface acquisition unit is used for acquiring a plurality of interfaces operated by a tester in the interface test process and a jump sequence among the interfaces, wherein intersections exist among the interfaces of the interface test operation;
the interface map construction unit is used for constructing an interface map according to the interfaces and the jump sequence among the interfaces;
the fault number and doubt number calculation unit is used for calculating the fault number and the doubt number of each interface in the interface map according to the test results of the interfaces and the jump sequence among the interfaces, wherein the fault number represents the total times of faults of the test results of the interfaces, and the doubt number represents the total times of the interfaces which have jump relations with the interfaces of the faults and are caused by the faults of the interfaces in the interface test executed once and are regarded as the doubt interfaces;
and the interface weight calculation unit is used for calculating the weight of the interface according to the doubtful number and the fault number of the interface and determining a testing key interface according to the weight.
11. A computer device comprising a memory, a processor, and a computer program stored on the memory, characterized in that the processor, when executing the computer program, implements the method of any of claims 1 to 9.
12. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the method of any of claims 1 to 9.
CN202310930179.XA 2023-07-27 2023-07-27 Method, device and equipment for screening testing key points of interface test Pending CN117435461A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310930179.XA CN117435461A (en) 2023-07-27 2023-07-27 Method, device and equipment for screening testing key points of interface test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310930179.XA CN117435461A (en) 2023-07-27 2023-07-27 Method, device and equipment for screening testing key points of interface test

Publications (1)

Publication Number Publication Date
CN117435461A true CN117435461A (en) 2024-01-23

Family

ID=89545189

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310930179.XA Pending CN117435461A (en) 2023-07-27 2023-07-27 Method, device and equipment for screening testing key points of interface test

Country Status (1)

Country Link
CN (1) CN117435461A (en)

Similar Documents

Publication Publication Date Title
US10102113B2 (en) Software test automation systems and methods
US8276020B2 (en) Systems and methods for automated determination of error handling
US10437717B2 (en) Defect reporting in application testing
WO2007005586A1 (en) System and method for using model analysis to generate directed test vectors
US10459830B2 (en) Executable code abnormality detection
US8006138B2 (en) Software quality assessment based on semantic similarities
CN108009085B (en) Channel package testing method
US9734042B1 (en) System, method, and computer program for automated parameterized software testing
US8327189B1 (en) Diagnosing an incident on a computer system using a diagnostics analyzer database
CN112199277A (en) Browser-based defect reproduction method, device, equipment and storage medium
CN109710476B (en) System interface robustness testing method and device
CN111367782B (en) Regression testing data automatic generation method and device
CN110162973A (en) A kind of Webshell file test method and device
CN117435461A (en) Method, device and equipment for screening testing key points of interface test
CN113282496B (en) Automatic interface testing method, device, equipment and storage medium
CN116016270A (en) Switch test management method and device, electronic equipment and storage medium
CN112787883B (en) Method, device and equipment for detecting NAT (network Address translation) fault of equipment
US20220012166A1 (en) Directed graph for application under test
CN112612882B (en) Review report generation method, device, equipment and storage medium
CN115473788B (en) Storage alarm test method, device, equipment and storage medium
CN116881159A (en) Program fault processing method, device, equipment and storage medium
CN114328195A (en) Method for rapidly counting interface defect rate and estimating development quality
CN114154167A (en) Safety detection model testing method and device, electronic equipment and storage medium
CN115454819A (en) Test method, device, equipment and storage medium for block chain cross-chain system
CN118093381A (en) Software testing method and system based on artificial intelligence

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