CN111782552A - Automatic testing method and device based on region division - Google Patents
Automatic testing method and device based on region division Download PDFInfo
- Publication number
- CN111782552A CN111782552A CN202010788992.4A CN202010788992A CN111782552A CN 111782552 A CN111782552 A CN 111782552A CN 202010788992 A CN202010788992 A CN 202010788992A CN 111782552 A CN111782552 A CN 111782552A
- Authority
- CN
- China
- Prior art keywords
- sub
- region
- execution
- recognition
- threads
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5021—Priority
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Human Computer Interaction (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application discloses an automatic testing method and device based on region division, which are used for solving the technical problem that the existing testing method based on image recognition is low in recognition accuracy rate and inaccurate in testing result, wherein the method comprises the following steps: acquiring an operation interface image of the tested software; according to the test content of the tested software, carrying out region division on the running interface image to obtain a plurality of sub-regions, and determining the processing strategy of each sub-region; performing image recognition on the corresponding sub-region based on the processing strategy to obtain a recognition result; and summarizing all the identification results to obtain the test result corresponding to the tested software.
Description
Technical Field
The present application relates to the field of automated testing technologies, and in particular, to an automatic testing method and apparatus based on region partitioning.
Background
In the existing graphical user interface testing software or tool realized by using an image recognition method, an image recognition framework of the software or tool requires a user to set a screen capture range in advance, in practical application, a scene is only subjected to screen capture once, then, the screen capture is subjected to feature recognition and matching operation or positioning to obtain a test result, when the size of the screen capture is large, in order to improve the recognition speed, the image recognition algorithm is improved to compress image details to reduce the calculation amount, so that the recognition accuracy is reduced, and when the number of recognition objects in the screen capture is large, the recognition is easy to make mistakes, so that the test result is inaccurate.
Disclosure of Invention
The application provides an automatic testing method and device based on region division, which are used for solving the technical problem that the existing testing method based on image recognition is low in recognition accuracy rate and inaccurate in testing result.
In view of the above, a first aspect of the present application provides an automatic testing method based on region partitioning, including:
acquiring an operation interface image of the tested software;
according to the test content of the tested software, carrying out region division on the running interface image to obtain a plurality of sub-regions, and determining the processing strategy of each sub-region;
performing image recognition on the corresponding sub-region based on the processing strategy to obtain a recognition result;
and summarizing all the identification results to obtain the test result corresponding to the tested software.
Optionally, the image recognition of the corresponding sub-region based on the processing policy to obtain a recognition result includes:
creating a plurality of sub threads according to the number of the sub areas, wherein the sub threads comprise execution sub threads;
distributing the processing strategy corresponding to each sub-region to the execution sub-thread, and operating the execution sub-thread to enable the execution sub-thread to perform image recognition on the corresponding sub-region based on the processing strategy to obtain a recognition result;
wherein the number of execution child threads is equal to the number of sub-regions.
Optionally, the sub-thread further includes a monitoring sub-thread, the collecting all the identification results to obtain a test result corresponding to the tested software, and the method further includes:
running the monitoring sub-threads to enable the monitoring sub-threads to time the execution process of the execution sub-threads to obtain execution duration, wherein the number of the monitoring sub-threads is equal to that of the execution sub-threads;
and when the execution time length reaches a preset time length, forcibly ending the execution sub-thread and the monitoring sub-thread.
Optionally, the determining the processing policy of each sub-region further includes:
determining a priority order of the processing strategies;
correspondingly, the image recognition of the corresponding sub-region based on the processing strategy to obtain a recognition result includes:
and according to the priority order of the processing strategies, carrying out image identification on the corresponding sub-regions based on the processing strategies to obtain an identification result.
Optionally, the image recognition of the corresponding sub-region based on the processing policy is performed to obtain a recognition result, and the method further includes:
determining a polling strategy of the tested software according to the test content of the tested software;
when the polling strategy is not empty, acquiring the polling times included in the polling strategy;
correspondingly, the image recognition of the corresponding sub-region based on the processing strategy to obtain a recognition result includes:
according to the polling times, image recognition is carried out on the corresponding sub-regions based on the processing strategy, and recognition results are obtained;
correspondingly, the summarizing all the identification results to obtain the test result corresponding to the tested software includes:
and summarizing the identification result after the last polling to obtain a test result corresponding to the tested software.
The second aspect of the present application provides an automatic testing apparatus based on region division, including:
the first acquisition unit is used for acquiring an operation interface image of the tested software;
the area dividing unit is used for carrying out area division on the running interface image according to the test content of the tested software to obtain a plurality of sub-areas and determining the processing strategy of each sub-area;
the identification unit is used for carrying out image identification on the corresponding sub-region based on the processing strategy to obtain an identification result;
and the summarizing unit is used for summarizing all the identification results to obtain the test result corresponding to the tested software.
Optionally, the identification unit includes:
the creating subunit is used for creating a plurality of sub threads according to the number of the sub areas, and the sub threads comprise executing sub threads;
the first operation subunit is configured to distribute the processing policy corresponding to each sub-region to the execution sub-thread, and operate the execution sub-thread, so that the execution sub-thread performs image recognition on the corresponding sub-region based on the processing policy to obtain a recognition result;
wherein the number of execution child threads is equal to the number of sub-regions.
Optionally, the sub-thread further includes a monitoring sub-thread, and the identification unit further includes:
the second running subunit is used for running the monitoring sub-threads, so that the monitoring sub-threads time the execution process of the execution sub-threads to obtain the execution duration, and the number of the monitoring sub-threads is equal to that of the execution sub-threads;
and the ending subunit is used for forcibly ending the execution sub-thread and the monitoring sub-thread when the execution duration reaches a preset duration.
Optionally, the method further includes:
a first determining unit, configured to determine a priority order of the processing strategies;
correspondingly, the identification unit is specifically configured to:
and according to the priority order of the processing strategies, carrying out image identification on the corresponding sub-regions based on the processing strategies to obtain an identification result.
Optionally, the method further includes:
the second determining unit is used for determining the polling strategy of the software to be tested according to the test content of the software to be tested;
the second acquisition unit is used for acquiring the polling times included in the polling strategy when the polling strategy is not empty;
correspondingly, the identification unit is specifically configured to:
according to the polling times, image recognition is carried out on the corresponding sub-regions based on the processing strategy, and recognition results are obtained;
correspondingly, the summarizing unit is specifically configured to:
and summarizing the identification result after the last polling to obtain a test result corresponding to the tested software.
According to the technical scheme, the method has the following advantages:
the application provides an automatic testing method based on region division, which comprises the following steps: acquiring an operation interface image of the tested software; according to the test content of the tested software, carrying out region division on the running interface image to obtain a plurality of sub-regions, and determining the processing strategy of each sub-region; performing image recognition on the corresponding sub-region based on the processing strategy to obtain a recognition result; and summarizing all the identification results to obtain the test result corresponding to the tested software.
According to the automatic testing method based on the region division, after the running interface image of the tested software is obtained, the running interface image is subjected to the region division according to the testing content of the tested software to obtain a plurality of sub-regions, after the processing strategy of each sub-region is determined, the corresponding sub-region is subjected to image recognition according to the processing strategy to obtain a recognition result, the sub-region is obtained by performing the region division on the running interface image, and each sub-region subjected to the region division is subjected to image recognition, so that the situation that the error recognition is easy to occur when the number of recognition objects in the running interface image is large is avoided, the situation that the recognition rate is reduced when the size of the running interface image is large is also avoided, and the recognition rate is improved; all the identification results are collected to obtain a test result, and the accuracy of the test result is improved by improving the identification rate, so that the technical problem that the existing test method based on image identification is low in identification accuracy and inaccurate in test result is solved.
Drawings
Fig. 1 is a schematic flowchart of an automatic testing method based on region partition according to an embodiment of the present disclosure;
fig. 2 is another schematic flow chart of an automatic testing method based on region partition according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an automatic testing apparatus based on region division according to an embodiment of the present application;
fig. 4 is a schematic diagram of a 3D real-time design software operating interface provided in an embodiment of the present application;
fig. 5 is a schematic diagram of a left article image list selection sub-area according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the prior art, UI or GUI (graphical User Interface) test software or tools are implemented through image recognition, an image recognition framework of the UI or GUI test software or tools requires a User to set a screen capture range in advance, in practical application, a scene is only captured once, and then feature recognition and matching or positioning are directly performed through screenshot. In general, a feature image is searched in a screenshot, if the feature image has the same size as the screenshot image, a method of measuring image similarity can be directly used, and the feature image is directly considered as mismatching if the feature image is larger. When the feature image size is smaller than the screenshot image size, a sliding match is typically required, such as from top left to bottom right, over the entire screenshot image. If the sizes are different greatly, for example, 64 × 64 pixel features are searched in images with sizes of 1920 × 1080 pixels, the similarity needs to be calculated (1920/64 × 1080/64 ≈ 507) about 507 times for complete calculation, and 64 × 64 ═ 4096 data nodes are compared each time, so that the recognition speed is slow, in order to improve the recognition speed, the image details are compressed by improving an image recognition method to reduce the calculation amount, for example, a perceptual hash method, two images are compressed to be compared, so that the recognition speed is accelerated, but the recognition accuracy is reduced, when the requirement on the matching accuracy of the feature images is high, a certain error exists in the method, and the recognition is easy to make an error; and when the number of recognition objects in the screenshot is large, recognition errors are easy to occur, and the test result is inaccurate.
In order to solve the above problems, the present application provides an automatic testing method based on region division, which is implemented by performing region division on a captured image, and performing image recognition on each sub-region is faster in image recognition speed on the whole captured image, and image details are not required to be compressed, so that the risk of recognition errors is reduced, for example, a captured image with a size of 1920 × 1080 is divided into a plurality of 256 sub-regions, 64 × 64 pixel features are searched for in each sub-region, only 4 × 16 times at most is required to be calculated, and image details are not required to be compressed; after the intercepted image is subjected to region division, the recognition objects of each subregion are fewer than those of the whole intercepted image, so that the recognition error condition can be reduced; moreover, the intercepted image is subjected to region division, and each subregion is identified and matched, so that the method is more reliable than the method for identifying the whole intercepted image.
For easy understanding, please refer to fig. 1, an embodiment of an automatic testing method based on region partition provided in the present application includes:
And when the tested software runs, performing real-time screenshot on the running interface of the tested software to obtain a running interface image of the tested software.
102, according to the test content of the tested software, carrying out region division on the running interface image to obtain a plurality of sub-regions, and determining the processing strategy of each sub-region.
The running interface image can be subjected to region division based on a region division method, and assuming that the maximum display range of the tested software is RegionA11, the region division follows the following principle:
RegionA11≥Region_1∪Region_2∪…∪Region_n;
the Region _1, the Region _2, the Region … and the Region _ n are n sub-regions obtained by dividing, and gaps are allowed between every two sub-regions, and the sub-regions can be overlapped.
Taking a certain 3D real-time design software as an example, please refer to the running interface image of the 3D real-time design software provided in fig. 4, assuming that the performance of each functional area of the running interface of the 3D real-time design software needs to be tested during running, the running interface image of the 3D real-time design software can be divided into the following functional areas according to the functions:
a: selecting a subregion Region _1 from the left article image list;
b: designing a subregion Region _2 in real time in 3D on the right side;
c: the top information display and toolbar sub-area Region _ 3;
d: navigation tool sub-Region _ 4;
e: effect map task sub-Region _ 5.
Scene region partitioning is targeted, for example, when only the left item image list of the running interface of the 3D real-time design software needs to be checked to see whether the ordering is correct, region a11 becomes region a in fig. 4; further, when the finer regions need to be divided according to the influence range and the sequence of each image display, please refer to fig. 5, a clear boundary exists between each cabinet image, and the sequence is shown in fig. 5, at this time, the region a can be further divided into 8 display sub-regions.
After the areas are divided to obtain a plurality of sub-areas, a processing strategy of each sub-area is determined according to the test content of the tested software, the processing strategy can be simple judgment and can be used for verifying the performance of the tested software in operation, taking 3D real-time design software as an example, a left cabinet image list of a software operation interface displays cabinets with a preset arrangement sequence, during testing, a real-time sequence is obtained through screenshot, and whether the arrangement sequence of the cabinets meets the expectation or not needs to be tested through image recognition, and the following possibilities exist:
A. the left article image list is known to select which types of cabinets exist in the sub-area, and only the position of the cabinets is adjusted, so that the overall strategy is determined.
B. Is it tested whether the preset positions all show cabinet images? Is the same cabinet image repeated?
C. Is the cabinet image displayed at each position in line with the expected sequence?
D. During testing, click each cabinet body or drag and drop each cabinet body to the right 3D real-time design sub-region, and determine whether the cabinet body displayed by the right 3D real-time design sub-region corresponds to the cabinet body image of the selected sub-region of the left article image list one-to-one?
According to the above possibility, the processing strategy at the time of test at least comprises:
fun (a), test preferentially if the left article image list selection subarea displays the cabinet image?
Fun (b), test whether the cabinet image displayed at each position in the left article image list selection sub-area meets expectations? The test can be performed by subdividing the display area into 8 display sub-areas;
fun (c), test whether the cabinet displayed in the right 3D real-time design sub-area is consistent with the cabinet image corresponding to the left article image list selection sub-area?
According to the processing strategy, the processing strategy of the selected sub-area of the left article image list is fun (A), the processing strategies of the 8 display sub-areas are fun (B), and the processing strategy of the right 3D real-time design sub-area is fun (C).
And 103, carrying out image identification on the corresponding sub-area based on the processing strategy to obtain an identification result.
After the processing strategy of each sub-region is determined, the processing strategy corresponding to each sub-region may be executed, and the processing strategy is implemented by image recognition, and in the case of the above 3D real-time design software, it is assumed that the processing strategy of the first display sub-region of the 8 display sub-regions is to determine whether the cabinet in the display sub-region is a unit cabinet (left and right), and it is necessary to recognize whether the image in the display sub-region is a unit cabinet (left and right), and a yes or no recognition result is obtained. As can be seen from FIG. 5, the similarity between cabinet images is high, and if the cabinet images are identified by adopting an image identification method based on image compression, although the identification speed can be increased, the identification accuracy is reduced, the identification is easy to make mistakes, and the test result is influenced.
And step 104, summarizing all the identification results to obtain a test result corresponding to the tested software.
And after the image recognition is carried out on all the sub-areas to obtain recognition results, summarizing all the recognition results to obtain test results corresponding to the tested software.
According to the automatic testing method based on the region division, after the running interface image of the tested software is obtained, the running interface image is subjected to the region division according to the testing content of the tested software to obtain a plurality of sub-regions, after the processing strategy of each sub-region is determined, the corresponding sub-region is subjected to image recognition according to the processing strategy to obtain a recognition result, the sub-region is obtained by performing the region division on the running interface image, and each sub-region subjected to the region division is subjected to image recognition, so that the situation that the false recognition is easy to occur when the number of recognition objects in the running interface image is large is avoided, the situation that the recognition rate is reduced when the size of the running interface image is large is also avoided, and the recognition rate is improved; all the identification results are collected to obtain a test result, and the accuracy of the test result is improved by improving the identification rate, so that the technical problem that the existing test method based on image identification is low in identification accuracy and inaccurate in test result is solved.
For easy understanding, please refer to fig. 2, another embodiment of an automatic testing method based on region partition provided in the present application includes:
And when the tested software runs, performing real-time screenshot on the running interface of the tested software to obtain a running interface image of the tested software.
The running interface image can be subjected to region division based on a region division method, and assuming that the maximum display range of the tested software is RegionA11, the region division follows the following principle:
RegionA11≥Region_1∪Region_2∪…∪Region_n;
the Region _1, the Region _2, the Region … and the Region _ n are n sub-regions obtained by dividing, and gaps are allowed between every two sub-regions, and the sub-regions can be overlapped.
Taking a certain 3D real-time design software as an example, please refer to the running interface image of the 3D real-time design software provided in fig. 4, assuming that the performance of each functional area of the running interface of the 3D real-time design software needs to be tested during running, the running interface image of the 3D real-time design software can be divided into the following functional areas according to the functions:
a: selecting a subregion Region _1 from the left article image list;
b: designing a subregion Region _2 in real time in 3D on the right side;
c: the top information display and toolbar sub-area Region _ 3;
d: navigation tool sub-Region _ 4;
e: effect map task sub-Region _ 5.
Scene region partitioning is targeted, for example, when only the left item image list of the running interface of the 3D real-time design software needs to be checked to see whether the ordering is correct, region a11 becomes region a in fig. 4; further, when the finer regions need to be divided according to the influence range and the sequence of each image display, please refer to fig. 5, a clear boundary exists between each cabinet image, and the sequence is shown in fig. 5, at this time, the region a can be further divided into 8 display sub-regions.
After the areas are divided to obtain a plurality of sub-areas, a processing strategy of each sub-area is determined according to the test content of the tested software, the processing strategy can be simple judgment and can be used for verifying the performance of the tested software in operation, taking 3D real-time design software as an example, a left cabinet image list of a software operation interface displays cabinets with a preset arrangement sequence, during testing, a real-time sequence is obtained through screenshot, and whether the arrangement sequence of the cabinets meets the expectation or not needs to be tested through image recognition, and the following possibilities exist:
A. the left article image list is known to select which types of cabinets exist in the sub-area, and only the position of the cabinets is adjusted, so that the overall strategy is determined.
B. Is it tested whether the preset positions all show cabinet images? Is the same cabinet image repeated?
C. Is the cabinet image displayed at each position in line with the expected sequence?
D. During testing, click each cabinet body or drag and drop each cabinet body to the right 3D real-time design sub-region, and determine whether the cabinet body displayed by the right 3D real-time design sub-region corresponds to the cabinet body image of the selected sub-region of the left article image list one-to-one?
According to the above possibility, the processing strategy at the time of test at least comprises:
fun (a), test preferentially if the left article image list selection subarea displays the cabinet image?
Fun (b), test whether the cabinet image displayed at each position in the left article image list selection sub-area meets expectations? The test can be performed by subdividing the display area into 8 display sub-areas;
fun (c), test whether the cabinet displayed in the right 3D real-time design sub-area is consistent with the cabinet image corresponding to the left article image list selection sub-area?
According to the processing strategy, the processing strategy of the selected sub-area of the left article image list is fun (A), the processing strategies of the 8 display sub-areas are fun (B), and the processing strategy of the right 3D real-time design sub-area is fun (C).
After the processing strategy of each sub-area is determined, the priority order of the processing strategies is determined according to the test content of the tested software, and the example is continued, whether the cabinet images are displayed in all the sub-areas selected by the left article image list or not needs to be tested preferentially, so that the processing strategy fun (A) is higher in priority, in addition, under the condition that the cabinet images designated by the sub-areas selected by the left article image list are displayed, the cabinets need to be dragged and dropped one by one to the right 3D real-time design sub-areas, and during testing, the priority of the processing strategy for judging whether the cabinet images of the placed cabinets and the cabinet images of the sub-areas selected by the left article image list are consistent or; if the process strategies repeatedly appear, the process strategies of the whole placing sequence have higher priority only by judging whether the process strategies are dragged and dropped or not.
The polling strategy of the tested software can be determined according to the test content of the tested software, the polling strategy and the processing strategy can be determined simultaneously, the processing strategy and the polling strategy can also be determined sequentially, and the running performance of the tested software can be verified more accurately by setting polling, so that more accurate and comprehensive test results can be obtained, and the reliability of the test results can be improved. When the polling strategy is empty, it indicates that polling is not needed, and when the polling strategy is not empty, the polling strategy includes polling times and also can include polling duration, and the polling duration is the maximum duration of the cycle period, and when the first test is finished, the running interface image of the tested software is intercepted again, and the next polling is carried out.
And 204, carrying out image recognition on the corresponding sub-regions based on the processing strategy to obtain recognition results.
After the processing strategy of each subregion is determined, image recognition is carried out on the corresponding subregion based on the processing strategy to obtain a recognition result, and when the processing strategies have priority sequences, the image recognition is carried out on the corresponding subregion based on the processing strategy according to the priority sequence of the processing strategies to obtain a recognition result; and when the polling strategy is not empty, acquiring the polling times included in the polling strategy, and carrying out image identification on the corresponding sub-region based on the processing strategy according to the polling times to obtain an identification result.
When executing the processing strategies of 8 display sub-regions, if the testing steps are executed only by the main thread, the execution needs to be performed 8 times, which consumes a long testing time, in order to reduce the testing time, in the embodiment of the present application, the processing strategies are executed by multiple threads, and the specific steps may be:
and according to the number of the sub-regions, creating a thread pool in the main thread, wherein the thread pool comprises a plurality of sub-threads, the sub-threads can comprise execution sub-threads and monitoring sub-threads, and the number of the execution sub-threads and the number of the monitoring sub-threads are equal to the number of the sub-regions.
And distributing the processing strategy corresponding to each sub-region to an execution sub-thread, and operating the execution sub-thread to enable the execution sub-thread to perform image recognition on the corresponding sub-region based on the processing strategy to obtain a recognition result.
The execution sub-thread can be run, the monitoring sub-thread can time the execution process of the execution sub-thread to obtain the execution duration, namely, each processing strategy can be executed by adopting a thread group mechanism during execution, two threads, namely the execution sub-thread and the monitoring sub-thread, are simultaneously started in the thread group, the execution sub-thread is used for executing the processing strategies, and the monitoring sub-thread is used for monitoring the execution process of the execution sub-thread.
When the execution time length reaches a preset time length, forcibly ending the execution sub-thread and the monitoring sub-thread, and when the execution sub-thread is ended, ending the monitoring sub-thread and not monitoring any more; when the execution sub-thread runs overtime, the monitoring sub-thread actively triggers interruption at the appointed maximum time limit (preset time duration) and finishes executing the sub-thread, which is equivalent to a forced termination strategy; the maximum time limit is constrained by the polling time length, if the maximum time limit of the execution sub-thread is larger than the value of the polling time length, the execution sub-thread and the monitoring sub-thread are forcibly ended when the polling time length is reached.
And step 205, summarizing all the identification results to obtain a test result corresponding to the tested software.
And after the main thread waits for all the sub-threads to finish executing, the main thread collects all the identification results after the last polling to obtain the test result corresponding to the tested software.
For easy understanding, please refer to fig. 3, which illustrates an embodiment of an automatic testing apparatus based on region partition, including:
the first acquiring unit 301 is configured to acquire an operation interface image of the software under test.
The region dividing unit 302 is configured to perform region division on the running interface image according to the test content of the software to be tested to obtain a plurality of sub regions, and determine a processing policy of each sub region.
The identifying unit 303 is configured to perform image identification on the corresponding sub-region based on the processing policy to obtain an identification result.
And the summarizing unit 304 is configured to summarize all the identification results to obtain a test result corresponding to the tested software.
As a further improvement, the identifying unit 303 includes:
a creating subunit 3031, configured to create a plurality of sub-threads according to the number of the sub-regions, where the sub-threads include an execution sub-thread;
the first operation subunit 3032 is configured to distribute the processing policy corresponding to each sub-region to the execution sub-thread, and operate the execution sub-thread, so that the execution sub-thread performs image recognition on the corresponding sub-region based on the processing policy to obtain a recognition result;
wherein the number of executing child threads is equal to the number of sub-regions.
As a further improvement, the sub-thread further includes a monitoring sub-thread, and the recognition unit 303 further includes:
a second operation subunit 3033, configured to operate the monitoring sub-thread, so that the monitoring sub-thread times an execution process of the execution sub-thread to obtain an execution duration, where the number of the monitoring sub-threads is equal to the number of the execution sub-threads;
an end sub unit 3034 for forcibly ending the execution sub thread and the monitor sub thread when the execution time reaches a preset time length.
As a further improvement, the method further comprises the following steps:
a first determination unit 305 for determining a priority order of the processing policies;
correspondingly, the identifying unit 303 is specifically configured to:
and according to the priority order of the processing strategies, carrying out image identification on the corresponding sub-regions based on the processing strategies to obtain an identification result.
As a further improvement, the method further comprises the following steps:
a second determining unit 306, configured to determine a polling policy of the software under test according to the test content of the software under test;
a second obtaining unit 307, configured to obtain, when the polling policy is not empty, the number of polling times included in the polling policy;
correspondingly, the identifying unit 303 is specifically configured to:
performing image recognition on the corresponding sub-region based on the processing strategy according to the polling times to obtain a recognition result;
correspondingly, the summarizing unit 304 is specifically configured to:
and summarizing the identification result after the last polling to obtain the test result corresponding to the tested software.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.
Claims (10)
1. An automatic test method based on region division is characterized by comprising the following steps:
acquiring an operation interface image of the tested software;
according to the test content of the tested software, carrying out region division on the running interface image to obtain a plurality of sub-regions, and determining the processing strategy of each sub-region;
performing image recognition on the corresponding sub-region based on the processing strategy to obtain a recognition result;
and summarizing all the identification results to obtain the test result corresponding to the tested software.
2. The method for automatic testing based on region partition according to claim 1, wherein the image recognition of the corresponding sub-region based on the processing policy to obtain a recognition result comprises:
creating a plurality of sub threads according to the number of the sub areas, wherein the sub threads comprise execution sub threads;
distributing the processing strategy corresponding to each sub-region to the execution sub-thread, and operating the execution sub-thread to enable the execution sub-thread to perform image recognition on the corresponding sub-region based on the processing strategy to obtain a recognition result;
wherein the number of execution child threads is equal to the number of sub-regions.
3. The automatic testing method based on region division according to claim 2, wherein the child thread further includes a monitoring child thread, the collecting all the recognition results to obtain the testing results corresponding to the tested software further includes:
running the monitoring sub-threads to enable the monitoring sub-threads to time the execution process of the execution sub-threads to obtain execution duration, wherein the number of the monitoring sub-threads is equal to that of the execution sub-threads;
and when the execution time length reaches a preset time length, forcibly ending the execution sub-thread and the monitoring sub-thread.
4. The method for automatic testing based on region partition according to claim 1, wherein said determining the processing strategy of each of said sub-regions further comprises:
determining a priority order of the processing strategies;
correspondingly, the image recognition of the corresponding sub-region based on the processing strategy to obtain a recognition result includes:
and according to the priority order of the processing strategies, carrying out image identification on the corresponding sub-regions based on the processing strategies to obtain an identification result.
5. The method for automatic testing based on region partition according to claim 1, wherein the image recognition of the corresponding sub-region based on the processing policy is performed to obtain a recognition result, and before the method, the method further comprises:
determining a polling strategy of the tested software according to the test content of the tested software;
when the polling strategy is not empty, acquiring the polling times included in the polling strategy;
correspondingly, the image recognition of the corresponding sub-region based on the processing strategy to obtain a recognition result includes:
according to the polling times, image recognition is carried out on the corresponding sub-regions based on the processing strategy, and recognition results are obtained;
correspondingly, the summarizing all the identification results to obtain the test result corresponding to the tested software includes:
and summarizing the identification result after the last polling to obtain a test result corresponding to the tested software.
6. An automatic test device based on area division, comprising:
the first acquisition unit is used for acquiring an operation interface image of the tested software;
the area dividing unit is used for carrying out area division on the running interface image according to the test content of the tested software to obtain a plurality of sub-areas and determining the processing strategy of each sub-area;
the identification unit is used for carrying out image identification on the corresponding sub-region based on the processing strategy to obtain an identification result;
and the summarizing unit is used for summarizing all the identification results to obtain the test result corresponding to the tested software.
7. The automatic test device based on area division according to claim 6, wherein the recognition unit comprises:
the creating subunit is used for creating a plurality of sub threads according to the number of the sub areas, and the sub threads comprise executing sub threads;
the first operation subunit is configured to distribute the processing policy corresponding to each sub-region to the execution sub-thread, and operate the execution sub-thread, so that the execution sub-thread performs image recognition on the corresponding sub-region based on the processing policy to obtain a recognition result;
wherein the number of execution child threads is equal to the number of sub-regions.
8. The automatic test device based on area division according to claim 7, wherein the sub thread further includes a monitoring sub thread, the recognition unit further includes:
the second running subunit is used for running the monitoring sub-threads, so that the monitoring sub-threads time the execution process of the execution sub-threads to obtain the execution duration, and the number of the monitoring sub-threads is equal to that of the execution sub-threads;
and the ending subunit is used for forcibly ending the execution sub-thread and the monitoring sub-thread when the execution duration reaches a preset duration.
9. The automatic test device based on area division according to claim 6, further comprising:
a first determining unit, configured to determine a priority order of the processing strategies;
correspondingly, the identification unit is specifically configured to:
and according to the priority order of the processing strategies, carrying out image identification on the corresponding sub-regions based on the processing strategies to obtain an identification result.
10. The automatic test device based on area division according to claim 6, further comprising:
the second determining unit is used for determining the polling strategy of the software to be tested according to the test content of the software to be tested;
the second acquisition unit is used for acquiring the polling times included in the polling strategy when the polling strategy is not empty;
correspondingly, the identification unit is specifically configured to:
according to the polling times, image recognition is carried out on the corresponding sub-regions based on the processing strategy, and recognition results are obtained;
correspondingly, the summarizing unit is specifically configured to:
and summarizing the identification result after the last polling to obtain a test result corresponding to the tested software.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010788992.4A CN111782552B (en) | 2020-08-07 | 2020-08-07 | Automatic testing method and device based on region division |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010788992.4A CN111782552B (en) | 2020-08-07 | 2020-08-07 | Automatic testing method and device based on region division |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111782552A true CN111782552A (en) | 2020-10-16 |
CN111782552B CN111782552B (en) | 2021-05-18 |
Family
ID=72766029
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010788992.4A Active CN111782552B (en) | 2020-08-07 | 2020-08-07 | Automatic testing method and device based on region division |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111782552B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112099922A (en) * | 2020-11-13 | 2020-12-18 | 北京智慧星光信息技术有限公司 | Simulator control method and system based on image recognition and positioning and electronic equipment |
CN112633341A (en) * | 2020-12-15 | 2021-04-09 | 平安普惠企业管理有限公司 | Interface testing method and device, computer equipment and storage medium |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103699876A (en) * | 2013-11-26 | 2014-04-02 | 天津商业大学 | Method and device for identifying vehicle number based on linear array CCD (Charge Coupled Device) images |
US8973010B2 (en) * | 2010-05-28 | 2015-03-03 | Varian Medical Systems International, AG | Scheduling image recognition tasks based on task dependency and phase |
CN104598702A (en) * | 2013-10-31 | 2015-05-06 | 鸿富锦精密工业(深圳)有限公司 | Method and system for generating test report |
CN107179983A (en) * | 2016-03-09 | 2017-09-19 | 阿里巴巴集团控股有限公司 | The method of calibration and device of ui testing result |
CN107885180A (en) * | 2016-09-30 | 2018-04-06 | 西门子公司 | Test equipment and method of testing |
JP2018128930A (en) * | 2017-02-09 | 2018-08-16 | キヤノン株式会社 | Image processing device and control method thereof |
CN108845930A (en) * | 2018-05-23 | 2018-11-20 | 深圳市腾讯网络信息技术有限公司 | Interface operation test method and device, storage medium and electronic device |
CN108875600A (en) * | 2018-05-31 | 2018-11-23 | 银江股份有限公司 | A kind of information of vehicles detection and tracking method, apparatus and computer storage medium based on YOLO |
CN109408384A (en) * | 2018-10-16 | 2019-03-01 | 网易(杭州)网络有限公司 | Test method, device, processor and the electronic device of software application |
CN109857674A (en) * | 2019-02-27 | 2019-06-07 | 上海优扬新媒信息技术有限公司 | A kind of recording and playback test method and relevant apparatus |
CN110399291A (en) * | 2019-06-20 | 2019-11-01 | 平安普惠企业管理有限公司 | User Page test method and relevant device based on image recognition |
CN110796242A (en) * | 2019-11-01 | 2020-02-14 | 广东三维家信息科技有限公司 | Neural network model reasoning method and device, electronic equipment and readable medium |
CN110992299A (en) * | 2018-09-28 | 2020-04-10 | 华为终端有限公司 | Method and device for detecting browser compatibility |
-
2020
- 2020-08-07 CN CN202010788992.4A patent/CN111782552B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8973010B2 (en) * | 2010-05-28 | 2015-03-03 | Varian Medical Systems International, AG | Scheduling image recognition tasks based on task dependency and phase |
CN104598702A (en) * | 2013-10-31 | 2015-05-06 | 鸿富锦精密工业(深圳)有限公司 | Method and system for generating test report |
CN103699876A (en) * | 2013-11-26 | 2014-04-02 | 天津商业大学 | Method and device for identifying vehicle number based on linear array CCD (Charge Coupled Device) images |
CN107179983A (en) * | 2016-03-09 | 2017-09-19 | 阿里巴巴集团控股有限公司 | The method of calibration and device of ui testing result |
CN107885180A (en) * | 2016-09-30 | 2018-04-06 | 西门子公司 | Test equipment and method of testing |
JP2018128930A (en) * | 2017-02-09 | 2018-08-16 | キヤノン株式会社 | Image processing device and control method thereof |
CN108845930A (en) * | 2018-05-23 | 2018-11-20 | 深圳市腾讯网络信息技术有限公司 | Interface operation test method and device, storage medium and electronic device |
CN108875600A (en) * | 2018-05-31 | 2018-11-23 | 银江股份有限公司 | A kind of information of vehicles detection and tracking method, apparatus and computer storage medium based on YOLO |
CN110992299A (en) * | 2018-09-28 | 2020-04-10 | 华为终端有限公司 | Method and device for detecting browser compatibility |
CN109408384A (en) * | 2018-10-16 | 2019-03-01 | 网易(杭州)网络有限公司 | Test method, device, processor and the electronic device of software application |
CN109857674A (en) * | 2019-02-27 | 2019-06-07 | 上海优扬新媒信息技术有限公司 | A kind of recording and playback test method and relevant apparatus |
CN110399291A (en) * | 2019-06-20 | 2019-11-01 | 平安普惠企业管理有限公司 | User Page test method and relevant device based on image recognition |
CN110796242A (en) * | 2019-11-01 | 2020-02-14 | 广东三维家信息科技有限公司 | Neural network model reasoning method and device, electronic equipment and readable medium |
Non-Patent Citations (2)
Title |
---|
刘云鹏等: "人工智能驱动的数据分析技术在电力变压器状态检修中的应用综述", 《高电压技术》 * |
姜枫等: "基于内容的图像分割方法综述", 《 软件学报》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112099922A (en) * | 2020-11-13 | 2020-12-18 | 北京智慧星光信息技术有限公司 | Simulator control method and system based on image recognition and positioning and electronic equipment |
CN112099922B (en) * | 2020-11-13 | 2021-02-02 | 北京智慧星光信息技术有限公司 | Simulator control method and system based on image recognition and positioning and electronic equipment |
CN112633341A (en) * | 2020-12-15 | 2021-04-09 | 平安普惠企业管理有限公司 | Interface testing method and device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111782552B (en) | 2021-05-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111782552B (en) | Automatic testing method and device based on region division | |
US9448908B2 (en) | System and method for model based session management | |
US20140218385A1 (en) | System and method for visual segmentation of application screenshots | |
Schmidt et al. | VAICo: Visual analysis for image comparison | |
CN105302413B (en) | UI (user interface) testing method and system for control | |
US9904517B2 (en) | System and method for automatic modeling of an application | |
GB2529943A (en) | Tracking processing device and tracking processing system provided with same, and tracking processing method | |
CN109298786B (en) | Method and device for evaluating marking accuracy | |
US11314089B2 (en) | Method and device for evaluating view images | |
CN102789405A (en) | Automated testing method and system for mainboard | |
US10089518B2 (en) | Graphical user interface for analysis of red blood cells | |
CN107229560A (en) | A kind of interface display effect testing method, image specimen page acquisition methods and device | |
CN104463827B (en) | A kind of automatic testing method and corresponding electronic equipment of image capture module | |
CN105144705A (en) | Object monitoring system, object monitoring method, and program for extracting object to be monitored | |
US20150356342A1 (en) | Image processing apparatus, image processing method, and storage medium | |
KR20180011794A (en) | Object visualization method | |
CN110533654A (en) | The method for detecting abnormality and device of components | |
CN111325128A (en) | Illegal operation detection method and device, computer equipment and storage medium | |
JP2017010277A (en) | Work analysis system and work analysis method | |
CN111143188A (en) | Method and equipment for automatically testing application | |
CN109482515A (en) | Screw sorting method and device and screw sorting system | |
US20180336122A1 (en) | Generating application flow entities | |
CN112633341A (en) | Interface testing method and device, computer equipment and storage medium | |
CN115601811A (en) | Facial acne detection method and device | |
CN112308869A (en) | Image acquisition method and device, electronic equipment and computer storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP02 | Change in the address of a patent holder |
Address after: 510000 room 1201, 620 Xingang East Road, Haizhu District, Guangzhou City, Guangdong Province, self number 1203-1218 (office only) Patentee after: Guangzhou pole 3D Information Technology Co.,Ltd. Address before: Room 047, first floor, 2429 Xingang East Road, Haizhu District, Guangzhou, Guangdong 510220 Patentee before: Guangzhou pole 3D Information Technology Co.,Ltd. |
|
CP02 | Change in the address of a patent holder |