CN115269285A - Test method and device, equipment and computer readable storage medium - Google Patents

Test method and device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN115269285A
CN115269285A CN202210643767.0A CN202210643767A CN115269285A CN 115269285 A CN115269285 A CN 115269285A CN 202210643767 A CN202210643767 A CN 202210643767A CN 115269285 A CN115269285 A CN 115269285A
Authority
CN
China
Prior art keywords
tested
execution script
configuration attribute
test
identification information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210643767.0A
Other languages
Chinese (zh)
Inventor
张晋铭
戴剑雯
刘雨曦
周素紫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Futu Network Technology Co Ltd
Original Assignee
Shenzhen Futu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Futu Network Technology Co Ltd filed Critical Shenzhen Futu Network Technology Co Ltd
Priority to CN202210643767.0A priority Critical patent/CN115269285A/en
Publication of CN115269285A publication Critical patent/CN115269285A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2289Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing by configuration test
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/263Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers
    • G06F11/2635Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers using a storage for the test inputs, e.g. test ROM, script files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Abstract

The embodiment of the application discloses a test method, a test device, test equipment and a computer-readable storage medium. The method comprises the following steps: determining an information page to be filled in based on configuration attribute information of an object to be tested contained in the object test request; obtaining form parameters of an object to be tested through an information page to be filled; obtaining a target execution script based on the form parameters and the identification information of the object to be tested; and executing the target execution script to obtain a test result corresponding to the object to be tested. The method obtains the form parameters of the object to be tested through the information page to be filled, does not need to adjust the form parameters to different types of development languages, overcomes the technical obstacles of the development languages, can quickly match to corresponding target execution scripts, does not need to execute the scripts of the different types of development languages respectively, only needs to execute the target execution scripts and overcomes the technical obstacles of the development languages; therefore, the test result corresponding to the object to be tested is obtained, and the whole test process is convenient and quick.

Description

Test method and device, equipment and computer readable storage medium
Technical Field
The present application relates to the field of computers, and in particular, to a test method, a test device, a test apparatus, and a computer-readable storage medium.
Background
The method is characterized in that different objects to be tested are tested, a tool developer needs to develop tools corresponding to a plurality of objects to be tested to test the objects, and special test tool platforms are respectively built to test the objects to be tested, so that the whole process consumes a long time, and the efficiency is low.
In addition, the existing testing tool platform cannot be compatible with tools of multiple development languages, so that testing cannot be performed on objects to be tested in different development languages, and the testing results of the corresponding objects to be tested cannot be obtained quickly.
Therefore, a testing method is needed to solve the above technical problems.
Disclosure of Invention
In order to solve the above technical problems, embodiments of the present application respectively provide a testing method, a testing device, a testing apparatus, and a computer-readable storage medium, so as to quickly obtain a testing result corresponding to an object to be tested.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of an embodiment of the present application, there is provided a test method, including: determining an information page to be filled in based on configuration attribute information of an object to be tested contained in the object test request; obtaining form parameters of the object to be tested through the information page to be filled; obtaining a target execution script based on the form parameters and the identification information of the object to be tested; and executing the target execution script to obtain a test result corresponding to the object to be tested.
In another embodiment, the determining to-be-populated information page based on configuration attribute information of the object to be tested contained in the object test request includes: detecting the configuration attribute type of the object to be tested based on the configuration attribute information; if the configuration attribute type is a code configuration attribute type, performing page rendering according to a preset page code file corresponding to the object to be tested to obtain the information page to be filled; and if the configuration attribute type is the editor configuration attribute type, performing page rendering according to a preset open source assembly to obtain the information page to be filled.
In another embodiment, the obtaining a target execution script based on the form parameter and the identification information of the object to be tested includes: determining a preset execution script of the object to be tested based on the identification information; packaging the identification information and the form parameters to obtain request parameters corresponding to the object to be tested; and obtaining the target execution script according to the preset execution script and the request parameter.
In another embodiment, the determining a preset execution script of the object to be tested based on the identification information includes: detecting the configuration attribute type of the object to be tested based on the configuration attribute information; if the configuration attribute type is the editor configuration attribute type, determining a preset execution script of the object to be tested according to the identification information; if the configuration attribute type is a code configuration attribute type, determining an execution script type corresponding to the object code according to the object code corresponding to the object to be tested, and determining a preset execution script of the object to be tested according to the execution script type and the identification information.
In another embodiment, the execution script type includes a plurality of preset execution scripts having identification information; the determining the preset execution script of the object to be tested according to the execution script type and the identification information of the object to be tested includes: matching the identification information of the object to be tested with the identification information corresponding to a plurality of preset execution scripts contained in the execution script type; and if the matching is successful, taking the preset execution script corresponding to the successfully matched identification information as the preset execution script of the object to be tested.
In another embodiment, the obtaining the target execution script according to the preset execution script and the request parameter includes: acquiring an execution command parameter of the preset execution script; and adding the form parameters into the execution command parameters to obtain a target execution script.
In another embodiment, if the configuration attribute type is a code configuration attribute type; the method further comprises the following steps: detecting whether the test result is normal or not to obtain a detection result; if the detection result represents that the test is normal, updating the test result to the information page to be filled, and displaying the updated information page to be filled; if the detection result represents that the test is abnormal, determining an abnormal reason and an abnormal position in the target execution script, updating the abnormal reason, the abnormal position and the test result to the information page to be filled, and displaying the updated information page to be filled.
According to an aspect of an embodiment of the present application, there is provided a test apparatus including: the determining module is configured to determine an information page to be filled in based on configuration attribute information of the object to be tested contained in the object test request; the acquisition module is configured to acquire the form parameters of the object to be tested through the information page to be filled; the execution module is configured to obtain a target execution script based on the form parameters and the identification information of the object to be tested; and executing the target execution script to obtain a test result corresponding to the object to be tested.
According to an aspect of an embodiment of the present application, there is provided an electronic device including: a controller; a memory for storing one or more programs that, when executed by the controller, perform the testing method described above.
According to an aspect of embodiments of the present application, there is also provided a computer-readable storage medium having stored thereon computer-readable instructions, which, when executed by a processor of a computer, cause the computer to execute the above-mentioned test method.
According to an aspect of an embodiment of the present application, there is also provided a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the testing method described above.
In the technical scheme provided by the embodiment of the application, the information page to be filled is determined based on the configuration attribute information of the object to be tested contained in the object test request, and the corresponding information page to be filled is accurately determined; the form parameters of the object to be tested are obtained through the information page to be filled, and the target execution script is obtained based on the form parameters and the identification information of the object to be tested, so that the corresponding target execution script can be quickly matched, scripts of different types of development languages do not need to be executed respectively, the target execution script only needs to be executed, and the technical obstacle of the development languages is overcome; therefore, the test result corresponding to the object to be tested is obtained, and the whole test process is convenient and quick.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 is a schematic diagram of a test tool platform based tool usage process to which the present application relates;
FIG. 2 is a flow chart of a testing method shown in an exemplary embodiment of the present application;
FIG. 3 is a flow chart of another proposed testing method based on the embodiment shown in FIG. 2;
FIG. 4 is a flow chart of another proposed testing method based on the embodiment shown in FIG. 2;
FIG. 5 is a flow chart of another proposed testing method based on the embodiment shown in FIG. 4;
FIG. 6 is a flow chart of another testing method proposed based on the embodiment shown in FIG. 5;
FIG. 7 is a flow chart of another testing method proposed based on the embodiment shown in FIG. 4;
FIG. 8 is a flow chart of another proposed testing method based on the embodiment shown in FIG. 3;
FIG. 9 is a block diagram of a test tool platform according to an exemplary embodiment of the present application;
FIG. 10 is a schematic diagram of a test apparatus according to an exemplary embodiment of the present application;
fig. 11 is a schematic diagram illustrating a computer system of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Reference to "a plurality" in this application means two or more. "and/or" describes the association relationship of the associated object, indicating that there may be three relationships, for example, a and/or B may indicate: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Referring first to fig. 1, fig. 1 is a schematic diagram illustrating a tool using process based on a test tool platform according to the present application. The test platform comprises a tool front end 100, a platform front end 200, a platform back end 300 and a script pool 400, wherein the tool front end 100, the platform front end 200, the platform back end 300 and the script pool 400 are communicated through a network.
The tool front end 100 is the tool used by the user on the tool platform front end; the platform front end 200 is connected with the tool front end 100 and the platform rear end 300, receives an object test request of the tool front end 100 and forwards the object test request to the platform rear end 300, renders a page of the tool front end 100 and the like; the platform back end 300 provides platform services, which mainly include query tool configuration, execution scripts, and the like; the script pool 400 stores a plurality of preset execution scripts.
The platform front end 200 receives an object test request; the object test request contains configuration attribute information of an object to be tested, the object to be tested can be a source program to be tested, and the test object has identification information; the platform front end 200 transmits the object test request to the platform back end 300, and the platform back end 300 determines whether the configuration attribute type of the object to be tested is a code configuration attribute type or an editor configuration attribute type based on the configuration attribute information of the object to be tested contained in the object test request.
If the configured attribute type result is a code configured attribute type, the platform back end 300 returns a preset page code file corresponding to an object to be tested to the platform front end 200, the platform front end 200 performs page rendering according to the preset page code file corresponding to the object to be tested, returns to the tool front end 100 to obtain an information page to be filled, and displays the information page to be filled to a user, the user fills in a form parameter of the object to be tested, the platform front end 200 obtains the form parameter, the platform back end 300 obtains a preset execution script of the object to be tested from the script pool 400 based on the identification information, packages the identification information and the form parameter to obtain a request parameter corresponding to the object to be tested, the request platform back end 300 obtains a target execution script according to the preset execution script and the request parameter, obtains a test result corresponding to the object to be tested after executing the target script, and returns the test result to the platform front end 200, if the test result indicates that the test is normal, the test result is updated to the information page to be filled, and displays the updated information page to be filled; if the detection result represents that the test is abnormal, determining the abnormal reason and the abnormal position in the target execution script, updating the abnormal reason, the abnormal position and the test result to the information page to be filled, and displaying the updated information page to be filled.
If the result of configuring the attribute type is the editor configured attribute type, the platform back end 300 returns the preset open source component corresponding to the object to be tested to the platform front end 200, the platform front end 200 performs page rendering according to the preset open source component, returns to the tool front end 100 to obtain an information page to be filled, displays the information page to be filled to the user, fills the form parameter of the object to be tested into the user, the platform front end 200 obtains the form parameter, the platform back end 300 obtains a preset execution script of the object to be tested from the script pool 400 based on the identification information, packages the identification information and the form parameter to obtain a request parameter corresponding to the object to be filled, the request platform back end 300 obtains a target execution script according to the preset execution script and the request parameter, obtains a test result corresponding to the object to be tested after executing the target script, returns the test result to the platform front end 200, and displays the updated information page to be filled.
Referring to fig. 2, fig. 2 is a flowchart illustrating a testing method according to an exemplary embodiment of the present application, which may be specifically executed by the tool testing platform shown in fig. 1. Of course, the method may also be applied to other implementation environments and executed by a server device in other implementation environments, and the embodiment is not limited thereto. As shown in fig. 2, the method at least includes steps S210 to S240, which are described in detail as follows:
s210: and determining the information page to be filled in based on the configuration attribute information of the object to be tested contained in the object test request.
The object test request is a request sent by a user, and the request is tested aiming at an object to be tested, and the object to be tested can be a source program. The object test request submitted by the user is transmitted to the platform front end 200 in the test platform, the platform back end 300 determines the information page to be filled based on the received object test request transmitted by the platform front end 200, and finally the information page to be filled is displayed to the user.
S220: and obtaining the form parameters of the object to be tested through the information page to be filled.
Form data is the relevant parameters, such as input values and/or output values, for testing the object to be tested, and the form parameters may be simple numeric characters, such as 10, 100, 500, etc.
The user inputs the form parameters of the object to be tested in the information page to be filled, and the platform front end 200 obtains the form parameters.
S230: and obtaining a target execution script based on the form parameters and the identification information of the object to be tested.
Each test object has corresponding identification information, which may be a number, such as 1, 2, 3, 4, or an english letter a, B, C, or the like, and in general, the identification information and the test object correspond one to one, but in some embodiments, the same identification information may represent a plurality of different test objects, for example, the identification information is 8, which may be the identification information of both the test object a and the test object B.
The target execution script is a script that finally executes the test, i.e., an execution script with complete running conditions.
S240: and executing the target execution script to obtain a test result corresponding to the object to be tested.
The test result represents that the test is normal or abnormal, a user can know whether the test object is normal or not according to the corresponding test result, and if the test result is abnormal, the corresponding test object can be debugged or modified.
In the technical scheme of the embodiment, the information page to be filled is determined based on the configuration attribute information of the object to be tested contained in the object test request, and the corresponding information page to be filled is accurately determined; the form parameters of the object to be tested are obtained through the information page to be filled, and the target execution script is obtained based on the form parameters and the identification information of the object to be tested, so that the corresponding target execution script can be quickly matched, scripts of different types of development languages do not need to be executed respectively, only the target execution script needs to be executed, and the technical obstacle of the development languages is overcome; therefore, the test result corresponding to the object to be tested is obtained, and the whole test process is convenient and quick.
Referring to fig. 3, fig. 3 is a flowchart of another testing method based on the embodiment shown in fig. 2.
The method further includes S310 to S330 in S210 shown in fig. 2, which are described in detail below:
s310: and detecting the configuration attribute type of the object to be tested based on the configuration attribute information.
The configuration attribute information includes preset configuration information related to the object to be tested, that is, preset information stored in the test platform, including a configuration attribute type, where the configuration attribute type in this embodiment includes a code configuration attribute type and an editor configuration attribute type.
S320: and if the configuration attribute type is the code configuration attribute type, performing page rendering according to a preset page code file corresponding to the object to be tested to obtain an information page to be filled.
When the types of the front end components of the platform are insufficient, the assembly of the front end of the test tool is difficult to support, and a developer can compile relevant codes by himself to configure the test tool, so that the assembly of the front end of the test tool is completed, a compiled preset page is obtained, and a preset page code file corresponding to the preset page is stored in the test tool platform.
And if the configuration attribute type of the object to be tested is the code configuration attribute type, acquiring a preset page code file corresponding to the object to be tested from the test platform to perform page rendering, thereby obtaining an information page to be filled.
S330: and if the configuration attribute type is the editor configuration attribute type, rendering the page according to the preset open source assembly to obtain the page to be filled with the information.
And if the configuration attribute type of the object to be tested is the editor configuration attribute type, namely the preset page is configured through a front end component in the platform editor, rendering the page according to a preset open source component, thereby obtaining the page to be filled with the information.
The embodiment further illustrates how to determine the information page to be filled based on the configuration attribute information of the object to be tested contained in the object test request, and specifically, different page rendering modes are selected according to the configuration attribute type of the object to be tested to obtain different information pages to be filled, so as to accurately obtain the form parameters of the object to be tested.
Fig. 4 is a flow chart of another proposed testing method based on the embodiment shown in fig. 2. The method further includes S410 to S420 in S130 shown in fig. 3, which are described in detail below:
s410: determining a preset execution script of the object to be tested based on the identification information; and packaging the identification information and the form parameters to obtain the request parameters corresponding to the object to be tested.
The preset execution script is a script that cannot be directly executed, lacks a corresponding parameter, for example, lacks an input or output value, and can be normally executed when the corresponding parameter lacking therein is given.
The encapsulation of the embodiment may be understood as performing association binding on the identification information and the form parameter, so as to obtain a request parameter corresponding to the object to be tested, where the request parameter is a corresponding parameter that is lacking in the preset execution script and runs normally, and thus the form parameter can be better matched with the preset execution script.
S420: and obtaining a target execution script according to the preset execution script and the request parameters.
S420 is exemplarily illustrated, the preset execution script a can be normally executed by inputting the request parameter 1 into the preset execution script a, that is, the preset execution script for assigning the request parameter is taken as the target execution script.
The embodiment explains how to obtain the target execution script based on the form parameters and the identification information of the object to be tested, firstly, the preset execution script of the object to be tested is accurately determined through the identification information, the identification information and the form parameters are packaged, the form parameters can be better matched with the preset execution script, the request parameters corresponding to the object to be tested are obtained, and finally, the target execution script is obtained according to the preset execution script and the request parameters.
Fig. 5 is a flow chart of another proposed testing method based on the embodiment shown in fig. 4. The method includes at least S510 to S530 in S410 shown in fig. 4, which is described in detail below:
s510: and detecting the configuration attribute type of the object to be tested based on the configuration attribute information.
Detecting whether the configuration attribute type of the object to be tested is an editor configuration attribute type or a code configuration attribute type, and subsequently determining a preset execution script of the object to be tested according to the configuration attribute type.
S520: and if the configuration attribute type is the editor configuration attribute type, determining a preset execution script of the object to be tested according to the identification information.
Specifically, if the configuration attribute type of the object a to be tested is the editor configuration attribute type and the identification information is a, the preset execution script of the object a to be tested is directly determined from the test platform according to the identification information a.
S530: and if the configuration attribute type is the code configuration attribute type, determining an execution script type corresponding to the target code according to the target code corresponding to the object to be tested, and determining a preset execution script of the object to be tested according to the execution script type and the identification information.
The object code is a preset code stored in the test platform, that is, a relevant code storing the object to be tested to the test platform, where the code type includes a C language type, a JS (Java Script, a lightweight, interpreted, or just-in-time compiled programming language) language type, and the like, and each code type corresponds to a different execution Script type, for example, the C language type code corresponds to the C language execution Script type, and the JS language type code corresponds to the JS language execution Script type.
In this embodiment, the code type of the object code corresponding to the object to be tested is a JS language type, that is, the corresponding execution script type is a JS language execution script type, and then the preset execution script of the object to be tested is determined according to the JS language execution script type and the identification information.
Illustratively, if the configuration attribute type of the object to be tested a is the code configuration attribute type and the identification information is a, obtaining an execution script type i corresponding to the target code of the object to be tested a, and finally determining a preset execution script of the object to be tested a from the test platform according to the identification information a and the execution script type i.
The present embodiment illustrates how to accurately determine the preset execution script of the object to be tested based on the identification information. If the configuration attribute type is the editor configuration attribute type, determining a preset execution script of the object to be tested directly according to the identification information; and if the configuration attribute type is the code configuration attribute type, determining an execution script type corresponding to the target code according to the target code corresponding to the object to be tested, and determining a preset execution script of the object to be tested according to the execution script type and the identification information.
Fig. 6 is a flow chart of another testing method proposed based on the embodiment shown in fig. 5. The execution script type includes a plurality of preset execution scripts having identification information, and the method further includes at least S610 to S620 in S510 shown in fig. 5, which is described in detail below:
s610: and matching the identification information of the object to be tested with the identification information corresponding to a plurality of preset execution scripts contained in the execution script type.
The embodiment illustrates the case that the configuration attribute type of the object to be tested is a code configuration attribute type. Because each execution script type comprises a plurality of preset execution scripts with identification information, the identification information of the object to be tested is required to be utilized to obtain the preset execution scripts of the object to be tested through matching from the plurality of preset execution scripts contained in the corresponding execution script types.
In a specific matching process, in this embodiment, the identification information of the object to be tested and the identification information corresponding to the multiple preset execution scripts are subjected to character matching, and the correlation rate (Ide _ tes, ide _ scr) between the identification information Ide _ tes of the object to be tested and the identification information Ide _ scr corresponding to the multiple preset execution scripts is calculated as follows:
Figure BDA0003684065800000091
where α is used to represent a preset identification factor. In the embodiment, it is default that the text types in all the identification information are consistent, and the same number of characters is provided, so that the accurate relevancy calculation is facilitated. And then selecting a corresponding preset execution script with the highest correlation as a preset execution script of the object to be tested.
S620: and if the matching is successful, taking the preset execution script corresponding to the successfully matched identification information as the preset execution script of the object to be tested.
Illustratively, the identification information of the object to be tested is 2, and the code type of the object code corresponding to the object to be tested is a JS language type, that is, the corresponding execution script type is a JS language execution script type. The JS language execution script type includes a preset execution script a corresponding to the identification information 1, a preset execution script B corresponding to the identification information 2, and a preset execution script C corresponding to the identification information 3, and it can be determined that the preset execution script of the object to be tested is B.
The embodiment further illustrates how to accurately determine the preset execution script of the object to be tested according to the identification information when the configuration attribute type of the object to be tested is the code configuration attribute type, because each execution script type includes a plurality of preset execution scripts having the identification information, the preset execution script of the object to be tested is accurately determined by matching the identification information of the object to be tested with the plurality of preset execution scripts included in the execution script type.
Fig. 7 is a flow chart of another testing method proposed based on the embodiment shown in fig. 4. The method includes S710 to S720 in S420 as shown in fig. 4, which will be described in detail below:
s710: and acquiring the execution command parameters of the preset execution script.
When the command parameters are executed, the relevant parameters of the execution script are preset, but the execution script cannot be normally executed due to the lack of the corresponding parameters, and the normal execution can be realized only after the form parameters are added.
S720: and adding the form parameters to the execution command parameters to obtain a target execution script.
Splicing the form parameters behind the execution command parameters to obtain a normally executable script, namely a target execution script.
The embodiment further clarifies how to obtain the target execution script according to the preset execution script and the request parameter, that is, the target execution script is obtained by adding the form parameter to the execution command parameter, and the target execution script can be obtained without excessively modifying and adjusting the preset execution script in the whole process, so that the method is more convenient and faster.
Fig. 8 is a flow chart of another testing method proposed based on the embodiment shown in fig. 3. If the configuration attribute type is the code configuration attribute type, the method further includes steps S810 to S830, which are described in detail below:
s810: and detecting whether the test result is normal or not to obtain a detection result.
After the target execution script is executed, a corresponding test result is obtained, and a user can judge whether the object to be tested is normal more intuitively according to whether the test result is represented to be normal or not.
In another exemplary embodiment, if the result of the configuration attribute type of the object to be tested is the editor configuration attribute type, no matter whether the test result is normal or not, the test result is directly returned to the platform front end 200, and the updated information page to be filled in is displayed.
S820: and if the detection result represents that the test is normal, updating the test result to the information page to be filled, and displaying the updated information page to be filled.
The platform back end 300 executes the target script to obtain a test result corresponding to the object to be tested, and returns the test result to the platform front end 200, if the test result indicates that the test is normal, the platform front end 200 updates the test result to the information page to be filled, and displays the updated information page to be filled, and specifically, the updated information page to be filled can be displayed in a pop-up window manner.
S830: if the detection result represents that the test is abnormal, determining the abnormal reason and the abnormal position in the target execution script, updating the abnormal reason, the abnormal position and the test result to the information page to be filled, and displaying the updated information page to be filled.
If the detection result represents that the test is abnormal, the platform front end 200 determines the reason of the abnormality and the abnormal position in the target execution script, updates the test result to the information page to be filled, and displays the updated information page to be filled.
The embodiment clarifies the step of updating the information page to be filled when the configuration attribute type of the object to be tested is the code configuration attribute type, and particularly, when the detection result represents that the test is abnormal, the abnormal reason and the abnormal position in the target execution script can be determined, so that a user can visually know the problem and the symptom of the code of the target execution script, and the user can modify and debug the code conveniently.
In another exemplary embodiment, the construction of the test tool platform and the process of using the test tool are described in detail in conjunction with the above-described tool test platform in fig. 1 and the above-described embodiments shown in fig. 2 to 8. The tool testing platform is mainly divided into a developer foreground, a platform rear end and a platform front end, as shown in fig. 9, and fig. 9 is a schematic structural diagram of the testing tool platform shown in an exemplary embodiment of the present application. The developer foreground comprises a script uploading function module and a script uploading function module, wherein the script uploading function module is used for uploading scripts; and the front-end component editor can upload the configuration parameters to a configuration pool in the back end of the platform, can combine a tool front-end page, is added to a system access path and is displayed at the front end of the platform.
The platform back end comprises a script pool, a control center and a configuration pool. The control center controls the preset execution script in the calling script pool and the configuration parameters in the calling configuration pool. The configuration pool can store form parameters, and the control center can control the configuration pool to package the form parameters and the identification information to obtain request parameters; the platform front end comprises a directory skip module and a tool page module.
Specifically, a test tool developer needs to create a code warehouse by himself, and compile a business logic script according to a certain input/output format, so as to ensure that the script can normally complete the function of the test tool. Then, the developer opens the developer foreground, fills in a newly built code warehouse, and the platform can automatically load script codes in the developer warehouse. Then, the developer can go to the front end component editor to select and edit the front end component of the tool that the developer wants to create, and complete the creation of the front end UI (User Interface). After the above operations are completed, the developer can use the preview function to preview and debug the newly created tool. The whole process is roughly creating tool script (git) → writing business logic script → creating tool → inputting warehouse address → selecting front end component → completing the creation.
When the developer creates the front page, two modes can be selected:
1) And uploading the self-written front-end page through a code warehouse. This approach corresponds to very complex front-end interaction logic and the type of front-end components are not sufficient to fully support the assembly of the test tool front-end.
2) And selecting the required components by utilizing a front-end component editor, and adding certain interactive association to the components needing to be associated. Setting values output by all components; after saving, preview and debugging can be carried out. The method is relatively simple corresponding to front-end interaction, and can quickly realize the creation and debugging of the front-end page.
After the platform is constructed, a user can use the tool testing platform to execute the testing methods in the above fig. 2 to 8, determine an information page to be filled in based on the configuration attribute information of the object to be tested contained in the object testing request, and accurately determine the corresponding information page to be filled in; the form parameters of the object to be tested are obtained through the information page to be filled, the form parameters do not need to be adjusted to different types of development languages, and the technical obstacle of the development languages is overcome; and obtaining a target execution script based on the form parameters and the identification information of the object to be tested, so that the corresponding target execution script can be quickly matched, and the target execution script is executed at the same time to obtain a test result corresponding to the object to be tested, thereby the whole test process is convenient and quick.
Another aspect of the present application also provides a testing apparatus, as shown in fig. 10, where fig. 10 is a schematic structural diagram of the testing apparatus shown in an exemplary embodiment of the present application. Wherein, testing arrangement includes:
the determining module 1010 is configured to determine the information page to be filled in based on the configuration attribute information of the object to be tested contained in the object test request.
The obtaining module 1030 is configured to obtain the form parameters of the object to be tested through the information page to be filled.
The execution module 1050 is configured to obtain a target execution script based on the form parameters and the identification information of the object to be tested; and executing the target execution script to obtain a test result corresponding to the object to be tested.
In another exemplary embodiment, the determining module 1010 is specifically configured to detect a configuration attribute type of the object to be tested based on the configuration attribute information; if the configuration attribute type is the code configuration attribute type, performing page rendering according to a preset page code file corresponding to the object to be tested to obtain an information page to be filled; and if the configuration attribute type is the editor configuration attribute type, performing page rendering according to the preset open source assembly to obtain an information page to be filled.
In another exemplary embodiment, the execution module 1050 is specifically configured to determine a preset execution script of the object to be tested based on the identification information; packaging the identification information and the form parameters to obtain request parameters corresponding to the object to be tested; and obtaining a target execution script according to the preset execution script and the request parameters.
In another exemplary embodiment, the execution module 1050 includes:
and the configuration attribute type detection unit is configured to detect the configuration attribute type of the object to be tested based on the configuration attribute information.
And the first detection unit is configured to determine a preset execution script of the object to be tested according to the identification information if the configuration attribute type is the editor configuration attribute type.
And the second detection unit is configured to determine an execution script type corresponding to the target code according to the target code corresponding to the object to be tested if the configuration attribute type is the code configuration attribute type, and determine a preset execution script of the object to be tested according to the execution script type and the identification information.
In another exemplary embodiment, the execution script type includes a plurality of preset execution scripts having identification information, and the second detection unit includes:
the matching plate is configured to match the identification information of the object to be tested with the identification information corresponding to a plurality of preset execution scripts contained in the execution script types; and if the matching is successful, taking the preset execution script corresponding to the successfully matched identification information as the preset execution script of the object to be tested.
In another exemplary embodiment, the execution module 1050 includes:
the target execution script unit is configured to acquire an execution command parameter of a preset execution script; and adding the form parameters to the execution command parameters to obtain a target execution script.
In another exemplary embodiment, if the configuration attribute type is a code configuration attribute type, the testing apparatus further includes:
the test result display module is configured to detect whether the test result is normal or not to obtain a detection result; if the detection result represents that the test is normal, updating the test result to the information page to be filled, and displaying the updated information page to be filled; and if the detection result represents that the test is abnormal, determining the abnormal reason and the abnormal position in the target execution script, updating the abnormal reason, the abnormal position and the test result to the information page to be filled, and displaying the updated information page to be filled.
It should be noted that the test apparatus provided in the foregoing embodiment and the test method provided in the foregoing embodiment belong to the same concept, and the specific manner in which each module and unit execute operations has been described in detail in the method embodiment, and is not described again here.
Another aspect of the present application also provides an electronic device, including: a controller; a memory for storing one or more programs, the one or more programs when executed by the controller for performing the above-described method.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a computer system of an electronic device according to an exemplary embodiment of the present application, which illustrates a schematic structural diagram of a computer system suitable for implementing the electronic device according to the embodiment of the present application.
It should be noted that the computer system 1100 of the electronic device shown in fig. 11 is only an example, and should not bring any limitation to the functions and the application scope of the embodiments of the present application.
As shown in fig. 11, the computer system 1100 includes a Central Processing Unit (CPU) 1101, which can perform various appropriate actions and processes, such as executing the methods in the above-described embodiments, according to a program stored in a Read-Only Memory (ROM) 1102 or a program loaded from a storage section 1108 into a Random Access Memory (RAM) 1103. In the RAM 1103, various programs and data necessary for system operation are also stored. The CPU 1101, ROM 1102, and RAM 1103 are connected to each other by a bus 1104. An Input/Output (I/O) interface 1105 is also connected to bus 1104.
The following components are connected to the I/O interface 1105: an input portion 1106 including a keyboard, mouse, and the like; an output section 1107 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 1108 including a hard disk and the like; and a communication section 1109 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section 1109 performs communication processing via a network such as the internet. Drivers 1110 are also connected to the I/O interface 1105 as needed. A removable medium 1111 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1110 as necessary, so that a computer program read out therefrom is mounted into the storage section 1108 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication portion 1109 and/or installed from the removable medium 1111. When the computer program is executed by a Central Processing Unit (CPU) 1101, various functions defined in the system of the present application are executed.
It should be noted that the computer readable media shown in the embodiments of the present application may be computer readable signal media or computer readable storage media or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
Another aspect of the present application also provides a computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, realizes the foregoing testing method. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist separately without being incorporated in the electronic device.
Another aspect of the application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the test method provided in the above embodiments.
According to an aspect of an embodiment of the present application, there is also provided a computer system including a Central Processing Unit (CPU) that can perform various appropriate actions and processes, such as performing the method in the above-described embodiment, according to a program stored in a Read-Only Memory (ROM) or a program loaded from a storage portion into a Random Access Memory (RAM). In the RAM, various programs and data necessary for system operation are also stored. The CPU, ROM, and RAM are connected to each other via a bus. An Input/Output (I/O) interface is also connected to the bus.
The following components are connected to the I/O interface: an input section including a keyboard, a mouse, and the like; an output section including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section including a hard disk and the like; and a communication section including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like. The communication section performs communication processing via a network such as the internet. The drive is also connected to the I/O interface as needed. A removable medium such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive as necessary, so that a computer program read out therefrom is mounted into the storage section as necessary.
The above description is only a preferred exemplary embodiment of the present application, and is not intended to limit the embodiments of the present application, and those skilled in the art can easily make various changes and modifications according to the main concept and spirit of the present application, so that the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method of testing, the method comprising:
determining an information page to be filled in based on configuration attribute information of an object to be tested contained in the object test request;
obtaining the form parameters of the object to be tested through the information page to be filled;
obtaining a target execution script based on the form parameters and the identification information of the object to be tested;
and executing the target execution script to obtain a test result corresponding to the object to be tested.
2. The method of claim 1, wherein the determining to be filled in an information page based on configuration attribute information of the object to be tested contained in the object test request comprises:
detecting the configuration attribute type of the object to be tested based on the configuration attribute information;
if the configuration attribute type is a code configuration attribute type, performing page rendering according to a preset page code file corresponding to the object to be tested to obtain the information page to be filled;
and if the configuration attribute type is the editor configuration attribute type, performing page rendering according to a preset open source assembly to obtain the information page to be filled.
3. The method of claim 1, wherein the obtaining a target execution script based on the form parameters and the identification information of the object to be tested comprises:
determining a preset execution script of the object to be tested based on the identification information; and
packaging the identification information and the form parameters to obtain request parameters corresponding to the object to be tested;
and obtaining the target execution script according to the preset execution script and the request parameter.
4. The method of claim 3, wherein the determining a preset execution script of the object to be tested based on the identification information comprises:
detecting the configuration attribute type of the object to be tested based on the configuration attribute information;
if the configuration attribute type is the editor configuration attribute type, determining a preset execution script of the object to be tested according to the identification information;
if the configuration attribute type is a code configuration attribute type, determining an execution script type corresponding to the object code according to the object code corresponding to the object to be tested, and determining a preset execution script of the object to be tested according to the execution script type and the identification information.
5. The method according to claim 4, wherein the execution script type comprises a plurality of preset execution scripts with identification information; the determining the preset execution script of the object to be tested according to the execution script type and the identification information of the object to be tested includes:
matching the identification information of the object to be tested with the identification information corresponding to a plurality of preset execution scripts contained in the execution script type;
and if the matching is successful, taking the preset execution script corresponding to the successfully matched identification information as the preset execution script of the object to be tested.
6. The method according to claim 3, wherein the obtaining the target execution script according to the preset execution script and the request parameter comprises:
acquiring an execution command parameter of the preset execution script;
and adding the form parameters into the execution command parameters to obtain a target execution script.
7. The method of claim 2, wherein if the configuration attribute type is a code configuration attribute type; the method further comprises the following steps:
detecting whether the test result is normal or not to obtain a detection result;
if the detection result represents that the test is normal, updating the test result to the information page to be filled, and displaying the updated information page to be filled;
if the detection result represents that the test is abnormal, determining an abnormal reason and an abnormal position in the target execution script, updating the abnormal reason, the abnormal position and the test result to the information page to be filled, and displaying the updated information page to be filled.
8. A test apparatus, comprising:
the determining module is configured to determine an information page to be filled based on configuration attribute information of an object to be tested contained in the object test request;
the acquisition module is configured to acquire the form parameters of the object to be tested through the information page to be filled;
the execution module is configured to obtain a target execution script based on the form parameters and the identification information of the object to be tested; and executing the target execution script to obtain a test result corresponding to the object to be tested.
9. An electronic device, comprising:
a controller;
a memory for storing one or more programs that, when executed by the controller, cause the controller to implement a test method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer-readable instructions which, when executed by a processor of a computer, cause the computer to perform the testing method of any one of claims 1 to 7.
CN202210643767.0A 2022-06-08 2022-06-08 Test method and device, equipment and computer readable storage medium Pending CN115269285A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210643767.0A CN115269285A (en) 2022-06-08 2022-06-08 Test method and device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210643767.0A CN115269285A (en) 2022-06-08 2022-06-08 Test method and device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115269285A true CN115269285A (en) 2022-11-01

Family

ID=83758895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210643767.0A Pending CN115269285A (en) 2022-06-08 2022-06-08 Test method and device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115269285A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115952103A (en) * 2023-03-10 2023-04-11 北京全路通信信号研究设计院集团有限公司 Test script editing method, device, medium and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115952103A (en) * 2023-03-10 2023-04-11 北京全路通信信号研究设计院集团有限公司 Test script editing method, device, medium and electronic equipment

Similar Documents

Publication Publication Date Title
US9977658B2 (en) Code validation using content assist
EP3511836A1 (en) Generation of automated testing scripts by converting manual test cases
US6239800B1 (en) Method and apparatus for leading a user through a software installation procedure via interaction with displayed graphs
CN107506300B (en) User interface testing method, device, server and storage medium
US20080127060A1 (en) Dynamic mating of a modified user interface with pre-modified user interface code library
CN108319575B (en) Page component checking method, device, server and storage medium
CN113360144B (en) Auxiliary processing method, device, storage medium and program product for software development
CN111459504A (en) Intelligent contract processing method, device, equipment and storage medium
KR20140116438A (en) Graphical representation of an order of operations
CN115269285A (en) Test method and device, equipment and computer readable storage medium
CN112988578A (en) Automatic testing method and device
CN111061522B (en) Method, device, equipment and storage medium for generating front-end card assembly based on back end
CN111930629A (en) Page testing method and device, electronic equipment and storage medium
US10061686B2 (en) Method, electronic apparatus, system, and storage medium for automated testing of application user interface
CN115543324A (en) Method, device, equipment and medium for generating interactive interface
CN115080113A (en) Item code detection method and device, readable storage medium and electronic equipment
CN114741294A (en) Page debugging method, device, equipment and storage medium
CN114791885A (en) Interface test method, device, equipment and medium
CN113760317A (en) Page display method, device, equipment and storage medium
CN113656041A (en) Data processing method, device, equipment and storage medium
CN113392002A (en) Test system construction method, device, equipment and storage medium
CN111158684A (en) System creation method, device, electronic equipment and readable storage medium
CN110348127B (en) Method, device, equipment and storage medium for generating test cases
CN116339742A (en) Method, device and storage medium for acquiring function
US20230176834A1 (en) Graphical programming environment

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