Application program detection method and device, electronic equipment and storage medium
The application detection method enhances testing efficiency and accuracy by analyzing detection types, generating tailored test cases, and executing them in virtual containers, addressing the inefficiencies of traditional testing methods.
Patent Information
- Application Number
- CN202411243450.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-27
AI Technical Summary
Existing application testing methods are time-consuming, require extensive data preparation, and are limited by test environments and tester availability, leading to inefficiencies in detection processes.
An application detection method that analyzes the detection type of a program based on a predetermined mapping relationship, generates a test case using a use case template and test parameters, executes the test case in a virtual container, and compares results against predefined standards to ensure accuracy and efficiency.
Improves detection efficiency and accuracy by selecting appropriate detection modes, generating tailored test cases, and executing them in simulated environments, ensuring consistent and timely testing across various applications.
Smart Images

Figure CN119201701A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of application development, and in particular to an application detection method, device, electronic device and storage medium. Background Art
[0002] After various applications are developed or updated before they go online, they need to be tested to ensure that the developed applications are consistent with the development requirements, or that the updated application systems are consistent with the update requirements.
[0003] In the related technology, there are usually the following problems in testing applications: ① Face-to-face testing takes a long time, and requires different data preparation and server time; ② There are many screenshots for testing, and it takes a long time to organize them; ③ Business testing is limited by the test environment, test data, and the time of testers, and cannot be tested at any time.
[0004] Therefore, how to improve detection efficiency has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of the above, it is necessary to provide an application detection control method, the main purpose of which is to improve the accuracy and efficiency of application detection.
[0006] To achieve the above object, the present invention provides an application detection method, characterized in that the method comprises:
[0007] Upon receiving a detection request of a program to be detected, analyzing the detection type of the program to be detected according to the detection request, and determining a corresponding detection mode for the analyzed detection type according to a predetermined mapping relationship between the detection type and the detection mode, wherein the detection request of the program to be detected includes a test parameter and a verification layout image set, or includes a test parameter and a verification parameter;
[0008] According to the predetermined mapping relationship between the detection mode and the use case template, the use case template corresponding to the determined detection mode is analyzed, and based on the analyzed use case template and test parameters and using a preset test case management platform, a test case for the program to be detected is generated;
[0009] Creating a new test cluster, creating a virtual container using the test cluster and the test parameters, and executing the test case based on the created virtual container to obtain a test result of the program to be tested;
[0010] If the test result is a page layout image set, the page layout image set is compared with the verification layout image set to obtain a first comparison result, and the corresponding page attribute information in the page layout image set is compared with the preset standard attribute information to obtain a second comparison result. If the first comparison result meets the first preset test condition and the second comparison result meets the second preset test condition, the test of the program to be tested passes.
[0011] Optionally, when receiving a detection request of a program to be detected, analyzing the detection type of the program to be detected according to the detection request includes:
[0012] Obtaining test parameters in the detection request;
[0013] Determining whether the test parameters include page layout data;
[0014] If it is included, determining that the detection type of the program to be detected is page detection;
[0015] If not, it is determined that the detection type of the program to be detected is data detection.
[0016] Optionally, the step of analyzing the use case template corresponding to the determined detection mode according to the mapping relationship between the predetermined detection mode and the use case template, and generating the test case of the program to be detected based on the analyzed use case template and test parameters and using a preset test case management platform includes:
[0017] Obtaining test parameters in the detection request;
[0018] Constructing test data on the preset test case management platform according to the test parameters;
[0019] The test case template corresponding to the detection mode of the program to be detected in the test case template library is called, and the test data is automatically rendered according to the test case design method based on the test case template to generate a test case.
[0020] Optionally, creating a new test cluster includes:
[0021] Obtaining configuration information of the online cluster of the program to be detected, wherein the configuration information includes the type of service components included in each host in the online cluster;
[0022] Based on the configuration information, a test cluster is built to simulate the online cluster, wherein the service component types included in the test cluster are the same as the service component types included in the online cluster, and the number of hosts included in the test cluster is less than the number of hosts included in the online cluster.
[0023] Optionally, comparing the page layout image set with the verification layout image set to obtain a first comparison result includes:
[0024] Extracting page layout images from the page layout image set one by one, and extracting corresponding detection layout images from the verification layout image set according to the extracted page layout images;
[0025] Displaying the page layout image and the detection layout image in an overlapping manner in upper and lower layers;
[0026] The page displayed on the upper layer after the overlapping display is used as the target adjustment page;
[0027] Calling a preset transparency adjustment tool to adjust the transparency of the target adjustment page;
[0028] The page layout image and the detection layout image are compared and detected based on the transparency to obtain the first comparison result.
[0029] Optionally, comparing the corresponding page attribute information in the page layout image set with preset standard attribute information to obtain a second comparison result includes:
[0030] Extracting page attribute information corresponding to each page layout image in the page layout image set one by one;
[0031] The page attribute information is compared with preset standard attribute information to obtain a second comparison result.
[0032] Optionally, if the test result is a functional parameter, the functional parameter is compared with the verification parameter to obtain a third comparison result, and the functional parameter is compared with the preset standard parameter to obtain a fourth comparison result. If the third comparison result meets the third preset test condition and the fourth comparison result meets the fourth preset test condition, the test of the program to be tested passes.
[0033] In addition, to achieve the above object, the present invention also provides an application detection device, the device comprising:
[0034] A detection mode determination module: when receiving a detection request of a program to be detected, analyzing the detection type of the program to be detected according to the detection request, and determining a corresponding detection mode for the analyzed detection type according to a predetermined mapping relationship between the detection type and the detection mode, wherein the detection request of the program to be detected includes a test parameter and a verification layout image set, or includes a test parameter and a verification parameter;
[0035] Test case generation module: according to the mapping relationship between the predetermined detection mode and the use case template, analyze the use case template corresponding to the determined detection mode, and generate the test case of the program to be detected based on the analyzed use case template and test parameters and using the preset test case management platform;
[0036] Test case execution module: creates a new test cluster, creates a virtual container using the test cluster and the test parameters, and executes the test case based on the created virtual container to obtain the test result of the program to be tested;
[0037] Test result determination module: If the test result is a page layout image set, the page layout image set is compared with the verification layout image set to obtain a first comparison result, and the corresponding page attribute information in the page layout image set is compared with the preset standard attribute information to obtain a second comparison result. If the first comparison result meets the first preset test condition and the second comparison result meets the second preset test condition, the detection of the program to be tested passes.
[0038] In addition, to achieve the above object, the present invention further provides an electronic device, the electronic device comprising:
[0039] a memory storing at least one computer program; and
[0040] The processor executes the program stored in the memory to implement the above-mentioned application detection method.
[0041] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the above-mentioned application detection method.
[0042] In the above technical solution provided by the present invention, a corresponding detection mode is selected according to the detection type of the program to be detected, a use case template corresponding to the detection mode is obtained, a test case of the program to be detected is generated based on the use case template using a preset test case management platform, and a corresponding detection mode is selected according to the detection type of the program to be detected, thereby improving the detection efficiency of the program to be detected; then a new test cluster is created, and the test case is executed in a virtual container created using the test cluster and the test parameters to obtain the test result of the program to be detected. If the test result is a page layout image set, the page layout image set is first compared with the detection layout image set provided by the developer, and then the corresponding page attribute information in the page layout image set is compared with the preset standard attribute information. When the above comparison results all meet the preset test conditions, the program to be detected is detected. By comparing the test results with the verification results provided by the developer and the preset standard results, the test results are ensured to be accurate, thereby improving the accuracy of the detection of the program to be detected. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic diagram of a flow chart of an application program detection method provided by an embodiment of the present invention;
[0044] Figure 2 A schematic diagram of a module of an application program detection device provided by an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of the internal structure of an electronic device for implementing an application detection method provided by an embodiment of the present invention;
[0046] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0048] It should be noted that the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0049] Reference Figure 1 FIG. 1 is a flow chart of an application detection method provided by an embodiment of the present invention. In the embodiment of the present invention, the application detection method includes the following steps S1-S4:
[0050] S1. When receiving a detection request for a program to be detected, analyze the detection type of the program to be detected according to the detection request, and determine the corresponding detection mode for the analyzed detection type according to a predetermined mapping relationship between the detection type and the detection mode. The detection request for the program to be detected includes test parameters and a verification layout image set, or includes test parameters and verification parameters.
[0051] In the present embodiment, before various application programs are developed and launched, or before the content is updated and launched, the application programs need to be tested. Usually, the newly added functions, activities or interfaces in the application programs are tested, and in the detection process, the page layout or interface parameters in the application programs are usually used as the test basis for the program to be tested. Since the test methods and judgment conditions for using the page layout as the test basis and the interface parameters as the test basis are different. Therefore, in the present embodiment, it is necessary to first determine the subsequent detection mode by analyzing the test type of the program to be tested, and the test type can be analyzed according to the test parameters of the program to be tested.
[0052] In one embodiment, when receiving a detection request of a program to be detected, analyzing the detection type of the program to be detected according to the detection request includes:
[0053] Obtaining test parameters in the detection request;
[0054] Determining whether the test parameters include page layout data;
[0055] If it is included, determining that the detection type of the program to be detected is page detection;
[0056] If not, it is determined that the detection type of the program to be detected is data detection.
[0057] In the present embodiment, the detection request of the program to be detected includes test parameters and verification layout image set, or includes test parameters and verification parameters (verification parameters and verification layout image set are data provided by developers for subsequent comparison with test results). The test parameters refer to various parameters required for detecting the program to be detected, for example, font size, color, text box, button switch, resolution, simulated user data, simulated test data, etc., and the page layout data refers to the data about page layout in the program to be detected, for example, the position and size of the text box, button (switch) and corresponding state, page color, etc. The detection type of the program to be detected includes page detection and data detection. If the test parameters contain page layout data, it means that the detection type of the program to be detected is page detection, that is, the page layout of the program to be detected is used as the test basis, such as the layout of various pages and sub-pages of the double 11 activities in a certain e-commerce software. If the test parameters do not contain page layout data, it means that the detection type of the program to be detected is data detection, and data detection refers to only detecting various data in the application program, and does not contain the detection of page layout, such as the detection of interface parameters (no need to display through the page).
[0058] The detection type of the program to be detected corresponds to the detection mode one by one, and the detection mode is divided into a page layout detection mode and a function data detection mode. If the type of the program to be detected is page detection, the corresponding detection mode is usually a page layout detection mode; if the type of the program to be detected is data detection, the corresponding detection mode is a function data detection mode.
[0059] S2. According to the mapping relationship between the predetermined detection mode and the use case template, the use case template corresponding to the determined detection mode is analyzed, and the test case of the program to be detected is generated based on the analyzed use case template and test parameters and using a preset test case management platform.
[0060] In one embodiment, the method of analyzing the use case template corresponding to the determined detection mode according to the mapping relationship between the predetermined detection mode and the use case template, and generating the test case of the program to be detected based on the analyzed use case template and test parameters and using a preset test case management platform includes:
[0061] Obtaining test parameters in the detection request;
[0062] Constructing test data on the preset test case management platform according to the test parameters;
[0063] The test case template corresponding to the detection mode of the program to be detected in the test case template library is called, and the test data is automatically rendered according to the test case design method based on the test case template to generate a test case.
[0064] In this embodiment, the detection mode has a corresponding use case template, and the test case is used to define the steps and expected results of testing a specific application or a specific function. After obtaining the test parameters in the detection request, the test case management platform will verify the validity of the test parameters, such as not allowing the input of an empty string in the specified text box, whether the test parameter format is correct, and the test parameter type verification, etc., through the above many judgments to decide whether to continue to pass the operation backward, try to ensure the normal operation of the program. If the validity verification passes, the test parameters are directly used as test data. If the validity verification fails, the test data generation tool is used to define and modify the test parameters to generate test data. After obtaining the test data, the test data is substituted into the use case template corresponding to the detection mode of the program to be detected and rendered according to the use case design method to generate a test case. The use case template is stored in a preset template database. The use case design method includes an equivalence class partitioning method and a boundary value analysis method.
[0065] The use case design method is the equivalence class division method. Through the equivalence class division method, all possible input data (valid and invalid) of the program to be tested are divided into several equivalence classes, and then representative data are selected from each part as test cases for reasonable classification; the test cases are composed of representatives of valid equivalence classes and invalid equivalence classes, thereby ensuring that the test cases are complete and representative. Using this method to design test cases, the internal structure of the program to be tested can be ignored. Based on the user's actual requirements specification, appropriate typical subsets are selected, and the user's various requirements are carefully analyzed and considered to find as many errors as possible.
[0066] In another achievable manner, the use case design method is the boundary value analysis method. Boundary value analysis makes further improvements on the basis of the equivalence class partitioning method. The boundary value analysis method does not randomly pick one from a certain equivalence class as a representative, but makes each boundary of this equivalence class a test condition; it not only considers the input conditions, but also considers the test conditions generated by the output space. According to long-term testing practice experience, a large number of software test errors occur at the boundaries of the input or output range, rather than within the input and output range. Therefore, designing test cases for various boundary conditions can help detect more errors.
[0067] S3: Create a new test cluster, use the test cluster and the test parameters to create a virtual container, and execute the test case based on the created virtual container to obtain a test result of the program to be tested.
[0068] In this embodiment, the test cluster is a dedicated test cluster, and a virtual container refers to a lightweight, independent environment for isolating and running applications or services. The virtual container provides a closed operating environment through virtualization technology, so that applications can be consistently run and tested in different environments.
[0069] In another embodiment of the present invention, before creating a new test cluster, the following steps are included:
[0070] Storing the test case in a pre-built test queue and setting the test time;
[0071] Obtaining the local system time, and comparing the local system time with the test time;
[0072] When the local system time is the same as the test time, the test case is executed.
[0073] In this embodiment, since there may be too many programs to be tested, after obtaining the test cases, this embodiment stores the test cases in a pre-built test queue and sets the test time. When the test time comes, the test of the program to be tested is performed. The test time refers to the time when the test program is tested according to the test case, such as setting the test time on June 30 at 8:30 to test the program to be tested. By real-time monitoring of the local system time, the local system time is compared with the test time to ensure that the test of the program to be tested can be completed in time, thereby improving the detection efficiency.
[0074] In one embodiment, creating a new test cluster includes:
[0075] Obtaining configuration information of the online cluster of the program to be detected, wherein the configuration information includes the type of service components included in each host in the online cluster;
[0076] Based on the configuration information, a test cluster is built to simulate the online cluster, wherein the service component types included in the test cluster are the same as the service component types included in the online cluster, and the number of hosts included in the test cluster is less than the number of hosts included in the online cluster.
[0077] In the embodiments of the present disclosure, an online cluster refers to a server cluster composed of multiple servers (also referred to as hosts) in the real environment of the program to be detected, wherein each server in the cluster may include one or more service components, and each service component may include one or more service components. Different types of service components provide different services.
[0078] It should be noted that in the embodiments of the present disclosure, service components may include but are not limited to management service components and managed service components, wherein the management service components are used to provide management services, and the managed service components are used to assist the management service components.
[0079] In actual applications, since the online cluster generally includes a large number of hosts, a cluster manager can be set up to manage these hosts. When the cluster manager manages the online cluster, it can perform some operations on the online cluster, which may include but are not limited to upgrading components, adding and / or deleting components, etc.
[0080] In the embodiments of the present disclosure, there are multiple ways to obtain the configuration information of the online cluster, for example, a function can be added to the cluster manager to specifically export the above configuration information. Here, the configuration information may include but is not limited to the types of service components contained in each host in the online cluster and the number and distribution of each type of service components.
[0081] Based on the configuration information, a test cluster is built to simulate an online cluster, wherein the service component types included in the test cluster are the same as those included in the online cluster, and the number of hosts included in the test cluster is less than the number of hosts included in the online cluster.
[0082] Since the test cluster needs to simulate the online cluster and realize the same functions as the online cluster, it is necessary to ensure that the service component types contained in the test cluster are the same as those contained in the online cluster. Since each service component type contained in the online cluster can realize a service, and this service is often realized by one or more components, in order to avoid wasting resources, the number of hosts can be compressed as much as possible on the basis of ensuring that the test cluster and the online cluster have the same functions. Specifically, when building a test cluster, the number of components in the aforementioned services that need to be realized by one or more components can be compressed to realize the use of as few components as possible to realize the service. Preferably, the number of components can be compressed to 1.
[0083] Specifically, in an embodiment of the present disclosure, after obtaining the service component included in the configuration information, it is also possible to determine what kind of component the service component is. If the service component is a management service component, the constructed test cluster contains all the above-mentioned management service components. If the service component is a managed service component, the type of the managed service component is determined, wherein different types of managed service components are used to provide different services. In order to achieve the purpose of simulating an online cluster, when constructing a test cluster, the type of managed service components contained in the test cluster is the same as the type of managed service components contained in the online cluster. If each type of managed service component in the online cluster contains multiple managed service components, wherein managed service components of the same type are used to provide the same service. Then, when constructing the test cluster, the number of managed service components contained in the type of managed service components in the test cluster is less than the number of managed service components contained in the type of the same managed service component in the online cluster. In other words, the number of managed service components used to provide the same type of service contained in the test cluster is less than the number of managed service components used to provide the same type of service in the online cluster. Preferably, when building a test cluster, the test cluster may include all of the above-mentioned management service components and any one managed service component of each type of managed service component.
[0084] In this embodiment, the test cases are stored in a pre-built test queue and the test time is set to ensure that when there are too many programs to be tested, the test of each program to be tested can be completed in sequence according to the test time, thereby improving the detection efficiency; when executing the test cases, a new test cluster is created to simulate the online cluster of the program to be tested to ensure that the execution environment of the test cases is the same as the actual environment, thereby ensuring the authenticity of the test results, and when setting the test cluster, it is stipulated that the service component type included in the test cluster is the same as the service component type included in the online cluster, and the number of hosts included in the test cluster is less than the number of hosts included in the online cluster. On the basis of ensuring that the functions of the test cluster and the online cluster are equivalent, the number of hosts can be compressed as much as possible, thereby reducing the waste of computer resources.
[0085] S4. If the test result is a page layout image set, the page layout image set is compared with the verification layout image set to obtain a first comparison result, and the corresponding page attribute information in the page layout image set is compared with the preset standard attribute information to obtain a second comparison result. If the first comparison result meets the first preset test condition and the second comparison result meets the second preset test condition, the detection of the program to be detected passes.
[0086] In this embodiment, the page layout image set includes all page images of the program to be detected in the test case, for example, images of all interfaces and sub-interfaces of the double 11 activity page in the test case. The verification layout image set refers to all page images that should be obtained according to the test case provided by the developer, for example, images of all interfaces and sub-interfaces of the double 11 activity page provided by the developer. The first preset test condition refers to the first comparison result that the corresponding images in the page layout image set and the verification layout image set are the same, for example, the home page image of the double 11 activity page in the page layout image set is exactly the same as the home page image of the double 11 activity page in the verification layout image set (layout, position, size, etc. are the same), and the second preset test condition refers to the second comparison result that the format corresponding to the page attribute information is the same as the format of the preset standard attribute information, for example, the size and position of the text box, the position and size of the switch button, etc. If one of the first comparison result or the second comparison result does not meet the corresponding preset test condition, the detection of the program to be detected fails.
[0087] In one embodiment, comparing the page layout image set with the verification layout image set to obtain a first comparison result includes:
[0088] Extracting page layout images from the page layout image set one by one, and extracting corresponding detection layout images from the verification layout image set according to the extracted page layout images;
[0089] Displaying the page layout image and the detection layout image in an overlapping manner in upper and lower layers;
[0090] The page displayed on the upper layer after the overlapping display is used as the target adjustment page;
[0091] Calling a preset transparency adjustment tool to adjust the transparency of the target adjustment page;
[0092] The page layout image and the detection layout image are compared and detected based on the transparency to obtain the first comparison result.
[0093] In this embodiment, the corresponding detection layout image refers to the same page corresponding to the page layout image, for example, both correspond to the "My" page in the e-commerce application. The page layout image can be displayed in the lower layer and the detection layout image can be displayed in the upper layer, or the page layout image can be displayed in the upper layer and the detection layout image can be displayed in the lower layer. Among them, the upper and lower layers referred to here refer to the order in which the pictures are displayed. By displaying the page layout image and the detection layout image at the same time, and by overlapping the upper and lower layers, the convenience of comparison can be improved. In this embodiment, the page transparency can be adjusted through the transparency adjustment tool, and the convenience of comparison can also be improved, thereby improving the detection efficiency.
[0094] In one embodiment, comparing the page attribute information corresponding to the page layout image set with preset standard attribute information to obtain a second comparison result includes:
[0095] Extracting page attribute information corresponding to each page layout image in the page layout image set one by one;
[0096] The page attribute information is compared with preset standard attribute information to obtain a second comparison result.
[0097] In this embodiment, the page attribute information includes attribute information such as color, font, layout logic, animation speed, etc. in the page. The standard attribute information is a pre-defined page attribute or feature. If the page attribute information does not meet the preset standard attribute information, it means that the page attribute information needs to be improved. If the page attribute information meets the preset standard attribute information, the detection of the program to be detected is passed; if the page attribute information does not meet the preset standard attribute information, the detection of the program to be detected is failed, and feedback is given to the developer.
[0098] In another embodiment of the present invention, if the test result is a functional parameter, the functional parameter is compared with the verification parameter to obtain a third comparison result, and the functional parameter is compared with the preset standard parameter to obtain a fourth comparison result. If the third comparison result meets the third preset test condition and the fourth comparison result meets the fourth preset test condition, the test of the program to be tested passes.
[0099] In this embodiment, the test result corresponds to the detection mode. When the detection mode is the page layout detection mode, the test result is the page layout image set. When the detection mode is the function data detection mode, the test result is the function parameter. The function parameter refers to the various activity data obtained in the test case. The verification parameter is a parameter provided by the developer for comparing the test result of the program to be tested, which is obtained from the detection request of the program to be tested. The preset standard parameter refers to a parameter in a pre-defined standard format. The function parameter is compared with the preset standard parameter to ensure that the format of the obtained function parameter meets the preset requirements. If the format of the obtained function parameter is different from that of the standard parameter, the function parameter needs to be formatted, such as character conversion, removal of blank characters, etc.
[0100] The third preset test condition means that the third comparison result is that the corresponding parameters in the function parameter and the verification parameter are the same, for example, the text parameter, numerical parameter, time parameter, etc. in the function parameter are exactly the same as the text parameter, numerical parameter, time parameter, etc. in the verification parameter. The fourth preset test condition means that the fourth comparison result is that the format corresponding to the function parameter is the same as the format of the preset standard parameter, for example, the format and time zone of the time parameter.
[0101] In the above technical solution provided by the present invention, a corresponding detection mode is selected according to the detection type of the program to be detected, a use case template corresponding to the detection mode is obtained, a test case of the program to be detected is generated based on the use case template using a preset test case management platform, and a corresponding detection mode is selected according to the detection type of the program to be detected, thereby improving the detection efficiency of the program to be detected; then a new test cluster is created, and the test case is executed in a virtual container created using the test cluster and the test parameters to obtain the test result of the program to be detected. If the test result is a page layout image set, the page layout image set is first compared with the detection layout image set provided by the developer, and then the corresponding page attribute information in the page layout image set is compared with the preset standard attribute information. When the above comparison results all meet the preset test conditions, the program to be detected is detected. By comparing the test results with the verification results provided by the developer and the preset standard results, the test results are ensured to be accurate, thereby improving the accuracy of the detection of the program to be detected.
[0102] like Figure 2 The figure shows a functional module diagram of the application program detection device of the present invention.
[0103] The application detection device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the application detection device can include a detection mode determination module 101, a test case generation module 102, a test case execution module 103, and a test result determination module 104. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, and is stored in the memory of the electronic device.
[0104] In this embodiment, the functions of each module / unit are as follows:
[0105] The detection mode determination module 101: when receiving a detection request of a program to be detected, analyzing the detection type of the program to be detected according to the detection request, and determining a corresponding detection mode for the analyzed detection type according to a predetermined mapping relationship between the detection type and the detection mode, wherein the detection request of the program to be detected includes a test parameter and a verification layout image set, or includes a test parameter and a verification parameter;
[0106] Test case generation module 102: according to the mapping relationship between the predetermined detection mode and the use case template, analyze the use case template corresponding to the determined detection mode, and generate the test case of the program to be detected based on the analyzed use case template and test parameters and using the preset test case management platform;
[0107] Test case execution module 103: creates a new test cluster, creates a virtual container using the test cluster and the test parameters, and executes the test case based on the created virtual container to obtain a test result of the program to be tested;
[0108] Test result determination module 104: If the test result is a page layout image set, the page layout image set is compared with the verification layout image set to obtain a first comparison result, and the corresponding page attribute information in the page layout image set is compared with the preset standard attribute information to obtain a second comparison result. If the first comparison result meets the first preset test condition and the second comparison result meets the second preset test condition, the test of the program to be tested is passed.
[0109] In detail, each module described in the application detection device 100 in the embodiment of the present invention is used in the same manner as described above. Figure 1 The same technical means as the application detection method described in and can produce the same technical effects are not repeated here.
[0110] like Figure 3 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing the application program detection method of the present invention.
[0111] The electronic device may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an application detection program.
[0112] Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 11 may be an internal storage unit of an electronic device in some embodiments, such as a mobile hard disk of the electronic device. The memory 11 may also be an external storage device of an electronic device in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 may not only be used to store application software and various types of data installed in the electronic device, such as the code of the application detection program, etc., but also be used to temporarily store data that has been output or is to be output.
[0113] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules (such as application program detection, etc.) stored in the memory 11, and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
[0114] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The communication bus 12 is configured to realize connection and communication between the memory 11 and at least one processor 10, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0115] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0116] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure classification circuits, power converters or inverters, power status indicators, etc. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0117] Optionally, the communication interface 13 may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.
[0118] Optionally, the communication interface 13 may also include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0119] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0120] The application detection program stored in the memory 11 in the electronic device is a combination of multiple computer programs. When running in the processor 10, it can achieve:
[0121] Upon receiving a detection request of a program to be detected, analyzing the detection type of the program to be detected according to the detection request, and determining a corresponding detection mode for the analyzed detection type according to a predetermined mapping relationship between the detection type and the detection mode, wherein the detection request of the program to be detected includes a test parameter and a verification layout image set, or includes a test parameter and a verification parameter;
[0122] According to the predetermined mapping relationship between the detection mode and the use case template, the use case template corresponding to the determined detection mode is analyzed, and based on the analyzed use case template and test parameters and using a preset test case management platform, a test case for the program to be detected is generated;
[0123] Creating a new test cluster, creating a virtual container using the test cluster and the test parameters, and executing the test case based on the created virtual container to obtain a test result of the program to be tested;
[0124] If the test result is a page layout image set, the page layout image set is compared with the verification layout image set to obtain a first comparison result, and the corresponding page attribute information in the page layout image set is compared with the preset standard attribute information to obtain a second comparison result. If the first comparison result meets the first preset test condition and the second comparison result meets the second preset test condition, the test of the program to be tested passes.
[0125] Specifically, the specific implementation method of the processor 10 for the above computer program can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0126] Furthermore, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable medium can be non-volatile or volatile. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM).
[0127] An embodiment of the present invention may further provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program may implement:
[0128] Upon receiving a detection request of a program to be detected, analyzing the detection type of the program to be detected according to the detection request, and determining a corresponding detection mode for the analyzed detection type according to a predetermined mapping relationship between the detection type and the detection mode, wherein the detection request of the program to be detected includes a test parameter and a verification layout image set, or includes a test parameter and a verification parameter;
[0129] According to the predetermined mapping relationship between the detection mode and the use case template, the use case template corresponding to the determined detection mode is analyzed, and based on the analyzed use case template and test parameters and using a preset test case management platform, a test case for the program to be detected is generated;
[0130] Creating a new test cluster, creating a virtual container using the test cluster and the test parameters, and executing the test case based on the created virtual container to obtain a test result of the program to be tested;
[0131] If the test result is a page layout image set, the page layout image set is compared with the verification layout image set to obtain a first comparison result, and the corresponding page attribute information in the page layout image set is compared with the preset standard attribute information to obtain a second comparison result. If the first comparison result meets the first preset test condition and the second comparison result meets the second preset test condition, the test of the program to be tested passes.
[0132] Furthermore, the computer-usable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0133] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0134] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0135] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0136] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0137] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0138] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0139] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0140] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.
[0141] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. An application detection method, characterized in that: The method comprises: Upon receiving a detection request of a program to be detected, analyzing the detection type of the program to be detected according to the detection request, and determining a corresponding detection mode for the analyzed detection type according to a predetermined mapping relationship between the detection type and the detection mode, wherein the detection request of the program to be detected includes a test parameter and a verification layout image set, or includes a test parameter and a verification parameter; According to the predetermined mapping relationship between the detection mode and the use case template, the use case template corresponding to the determined detection mode is analyzed, and based on the analyzed use case template and test parameters and using a preset test case management platform, a test case for the program to be detected is generated; Creating a new test cluster, creating a virtual container using the test cluster and the test parameters, and executing the test case based on the created virtual container to obtain a test result of the program to be tested; If the test result is a page layout image set, the page layout image set is compared with the verification layout image set to obtain a first comparison result, and the corresponding page attribute information in the page layout image set is compared with the preset standard attribute information to obtain a second comparison result. If the first comparison result meets the first preset test condition and the second comparison result meets the second preset test condition, the test of the program to be tested passes.
2. The application detection method according to claim 1, characterized in that: When receiving a detection request of a program to be detected, analyzing the detection type of the program to be detected according to the detection request includes: Obtaining test parameters in the detection request; Determining whether the test parameters include page layout data; If it is included, determining that the detection type of the program to be detected is page detection; If not, it is determined that the detection type of the program to be detected is data detection.
3. The application detection method according to claim 1, characterized in that: The method of analyzing the use case template corresponding to the determined detection mode according to the mapping relationship between the predetermined detection mode and the use case template, and generating the test case of the program to be detected based on the analyzed use case template and test parameters and using a preset test case management platform, includes: Obtaining test parameters in the detection request; Constructing test data on the preset test case management platform according to the test parameters; The test case template corresponding to the detection mode of the program to be detected in the test case template library is called, and the test data is automatically rendered according to the test case design method based on the test case template to generate a test case.
4. The application detection method according to claim 1, characterized in that: Creating a new test cluster includes: Obtaining configuration information of the online cluster of the program to be detected, wherein the configuration information includes the type of service components included in each host in the online cluster; Based on the configuration information, a test cluster is built to simulate the online cluster, wherein the service component types included in the test cluster are the same as the service component types included in the online cluster, and the number of hosts included in the test cluster is less than the number of hosts included in the online cluster.
5. The application detection method according to claim 1, characterized in that: The comparing the page layout image set with the verification layout image set to obtain a first comparison result includes: Extracting page layout images from the page layout image set one by one, and extracting corresponding detection layout images from the verification layout image set according to the extracted page layout images; Displaying the page layout image and the detection layout image in an overlapping manner in upper and lower layers; The page displayed on the upper layer after the overlapping display is used as the target adjustment page; Calling a preset transparency adjustment tool to adjust the transparency of the target adjustment page; The page layout image and the detection layout image are compared and detected based on the transparency to obtain the first comparison result.
6. The application detection method according to claim 1, characterized in that: The comparing the page attribute information corresponding to the page layout image set with the preset standard attribute information to obtain a second comparison result includes: Extracting page attribute information corresponding to each page layout image in the page layout image set one by one; The page attribute information is compared with preset standard attribute information to obtain a second comparison result.
7. The application detection method according to claim 1, characterized in that: If the test result is a functional parameter, the functional parameter is compared with the verification parameter to obtain a third comparison result, and the functional parameter is compared with the preset standard parameter to obtain a fourth comparison result. If the third comparison result meets the third preset test condition and the fourth comparison result meets the fourth preset test condition, the test of the program to be tested passes.
8. An application detection device, characterized in that: The device comprises: A detection mode determination module: when receiving a detection request of a program to be detected, analyzing the detection type of the program to be detected according to the detection request, and determining a corresponding detection mode for the analyzed detection type according to a predetermined mapping relationship between the detection type and the detection mode, wherein the detection request of the program to be detected includes a test parameter and a verification layout image set, or includes a test parameter and a verification parameter; Test case generation module: according to the mapping relationship between the predetermined detection mode and the use case template, analyze the use case template corresponding to the determined detection mode, and generate the test case of the program to be detected based on the analyzed use case template and test parameters and using the preset test case management platform; Test case execution module: creates a new test cluster, creates a virtual container using the test cluster and the test parameters, and executes the test case based on the created virtual container to obtain the test result of the program to be tested; Test result determination module: If the test result is a page layout image set, the page layout image set is compared with the verification layout image set to obtain a first comparison result, and the corresponding page attribute information in the page layout image set is compared with the preset standard attribute information to obtain a second comparison result. If the first comparison result meets the first preset test condition and the second comparison result meets the second preset test condition, the test of the program to be tested passes.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the application detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the application program detection method according to any one of claims 1 to 7 is implemented.