CN111858331A - Method, device and equipment for detecting coverage of front-end control - Google Patents

Method, device and equipment for detecting coverage of front-end control Download PDF

Info

Publication number
CN111858331A
CN111858331A CN202010688606.4A CN202010688606A CN111858331A CN 111858331 A CN111858331 A CN 111858331A CN 202010688606 A CN202010688606 A CN 202010688606A CN 111858331 A CN111858331 A CN 111858331A
Authority
CN
China
Prior art keywords
control
mark
identification
target interface
execution
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
CN202010688606.4A
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.)
Anhui Tingjian Technology Co ltd
Original Assignee
Anhui Tingjian 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 Anhui Tingjian Technology Co ltd filed Critical Anhui Tingjian Technology Co ltd
Priority to CN202010688606.4A priority Critical patent/CN111858331A/en
Publication of CN111858331A publication Critical patent/CN111858331A/en
Pending legal-status Critical Current

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
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage 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)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method, a device and equipment for detecting coverage of a front-end control. The method mainly comprises the steps of recognizing and disassembling controls contained in a front-end interface image based on an image recognition technology, inserting a prefabricated mark into codes of each control, monitoring a front-end request, and updating a prestored operation record identifier of each control if the codes operate to the mark after the request is executed. The invention can quickly and conveniently identify and disassemble the front-end control information and realize the detection of the code coverage by matching with the inserted control mark and the set running record mark.

Description

Method, device and equipment for detecting coverage of front-end control
Technical Field
The invention relates to the technical field of front-end development, in particular to a method, a device and equipment for detecting coverage of a front-end control.
Background
With the wide application of various services related to human-computer interaction, the testing requirements of the front-end interface are increased, and meanwhile, the requirements of users on interaction functions and usability are higher and higher. When the interface involves interaction with a user, various interaction scenes are necessarily generated due to interaction operation logic, change of the interaction interface and the like.
The existing related front-end testing mode occupies a large amount of resources, is complex in operation and difficult to reasonably control cost, so that how to conveniently and efficiently ensure the quality of front-end codes under the condition of limited testing resources and accurately evaluate the coverage degree of a front-end control on various scenes becomes a focus of a front-end development link.
Disclosure of Invention
In view of the foregoing, the present invention provides a method, an apparatus, and a device for detecting coverage of a front-end control, and accordingly provides a computer-readable storage medium and a computer program product, so as to economically, efficiently, conveniently, and accurately test the scene coverage of the front-end control in a front-end development process.
The technical scheme adopted by the invention is as follows:
in a first aspect, the present invention provides a method for detecting coverage of a front-end control, including:
Acquiring control information of each contained control from an image of a target interface;
analyzing codes of all the controls according to the control information;
inserting control marks in the code of each control;
monitoring a request input by a user in real time and executing a corresponding control function;
when the request is processed and the code runs to the control mark of the corresponding control, updating a preset running record mark of the control;
and acquiring the final running record identification of each control of the target interface, and comparing the final running record identification with the set front-end control execution standard to generate a coverage detection result.
In at least one possible implementation manner, the obtaining, based on the image recognition technology, control information of each contained control from an image of a target interface includes:
collecting a target interface image;
extracting the characteristics of the target interface image, and determining a plurality of processing objects by combining a preset processing object identification strategy;
and extracting the characteristics of each processing object, and determining the type information and the position information of each control by combining a preset control identification strategy.
In at least one possible implementation manner, the method further includes:
generating control marks corresponding to the controls one by one according to the control information and a preset rule;
And storing the control information of each control and the corresponding control mark.
In at least one possible implementation manner, the method further includes:
comparing the generated control mark with the stored control mark;
if the two are repeated, discarding the currently generated control mark and regenerating a new control mark;
and continuously comparing the new control mark with the stored control mark so as to store the generated and non-repeated control mark.
In at least one possible implementation, the front-end control execution criteria includes:
establishing a control knowledge graph in advance based on various front-end frames, various front-end controls and a large number of front-end control calling records, and taking the control knowledge graph as the execution standard of the front-end controls;
or,
and extracting control knowledge data corresponding to each control of the target interface from the control knowledge graph based on the control information, and forming the front-end control execution standard.
In at least one possible implementation manner, the operation record identifier includes: executing the identification; or, the operation record identification includes: an execution identification and an enable identification.
In at least one possible implementation manner, the updating the running record identifier of the control includes:
updating the execution identification of the control;
or,
and updating the execution identifier and the enabling identifier of the control.
In at least one possible implementation manner, the running record identifier further includes: counting the identification;
the comparing with the set front-end control execution standard comprises: and comparing the control of the target interface with the front-end control execution standard one by one, and updating the statistical identification of the control after comparing each control.
In a second aspect, the present invention provides a front-end control coverage detection apparatus, including:
the control disassembling module is used for acquiring control information of each contained control from the image of the target interface;
the code analysis module is used for analyzing the codes of the controls according to the control information;
the mark inserting module is used for inserting control marks in the codes of the controls;
the request processing module is used for monitoring a request input by a user in real time and executing a corresponding control function;
the identification updating module is used for updating the preset running record identification of the control when the request is processed and the code runs to the control mark of the corresponding control;
And the comparison detection module is used for acquiring the final running record identifier of each control of the target interface, comparing the final running record identifier with the set front-end control execution standard and generating a coverage detection result.
In at least one possible implementation manner, the control disassembling module includes:
the image acquisition unit is used for acquiring a target interface image;
the processing object identification unit is used for extracting the characteristics of the target interface image and determining a plurality of processing objects by combining a preset processing object identification strategy;
and the control identification unit is used for extracting the characteristics of each processing object and determining the type information and the position information of each control by combining a preset control identification strategy.
In at least one possible implementation manner, the apparatus further includes: a control mark generation module; the control mark generation module specifically includes:
the mark generating unit is used for generating control marks corresponding to the controls one by one according to the control information and a preset rule;
and the information storage unit is used for storing the control information of each control and the corresponding control mark.
In at least one possible implementation manner, the apparatus further includes: a tag uniqueness check module; the tag uniqueness checking module specifically comprises:
The mark comparison unit is used for comparing the generated control mark with the stored control mark;
the mark regeneration unit is used for discarding the currently generated control mark and regenerating a new control mark if the two are repeated;
and the unique mark storage unit is used for continuously comparing the new control mark with the stored control mark so as to store the generated and non-repeated control mark.
In at least one possible implementation, the front-end control execution criteria includes:
establishing a control knowledge graph in advance based on various front-end frames, various front-end controls and a large number of front-end control calling records, and taking the control knowledge graph as the execution standard of the front-end controls;
or,
and extracting control knowledge data corresponding to each control of the target interface from the control knowledge graph based on the control information, and forming the front-end control execution standard.
In at least one possible implementation manner, the operation record identifier includes: executing the identification; or, the operation record identification includes: an execution identification and an enable identification.
In at least one possible implementation manner, the identifier updating module is specifically configured to:
Updating the execution identification of the control;
or,
and updating the execution identifier and the enabling identifier of the control.
In at least one possible implementation manner, the running record identifier further includes: counting the identification;
the comparison detection module comprises:
the comparison units one by one are used for comparing the control pieces of the target interface with the front-end control execution standard one by one;
and the identification updating unit is used for updating the statistical identification of each control after comparing the control.
In a third aspect, the present invention provides a front-end control coverage detection apparatus, including:
one or more processors, memory which may employ a non-volatile storage medium, and one or more computer programs stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the method as in the first aspect or any possible implementation of the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored thereon a computer program which, when run on a computer, causes the computer to perform the method as described in the first aspect or any possible implementation manner of the first aspect.
In a fifth aspect, the present invention also provides a computer program product for performing the method of the first aspect or any possible implementation manner of the first aspect, when the computer program product is executed by a computer.
In a possible design of the fifth aspect, the relevant program related to the product may be stored in whole or in part on a memory packaged with the processor, or may be stored in part or in whole on a storage medium not packaged with the processor.
The invention has the conception that the identification and disassembly of the controls contained in the front-end interface image are realized based on the image identification technology, the control codes can be further obtained, the prefabricated marks are inserted into the control codes, the pre-stored running record identification of the control is updated if the codes run to the marks after the front-end request is monitored and the execution of the request is completed, and by the way, the final running record identification of each control can be read after the execution of all the requests is completed, and then the final running record identification is compared with the set control execution standard, so that the detection of the element coverage of the control of the front-end interface can be completed, namely the code quality corresponding to the front-end interface can be evaluated. The invention can quickly and conveniently identify and disassemble the front-end control information, and can realize that the control changes the running record identification one by one in the front-end request execution process in cooperation with the inserted control mark, and further can compare the code coverage condition based on the execution standard after the test.
Drawings
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described with reference to the accompanying drawings, in which:
FIG. 1 is a flowchart of an embodiment of a method for detecting coverage of a front-end control according to the present invention;
FIG. 2 is a flow diagram of a preferred embodiment of identifying controls from an image provided by the present invention;
FIG. 3 is a block diagram of an embodiment of a front-end control coverage detection apparatus provided in the present invention;
fig. 4 is a schematic diagram of an embodiment of a front-end control coverage detection apparatus provided in the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
Before the technical scheme of the invention is introduced, it can be stated that the front end can be tested by installing a plug-in, that is, a code detection script is injected into a front end code and deployed and executed, but in the process, a newly generated file needs to be introduced into a project again, an output file is obtained, and a detection result is checked by running and outputting. In practical use, it is found that the method has to frequently verify the deployment execution results of the steps to determine that the code detection script has been injected into the project at each stage and is successfully deployed, and the method has the disadvantages of being cumbersome, not easy to operate and not efficient in verification.
In addition, the invention further analyzes that the interactive interface is very easy to change according to different service requirements, and after the control related to the user interface is changed, the method depends on the execution result of the server and the association of the whole environment and other modules to a great extent based on the traditional end-to-end test form, so that the investment cost is additionally added to the front-end test on the whole, and particularly, the multi-module test chain is lengthened, which is more obvious.
In view of the above, how to simply and economically overcome the problem that the coverage of the front-end control on multiple scenes is not well detected due to the change of an interactive interface or interactive operation is provided, the interface control analysis is realized based on an image recognition technology, a mark is inserted into a control code to accurately update a corresponding running record identifier after a front-end request is executed, and finally, the running record identifier of each control element is compared with a set standard, so that the coverage of the front-end control on multiple scenes can be simply and accurately evaluated.
The invention provides an embodiment of at least one method for detecting coverage of a front-end control, which, as shown in fig. 1, may include the following steps:
And step S1, acquiring control information of each control contained in the image of the target interface.
Since the birth of artificial intelligence, the application field is continuously expanded, and the invention considers the image recognition technology as a large category of artificial intelligence during design, and the image is a main source for acquiring and exchanging information by human beings, so that the problems of frequent change of an interactive interface and multi-interaction logic can be solved by combining the capabilities of image recognition, information comprehensive processing and the like, thereby promoting the technical evolution of a front end and meeting the actual development requirement of business. Therefore, the invention provides that the control recognition is carried out on the target interface to be processed by adopting the image recognition technology, and certainly, in the actual operation, other preferable links can be designed in the image recognition process, for example, the collected image is preprocessed, such as but not limited to denoising, smoothing, transforming and the like, and the link can strengthen the boundary and detail information of the image and is beneficial to improving the accuracy of the subsequent control recognition. In addition, the interface image can be treated in a partition mode, namely the whole interface is divided into a plurality of image areas, and then subsequent control identification detection is carried out on each image area.
For the specific image recognition operation, a variety of different implementations may also be designed, for example, an image directly based on the target interface is captured, and specific information of each control element in the image is captured, or a step-by-step processing strategy may also be adopted, for example, a plurality of control objects are locked from the interface, and then information such as specific types and positions of the controls is further recognized, for which, referring to the embodiment shown in fig. 2, the following steps are specifically included:
s11, collecting a target interface image;
step S12, extracting the characteristics of the target interface image, and determining a plurality of processing objects by combining a preset processing object identification strategy;
and step S13, extracting the characteristics of each processing object, and determining the type information and the position information of each control by combining a preset control identification strategy.
In an actual operation, specifically, the front-end image data may be acquired (or images of each region obtained by image segmentation may be acquired), and then a pre-constructed processing object recognition model is used to perform processing object recognition on the acquired image, where the processing object recognition model construction method may include:
firstly, acquiring a front-end interface image and marking a part to be identified;
Secondly, training a processing object recognition model by using a training set to determine which parts in the image belong to the control elements; wherein the processing object recognition model can be trained based on, but not limited to, an IncepotionResNet V2 neural network.
And then, identifying the control of the processing object by adopting a pre-constructed control identification model, wherein the construction method of the control identification model comprises the following steps:
firstly, acquiring a plurality of processed object images containing known control information, and labeling;
secondly, training a control identification model according to the marked training image, so that control information of each control of the target interface can be determined; wherein the control recognition model can be trained based on, but not limited to, a YOLOv3 neural network.
The image feature extraction and identification strategy itself may refer to a mature technology in the field of image processing, and is not described herein again, but it needs to be further explained in combination with the technical task of the present invention, where the control information may specifically refer to a function type of the control, and may of course include a position where the control is located. The type information about the control can be specifically referred to as follows: dialog boxes, pop-up boxes, radio boxes, multiple selection boxes, input boxes, switches, sliders, date and time selectors, clickable submit buttons, password fields, and the like, with particular reference to the field-related front-end component libraries, and the like. In short, the image recognition processing described above makes it possible to quickly extract information such as what type a certain control belongs to and at what position on the interface in the interface, even when the interface is changed or the control is adjusted.
Step S2, analyzing the code of each control according to the control information;
and step S3, inserting control marks in the codes of the controls.
After the control information is disassembled in the foregoing steps, the code of each control may be obtained from the interface code, and this embodiment proposes to insert one or more control marks for the code of each control, for example, insert a control mark that can represent the "identity" of the control or a control mark that represents that the code has been executed for all conditions of each front-end control code. Specifically, regarding the control mark, the control mark corresponding to each control one to one may be generated based on the aforementioned control information and a preset rule, where the rule may be adjusted according to an actual requirement, for example, in a preferred embodiment of the present invention, "control element + system time + control position + element number" is used as a rule condition for generating the control mark.
Further, in order to facilitate the detection process to query and check the control record and each control, and facilitate more accurate comparison and evaluation of the coverage, the control information of each control and the control mark corresponding to each control may be recorded, for example, the control information of each control and the corresponding control mark may be stored in a database, and more preferably, a mark record table may be constructed in the database, which may be used to store the generated control marks.
Based on this, the invention further considers that there are more control elements possibly involved in the actual operation or the interface is changed, and the control is added or adjusted, so before the control mark is stored, the generated control mark can be compared with the stored control mark, if the control mark and the stored control mark are repeated, the currently generated control mark is abandoned, a new control mark can be regenerated based on the rule condition and the current control information, and then the new control mark is continuously compared with the stored control mark, the final effect of the method is to store the generated and unrepeated control mark, the function of the method is to ensure the one-to-one correspondence and the mark uniqueness of the control mark and the control, and the implementation of the subsequent steps is avoided being influenced.
Continuing, step S4, monitoring the request input by the user in real time and executing the corresponding control function;
and step S5, when the request is processed and the code runs to the control mark of the corresponding control, updating the preset running record mark of the control.
The front end always keeps a monitoring state in the detection process so as to obtain a request instruction issued by a user, and it can be understood that the request input by the user can be based on various forms such as voice, text, image and the like, taking a voice request as an example, a text corresponding to a voice stream can be further obtained through a transcription engine, and the instruction meaning of the user is determined by combining a semantic understanding technology, so that a corresponding control can be called to operate so as to process the front end request. The invention does not limit the form of the front-end request and the process of processing the request, but emphasizes that the running record identifier of the control can be updated only when two conditions are met, wherein the two conditions refer to that the front-end request is completed and the control mark is run, so that the running state of the control can be accurately guaranteed to be changed, the running record identifier can comprise an execution identifier, an execution identifier and an enabling identifier, and the execution identifier and the enabling identifier can be set based on different control types, for example, a control running state record table (or called a code running record table and the like) is set for a target interface in the database, of course, the control running state record table can also be pre-constructed into a pre-fabricated table which can cover more control types and more identification types, and when the current target interface is detected, targeted changes can be made in the more comprehensive pre-formed form.
The running record identifier specifically related to the update control may include: updating the execution identification of the control; or updating the execution identifier and the enabling identifier of the control. For example, when the two aforementioned conditions are met, the execution identifier corresponding to the control may be changed from 0 to 1, while the activation identifier may be changed from 0 to 1 for the already activated control, and the non-activated control (e.g., a check box of a form-filling interface, and when an option is selected, another item is grayed out) may be kept at 0.
And step S6, acquiring the final running record identification of each control of the target interface, and comparing the final running record identification with the set front-end control execution standard to generate a coverage detection result.
In the coverage detection link mentioned in this step, information such as keywords, calling modes, descriptions, and the like in the front-end request can be acquired, type information and position information of each front-end control can be acquired, current execution identifiers and enabling identifiers of each front-end control in the database can be acquired, and then the information can be subjected to structured processing and combination to obtain a current control execution result of the target interface, for example, the various information of the target interface is filled into a structured template to obtain a multi-scene coverage report of the target interface. The front-end control execution criteria used as the comparison criteria may be based on various front-end frameworks, various front-end controls, and a large number of front-end control calling records in advance, so as to construct a control knowledge graph (or called a control knowledge base, etc.), and use the control knowledge graph as the front-end control execution criteria. With respect to the specific manner of constructing the control knowledge graph, reference may be made to the following:
Firstly, based on the definition, usage, calling rule and the like of various front-end controls (such as the known control components and the like mentioned above);
acquiring a large amount of former front-end control calling records, extracting description texts in the front-end control calling records and normalizing the description texts into control descriptions;
③ definitions, usage, calling rules, etc. based on various types of front end frameworks (e.g., Angular, React, Vue, etc.).
It can be further explained that, in other preferred embodiments of the present invention, detection pertinence may be further considered, based on the control information of the current target interface, control knowledge data corresponding to each control of the target interface is extracted from the above-mentioned comprehensive control knowledge graph, and the front-end control execution standard is formed, that is, a specific comparison standard is generated, and the coverage of the control execution result of the current interface is evaluated.
Finally, it can be added that, in at least one preferred embodiment of the present invention, the foregoing operation record identifier may further include: and (5) counting and identifying. Therefore, in the final coverage detection stage, the controls of the target interface can be compared with the front-end control execution standard one by one, and the statistical identification of the control is updated after each control is compared, so that the uniqueness of the detection object is ensured, and repeated comparison and confusion of detection results are avoided.
In summary, the idea of the present invention is that identification and disassembly of controls included in a front-end interface image are implemented based on an image identification technology, and then control codes can be obtained, a pre-made mark is inserted into each control code, after a front-end request is monitored and when the request is completed, if the code runs to the mark, a pre-stored running record identifier of the control is updated, and so on, after all requests are completed, the final running record identifier of each control can be read, and then the final running record identifier is compared with a set control execution standard, so that detection of coverage of elements of the front-end interface control can be completed, that is, the quality of the code corresponding to the front-end interface can be evaluated. The invention can quickly and conveniently identify and disassemble the front-end control information, and can realize that the control changes the running record identification in the front-end request execution process in an order-by-order manner by matching with the inserted control mark, and further can compare the code coverage condition based on the execution standard after the test.
Corresponding to the above embodiments and preferred solutions, the present invention further provides an embodiment of a front-end control coverage detection apparatus, as shown in fig. 3, which may specifically include the following components:
the control disassembling module 1 is used for acquiring control information of each contained control from an image of a target interface;
the code analysis module 2 is used for analyzing the codes of the controls according to the control information;
the mark inserting module 3 is used for inserting control marks in the codes of the controls;
the request processing module 4 is used for monitoring the request input by the user in real time and executing the corresponding control function;
the identification updating module 5 is used for updating the preset running record identification of the control when the request is processed and the code runs to the control mark of the corresponding control;
and the comparison detection module 6 is used for acquiring the final running record identifier of each control of the target interface, comparing the final running record identifier with the set front-end control execution standard and generating a coverage detection result.
In at least one possible implementation manner, the control disassembling module includes:
the image acquisition unit is used for acquiring a target interface image;
the processing object identification unit is used for extracting the characteristics of the target interface image and determining a plurality of processing objects by combining a preset processing object identification strategy;
And the control identification unit is used for extracting the characteristics of each processing object and determining the type information and the position information of each control by combining a preset control identification strategy.
In at least one possible implementation manner, the apparatus further includes: a control mark generation module; the control mark generation module specifically includes:
the mark generating unit is used for generating control marks corresponding to the controls one by one according to the control information and a preset rule;
and the information storage unit is used for storing the control information of each control and the corresponding control mark.
In at least one possible implementation manner, the apparatus further includes: a tag uniqueness check module; the tag uniqueness checking module specifically comprises:
the mark comparison unit is used for comparing the generated control mark with the stored control mark;
the mark regeneration unit is used for discarding the currently generated control mark and regenerating a new control mark if the two are repeated;
and the unique mark storage unit is used for continuously comparing the new control mark with the stored control mark so as to store the generated and non-repeated control mark.
In at least one possible implementation, the front-end control execution criteria includes:
establishing a control knowledge graph in advance based on various front-end frames, various front-end controls and a large number of front-end control calling records, and taking the control knowledge graph as the execution standard of the front-end controls;
or,
and extracting control knowledge data corresponding to each control of the target interface from the control knowledge graph based on the control information, and forming the front-end control execution standard.
In at least one possible implementation manner, the operation record identifier includes: executing the identification; or, the operation record identification includes: an execution identification and an enable identification.
In at least one possible implementation manner, the identifier updating module is specifically configured to:
updating the execution identification of the control;
or,
and updating the execution identifier and the enabling identifier of the control.
In at least one possible implementation manner, the running record identifier further includes: counting the identification;
the comparison detection module comprises:
the comparison units one by one are used for comparing the control pieces of the target interface with the front-end control execution standard one by one;
And the identification updating unit is used for updating the statistical identification of each control after comparing the control.
It should be understood that the division of each component in the front-end control coverage detection apparatus shown in fig. 3 is only a division of a logical function, and all or part of the actual implementation may be integrated into one physical entity, or may be physically separated. And these components may all be implemented in software invoked by a processing element; or may be implemented entirely in hardware; and part of the components can be realized in the form of calling by the processing element in software, and part of the components can be realized in the form of hardware. For example, a certain module may be a separate processing element, or may be integrated into a certain chip of the electronic device. Other components are implemented similarly. In addition, all or part of the components can be integrated together or can be independently realized. In implementation, each step of the above method or each component above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
For example, the above components may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors (DSPs), one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, these components may be integrated together and implemented in the form of a System-On-a-Chip (SOC).
In view of the foregoing examples and their preferred embodiments, it will be appreciated by those skilled in the art that in practice, the invention may be practiced in a variety of embodiments, and that the invention is illustrated schematically in the following vectors:
(1) a front-end control coverage detection apparatus, may comprise:
one or more processors, memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions, which when executed by the apparatus, cause the apparatus to perform the steps/functions of the foregoing embodiments or equivalent implementations.
Fig. 4 is a schematic structural diagram of an embodiment of a front-end control coverage detection device according to the present invention, where the device may be an electronic device or a circuit device built in the electronic device. The electronic device can be a PC, a server, an intelligent terminal (a mobile phone, a tablet and the like), a special front-end development testing device and the like. The embodiment does not limit the specific form of the front-end control coverage detection device.
As shown in particular in fig. 4, the front-end control coverage detection apparatus 900 includes a processor 910 and a memory 930. Wherein, the processor 910 and the memory 930 can communicate with each other and transmit control and/or data signals through the internal connection path, the memory 930 is used for storing computer programs, and the processor 910 is used for calling and running the computer programs from the memory 930. The processor 910 and the memory 930 may be combined into a single processing device, or more generally, separate components, and the processor 910 is configured to execute the program code stored in the memory 930 to implement the functions described above. In particular implementations, the memory 930 may be integrated with the processor 910 or may be separate from the processor 910.
In addition, to further improve the functionality of the front-end control coverage detection device 900, the device 900 may further comprise one or more of an input unit 960, a display unit 970, an audio circuit 980, a camera 990, a sensor 901, and the like, which may further comprise a speaker 982, a microphone 984, and the like. The display unit 970 may include a display screen, among others.
Further, the front-end control coverage detection apparatus 900 may further include a power supply 950 for supplying power to various devices or circuits in the apparatus 900.
It should be understood that the front-end control coverage detection apparatus 900 shown in fig. 4 can implement the processes of the methods provided by the foregoing embodiments. The operations and/or functions of the various components of the apparatus 900 may each be configured to implement the corresponding flow in the above-described method embodiments. Reference is made in detail to the foregoing description of embodiments of the method, apparatus, etc., and a detailed description is omitted here as appropriate to avoid redundancy.
It should be understood that the processor 910 in the front-end control coverage detection apparatus 900 shown in fig. 4 may be a system on a chip SOC, and the processor 910 may include a Central Processing Unit (CPU), and may further include other types of processors, for example: an image Processing Unit (GPU), etc., which will be described in detail later.
In summary, various portions of the processors or processing units within the processor 910 may cooperate to implement the foregoing method flows, and corresponding software programs for the various portions of the processors or processing units may be stored in the memory 930.
(2) A readable storage medium, on which a computer program or the above-mentioned apparatus is stored, which, when executed, causes the computer to perform the steps/functions of the above-mentioned embodiments or equivalent implementations.
In the several embodiments provided by the present invention, any function, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. Based on this understanding, some aspects of the present invention may be embodied in the form of software products, which are described below, or portions thereof, which substantially contribute to the art.
(3) A computer program product (which may include the above apparatus) when run on a terminal device, causes the terminal device to perform the front-end control coverage detection method of the foregoing embodiment or an equivalent embodiment.
From the above description of the embodiments, it is clear to those skilled in the art that all or part of the steps in the above implementation method can be implemented by software plus a necessary general hardware platform. With this understanding, the above-described computer program products may include, but are not limited to, refer to APP; continuing on, the aforementioned device/terminal may be a computer device (e.g., a mobile phone, a PC terminal, a cloud platform, a server cluster, or a network communication device such as a media gateway). Moreover, the hardware structure of the computer device may further specifically include: at least one processor, at least one communication interface, at least one memory, and at least one communication bus; the processor, the communication interface and the memory can all complete mutual communication through the communication bus. The processor may be a central Processing unit CPU, a DSP, a microcontroller, or a digital Signal processor, and may further include a GPU, an embedded Neural Network Processor (NPU), and an Image Signal Processing (ISP), and may further include a specific integrated circuit ASIC, or one or more integrated circuits configured to implement the embodiments of the present invention, and the processor may have a function of operating one or more software programs, and the software programs may be stored in a storage medium such as a memory; and the aforementioned memory/storage media may comprise: non-volatile memories (non-volatile memories) such as non-removable magnetic disks, U-disks, removable hard disks, optical disks, etc., and Read-Only memories (ROM), Random Access Memories (RAM), etc.
In the embodiments of the present invention, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, and means that there may be three relationships, for example, a and/or B, and may mean that a exists alone, a and B exist simultaneously, and B exists alone. Wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c may represent: a, b, c, a and b, a and c, b and c or a and b and c, wherein a, b and c can be single or multiple.
Those of skill in the art will appreciate that the various modules, elements, and method steps described in the embodiments disclosed in this specification can be implemented as electronic hardware, combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. 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 present invention.
In addition, the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments may be referred to each other. In particular, for embodiments of devices, apparatuses, etc., since they are substantially similar to the method embodiments, reference may be made to some of the descriptions of the method embodiments for their relevant points. The above-described embodiments of devices, apparatuses, etc. are merely illustrative, and modules, units, etc. described as separate components may or may not be physically separate, and may be located in one place or distributed in multiple places, for example, on nodes of a system network. Some or all of the modules and units can be selected according to actual needs to achieve the purpose of the above-mentioned embodiment. Can be understood and carried out by those skilled in the art without inventive effort.
The structure, features and effects of the present invention have been described in detail with reference to the embodiments shown in the drawings, but the above embodiments are merely preferred embodiments of the present invention, and it should be understood that technical features related to the above embodiments and preferred modes thereof can be reasonably combined and configured into various equivalent schemes by those skilled in the art without departing from and changing the design idea and technical effects of the present invention; therefore, the invention is not limited to the embodiments shown in the drawings, and all the modifications and equivalent embodiments that can be made according to the idea of the invention are within the scope of the invention as long as they are not beyond the spirit of the description and the drawings.

Claims (10)

1. A method for detecting coverage of a front-end control is characterized by comprising the following steps:
acquiring control information of each contained control from an image of a target interface;
analyzing codes of all the controls according to the control information;
inserting control marks in the code of each control;
monitoring a request input by a user in real time and executing a corresponding control function;
when the request is processed and the code runs to the control mark of the corresponding control, updating a preset running record mark of the control;
and acquiring the final running record identification of each control of the target interface, and comparing the final running record identification with the set front-end control execution standard to generate a coverage detection result.
2. The method for detecting coverage of front-end controls according to claim 1, wherein the obtaining control information of each control included in the image of the target interface based on the image recognition technology comprises:
collecting a target interface image;
extracting the characteristics of the target interface image, and determining a plurality of processing objects by combining a preset processing object identification strategy;
and extracting the characteristics of each processing object, and determining the type information and the position information of each control by combining a preset control identification strategy.
3. The front-end control coverage detection method of claim 1, further comprising:
generating control marks corresponding to the controls one by one according to the control information and a preset rule;
and storing the control information of each control and the corresponding control mark.
4. The front-end control coverage detection method of claim 3, further comprising:
comparing the generated control mark with the stored control mark;
if the two are repeated, discarding the currently generated control mark and regenerating a new control mark;
and continuously comparing the new control mark with the stored control mark, and storing the generated and non-repeated control mark.
5. The front-end control coverage detection method of claim 1, wherein the front-end control execution criteria comprises:
establishing a control knowledge graph in advance based on various front-end frames, various front-end controls and a large number of front-end control calling records, and taking the control knowledge graph as the execution standard of the front-end controls;
or,
and extracting control knowledge data corresponding to each control of the target interface from the control knowledge graph based on the control information, and forming the front-end control execution standard.
6. The front-end control coverage detection method according to any one of claims 1 to 5,
the operation record identification comprises: executing the identification;
or,
the operation record identification comprises: an execution identification and an enable identification.
7. The front-end control coverage detection method of claim 6, wherein the updating the running record identifier of the control comprises:
updating the execution identification of the control;
or,
and updating the execution identifier and the enabling identifier of the control.
8. The front-end control coverage detection method of claim 6,
the operation record identification further comprises: counting the identification;
the comparing with the set front-end control execution standard comprises: and comparing the control of the target interface with the front-end control execution standard one by one, and updating the statistical identification of the control after comparing each control.
9. A front end control coverage detection device, comprising:
the control disassembling module is used for acquiring control information of each contained control from the image of the target interface;
the code analysis module is used for analyzing the codes of the controls according to the control information;
The mark inserting module is used for inserting control marks in the codes of the controls;
the request processing module is used for monitoring a request input by a user in real time and executing a corresponding control function;
the identification updating module is used for updating the preset running record identification of the control when the request is processed and the code runs to the control mark of the corresponding control;
and the comparison detection module is used for acquiring the final running record identifier of each control of the target interface, comparing the final running record identifier with the set front-end control execution standard and generating a coverage detection result.
10. A front-end control coverage detection device, comprising:
one or more processors, memory, and one or more computer programs stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the front-end control coverage detection method of any of claims 1-8.
CN202010688606.4A 2020-07-16 2020-07-16 Method, device and equipment for detecting coverage of front-end control Pending CN111858331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010688606.4A CN111858331A (en) 2020-07-16 2020-07-16 Method, device and equipment for detecting coverage of front-end control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010688606.4A CN111858331A (en) 2020-07-16 2020-07-16 Method, device and equipment for detecting coverage of front-end control

Publications (1)

Publication Number Publication Date
CN111858331A true CN111858331A (en) 2020-10-30

Family

ID=72984304

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010688606.4A Pending CN111858331A (en) 2020-07-16 2020-07-16 Method, device and equipment for detecting coverage of front-end control

Country Status (1)

Country Link
CN (1) CN111858331A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112698187A (en) * 2020-12-08 2021-04-23 重庆百瑞互联电子技术有限公司 Method and device for improving test coverage rate of integrated circuit
CN114461124A (en) * 2022-01-30 2022-05-10 深圳创维-Rgb电子有限公司 Screen projection control method and device, screen projector and computer readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100146420A1 (en) * 2008-12-10 2010-06-10 Microsoft Corporation Gui testing
CN104166541A (en) * 2013-05-17 2014-11-26 阿里巴巴集团控股有限公司 Method and device for updating measured control library
CN108681508A (en) * 2018-05-15 2018-10-19 福建天泉教育科技有限公司 A kind of test method and terminal of view-based access control model identification
CN108710574A (en) * 2018-05-23 2018-10-26 百度在线网络技术(北京)有限公司 Ui testing method and apparatus
CN109408367A (en) * 2018-09-03 2019-03-01 深圳壹账通智能科技有限公司 A kind of method and terminal of the control element identifying interactive interface
CN109871316A (en) * 2019-01-10 2019-06-11 北京云测信息技术有限公司 A kind of control recognition methods and device
CN109947617A (en) * 2019-02-25 2019-06-28 努比亚技术有限公司 A kind of method, terminal and readable storage medium storing program for executing monitored application interface and show content
CN110879777A (en) * 2019-10-12 2020-03-13 平安普惠企业管理有限公司 Control testing method and device for application interface, computer equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100146420A1 (en) * 2008-12-10 2010-06-10 Microsoft Corporation Gui testing
CN104166541A (en) * 2013-05-17 2014-11-26 阿里巴巴集团控股有限公司 Method and device for updating measured control library
CN108681508A (en) * 2018-05-15 2018-10-19 福建天泉教育科技有限公司 A kind of test method and terminal of view-based access control model identification
CN108710574A (en) * 2018-05-23 2018-10-26 百度在线网络技术(北京)有限公司 Ui testing method and apparatus
CN109408367A (en) * 2018-09-03 2019-03-01 深圳壹账通智能科技有限公司 A kind of method and terminal of the control element identifying interactive interface
CN109871316A (en) * 2019-01-10 2019-06-11 北京云测信息技术有限公司 A kind of control recognition methods and device
CN109947617A (en) * 2019-02-25 2019-06-28 努比亚技术有限公司 A kind of method, terminal and readable storage medium storing program for executing monitored application interface and show content
CN110879777A (en) * 2019-10-12 2020-03-13 平安普惠企业管理有限公司 Control testing method and device for application interface, computer equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112698187A (en) * 2020-12-08 2021-04-23 重庆百瑞互联电子技术有限公司 Method and device for improving test coverage rate of integrated circuit
CN112698187B (en) * 2020-12-08 2023-08-04 重庆百瑞互联电子技术有限公司 Method and device for improving test coverage rate of integrated circuit
CN114461124A (en) * 2022-01-30 2022-05-10 深圳创维-Rgb电子有限公司 Screen projection control method and device, screen projector and computer readable storage medium

Similar Documents

Publication Publication Date Title
US9251046B2 (en) Method and system for generating and processing black box test cases
CN109376069B (en) Method and device for generating test report
KR20160122452A (en) Deep learnig framework and image recognition method for content-based visual image recognition
CN111552633A (en) Interface abnormal call testing method and device, computer equipment and storage medium
CN104252592A (en) Method and device for identifying plug-in application program
CN111858331A (en) Method, device and equipment for detecting coverage of front-end control
CN105095415A (en) Method and apparatus for confirming network emotion
CN110245077A (en) A kind of response method and equipment of program exception
CN109241485A (en) Relation establishing method and device are jumped between a kind of page
CN109743286A (en) A kind of IP type mark method and apparatus based on figure convolutional neural networks
CN109710240A (en) Flow chart decomposition method and system
CN113778864A (en) Test case generation method and device, electronic equipment and storage medium
CN108875317A (en) Software clone detection method and device, detection device and storage medium
CN117421217A (en) Automatic software function test method, system, terminal and medium
CN112687274A (en) Voice information processing method, device, equipment and medium
CN110427998A (en) Model training, object detection method and device, electronic equipment, storage medium
CN110322587B (en) Evaluation recording method, device and equipment in driving process and storage medium
CN109285009A (en) It brushes single recognition methods and brushes single identification device
CN103701671B (en) Method and device for detecting conflicts among businesses
CN112416800A (en) Intelligent contract testing method, device, equipment and storage medium
CN112015648A (en) Test method, device, computer equipment and medium based on automation script
CN114812695B (en) Product testing method and device, computer equipment and storage medium
CN111708712A (en) User behavior test case generation method, flow playback method and electronic equipment
CN113628077B (en) Method, terminal and readable storage medium for generating non-repeated questions
CN105848155B (en) Terminal illegal flashing recognition 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