A testing method, device, electronic equipment and storage medium
Through parallel testing methods, the existing test efficiency is solved, rapid testing of multi-functional applications or websites is realized, testing efficiency and coverage is improved, and program errors are promptly discovered and repaired.
Patent Information
- Application Number
- CN202210346268.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2042-03-31
AI Technical Summary
The existing testing methods are inefficient, resulting in a long test time, especially when multifunctional applications or websites need to be tested one by one before they are launched, making it difficult to ensure that program errors are minimized.
The parallel testing method is adopted to obtain the object to be tested and the test description document, determine the test tasks and test sets, and conduct parallel testing based on the test data and requirements types, including mixed testing requirements for front-end interface display and back-end interface calls.
Improves test execution efficiency, reduces test time, enables faster detection and fixing of program errors, and improves test coverage and accuracy of results.
Smart Images

Figure CN114860576B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technology, and in particular to a testing method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of mobile Internet, a large number of applications and websites are launched into the market or continuously updated based on user feedback. In order to ensure that the uploaded applications or websites have as few program errors as possible, that is, bugs, developers need to test them before going online.
[0003] However, current testing usually involves testing one function after another, which results in low testing efficiency and a high cost of time. Summary of the invention
[0004] The present disclosure provides a testing method, device, electronic device and storage medium. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a testing method is provided, including:
[0006] Obtain the object to be tested and the test description document of the object to be tested;
[0007] Determine one or more test tasks corresponding to the object to be tested based on the test description document; each of the multiple test tasks includes test data of a function to be tested, a test requirement type and a test sequence identifier;
[0008] Determine one or more test sets based on the test sequence identifiers of the functions to be tested included in each test task; each test set in the multiple test sets includes at least one function to be tested;
[0009] In the same time period, based on the test data and the test requirement type of the at least one function to be tested included in the target test set, parallel testing is performed on at least one function to be tested included in the target test set;
[0010] The target test set is a test set among multiple test sets.
[0011] In some possible embodiments, determining one or more test tasks corresponding to the object to be tested based on the test description document includes:
[0012] Determine the test data and function description statement for each function to be tested based on the test description document;
[0013] Identify the requirement type keywords of the function description statement and obtain the test requirement type of each function to be tested;
[0014] Identify the sequence identifier of the function description statement and obtain the test sequence identifier of each function to be tested;
[0015] Based on the test data, test requirement type and test sequence identification of each function to be tested, one or more test tasks are determined.
[0016] In some possible embodiments, the types of test requirements include a first test requirement displayed by the front-end interface, a second test requirement called by the back-end interface, and a mixed test requirement displayed by the front-end interface and called by the back-end interface.
[0017] In some possible embodiments, when one of the at least one function to be tested is a target function to be tested, testing the target function to be tested includes:
[0018] Get script data and expected data from the test data of the target function to be tested;
[0019] Acquire test data of the target function to be tested based on script data;
[0020] Determine the test results of the target function to be tested based on the predicted data and the expected data.
[0021] In some possible embodiments, when the target function to be tested is the first function to be tested, and the test requirement type of the first function to be tested is the first test requirement displayed on the front-end interface, acquiring script data and expected data from test data of the target function to be tested, acquiring test data of the target function to be tested based on the script data, and determining a test result of the target function to be tested based on the predicted data and the expected data includes:
[0022] Acquire the interface script data and the first expected data from the test data of the first function to be tested;
[0023] Acquire current data of a target in a first function to be tested based on the interface script data;
[0024] A test result of the first function to be tested is determined based on the current data and the first expected data.
[0025] In some possible embodiments, when the target function to be tested is the second function to be tested, and the test requirement type of the second function to be tested is the second test requirement called by the back-end interface, acquiring script data and expected data from test data of the target function to be tested, acquiring test data of the target function to be tested based on the script data, and determining a test result of the target function to be tested based on the predicted data and the expected data includes:
[0026] Acquire the calling script data and the second expected data from the test data of the second function to be tested;
[0027] Acquire return data of the second function to be tested based on the calling script data;
[0028] A test result of the second function to be tested is determined based on the returned data and the second expected data.
[0029] In some possible embodiments, obtaining the return data of the second function to be tested based on the calling script data includes:
[0030] Obtain input data from the test data of the second function to be tested;
[0031] An interface corresponding to the second function to be tested is called based on the calling script data to obtain return data of the first type of simulation of the input data.
[0032] In some possible embodiments, when the target function to be tested is the third function to be tested, and the test requirement type of the third function to be tested is a mixed test requirement of front-end interface display and back-end interface call, obtaining script data and expected data from test data of the target function to be tested, obtaining test data of the target function to be tested based on the script data, and determining a test result of the target function to be tested based on the predicted data and the expected data includes:
[0033] Obtaining interface script data, calling script data, first expected data and second expected data from test data of a third function to be tested;
[0034] Acquire current data of the target in the third function to be tested based on the interface script data;
[0035] Acquire return data of the third function to be tested based on the calling script data;
[0036] Determine a first test result of a first function to be tested based on current data and first expected data;
[0037] Determine a second test result of a second function to be tested based on the returned data and the second expected data;
[0038] A mixed test result is determined based on the first test result and the second test result.
[0039] In some possible embodiments, obtaining the return data of the third function to be tested based on the calling script data includes:
[0040] An instance creation statement is called based on the calling script data to obtain return data of the second type of simulation of the instance corresponding to the third function to be tested.
[0041] According to a second aspect of an embodiment of the present disclosure, a testing device is provided, including:
[0042] An acquisition module is configured to acquire the object to be tested and the test description document of the object to be tested;
[0043] A task determination module is configured to execute one or more test tasks corresponding to the object to be tested determined based on the test description document; each of the multiple test tasks includes test data of a function to be tested, a test requirement type and a test sequence identifier;
[0044] A test set determination module is configured to determine one or more test sets based on the test sequence identification of the functions to be tested included in each test task; each test set in the multiple test sets includes at least one function to be tested;
[0045] The test module is configured to perform, within the same time period, parallel testing of at least one function to be tested included in the target test set based on test data and test requirement type of at least one function to be tested included in the target test set;
[0046] The target test set is a test set among multiple test sets.
[0047] In some possible embodiments, the task determination module is configured to execute:
[0048] Determine the test data and function description statement for each function to be tested based on the test description document;
[0049] Identify the requirement type keywords of the function description statement and obtain the test requirement type of each function to be tested;
[0050] Identify the sequence identifier of the function description statement and obtain the test sequence identifier of each function to be tested;
[0051] Based on the test data, test requirement type and test sequence identification of each function to be tested, one or more test tasks are determined.
[0052] In some possible embodiments, the types of test requirements include a first test requirement displayed by the front-end interface, a second test requirement called by the back-end interface, and a mixed test requirement displayed by the front-end interface and called by the back-end interface.
[0053] In some possible embodiments, when one of the at least one to-be-tested function is a target to-be-tested function, the testing module is configured to execute:
[0054] Get script data and expected data from the test data of the target function to be tested;
[0055] Acquire test data of the target function to be tested based on script data;
[0056] Determine the test results of the target function to be tested based on the predicted data and the expected data.
[0057] In some possible embodiments, when the target function to be tested is the first function to be tested, and the test requirement type of the first function to be tested is the first test requirement displayed on the front-end interface, the test module is configured to execute:
[0058] Acquire the interface script data and the first expected data from the test data of the first function to be tested;
[0059] Acquire current data of a target in a first function to be tested based on the interface script data;
[0060] A test result of the first function to be tested is determined based on the current data and the first expected data.
[0061] In some possible embodiments, when the target function to be tested is the second function to be tested, and the test requirement type of the second function to be tested is the second test requirement called by the backend interface, the test module is configured to execute:
[0062] Acquire the calling script data and the second expected data from the test data of the second function to be tested;
[0063] Acquire return data of the second function to be tested based on the calling script data;
[0064] A test result of the second function to be tested is determined based on the returned data and the second expected data.
[0065] In some possible embodiments, the test module is configured to perform:
[0066] Obtain input data from the test data of the second function to be tested;
[0067] An interface corresponding to the second function to be tested is called based on the calling script data to obtain return data of the first type of simulation of the input data.
[0068] In some possible embodiments, when the target function to be tested is the third function to be tested, and the test requirement type of the third function to be tested is a mixed test requirement of front-end interface display and back-end interface call, the test module is configured to execute:
[0069] Obtaining interface script data, calling script data, first expected data and second expected data from test data of a third function to be tested;
[0070] Acquire current data of the target in the third function to be tested based on the interface script data;
[0071] Acquire return data of the third function to be tested based on the calling script data;
[0072] Determine a first test result of a first function to be tested based on current data and first expected data;
[0073] Determine a second test result of a second function to be tested based on the returned data and the second expected data;
[0074] A mixed test result is determined based on the first test result and the second test result.
[0075] In some possible embodiments, the test module is configured to perform:
[0076] An instance creation statement is called based on the calling script data to obtain return data of the second type of model of the instance corresponding to the third function to be tested.
[0077] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement a method as described in any one of the first aspects above.
[0078] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any one of the methods in the first aspect of the embodiment of the present disclosure.
[0079] According to the fifth aspect of an embodiment of the present disclosure, a computer program product is provided, the computer program product comprising a computer program, the computer program being stored in a readable storage medium, at least one processor of a computer device reading and executing the computer program from the readable storage medium, so that the computer device performs any one of the methods in the first aspect of the embodiment of the present disclosure.
[0080] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0081] Obtain an object to be tested and a test description document of the object to be tested, determine one or more test tasks corresponding to the object to be tested based on the test description document, each of the multiple test tasks includes test data, test requirement type and test sequence identifier of a function to be tested, determine one or more test sets based on the test sequence identifier of the function to be tested included in each test task, each test set in the multiple test sets includes at least one function to be tested, and within the same time period, perform parallel testing on at least one function to be tested included in the target test set based on the test data and test requirement type of at least one function to be tested included in the target test set, and the target test set is a test set in the multiple test sets. The present application can improve test execution efficiency and reduce test time through parallel testing.
[0082] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0084] Figure 1 is a schematic diagram of an application environment according to an exemplary embodiment;
[0085] Figure 2 is a flow chart of a testing method according to an exemplary embodiment;
[0086] Figure 3 is a flow chart showing a method of determining a test task according to an exemplary embodiment;
[0087] Figure 4 is a schematic diagram of a test environment according to an exemplary embodiment;
[0088] Figure 5 is a flow chart showing a method of testing a first function to be tested according to an exemplary embodiment;
[0089] Figure 6 is a flow chart showing a method of testing a second function to be tested according to an exemplary embodiment;
[0090] Figure 7 is a flow chart showing a method of testing a third function to be tested according to an exemplary embodiment;
[0091] Figure 8 is a block diagram of a testing device according to an exemplary embodiment;
[0092] Fig. 9 It is a block diagram of an electronic device for testing according to an exemplary embodiment. DETAILED DESCRIPTION
[0093] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0094] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar first objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0095] All user data in this application is authorized by the user.
[0096] See also Figure 1 , Figure 1 is a schematic diagram of an application environment of a testing method according to an exemplary embodiment. Figure 1 As shown, the application environment may include a test device 01 and a server 02 .
[0097] In an embodiment of the present application, the testing device 01 can obtain an object to be tested and a test description document of the object to be tested, determine one or more test tasks corresponding to the object to be tested based on the test description document, each of the multiple test tasks includes test data, a test requirement type and a test sequence identifier of a function to be tested, determine one or more test sets based on the test sequence identifier of the function to be tested included in each test task, each test set in the multiple test sets includes at least one function to be tested, and within the same time period, based on the test data and test requirement type of at least one function to be tested included in the target test set, perform parallel testing on at least one function to be tested included in the target test set, and the target test set is a test set in the multiple test sets.
[0098] Optionally, the test device 01 may include but is not limited to smartphones, desktop computers, tablet computers, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, etc. It may also be software running on the above devices, such as applications, applets, etc. Optionally, the operating system running on the device may include but is not limited to Android, IOS, Linux, Windows, Unix, etc.
[0099] Optionally, the server 02 is used to assist in the testing of the test equipment, and may include an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The operating system running on the server may include but is not limited to Android, IOS, Linux, Windows, Unix, etc.
[0100] In addition, it should be noted that Figure 1 What is shown is only one application environment of the testing method provided by the present disclosure. In actual application, other application environments may also be included.
[0101] Figure 2 is a flow chart of a testing method according to an exemplary embodiment. Figure 2 As shown, the test method can be applied to the server or the client, including the following steps:
[0102] In step S201, an object to be tested and a test description document of the object to be tested are obtained.
[0103] In some possible embodiments, the testing device may obtain the object to be tested and a test description document of the object to be tested.
[0104] Optionally, the object to be tested may be an application or a website. Optionally, the object to be tested may be a single module in an application or a website, or a collection of modules.
[0105] In step S203, one or more test tasks corresponding to the object to be tested are determined based on the test description document; each of the multiple test tasks includes test data of a function to be tested, a test requirement type and a test sequence identifier.
[0106] In an optional embodiment, the test description document of the object to be tested may include one file or multiple files, and one file or multiple files may correspond to one test task. The test task may include test data of the function to be tested, test requirement type and test sequence identifier.
[0107] In an optional embodiment, the test description document of the object to be tested may include multiple files, each of the multiple files may correspond to a test task, and a test task may include all data required for a function to be tested. In other words, the test description document includes multiple test tasks, and each test task may include test data, test requirement type, and test sequence identifier of the function to be tested.
[0108] In the above embodiment, the test description document uploaded to the test device has been planned in advance, and the test device can directly extract test tasks from it for subsequent testing. In this way, the embodiment of the present application reduces the hardware and software resources required for the test device to determine the test tasks.
[0109] In another optional embodiment, there are no independent and distinguished test tasks in the test description document, but multiple test tasks corresponding to the object to be tested are determined by the test description document based on certain rules. In this way, the preliminary manual preparation work can be reduced and the labor cost can be reduced. Figure 3 is a flowchart of determining a test task according to an exemplary embodiment. Figure 3 As shown:
[0110] In step S2031, the test data and function description statements of each function to be tested are determined based on the test description document.
[0111] In an embodiment of the present application, the testing device can determine the test data and function description statements for each function to be tested based on the test description document.
[0112] In some possible embodiments, the test data may be determined according to the function to be tested to which it belongs. Optionally, the test data may include script data and expected data, and may include input data, script data, and expected data. The input data may be referred to as input parameters.
[0113] In some possible embodiments, the function description statement may include the name or code of the function to be tested, and may also include a description of the test effect to be achieved by the function to be tested.
[0114] For example, a function description statement is "Drag the directory, drag the third directory from its original position to the position of the first directory and display it, and after dragging, when the third directory is clicked, the jump interface test can be used to determine whether it can jump to the content." Among them, "Drag the directory" in the function description statement is the name or code of the function to be tested, and the other "Drag the third directory from its original position to the position of the first directory, and after dragging, when the third directory is clicked, the jump interface test can be used to determine whether it can jump to the preset content" is the description of the test effect to be achieved by the function to be tested.
[0115] For another example, a function description statement is "Get Table 1, get Table 1 through the database interface". Among them, "Get Table 1" in the function description statement is the name or code of the function to be tested, and the other "Get Table 1 through the database interface" is the description of the test effect to be achieved by the function to be tested.
[0116] In step S2033, the requirement type keyword of the function description statement is identified to obtain the test requirement type of each function to be tested.
[0117] In the embodiment of the present application, the test requirement type can be determined according to the actual test requirements. Since the present application focuses on the distinction between the front-end interface display and the back-end interface call test, the test requirement type can be defined as including the following three categories: the first test requirement of the front-end interface display, the second test requirement of the back-end interface call, and the mixed test requirement of the front-end interface display and the back-end interface call.
[0118] Specifically, the first test requirement of the front-end interface display is the requirement for user interface test verification. For example, to verify the normal display function of a chart, you only need to verify whether the display position of the chart and the legend information on the web page are correct. The second test requirement of the back-end interface call verifies whether the corresponding interface can be called normally. The mixed test requirement of the front-end interface display and the back-end interface call is a combination of the above two contents. For example, it is necessary not only to verify whether the chart is called successfully, but also to verify whether the display position of the chart on the web page and the legend information are displayed correctly.
[0119] In the prior art, the test scheme used is more focused on the test of the back-end interface call, ignoring the test of the front-end interface display. When the tested object requires a test of the front-end interface display, it is generally tested manually by the tester. Since it is divided into device autonomous testing and manual testing, the entire test process not only lacks test continuity, but also increases the workload of the tester. Based on this, the embodiment of this invention can perform requirement type keyword recognition on the function description statement to obtain the test requirement type of each function to be tested.
[0120] Before performing keyword recognition of the requirement type for the function description statement, the test device may first obtain the keyword corresponding to the test requirement type. For example, if some words or phrases related to the display of the front-end interface, such as "display", "show", "appear", etc., appear, it is determined that the test requirement type of the function to be tested includes the first test requirement of the display of the front-end interface. If some words or phrases related to the call of the back-end interface, such as "call interface", "return value", "through... interface", etc., appear, it is determined that the test requirement type of the function to be tested includes the second test requirement of the call of the back-end interface. If some words or phrases related to the display of the front-end interface, such as "display", "show", "appear", etc., and some words or phrases related to the call of the back-end interface, such as "call interface", "return value", etc., appear, it is determined that the test requirement type of the function to be tested includes a mixed test requirement of the display of the front-end interface and the call of the back-end interface. Among them, the keywords corresponding to the test requirement types appearing in the above content are pre-set, and there may also be other feasible keywords.
[0121] Continuing with the example of the first function description statement, when the test device obtains the function description statement of "drag the directory, drag the third directory from its original position to the position of the first directory and display it, and after dragging, when the third directory is clicked, the jump interface test can be used to determine whether it can jump to the content", the test device can perform keyword recognition of the requirement type, specifically: based on "display", determine that the function to be tested needs to perform a front-end interface display test, based on "through...interface", determine that the function to be tested needs to perform a back-end interface call test, thereby, it can be determined that the test requirement type of the function to be tested is a mixed test requirement of front-end interface display and back-end interface call.
[0122] Continuing with the example of the second function description statement, when the test device obtains the function description statement of "obtaining Table 1, obtaining Table 1 through the database interface", the test device can perform keyword recognition of the requirement type, specifically: based on "through...interface", it is determined that the function to be tested needs to perform a back-end interface call test, thereby, it can be determined that the test requirement type of the function to be tested is the second test requirement of the back-end interface call.
[0123] Continuing with the example of the third function description statement, when the test device obtains the function description statement "interface display, display XXX chart on the interface", the test device can perform keyword recognition of the requirement type, specifically: based on "display", determine that the function to be tested requires a front-end interface display test, thereby, it can be determined that the test requirement type of the function to be tested is the first test requirement for the front-end interface display.
[0124] The function description statements in the above examples are only an optional way, that is, to express the function description statements in pure text. However, due to some reasons (such as typos, misspellings) in the expression of some function description statements, the keywords cannot be well recognized by the test equipment. Based on this, when defining keywords, the test equipment can not only define some words or phrases related to the front-end interface display, such as "display", "show", "appear", etc., but also define "[1]" to represent that the function to be tested needs to be tested for the front-end interface display. Similarly, not only can some words or phrases related to the back-end interface call, such as "call interface", "return value", "through... interface", etc., be defined, but also "[2]" can be defined to represent that the function to be tested needs to be tested for the back-end interface call.
[0125] In this way, when the test device obtains the functional description statement of "drag the directory, drag the third directory from the original position to the position of the first directory and display it [1], and after the dragging is completed, when the third directory is clicked, the jump interface [2] test can be used to determine whether it can jump to the content", the test device can perform keyword recognition of the requirement type, specifically: based on "display" and / or [1], determine that the function to be tested needs to perform a front-end interface display test, based on "through... interface" and / or [2], determine that the function to be tested needs to perform a back-end interface call test, thereby, it can be determined that the test requirement type of the function to be tested is a mixed test requirement of front-end interface display and back-end interface call. The above-mentioned "[1]" and "[2]" are exemplary identifiers referring to test requirements. In the embodiment of the present application, character strings such as "aaa" and "bbb" can also be used to represent them. This is not limited by the present application.
[0126] In step S2035, the sequence identifier of the function description statement is identified to obtain the test sequence identifier of each function to be tested.
[0127] In an embodiment of the present application, a test sequence identifier can be used to determine one or more test sets, wherein each test set in the multiple test sets includes at least one function to be tested, so that the test device performs parallel testing on at least one function to be tested included in the target test set based on the test data and test requirement type of at least one function to be tested included in the target test set within the same time period, rather than testing one by one in series. Based on this, in order to enable the test device to determine which functions to be tested can be tested in parallel at the same time, the function description language may include a test sequence identifier in addition to the name or code of the function to be tested and the description of the test effect to be achieved. For example, function description statement 1 "interface display, display XXX's chart, widget on the interface", function description statement 2 "interface display, display YYY's chart, widget on the interface", function description statement 3 "interface display, display ZZZ's chart, widget on the interface" all include the same test sequence identifier "widget", and when the test device obtains any of the above three function description statements, it can identify the test sequence identifier "widget".
[0128] In step S2037, one or more test tasks are determined based on the test data, test requirement type and test sequence identifier of each function to be tested.
[0129] In an embodiment of the present application, the testing device may package the identified test requirement type, test sequence identifier, and test data to obtain a test task, and other test tasks may be obtained according to the above packaging.
[0130] In step S205, one or more test sets are determined based on the test sequence identifiers of the functions to be tested included in each test task; each test set in the multiple test sets includes at least one function to be tested.
[0131] In an embodiment of the present application, the test device may determine one or more test sets based on the test sequence identifiers of the functions to be tested included in each test task, wherein each test set includes at least one function to be tested, or in other words, each test set includes at least one test task.
[0132] For example, the three test tasks mentioned above, all with the test sequence identifier "widget", can be assigned to one test set.
[0133] Optionally, there is no sequential relationship between the functions to be tested belonging to a test set. Assuming that a test set includes three functions to be tested, namely 1, 2, and 3, and taking function 1 to be tested and function 2 to be tested as examples, there is no sequential relationship means that: function 2 to be tested cannot be tested only after function 1 to be tested, that is, function 1 to be tested and function 2 to be tested do not interfere with each other in actual application process.
[0134] After the above steps S201-S205 are executed, the testing step can be performed.
[0135] In the embodiment of the present application, before testing, it is necessary to determine the test framework based on the development language of the object to be tested and the services involved. For example, when the development language is Java, some plug-in software supporting Java can be used, such as Junit5 and Selenium frameworks for testing.
[0136] The function to be tested can be an integration test or a unit test. For example, if a function to be tested is an integration test, before starting the integration test of the function to be tested, you need to build the dependent environment, and then run the unit test and integration test scripts for testing.
[0137] Figure 4 is a schematic diagram of a test environment according to an exemplary embodiment. Figure 4 As shown, it includes the function to be tested (service a), and service a depends on downstream services, including external service b, external service c, internal service d and internal service e, among which external service b and external service c are services provided by a third party (such as authentication service). In fact, third-party services cannot be called offline or in the testing phase. Only when service a is online and deployed in the container cloud can external service b and external service c be called. In this way, this application can simulate the return value of the third-party service by simulating the mock idea to ensure the smooth implementation of the testing process.
[0138] In the embodiment of the present application, integration testing is also called assembly testing or joint testing. On the basis of unit testing, all modules are assembled into subsystems or systems according to design requirements (such as according to the structure diagram) for integration testing. Unit testing refers to checking and verifying the smallest testable unit in the software. As for the meaning of the unit in unit testing, generally speaking, its specific meaning should be determined according to the actual situation, such as a unit in C language refers to a function, a unit in Java refers to a class, and a window or a menu in graphical software. In general, a unit is the smallest artificially specified functional module to be tested. Unit testing is the lowest level of testing activity to be carried out in the software development process, and the independent units of the software will be tested in isolation from the rest of the program.
[0139] In the embodiment of the present application, the mock concept refers to creating a mock object to simulate the behavior of some objects that are not easy to construct / obtain during the test process. For example, if you need to call the H service, but the H service has not been developed yet, you can mock the part that calls the H service and write the desired return result.
[0140] In step S207, within the same time period, based on the test data and test requirement type of at least one function to be tested included in the target test set, at least one function to be tested included in the target test set is tested in parallel, and the target test set is a test set among multiple test sets.
[0141] In an embodiment of the present application, after constructing the test environment of the object to be tested, the testing device can perform parallel testing on at least one function to be tested included in a target test set within the same time period based on the test data and test requirement type of at least one function to be tested included in the target test set.
[0142] Optionally, assuming that one of the at least one functions to be tested is a target function to be tested, when the target function to be tested and other functions to be tested belonging to the target test set are tested in the same time period, the testing process of the target function to be tested is: the testing device obtains script data and expected data from the test data of the target function to be tested, obtains the test data of the target function to be tested based on the script data, and determines the test result of the target function to be tested based on the predicted data and the expected data.
[0143] The expected data refers to the data expected to be obtained, which is used to compare with the test data obtained during the actual test process to obtain the test results.
[0144] In an optional embodiment, when the target function to be tested is the first function to be tested, and the test requirement type of the first function to be tested is the first test requirement displayed on the front-end interface, Figure 5 is a flow chart showing a method of testing a first function to be tested according to an exemplary embodiment. Figure 5 As shown:
[0145] In step S501, interface script data and first expected data are obtained from test data of a first function to be tested.
[0146] Optionally, the interface script data is used to simulate user operations, and the first expected data refers to ideal data. A single test requirement displayed on the front-end interface requires executing an automated operation page script to capture the value of the target element for result comparison.
[0147] In step S503, current data of the target in the first function to be tested is obtained based on the interface script data.
[0148] Optionally, the test device may execute interface script data to simulate user operations, such as clicking, to obtain the current comparison value of a field in the table, such as the display format of the year.
[0149] In step S505 , a test result of the first function to be tested is determined based on the current data and the first expected data.
[0150] The test device can determine the test result of the first to-be-tested function based on the current data and the first expected data. Specifically, when the display format of the year is consistent with the first expected data, the test is successful, otherwise it fails.
[0151] In another optional embodiment, when the target function to be tested is the second function to be tested, and the test requirement type of the second function to be tested is the second test requirement called by the backend interface, Figure 6 is a flow chart showing a method of testing a second function to be tested according to an exemplary embodiment. Figure 6 As shown:
[0152] In step S601, the calling script data and the second expected data are obtained from the test data of the second function to be tested.
[0153] Optionally, the script data is called to simulate user operations, and the second expected data refers to ideal data.
[0154] In step S603, the return data of the second function to be tested is obtained based on the calling script data.
[0155] In step S605 , a test result of the second function to be tested is determined based on the returned data and the second expected data.
[0156] In some possible embodiments, the test device obtains the return data of the second function to be tested based on the calling script data, which can be expressed as follows: the test device obtains input data from the test data of the second function to be tested, calls the interface corresponding to the second function to be tested based on the calling script data, and obtains the first type of simulated return data of the input data. The return data is return data defined based on the above-mentioned mock concept. The return data can be simulated by others, generated by the environment, or prepared before testing the object to be tested.
[0157] Taking the function to be tested corresponding to the newly created chart as an example, the test effect to be achieved by the function to be tested is described as the data of the corresponding table in the newly created chart database will change and calling the newly created chart interface will return the result.
[0158] The embodiment of the present application uses a cache database specifically for testing functional requirements, which is isolated from the data used in the actual project to ensure that the testing work will not affect the actual data of the project. All test data comes from the cache database, and its test results are also compared with the data in the cache database. For example, after calling the interface, the required table will be automatically obtained from the cache database based on the input data, and this table will be printed as a json file, and then the newly added or changed data in the table will be found by reading the json file and the json file of the corresponding table before the new chart is created. The second expected data at this time is the newly added or changed data.
[0159] If the table to be returned is a large object, the large object contains multiple objects and multiple collections (attribute collections or parameter collections), and the multiple objects and multiple collections also contain other complex objects and collections. The embodiment of the present application can ensure that the returned embedded objects are compared with the expected data.
[0160] Optionally, you can also use an encapsulated result comparison tool class to verify the result. The comparison tool class can be used to compare the results of collection types such as List and Set, or to compare the results of a certain type of object. In this way, the returned object can be compared with the second expected data (the expected returned object).
[0161] In this way, the present application can not only verify the outermost objects, but also the objects and collections embedded within the objects, thus realizing multi-dimensional verification of the test results and ensuring the accuracy of the test.
[0162] In some other possible embodiments, the test device obtains the return data of the second function to be tested based on the calling script data, which can be expressed as: calling the instance establishment statement based on the calling script data to obtain the return data of the second type of model of the instance corresponding to the second function to be tested. For example, to test the normal connection to a database object, the database object is a very complex database. The database cannot be generated using the original mock idea, and there is no data simulated by others. Based on this, the test device can construct an external service instance to return a specific result before testing.
[0163] For example, in the external service that the object to be tested depends on, there is a database connection service class named SqlUtils. There is a method under this class called connect(Source source). When calling this method, a database resource needs to be passed in, and it will realize the database connection. However, when the object is deployed to other environments, it cannot be guaranteed that the database will always be successfully connected. In this case, it is necessary to simulate the external service. If it is not implemented by mock, a set(Source source) method can be added to the SqlUtils class, and then a new SqlUtils instance can be created. The instance calls the set(Source source) method, and the database resource passed in is a pre-prepared database (to ensure successful connection in different environments. This database is generally a cache database). That is, a new external service instance (SqlUtils instance) is created, and then its set method (i.e., instance creation statement) is called during testing, and a pre-prepared instance will be returned. This is because Sqlutils represents the MySQL database tool class, which contains database connection functions, and the test equipment can use it to connect to the database.
[0164] In another optional embodiment, when the target function to be tested is the third function to be tested, and the test requirement type of the third function to be tested is a mixed test requirement of front-end interface display and back-end interface call, Figure 7 is a flow chart showing a method of testing a third function to be tested according to an exemplary embodiment. Figure 7 As shown:
[0165] In step S701, interface script data, calling script data, first expected data and second expected data are obtained from test data of the third function to be tested.
[0166] Optionally, the interface script data is used to simulate user operations, the calling script data is used to simulate user operations, and the first expected data and the second expected data refer to ideal data. The first test requirement displayed on the front-end interface requires the execution of an automated operation page script to capture the value of the target element for result comparison.
[0167] In step S702, current data of the target in the third function to be tested is obtained based on the interface script data.
[0168] Optionally, the test device may execute interface script data to simulate user operations, such as clicking, to obtain the current comparison value of a field in the table, such as the display format of the year.
[0169] In step S703, the return data of the third function to be tested is obtained based on the calling script data.
[0170] In step S704, a first test result of a first function to be tested is determined based on current data and first expected data.
[0171] The test device can determine the test result of the first to-be-tested function based on the current data and the first expected data. Specifically, when the display format of the year is consistent with the first expected data, the test is successful, otherwise it fails.
[0172] In step S705 , a second test result of the second function to be tested is determined based on the returned data and the second expected data.
[0173] The testing device may determine a second test result of the second function to be tested based on the returned data and the second expected data.
[0174] In step S706, a mixed test result is determined according to the first test result and the second test result.
[0175] In the embodiment of the present application, the testing device can determine a mixed test result based on the first test result and the second test result to determine whether the test passes.
[0176] In some possible embodiments, the test device obtains return data of the third function to be tested based on calling script data, including: the test device calls an instance creation statement based on the calling script data to obtain return data of the second type model of the instance corresponding to the third function to be tested.
[0177] For example, to test the normal connection to a database object, the database object is a very complex database. The database cannot be generated using the original mock idea, and there is no data simulated by others. Based on this, the test device can construct an external service instance before the test to return a specific result.
[0178] For example, in the external service that the object to be tested depends on, there is a database connection service class named SqlUtils. There is a method under this class called connect(Source source). When calling this method, a database resource needs to be passed in, and it will realize the database connection. However, when the object is deployed to other environments, it cannot be guaranteed that the database will always be successfully connected. In this case, it is necessary to simulate the external service. If it is not implemented by mock, a set(Source source) method can be added to the SqlUtils class, and then a new SqlUtils instance can be created. The instance calls the set(Source source) method, and the database resource passed in is a pre-prepared database (to ensure successful connection in different environments. This database is generally a cache database). That is, a new external service instance (SqlUtils instance) is created, and then its set method (i.e., instance creation statement) is called during testing, and a pre-prepared instance will be returned. This is because Sqlutils represents the MySQL database tool class, which contains database connection functions, and the test equipment can use it to connect to the database.
[0179] In some other possible embodiments, the test device obtains the return data of the third function to be tested based on the calling script data, including: the test device obtains input data from the test data of the third function to be tested, calls the interface corresponding to the third function to be tested based on the calling script data, and obtains the first type of simulated return data of the input data. The return data is the return data defined based on the above-mentioned mock concept. The return data can be simulated by others, generated by the environment, and prepared before testing the object to be tested.
[0180] Taking the function to be tested corresponding to the newly created chart as an example, the test effect to be achieved by the function to be tested is described as the data of the corresponding table in the newly created chart database will change and calling the newly created chart interface will return the result.
[0181] The embodiment of the present application uses a cache database specifically for testing functional requirements, which is isolated from the data used in the actual project to ensure that the testing work will not affect the actual data of the project. All test data comes from the cache database, and its test results are also compared with the data in the cache database. For example, after calling the interface, the required table will be automatically obtained from the cache database based on the input data, and this table will be printed as a json file, and then the newly added or changed data in the table will be found by reading the json file and the json file of the corresponding table before the new chart is created. The second expected data at this time is the newly added or changed data.
[0182] If the table to be returned is a large object, the large object contains multiple objects and multiple collections (attribute collections or parameter collections), and the multiple objects and multiple collections also contain other complex objects and collections. The embodiment of the present application can ensure that the returned embedded objects are compared with the expected data.
[0183] Optionally, you can also use an encapsulated result comparison tool class to verify the result. The comparison tool class can be used to compare the results of collection types such as List and Set, or to compare the results of a certain type of object. In this way, the returned object can be compared with the second expected data (the expected returned object).
[0184] In this way, this application calls the interface corresponding to the function to be tested through the interface script data, which can not only verify the acquisition of the outermost table, but also verify the embedded objects and collections (attribute data and parameter data) in the table. At the same time, it can also verify the presentation of the table on the interface. In this way, multi-dimensional verification of the test results is achieved, thereby ensuring the accuracy of the test.
[0185] In summary, the present application has developed an automated testing method for front-end interface display and back-end interface call that can meet the functional testing in most projects, improve the coverage of demand testing, and make more demands testable. Secondly, the test result verification method proposed in the present application can compare the verification results in multiple dimensions, discover the comparison loopholes of the test results to a greater extent, and improve the credibility of the correctness of the test results. Furthermore, the lightweight mock idea based on the use of instance-based statements provided by the present invention can simulate external services and is simple to operate. Finally, the present invention improves execution efficiency and reduces testing time through parallel testing.
[0186] Figure 8 is a block diagram of a test device according to an exemplary embodiment. Figure 8 The device includes an acquisition module 801, a task determination module 802, a test set determination module 803 and a test module 804.
[0187] An acquisition module is configured to acquire the object to be tested and the test description document of the object to be tested;
[0188] A task determination module is configured to execute one or more test tasks corresponding to the object to be tested determined based on the test description document; each of the multiple test tasks includes test data of a function to be tested, a test requirement type and a test sequence identifier;
[0189] A test set determination module is configured to determine one or more test sets based on the test sequence identification of the functions to be tested included in each test task; each test set in the multiple test sets includes at least one function to be tested;
[0190] The test module is configured to perform, within the same time period, parallel testing of at least one function to be tested included in the target test set based on test data and test requirement type of at least one function to be tested included in the target test set;
[0191] The target test set is a test set among multiple test sets.
[0192] In some possible embodiments, the task determination module is configured to execute:
[0193] Determine the test data and function description statement for each function to be tested based on the test description document;
[0194] Identify the requirement type keywords of the function description statement and obtain the test requirement type of each function to be tested;
[0195] Identify the sequence identifier of the function description statement and obtain the test sequence identifier of each function to be tested;
[0196] Based on the test data, test requirement type and test sequence identification of each function to be tested, one or more test tasks are determined.
[0197] In some possible embodiments, the types of test requirements include a first test requirement displayed by the front-end interface, a second test requirement called by the back-end interface, and a mixed test requirement displayed by the front-end interface and called by the back-end interface.
[0198] In some possible embodiments, when one of the at least one to-be-tested function is a target to-be-tested function, the testing module is configured to execute:
[0199] Get script data and expected data from the test data of the target function to be tested;
[0200] Acquire test data of the target function to be tested based on script data;
[0201] Determine the test results of the target function to be tested based on the predicted data and the expected data.
[0202] In some possible embodiments, when the target function to be tested is the first function to be tested, and the test requirement type of the first function to be tested is the first test requirement displayed on the front-end interface, the test module is configured to execute:
[0203] Acquire the interface script data and the first expected data from the test data of the first function to be tested;
[0204] Acquire current data of a target in a first function to be tested based on the interface script data;
[0205] A test result of the first function to be tested is determined based on the current data and the first expected data.
[0206] In some possible embodiments, when the target function to be tested is the second function to be tested, and the test requirement type of the second function to be tested is the second test requirement called by the backend interface, the test module is configured to execute:
[0207] Acquire the calling script data and the second expected data from the test data of the second function to be tested;
[0208] Acquire return data of the second function to be tested based on the calling script data;
[0209] A test result of the second function to be tested is determined based on the returned data and the second expected data.
[0210] In some possible embodiments, the test module is configured to perform:
[0211] Obtain input data from the test data of the second function to be tested;
[0212] An interface corresponding to the second function to be tested is called based on the calling script data to obtain return data of the first type of simulation of the input data.
[0213] In some possible embodiments, when the target function to be tested is the third function to be tested, and the test requirement type of the third function to be tested is a mixed test requirement of front-end interface display and back-end interface call, the test module is configured to execute:
[0214] Obtaining interface script data, calling script data, first expected data and second expected data from test data of a third function to be tested;
[0215] Acquire current data of the target in the third function to be tested based on the interface script data;
[0216] Acquire return data of the third function to be tested based on the calling script data;
[0217] Determine a first test result of a first function to be tested based on current data and first expected data;
[0218] Determine a second test result of a second function to be tested based on the returned data and the second expected data;
[0219] A mixed test result is determined based on the first test result and the second test result.
[0220] In some possible embodiments, the test module is configured to perform:
[0221] An instance creation statement is called based on the calling script data to obtain return data of the second type of model of the instance corresponding to the third function to be tested.
[0222] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0223] Fig. 9 2 is a block diagram of a device 2000 for testing according to an exemplary embodiment. For example, the device 2000 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0224] Reference Fig. 9 , the device 2000 may include one or more of the following components: a processing component 2002 , a memory 2004 , a power component 2006 , a multimedia component 2008 , an audio component 2010 , an input / output (I / O) interface 2012 , a sensor component 2014 , and a communication component 2016 .
[0225] The processing component 2002 generally controls the overall operation of the device 2000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 2002 may include one or more processors 2020 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 2002 may include one or more modules to facilitate interaction between the processing component 2002 and other components. For example, the processing component 2002 may include a multimedia module to facilitate interaction between the multimedia component 2008 and the processing component 2002.
[0226] The memory 2004 is configured to store various types of data to support operations on the device 2000. Examples of such data include instructions for any application or method operating on the device 2000, contact data, phone book data, messages, pictures, videos, etc. The memory 2004 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0227] The power supply component 2006 provides power to the various components of the device 2000. The power supply component 2006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 2000.
[0228] The multimedia component 2008 includes a screen that provides an output interface between the device 2000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 2008 includes a front camera and / or a rear camera. When the device 2000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0229] The audio component 2010 is configured to output and / or input audio signals. For example, the audio component 2010 includes a microphone (MIC), and when the device 2000 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 2004 or sent via the communication component 2016. In some embodiments, the audio component 2010 also includes a speaker for outputting audio signals.
[0230] The I / O interface 2012 provides an interface between the processing component 2002 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0231] The sensor assembly 2014 includes one or more sensors for providing various aspects of status assessment for the device 2000. For example, the sensor assembly 2014 can detect the open / closed state of the device 2000, the relative positioning of components, such as the display and keypad of the device 2000, the sensor assembly 2014 can also detect the position change of the device 2000 or a component of the device 2000, the presence or absence of user contact with the device 2000, the orientation or acceleration / deceleration of the device 2000 and the temperature change of the device 2000. The sensor assembly 2014 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 2014 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 2014 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0232] The communication component 2016 is configured to facilitate wired or wireless communication between the device 2000 and other devices. The device 2000 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 2016 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 2016 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0233] In an exemplary embodiment, the apparatus 2000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0234] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory 2004 including instructions, and the instructions can be executed by the processor 2020 of the device 2000 to complete the above method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
Claims
1. A testing method, characterized in that: include: Obtaining an object to be tested and a test description document of the object to be tested; Determine one or more test tasks corresponding to the object to be tested based on the test description document; Each of the plurality of test tasks includes test data of a function to be tested, a test requirement type and a test sequence identifier; Determine one or more test sets based on the test sequence identifiers of the functions to be tested included in each test task; each test set in the multiple test sets includes at least one function to be tested; In the same time period, based on the test data and the test requirement type of the at least one function to be tested included in the target test set, parallel testing is performed on the at least one function to be tested included in the target test set; The target test set is a test set among the multiple test sets; Determining one or more test tasks corresponding to the object to be tested based on the test description document includes: Determine the test data and function description statement of each function to be tested based on the test description document; Identify the requirement type keywords of the function description sentence to obtain the test requirement type of each function to be tested; Identify the sequence identifier of the function description statement to obtain the test sequence identifier of each function to be tested; The one or more test tasks are determined based on the test data, test requirement type and test sequence identifier of each function to be tested.
2. The testing method according to claim 1, characterized in that: The types of test requirements include a first test requirement displayed by a front-end interface, a second test requirement called by a back-end interface, and a mixed test requirement displayed by a front-end interface and called by a back-end interface.
3. The testing method according to claim 2, characterized in that: When one of the at least one to-be-tested function is a target to-be-tested function, testing the target to-be-tested function includes: Acquire script data and expected data from the test data of the target function to be tested; Acquire test data of the target function to be tested based on the script data; A test result of the target function to be tested is determined based on the test data and the expected data.
4. The testing method according to claim 3, characterized in that: When the target function to be tested is a first function to be tested, and the test requirement type of the first function to be tested is a first test requirement displayed on the front-end interface, acquiring script data and expected data from the test data of the target function to be tested, acquiring the test data of the target function to be tested based on the script data, and determining a test result of the target function to be tested based on the test data and the expected data includes: Acquire interface script data and first expected data from the test data of the first function to be tested; Acquire current data of a target in the first function to be tested based on the interface script data; A test result of the first function to be tested is determined based on the current data and the first expected data.
5. The testing method according to claim 3, characterized in that: When the target function to be tested is a second function to be tested, and the test requirement type of the second function to be tested is a second test requirement called by the back-end interface, acquiring script data and expected data from the test data of the target function to be tested, acquiring the test data of the target function to be tested based on the script data, and determining a test result of the target function to be tested based on the test data and the expected data includes: Acquire calling script data and second expected data from the test data of the second function to be tested; Acquire the return data of the second function to be tested based on the calling script data; A test result of the second function to be tested is determined based on the returned data and the second expected data.
6. The testing method according to claim 5, characterized in that: The acquiring the return data of the second function to be tested based on the calling script data comprises: Acquire input data from the test data of the second function to be tested; An interface corresponding to the second function to be tested is called based on the calling script data to obtain return data of the first type of simulation of the input data.
7. The testing method according to claim 3, characterized in that: When the target function to be tested is the third function to be tested, and the test requirement type of the third function to be tested is a mixed test requirement of the front-end interface display and the back-end interface call, acquiring the script data and the expected data from the test data of the target function to be tested, acquiring the test data of the target function to be tested based on the script data, and determining the test result of the target function to be tested based on the test data and the expected data includes: Acquire interface script data, call script data, first expected data and second expected data from the test data of the third function to be tested; Acquire current data of a target in the third function to be tested based on the interface script data; Acquire the return data of the third function to be tested based on the calling script data; Determine a first test result of a first function to be tested based on the current data and the first expected data; Determine a second test result of a second function to be tested based on the returned data and the second expected data; A mixed test result is determined based on the first test result and the second test result.
8. The testing method according to claim 7, characterized in that: The obtaining the return data of the third function to be tested based on the calling script data comprises: An instance creation statement is called based on the calling script data to obtain return data of the second type of simulation of the instance corresponding to the third function to be tested.
9. A testing device, characterized in that: include: An acquisition module is configured to acquire an object to be tested and a test description document of the object to be tested; A task determination module is configured to execute one or more test tasks corresponding to the object to be tested determined based on the test description document; each of the multiple test tasks includes test data of a function to be tested, a test requirement type and a test sequence identifier; A test set determination module is configured to determine one or more test sets based on the test sequence identification of the functions to be tested included in each test task; each test set in the multiple test sets includes at least one function to be tested; The test module is configured to perform, within the same time period, parallel testing of at least one function to be tested included in the target test set based on test data and test requirement type of at least one function to be tested included in the target test set; The target test set is a test set among the multiple test sets; The task determination module is configured to execute: Determine the test data and function description statement of each function to be tested based on the test description document; Identify the requirement type keywords of the function description sentence to obtain the test requirement type of each function to be tested; Identify the sequence identifier of the function description statement to obtain the test sequence identifier of each function to be tested; The one or more test tasks are determined based on the test data, test requirement type and test sequence identifier of each function to be tested.
10. The testing device according to claim 9, characterized in that: The types of test requirements include a first test requirement displayed by a front-end interface, a second test requirement called by a back-end interface, and a mixed test requirement displayed by a front-end interface and called by a back-end interface.
11. The testing device according to claim 10, characterized in that: When one of the at least one to-be-tested function is a target to-be-tested function, the testing module is configured to execute: Acquire script data and expected data from the test data of the target function to be tested; Acquire test data of the target function to be tested based on the script data; A test result of the target function to be tested is determined based on the test data and the expected data.
12. The testing device according to claim 11, characterized in that: When the target function to be tested is the first function to be tested, and the test requirement type of the first function to be tested is the first test requirement displayed on the front-end interface, the test module is configured to execute: Acquire interface script data and first expected data from the test data of the first function to be tested; Acquire current data of a target in the first function to be tested based on the interface script data; A test result of the first function to be tested is determined based on the current data and the first expected data.
13. The testing device according to claim 11, characterized in that: When the target function to be tested is the second function to be tested, and the test requirement type of the second function to be tested is the second test requirement called by the backend interface, the test module is configured to execute: Acquire calling script data and second expected data from the test data of the second function to be tested; Acquire the return data of the second function to be tested based on the calling script data; A test result of the second function to be tested is determined based on the returned data and the second expected data.
14. The testing device according to claim 13, characterized in that: The test module is configured to perform: Acquire input data from the test data of the second function to be tested; An interface corresponding to the second function to be tested is called based on the calling script data to obtain return data of the first type of simulation of the input data.
15. The testing device according to claim 11, characterized in that: When the target function to be tested is the third function to be tested, and the test requirement type of the third function to be tested is a mixed test requirement of the front-end interface display and the back-end interface call, the test module is configured to execute: Acquire interface script data, call script data, first expected data and second expected data from the test data of the third function to be tested; Acquire current data of a target in the third function to be tested based on the interface script data; Acquire the return data of the third function to be tested based on the calling script data; Determine a first test result of a first function to be tested based on the current data and the first expected data; Determine a second test result of a second function to be tested based on the returned data and the second expected data; A mixed test result is determined based on the first test result and the second test result.
16. The testing device according to claim 15, characterized in that: The test module is configured to perform: An instance creation statement is called based on the calling script data to obtain return data of the second type model of the instance corresponding to the third function to be tested.
17. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the testing method according to any one of claims 1 to 8.
18. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the testing method according to any one of claims 1 to 8.
19. A computer program product, characterized in that The computer program product comprises a computer program, which is stored in a readable storage medium. At least one processor of a computer device reads and executes the computer program from the readable storage medium, so that the computer device performs the test method according to any one of claims 1 to 8.
