Nothing Special   »   [go: up one dir, main page]

CN114860576B - A testing method, device, electronic equipment and storage medium - Google Patents

A testing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114860576B
CN114860576B CN202210346268.5A CN202210346268A CN114860576B CN 114860576 B CN114860576 B CN 114860576B CN 202210346268 A CN202210346268 A CN 202210346268A CN 114860576 B CN114860576 B CN 114860576B
Authority
CN
China
Prior art keywords
test
tested
data
function
target
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.)
Active
Application number
CN202210346268.5A
Other languages
Chinese (zh)
Other versions
CN114860576A (en
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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202210346268.5A priority Critical patent/CN114860576B/en
Publication of CN114860576A publication Critical patent/CN114860576A/en
Application granted granted Critical
Publication of CN114860576B publication Critical patent/CN114860576B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0486Drag-and-drop

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本公开关于一种测试方法、装置、电子设备及存储介质,包括:获取待测试对象和待测试对象的测试描述文档,基于测试描述文档确定待测试对象对应的一个或多个测试任务,多个测试任务中的每个测试任务包括一个待测试功能的测试数据、测试需求种类和测试顺序标识,基于每个测试任务包括的待测试功能的测试顺序标识确定一个或多个测试集,多个测试集中的每个测试集包括至少一个待测试功能,在同一时间段内,基于目标测试集包括的至少一个待测试功能的测试数据和测试需求种类,对目标测试集包括的至少一个待测试功能进行并行测试,目标测试集为多个测试集中的一个测试集。本申请通过并行测试,可以提升测试执行效率,减少测试时间。

The present disclosure relates to a testing method, device, electronic device and storage medium, including: obtaining an object to be tested and a test description document of the object to be tested, determining one or more test tasks corresponding to the object to be tested based on the test description document, each of the multiple test tasks including test data, test requirement type and test sequence identifier of a function to be tested, determining 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 including at least one function to be tested, and performing 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, wherein 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.

Description

Test method, test device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of internet, and in particular relates to a testing method, a testing device, electronic equipment and a storage medium.
Background
With the rapid development of the current mobile internet, massive applications and websites are put into the market or are continuously and iteratively updated according to feedback of users, so as to ensure that fewer program errors, namely Bug, occur in the uploaded applications or websites, and developers need to test before the online.
However, current testing is typically performed on a functional-by-functional basis, which results in less efficient and more time consuming testing.
Disclosure of Invention
The disclosure provides a testing method, a testing device, an electronic device and a storage medium, and the technical scheme of the disclosure is as follows:
According to a first aspect of embodiments of the present disclosure, there is provided a test method, including:
acquiring a test object to be tested and test description documents of the test object to be tested;
Determining one or more test tasks corresponding to the object to be tested based on the test description document, wherein each test task in the plurality of test tasks comprises test data of one function to be tested, a test requirement type and a test sequence identifier;
Determining one or more test sets based on test sequence identifications of functions to be tested included in each test task;
in the same time period, based on the test data and the test requirement types of at least one function to be tested included in the target test set, performing parallel test on at least one function to be tested included in the target test set;
the target test set is one of a plurality of test sets.
In some possible embodiments, determining, based on the test description document, one or more test tasks corresponding to the object to be tested includes:
Determining test data and function description sentences of each function to be tested based on the test description document;
identifying a requirement category keyword of the function description statement to obtain a test requirement category of each function to be tested;
identifying sequence identifiers of the function description sentences to obtain test sequence identifiers of each function to be tested;
One or more test tasks are determined based on the test data, the test requirement category, and the test sequence identification for each function to be tested.
In some possible embodiments, the test requirement categories include a first test requirement displayed by the front end interface, a second test requirement invoked by the back end interface, a hybrid test requirement displayed by the front end interface and invoked by the back end interface.
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:
script data and expected data are obtained from test data of a target function to be tested;
acquiring test data of a target function to be tested based on script data;
and determining a test result of the target function to be tested based on the predicted data and the expected data.
In some possible embodiments, when the target function to be tested is the first function to be tested and the type of the test requirement 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 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 expected data and the expected data includes:
acquiring interface script data and first expected data from test data of a first function to be tested;
acquiring current data of a target in a first function to be tested based on 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.
In some possible embodiments, when the target function to be tested is a second function to be tested and the type of test requirement 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 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 expected data and the expected data includes:
Acquiring call script data and second expected data from test data of a second function to be tested;
Acquiring return data of the second function to be tested based on the call script data;
And determining a test result of the second function to be tested based on the returned data and the second expected data.
In some possible embodiments, obtaining return data for the second function to be tested based on the call script data includes:
Acquiring input data from test data of a second function to be tested;
and calling an interface corresponding to the second function to be tested based on the calling script data, and acquiring the first-class simulated return data of the input data.
In some possible embodiments, when the target function to be tested is a third function to be tested and the type of test requirement of the third function to be tested is a mixed test requirement of front end interface display and back end interface call, 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 expected data and the expected data includes:
Acquiring interface script data, call script data, first expected data and second expected data from test data of a third function to be tested;
Acquiring current data of a target in a third function to be tested based on the interface script data;
Acquiring return data of the third function to be tested based on the call script data;
Determining a first test result of the first function to be tested based on the current data and the first expected data;
determining a second test result of a second function to be tested based on the returned data and the second expected data;
And determining a mixed test result according to the first test result and the second test result.
In some possible embodiments, obtaining return data for the third function to be tested based on the call script data includes:
And calling an instance establishment statement based on the calling script data, and acquiring second-class simulation return data of an instance corresponding to the third function to be tested.
According to a second aspect of embodiments of the present disclosure, there is provided a test apparatus comprising:
An acquisition module configured to perform acquisition of a test subject to be tested and a test description document of the test subject to be tested;
the system comprises a task determining module, a task processing module and a test processing module, wherein the task determining module is configured to execute one or more test tasks corresponding to an object to be tested based on a test description document;
A test set determination module configured to perform determining one or more test sets based on test order identifications of functions to be tested included in each test task;
The test module is configured to execute parallel test on at least one function to be tested, which is included in the target test set, based on test data and test requirement types of the at least one function to be tested, which are included in the target test set, in the same time period;
the target test set is one of a plurality of test sets.
In some possible embodiments, the task determination module is configured to perform:
Determining test data and function description sentences of each function to be tested based on the test description document;
identifying a requirement category keyword of the function description statement to obtain a test requirement category of each function to be tested;
identifying sequence identifiers of the function description sentences to obtain test sequence identifiers of each function to be tested;
One or more test tasks are determined based on the test data, the test requirement category, and the test sequence identification for each function to be tested.
In some possible embodiments, the test requirement categories include a first test requirement displayed by the front end interface, a second test requirement invoked by the back end interface, a hybrid test requirement displayed by the front end interface and invoked by the back end interface.
In some possible embodiments, when one of the at least one function to be tested is a target function to be tested, the test module is configured to perform:
script data and expected data are obtained from test data of a target function to be tested;
acquiring test data of a target function to be tested based on script data;
and determining a test result of the target function to be tested based on the predicted data and the expected data.
In some possible embodiments, when the target function to be tested is a first function to be tested and the type of test requirement of the first function to be tested is a first test requirement displayed on the front-end interface, the test module is configured to execute:
acquiring interface script data and first expected data from test data of a first function to be tested;
acquiring current data of a target in a first function to be tested based on 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.
In some possible embodiments, when the target function to be tested is a second function to be tested and the type of test requirement of the second function to be tested is a second test requirement called by the back-end interface, the test module is configured to execute:
Acquiring call script data and second expected data from test data of a second function to be tested;
Acquiring return data of the second function to be tested based on the call script data;
And determining a test result of the second function to be tested based on the returned data and the second expected data.
In some possible embodiments, the test module is configured to perform:
Acquiring input data from test data of a second function to be tested;
and calling an interface corresponding to the second function to be tested based on the calling script data, and acquiring the first-class simulated return data of the input data.
In some possible embodiments, when the target function to be tested is a third function to be tested and the type of test requirement 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 perform:
Acquiring interface script data, call script data, first expected data and second expected data from test data of a third function to be tested;
Acquiring current data of a target in a third function to be tested based on the interface script data;
Acquiring return data of the third function to be tested based on the call script data;
Determining a first test result of the first function to be tested based on the current data and the first expected data;
determining a second test result of a second function to be tested based on the returned data and the second expected data;
And determining a mixed test result according to the first test result and the second test result.
In some possible embodiments, the test module is configured to perform:
And calling an instance establishment statement based on the calling script data, and acquiring the return data of the second class model of the instance corresponding to the third function to be tested.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device comprising a processor, a memory for storing processor-executable instructions, wherein the processor is configured to execute the instructions to implement the method as in any one of the first aspects above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method of any one of the first aspects of embodiments of the present disclosure.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program stored in a readable storage medium, the computer program being read from the readable storage medium by at least one processor of the computer device and executed, such that the computer device performs the method of any one of the first aspects of embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
The method comprises the steps of obtaining test description documents of a to-be-tested object and the to-be-tested object, determining one or more test tasks corresponding to the to-be-tested object based on the test description documents, wherein each test task in the plurality of test tasks comprises test data, test requirement types and test sequence identifiers of one to-be-tested function, determining one or more test sets based on the test sequence identifiers of the to-be-tested function included in each test task, wherein each test set in the plurality of test sets comprises at least one to-be-tested function, and performing parallel test on the at least one to-be-tested function included in a target test set based on the test data and the test requirement types of the at least one to-be-tested function included in the target test set in the same time period. The application can improve the test execution efficiency and reduce the test time through parallel test.
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 disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a schematic diagram of an application environment shown in accordance with an exemplary embodiment;
FIG. 2 is a flow chart illustrating a method of testing according to an exemplary embodiment;
FIG. 3 is a flow chart illustrating one method of determining test tasks according to an exemplary embodiment;
FIG. 4 is a schematic diagram of a test environment, shown according to an exemplary embodiment;
FIG. 5 is a flow chart illustrating a test of a first function to be tested according to an exemplary embodiment;
FIG. 6 is a flow chart illustrating one method of testing a second function to be tested according to one exemplary embodiment;
FIG. 7 is a flowchart illustrating a test of a third function to be tested in accordance with an exemplary embodiment;
FIG. 8 is a block diagram of a test apparatus, according to an example embodiment;
FIG. 9 is a block diagram of an electronic device for testing, according to an example embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar first objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
All data about the user in the application are data after the authorization of the user.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating an application environment of a test method according to an exemplary embodiment, and as shown in fig. 1, the application environment may include a test device 01 and a server 02.
In the embodiment of the application, the test equipment 01 can acquire test description documents of the to-be-tested object and the to-be-tested object, determine one or more test tasks corresponding to the to-be-tested object based on the test description documents, each test task in the plurality of test tasks comprises test data, test requirement types and test sequence identifiers of one to-be-tested function, determine one or more test sets based on the test sequence identifiers of the to-be-tested function included in each test task, each test set in the plurality of test sets comprises at least one to-be-tested function, and in the same time period, perform parallel test on at least one to-be-tested function included in a target test set based on the test data and the test requirement types of the at least one to-be-tested function included in the target test set, wherein the target test set is one test set in the plurality of test sets.
Optionally, the test device 01 may include, but is not limited to, a smart phone, a desktop computer, a tablet computer, a notebook computer, a smart speaker, a digital assistant, an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a smart wearable device, and the like. Or may be software running on the device, such as an application, applet, etc. Alternatively, the operating system running on the device may include, but is not limited to, an android system, an IOS system, linux, windows, unix, and the like.
Optionally, the server 02 is used for assisting test equipment to test, and may include an independent physical server, or may be a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network ), and basic cloud computing services such as big data and an artificial intelligence platform. Operating systems running on the server may include, but are not limited to, android systems, IOS systems, linux, windows, unix, and the like.
In addition, it should be noted that, fig. 1 is only one application environment of the test method provided in the disclosure, and other application environments may also be included in practical applications.
Fig. 2 is a flow chart of a testing method according to an exemplary embodiment, and as shown in fig. 2, the testing method may be applied to a server or a client, and includes the following steps:
In step S201, a test description document of a subject to be tested and a subject to be tested is acquired.
In some possible embodiments, the test device may obtain the test description document of the object to be tested and the object to be tested.
Alternatively, the object to be tested may be an application or a website. Alternatively, the object to be tested may be a single module in an application or website, or a collection of modules.
In step S203, one or more test tasks corresponding to the object to be tested are determined based on the test description document, wherein each test task in the plurality of test tasks comprises test data, test requirement types and test sequence identifiers of one function to be tested.
In an alternative embodiment, the test description document of the object to be tested may comprise a file or files, which may correspond to a test task. The test task may include test data, test requirement types, and test sequence identifications of the functions to be tested.
In an alternative embodiment, the test description document of the object to be tested may include a plurality of files, each of the plurality of files may correspond to a test task, and one test task may include all data required for one function to be tested. That is, the test description document includes a plurality of test tasks, each of which may include test data, test requirement category, and test sequence identification of the function to be tested.
In the above embodiment, the test description document uploaded to the test device has been planned in advance, and the test device may directly extract each test task from the test description document for subsequent testing. Thus, the embodiment of the application reduces the hardware and software resources required by the test equipment for determining the test task.
In another alternative embodiment, the test description document does not have individual, already distinguished test tasks, but rather a plurality of test tasks corresponding to the object to be tested, which are determined by the test description document, based on a certain rule. Therefore, the manual preparation work in the earlier stage can be reduced, and the labor cost is reduced. FIG. 3 is a flow chart illustrating a method of determining test tasks, as shown in FIG. 3, according to an exemplary embodiment:
In step S2031, test data and a function description sentence of each function to be tested are determined based on the test description document.
In the embodiment of the application, the test equipment can determine the test data and the function description statement of each function to be tested based on the test description document.
In some possible embodiments, the test data may be determined according to the function under test to which it belongs. Alternatively, the test data may include script data and expected data, and may include input data, script data, and expected data. Wherein the input data may be referred to as an entry.
In some possible embodiments, the function description statement may include a 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.
For example, one function description sentence is "catalog drag, drag the third catalog from the original position to the position of the first catalog and display, after drag, after the third catalog is clicked, it can determine whether it can jump to the content by jump interface test. The "catalog drag" in the function description statement is the name or code number of the function to be tested, and the other "drag the third catalog from the original position to the position of the first catalog", after the drag is completed, after the third catalog is clicked, it can be determined whether the jump to the preset content can be performed through the jump interface test ", which is the test effect description to be achieved by the function to be tested.
For another example, one function description statement is "get table 1, get table 1 through database interface". The "table 1 acquisition" in the function description statement is the name or code of the function to be tested, and the other "table 1 acquisition through the database interface" is the test effect description to be achieved by the function to be tested.
In step S2033, a requirement category keyword of the function description sentence is identified, and a test requirement category of each function to be tested is obtained.
In the embodiment of the application, the type of the test requirement can be determined according to the actual test requirement. The application focuses on the distinction between front-end interface display and back-end interface call testing, so the type of test requirement can be defined as comprising the following three types, namely, a first test requirement of front-end interface display, a second test requirement of back-end interface call, and a mixed test requirement of front-end interface display and back-end interface call.
Specifically, the first test requirement displayed on the front-end interface is a requirement for testing and verifying the user interface, for example, verifying the normal display function of the chart, and only verifying whether the display position and the legend information of the chart are correct on the webpage. The second test requirement called by the back-end interface verifies whether the corresponding interface can be normally called. The mixed test requirement for the front-end interface display and the back-end interface call is the combination of the two contents, for example, whether the call of the chart is successful or not needs to be verified, and whether the display position of the chart on the webpage and the legend information are displayed correctly or not needs to be verified.
In the prior art, the used test scheme is more focused on the test called by the back-end interface, and the test displayed by the front-end interface is ignored. When the tested object needs the test displayed by the front end interface, the test is generally performed manually by a tester, and the device is split into an autonomous test and a manual test, so that the whole test process has no test consistency, and the workload of the tester is increased. Based on this, the embodiments of the present application can identify the requirement category keywords of the function description sentence, so as to obtain the test requirement category of each function to be tested.
Before the keyword recognition of the requirement category is performed on the functional description statement, the test device may first obtain a keyword corresponding to the test requirement category, for example, if some characters or words related to the front end interface display appear in the description of the functional description statement, such as "display", "show", "appear", etc., then it is determined that the test requirement category of the function to be tested includes the first test requirement displayed on the front end interface. If some characters or words related to the call of the back end interface appear in the terms of "call interface", "return value", "through the @. The interface", etc., then it is determined that the test requirement class of the function to be tested includes a second test requirement of the call of the back end interface. If some characters or words related to front-end interface display such as display, and the like and some characters or words related to back-end interface call such as call interface, return value, and the like appear, determining the test requirement types of the function to be tested, including the mixed test requirements of front-end interface display and back-end interface call. The keywords corresponding to the types of the test requirements appearing in the above content are preset, and other feasible keywords can also exist.
Continuing to state based on the example of the first function description statement, when the test equipment acquires the ' catalog drag ', drags the third catalog from the original position to the position of the first catalog and displays the third catalog, after the drag is finished, after the third catalog is clicked, the test equipment can determine whether the jump to the function description statement of the content can be carried out or not through the jump interface test, and the test equipment can identify the key word of the type of the requirement, specifically, determines that the function to be tested needs to be subjected to the front end interface display test based on the ' display ', and determines that the function to be tested needs to be subjected to the back end interface call test based on the ' through.
Continuing to state based on the example of the second function description statement, after the test device obtains the function description statement of "table 1", and obtains the function description statement of table 1 "through the database interface, the test device can identify the keyword of the type of requirement, specifically, based on the" pass.
Continuing to state based on the example of the third function description statement, after the test equipment acquires the function description statement of 'interface display, display a chart of XXX on the interface', the test equipment can identify the keywords of the type of requirements, specifically, based on 'display', the function to be tested is determined to need to be subjected to front-end interface display test, so that the type of test requirements of the function to be tested can be determined to be the first test requirement of front-end interface display.
The functional descriptive matter of the above example is only an alternative way of representing the functional descriptive matter in plain text. But keywords may not be well recognized by the test equipment due to the fact that some functional descriptive statement expressions may be present for some reasons (e.g., miswords, wrongly written words). Based on the above, when the keywords are defined, the test device may define not only some words or expressions related to the front-end interface display, such as "display", "show", "appear", etc., but also "[ 1] to represent that the function to be tested needs to be tested on the front-end interface display. Also, not only may some words or phrases related to the back-end interface call, such as "call interface", "return value", "pass-through" interface "etc., but also" [2] may be defined to represent that the function to be tested needs to perform the back-end interface call test.
When the test equipment acquires the catalog drag, drags the third catalog from the original position to the position of the first catalog and displays the [ 1], after the drag is finished, after the third catalog is clicked, the test equipment can determine whether the test can jump to the function description statement of the content through the jump interface [2 ], and then the test equipment can identify the key word of the type of the requirement, specifically, the test equipment determines that the function to be tested needs to be subjected to the front end interface display test based on the display and/or the [ 1], and determines that the function to be tested needs to be subjected to the back end interface call test based on the interface and/or the [2 ], thereby determining that the type of the test requirement of the function to be tested is the mixed test requirement of the front end interface display and the back end interface call. The foregoing "[ 1] and" [2 ] are exemplary identifiers that refer to test requirements, and in the embodiments of the present application, character strings such as "aaa" and "bbb" may be used to indicate the test requirements, which is not limited to this embodiment of the present application.
In step S2035, the sequence identifier of the function description sentence is identified, and a test sequence identifier of each function to be tested is obtained.
In an embodiment of the present application, the test sequence identifier may be used to determine one or more test sets, where each test set in the plurality of test sets includes at least one function to be tested, so that the test device performs parallel testing, instead of serially, one-by-one testing, on at least one function to be tested included in the target test set based on test data and a test requirement type of the at least one function to be tested included in the target test set in the same time period. 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 test effect description to be achieved. For example, the function description sentence 1 "shows an interface, a chart of XXX is shown on the interface, the widget" the function description sentence 2 "shows an interface, a chart of yyyy is shown on the interface, the widget" the function description sentence 3 "shows an interface, a chart of ZZZ is shown on the interface, the widget" all includes the same test sequence identifier "widget", and when the test device obtains any one of the 3 function description sentences, the test sequence identifier "widget" can be identified.
In step S2037, one or more test tasks are determined based on the test data, the test requirement category, and the test order identification of each function to be tested.
In the embodiment of the application, the test equipment can package the identified test requirement types, the test sequence identifiers and the test data to obtain one test task, and other test tasks can be obtained according to the package.
In step S205, one or more test sets are determined based on the test sequence identifications of the functions under test included in each test task, each test set in the plurality of test sets including at least one function under test.
In the embodiment of the application, the test equipment can determine one or more test sets based on the test sequence identification of the function to be tested, which is included in each test task. Wherein each test set comprises at least one function to be tested, or each test set comprises at least one test task.
For example, the 3 test tasks all with the test sequence identifier "widget" may be assigned to one test set.
Optionally, no sequence relationship exists among the functions to be tested belonging to one test set, and it is assumed that one test set includes 1,2 and 3 functions to be tested, taking function 1 to be tested and function 2 to be tested as examples, and the fact that no sequence relationship exists means that function 2 to be tested cannot be tested after function 1 to be tested is tested, that is, function 1 to be tested and function 2 to be tested cannot interfere with each other in the actual application process.
After all of the steps of S201-S205 described above are performed, a test step may be performed.
In the embodiment of the application, before testing, a testing framework needs to be determined based on the development language of the object to be tested and related services. For example, when the development language is Java, some plug-in software matched with Java can be used for testing, such as using two frameworks of Junit5 and Selenium.
The function to be tested may be an integrated test or a unit test. For example, a function to be tested is an integrated test, and before the integrated test of the function to be tested is started, a dependency environment needs to be built, and then a unit test and an integrated test script are run for testing.
Fig. 4 is a schematic diagram of a test environment according to an exemplary embodiment, as shown in fig. 4, including a function to be tested (service a), the service a depends on downstream services including an external service b, an external service c, an internal service d, and an internal service e, wherein the external service b and the external service c are services (such as authentication services) provided by a third party. In fact, the online or testing phase is to turn off the third party service, and the external service b and the external service c can be turned on only by deploying the service a into the container cloud. Therefore, the application can simulate the return value of the third party service by simulating the mock idea so as to ensure the smooth implementation of the test process.
In the embodiment of the application, the integrated test is also called an assembly test or a joint test. On the basis of unit testing, all modules are assembled into a subsystem or a system according to design requirements (such as a structural diagram) for integrated testing. Unit testing refers to checking and verifying the smallest testable unit in software. For the meaning of a unit in unit test, generally, the specific meaning of the unit is to be determined according to practical situations, for example, a unit in C language refers to a function, a unit in Java refers to a class, and graphical software can refer to a window or a menu. In general, a unit is an artificially defined minimum measured function module. Unit testing is the lowest level of testing activity to be performed during the development of software, where individual units of software will be tested in isolation from other parts of the program.
In the embodiment of the application, the mock idea is that in the test process, for some objects which are not easy to construct/acquire, a mock object is created to simulate the behavior of the object. For example, if the H service needs to be called, but the H service has not been developed, then the part calling the H service can be dropped to Mock, and the desired return result can be written.
In step S207, the at least one function to be tested included in the target test set is tested in parallel 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, and the target test set is one of the plurality of test sets.
In the embodiment of the application, after the test environment of the object to be tested is built, the test equipment can perform parallel test on at least one function to be tested included in the target test set 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 in the same time period.
Optionally, assuming that one function to be tested in at least one function to be tested is a target function to be tested, when the target function to be tested and other functions to be tested in the same time period are tested, the testing process of the target function to be tested is that test equipment acquires script data and expected data from test data of the target function to be tested, acquires test data of the target function to be tested based on the script data, and determines a test result of the target function to be tested based on the expected data and the expected data.
The expected data is expected to be obtained, and is used for comparing with test data obtained in an actual test process, so that a test result is obtained.
In an alternative embodiment, when the target function to be tested is the first function to be tested and the type of test requirement of the first function to be tested is the first test requirement displayed on the front end interface, fig. 5 is a flowchart of testing the first function to be tested according to an exemplary embodiment, as shown in fig. 5:
In step S501, interface script data and first expected data are acquired from test data of a first function to be tested.
Optionally, the interface script data is used to simulate the operation of the user, and the first expected data refers to ideal data. The single test requirement displayed by the front-end interface requires that an automation operation page script is executed to capture the value of the target element so as to compare the results.
In step S503, current data of a target in the first function to be tested is acquired based on the interface script data.
Optionally, the test device may execute the interface script data to simulate the user to perform an operation, such as clicking, so as to obtain a current comparison value of a certain field in the table, such as a display format of year.
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.
The test device may determine a test result of the first function to be tested 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, the test fails.
In another alternative embodiment, when the target function to be tested is the second function to be tested and the type of test requirement of the second function to be tested is the second test requirement called by the back-end interface, fig. 6 is a flowchart of a test of the second function to be tested according to an exemplary embodiment, as shown in fig. 6:
in step S601, call script data and second expected data are acquired from test data of a second function to be tested.
Optionally, the script data is invoked to simulate the user to perform an operation, and the second expected data refers to ideal data.
In step S603, return data of the second function to be tested is acquired based on the call script data.
In step S605, a test result of the second function to be tested is determined based on the return data and the second expected data.
In some possible embodiments, the test device obtaining the return data of the second function to be tested based on the call script data may be represented as the test device obtaining input data from the test data of the second function to be tested, calling an interface corresponding to the second function to be tested based on the call script data, and obtaining the return data of the first type simulation of the input data. The return data is defined based on the mock idea described above. The return data may be simulated by others, may be generated environmentally, or may be prepared prior to testing by the subject to be tested.
Taking the function to be tested corresponding to the new chart as an example, the test effect to be achieved by the function to be tested is described as that the data of the corresponding chart in the new chart database is changed and the new chart interface is called to return the result.
The embodiment of the application adopts the cache database to be specially used for testing the functional requirement and is isolated from the data used by the actual project, thereby ensuring that the testing work can not influence the actual data of the project. All data tested are from the cache database, and the test results are compared with the data in the cache database. For example, after the interface is called, a required table is automatically acquired from the cache database based on input data, the table is printed into a json file, and then newly added or changed data in the table is searched by reading the json file and the json file of the corresponding table before creating the chart. The second expected data at this time is newly added or changed data.
If the form to be returned is a large object, the large object contains multiple objects and multiple sets (attribute sets, or parameter sets) that also contain other complex objects and sets inside. The embodiment of the application can ensure that returned embedded objects are compared with expected data.
Alternatively, the packaged results may be used to verify results against tools. The comparison tool class can be used for comparing results of collection types such as List, set and the like, and can also be used for comparing results of certain objects. In this way, the returned object can be compared to the second expected data (expected returned object).
Therefore, the application not only can verify the outermost object, but also can verify the embedded object and the set in the object, thereby realizing the multi-dimensional verification test result and further ensuring the accuracy of the test.
In other possible embodiments, the test equipment obtaining the return data of the second function to be tested based on the call script data may be represented as obtaining the return data of the second class model of the instance corresponding to the second function to be tested based on the call script data call instance setup statement. For example, a database object, which is a very complex database, is tested for normal connection. The database cannot be generated by using the original mock thought, and has no data obtained by simulation of others. Based on this, the test equipment may construct an external service instance to return specific results prior to testing.
For example, a database connection service class name SqlUtils is included in the external services on which the object to be tested depends, and a method under the class name connect (Source source) is included in the external services, and a database resource is required to be transferred when the method is called, so that database connection can be realized. However, when the object is deployed to other environments, it cannot be guaranteed that the database is always successfully connected, so that external services need to be simulated at this time, if the external services are not realized by means of mock, a set (Source source) method can be added to the SqlUtils class, then a SqlUtils instance is newly created, the instance calls set (Source source) the method, and the incoming database resource is a database prepared in advance (ensuring that the database can be successfully connected in different environments, and the database is generally a cache database). That is, an external service instance (SqlUtils instances) is newly built, and then its set method (i.e., instance setup statement) is called at the time of test, and a prepared instance is returned. This is because Sqlutils represents a mysql database tool class that contains a database connection function inside, with which the test equipment can connect to the database.
In another alternative embodiment, when the target function to be tested is the third function to be tested and the type of test requirement of the third function to be tested is the mixed test requirement of the front end interface display and the back end interface call, fig. 7 is a flowchart of a test of the third function to be tested according to an exemplary embodiment, as shown in fig. 7:
In step S701, interface script data, call script data, first expected data, and second expected data are acquired from test data of a third function to be tested.
Optionally, the interface script data is used for simulating the operation of the user, the call script data is used for simulating the operation of the user, and the first expected data and the second expected data refer to ideal data. The first test requirement displayed by the front-end interface requires execution of an automation operation page script to capture the value of the target element so as to perform result comparison.
In step S702, current data of a target in the third function to be tested is acquired based on the interface script data.
Optionally, the test device may execute the interface script data to simulate the user to perform an operation, such as clicking, so as to obtain a current comparison value of a certain field in the table, such as a display format of year.
In step S703, return data of the third function to be tested is acquired based on the call script data.
In step S704, a first test result of the first function to be tested is determined based on the current data and the first expected data.
The test device may determine a test result of the first function to be tested 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, the test fails.
In step S705, a second test result of a second function to be tested is determined based on the return data and the second expected data.
The test device may determine a second test result for a second function to be tested based on the returned data and the second expected data.
In step S706, a hybrid test result is determined according to the first test result and the second test result.
In the embodiment of the application, the test equipment can determine the mixed test result based on the first test result and the second test result to determine whether the test passes.
In some possible embodiments, the test equipment obtaining the return data of the third function to be tested based on the call script data comprises the test equipment obtaining the return data of the second class model of the instance corresponding to the third function to be tested based on the call script data call instance establishment statement.
For example, a database object, which is a very complex database, is tested for normal connection. The database cannot be generated by using the original mock thought, and has no data obtained by simulation of others. Based on this, the test equipment may construct an external service instance to return specific results prior to testing.
For example, a database connection service class name SqlUtils is included in the external services on which the object to be tested depends, and a method under the class name connect (Source source) is included in the external services, and a database resource is required to be transferred when the method is called, so that database connection can be realized. However, when the object is deployed to other environments, it cannot be guaranteed that the database is always successfully connected, so that external services need to be simulated at this time, if the external services are not realized by means of mock, a set (Source source) method can be added to the SqlUtils class, then a SqlUtils instance is newly created, the instance calls set (Source source) the method, and the incoming database resource is a database prepared in advance (ensuring that the database can be successfully connected in different environments, and the database is generally a cache database). That is, an external service instance (SqlUtils instances) is newly built, and then its set method (i.e., instance setup statement) is called at the time of test, and a prepared instance is returned. This is because Sqlutils represents a mysql database tool class that contains a database connection function inside, with which the test equipment can connect to the database.
In other possible embodiments, the test equipment obtaining the return data of the third function to be tested based on the call script data comprises the test equipment obtaining input data from the test data of the third function to be tested, calling an interface corresponding to the third function to be tested based on the call script data, and obtaining the return data of the first type simulation of the input data. The return data is defined based on the mock idea described above. The return data may be simulated by others, may be generated environmentally, and is ready prior to testing by the subject to be tested.
Taking the function to be tested corresponding to the new chart as an example, the test effect to be achieved by the function to be tested is described as that the data of the corresponding chart in the new chart database is changed and the new chart interface is called to return the result.
The embodiment of the application adopts the cache database to be specially used for testing the functional requirement and is isolated from the data used by the actual project, thereby ensuring that the testing work can not influence the actual data of the project. All data tested are from the cache database, and the test results are compared with the data in the cache database. For example, after the interface is called, a required table is automatically acquired from the cache database based on input data, the table is printed into a json file, and then newly added or changed data in the table is searched by reading the json file and the json file of the corresponding table before creating the chart. The second expected data at this time is newly added or changed data.
If the form to be returned is a large object, the large object contains multiple objects and multiple sets (attribute sets, or parameter sets) that also contain other complex objects and sets inside. The embodiment of the application can ensure that returned embedded objects are compared with expected data.
Alternatively, the packaged results may be used to verify results against tools. The comparison tool class can be used for comparing results of collection types such as List, set and the like, and can also be used for comparing results of certain objects. In this way, the returned object can be compared to the second expected data (expected returned object).
Therefore, the application calls the interface corresponding to the function to be tested through the interface script data, not only can verify the acquisition of the table on the outermost surface, but also can verify the embedded objects and sets (attribute data and parameter data) in the table, and can verify the presentation of the table on the interface at the same time, thus realizing the multi-dimensional verification test result and ensuring the accuracy of the test.
In summary, the application develops an automatic test method for front-end interface display and back-end interface call, which can meet the function test in most projects, improve the coverage rate of the requirement test, and enable more requirements to be measurable. And secondly, the verification mode of the test result provided by the application can compare the verification result in a multi-dimensional way, so that the comparison loopholes of the test result can be found to a greater extent, and the correct credibility of the test result is improved. Furthermore, the application provides a lightweight mock idea based on the implementation of a use-by-instance build statement, which can simulate external services and is simple to operate. Finally, the application improves the execution efficiency and reduces the test time through parallel test.
Fig. 8 is a block diagram of a test apparatus, according to an example embodiment. Referring to fig. 8, the apparatus includes an acquisition module 801, a task determination module 802, a test set determination module 803, and a test module 804.
An acquisition module configured to perform acquisition of a test subject to be tested and a test description document of the test subject to be tested;
the system comprises a task determining module, a task processing module and a test processing module, wherein the task determining module is configured to execute one or more test tasks corresponding to an object to be tested based on a test description document;
A test set determination module configured to perform determining one or more test sets based on test order identifications of functions to be tested included in each test task;
The test module is configured to execute parallel test on at least one function to be tested, which is included in the target test set, based on test data and test requirement types of the at least one function to be tested, which are included in the target test set, in the same time period;
the target test set is one of a plurality of test sets.
In some possible embodiments, the task determination module is configured to perform:
Determining test data and function description sentences of each function to be tested based on the test description document;
identifying a requirement category keyword of the function description statement to obtain a test requirement category of each function to be tested;
identifying sequence identifiers of the function description sentences to obtain test sequence identifiers of each function to be tested;
One or more test tasks are determined based on the test data, the test requirement category, and the test sequence identification for each function to be tested.
In some possible embodiments, the test requirement categories include a first test requirement displayed by the front end interface, a second test requirement invoked by the back end interface, a hybrid test requirement displayed by the front end interface and invoked by the back end interface.
In some possible embodiments, when one of the at least one function to be tested is a target function to be tested, the test module is configured to perform:
script data and expected data are obtained from test data of a target function to be tested;
acquiring test data of a target function to be tested based on script data;
and determining a test result of the target function to be tested based on the predicted data and the expected data.
In some possible embodiments, when the target function to be tested is a first function to be tested and the type of test requirement of the first function to be tested is a first test requirement displayed on the front-end interface, the test module is configured to execute:
acquiring interface script data and first expected data from test data of a first function to be tested;
acquiring current data of a target in a first function to be tested based on 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.
In some possible embodiments, when the target function to be tested is a second function to be tested and the type of test requirement of the second function to be tested is a second test requirement called by the back-end interface, the test module is configured to execute:
Acquiring call script data and second expected data from test data of a second function to be tested;
Acquiring return data of the second function to be tested based on the call script data;
And determining a test result of the second function to be tested based on the returned data and the second expected data.
In some possible embodiments, the test module is configured to perform:
Acquiring input data from test data of a second function to be tested;
and calling an interface corresponding to the second function to be tested based on the calling script data, and acquiring the first-class simulated return data of the input data.
In some possible embodiments, when the target function to be tested is a third function to be tested and the type of test requirement 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 perform:
Acquiring interface script data, call script data, first expected data and second expected data from test data of a third function to be tested;
Acquiring current data of a target in a third function to be tested based on the interface script data;
Acquiring return data of the third function to be tested based on the call script data;
Determining a first test result of the first function to be tested based on the current data and the first expected data;
determining a second test result of a second function to be tested based on the returned data and the second expected data;
And determining a mixed test result according to the first test result and the second test result.
In some possible embodiments, the test module is configured to perform:
And calling an instance establishment statement based on the calling script data, and acquiring the return data of the second class model of the instance corresponding to the third function to be tested.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 9 is a block diagram illustrating an apparatus 2000 for testing, according to an example embodiment. For example, apparatus 2000 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and so forth.
Referring to fig. 9, the apparatus 2000 may include one or more of 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.
The processing component 2002 generally controls overall operation of the device 2000, such as operations associated with display, telephone 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 methods described above. Further, the processing component 2002 may include one or more modules that facilitate interactions between the processing component 2002 and other components. For example, the processing component 2002 can include a multimedia module to facilitate interaction between the multimedia component 2008 and the processing component 2002.
The memory 2004 is configured to store various types of data to support operations at the device 2000. Examples of such data include instructions for any application or method operating on the device 2000, contact data, phonebook data, messages, pictures, videos, and the like. The memory 2004 may be implemented by any type or combination of volatile or nonvolatile memory devices 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 or optical disk.
The power supply assembly 2006 provides power to the various components of the device 2000. The power supply components 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.
The multimedia component 2008 includes a screen between the device 2000 and the user that provides an output interface. 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 a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia assembly 2008 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the device 2000 is in an operational mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 2010 is configured to output and/or input audio signals. For example, audio component 2010 includes a Microphone (MIC) configured to receive external audio signals when device 2000 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 2004 or transmitted via the communication component 2016. In some embodiments, audio assembly 2010 further includes a speaker for outputting audio signals.
I/O interface 2012 provides an interface between processing component 2002 and peripheral interface modules, which may be keyboards, click wheels, buttons, and the like. These buttons may include, but are not limited to, a home button, a volume button, an activate button, and a lock button.
The sensor assembly 2014 includes one or more sensors for providing status assessment of various aspects of the apparatus 2000. For example, the sensor assembly 2014 may detect an on/off state of the apparatus 2000, a relative positioning of the components, such as a display and keypad of the device 2000, a change in position of the device 2000 or a component of the device 2000, the presence or absence of a user contact with the device 2000, an orientation or acceleration/deceleration of the device 2000, and a change in temperature of the device 2000. The sensor assembly 2014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 2014 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 2014 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 2016 is configured to facilitate communication between the apparatus 2000 and other devices, either wired or wireless. The device 2000 may access a wireless network based on a communication standard, such as WiFi, an operator network (e.g., 2G, 3G, 4G, or 5G), or a combination thereof. In one exemplary embodiment, the communication component 2016 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 2016 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
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 elements for executing the methods described above.
In an exemplary embodiment, a storage medium is also provided, such as a memory 2004 including instructions executable by the processor 2020 of the apparatus 2000 to perform the above-described method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.

Claims (19)

1.一种测试方法,其特征在于,包括:1. A testing method, comprising: 获取待测试对象和所述待测试对象的测试描述文档;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 multiple 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.根据权利要求1所述的测试方法,其特征在于,所述测试需求种类包括前端界面显示的第一测试需求、后端接口调用的第二测试需求、前端界面显示和后端接口调用的混合测试需求。2. The testing method according to claim 1 is characterized in that 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. 3.根据权利要求2所述的测试方法,其特征在于,当所述至少一个待测试功能中的一个待测试功能为目标待测试功能,所述对所述目标待测试功能进行测试,包括:3. The testing method according to claim 2, wherein 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 comprises: 从所述目标待测试功能的测试数据中获取脚本数据和预期数据;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.根据权利要求3所述的测试方法,其特征在于,当所述目标待测试功能为第一待测试功能,且所述第一待测试功能的测试需求种类为所述前端界面显示的第一测试需求时,所述从所述目标待测试功能的测试数据中获取脚本数据和预期数据,基于所述脚本数据获取所述目标待测试功能的测试数据,基于所述测试数据和所述预期数据确定所述目标待测试功能的测试结果包括:4. The test 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 the test result of the target function to be tested based on the test data and the expected data comprises: 从所述第一待测试功能的测试数据中获取界面脚本数据和第一预期数据;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.根据权利要求3所述的测试方法,其特征在于,当所述目标待测试功能为第二待测试功能,且所述第二待测试功能的测试需求种类为所述后端接口调用的第二测试需求时,所述从所述目标待测试功能的测试数据中获取脚本数据和预期数据,基于所述脚本数据获取所述目标待测试功能的测试数据,基于所述测试数据和所述预期数据确定所述目标待测试功能的测试结果包括:5. The test 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 the test result of the target function to be tested based on the test data and the expected data comprises: 从所述第二待测试功能的测试数据中获取调用脚本数据和第二预期数据;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.根据权利要求5所述的测试方法,其特征在于,所述基于所述调用脚本数据获取所述第二待测试功能的返回数据包括:6. The testing method according to claim 5, characterized in that the step of obtaining 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.根据权利要求3所述的测试方法,其特征在于,当所述目标待测试功能为第三待测试功能,且所述第三待测试功能的测试需求种类为所述前端界面显示和后端接口调用的混合测试需求时,所述从所述目标待测试功能的测试数据中获取脚本数据和预期数据,基于所述脚本数据获取所述目标待测试功能的测试数据,基于所述测试数据和所述预期数据确定所述目标待测试功能的测试结果包括:7. The test method according to claim 3, characterized in that when the target function to be tested is a 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 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 the test result of the target function to be tested based on the test data and the expected data comprises: 从所述第三待测试功能的测试数据中获取界面脚本数据、调用脚本数据、第一预期数据和第二预期数据;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.根据权利要求7所述的测试方法,其特征在于,所述基于所述调用脚本数据获取所述第三待测试功能的返回数据包括:8. The testing method according to claim 7, wherein the step of 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.一种测试装置,其特征在于,包括:9. A testing device, comprising: 获取模块,被配置为执行获取待测试对象和所述待测试对象的测试描述文档;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.根据权利要求9所述的测试装置,其特征在于,所述测试需求种类包括前端界面显示的第一测试需求、后端接口调用的第二测试需求、前端界面显示和后端接口调用的混合测试需求。10. The testing device according to claim 9 is 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.根据权利要求10所述的测试装置,其特征在于,当所述至少一个待测试功能中的一个待测试功能为目标待测试功能,所述测试模块,被配置为执行:11. The testing device according to claim 10, wherein 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.根据权利要求11所述的测试装置,其特征在于,当所述目标待测试功能为第一待测试功能,且所述第一待测试功能的测试需求种类为所述前端界面显示的第一测试需求时,所述测试模块,被配置为执行:12. The test device according to claim 11, 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, 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.根据权利要求11所述的测试装置,其特征在于,当所述目标待测试功能为第二待测试功能,且所述第二待测试功能的测试需求种类为所述后端接口调用的第二测试需求时,所述测试模块,被配置为执行:13. The test device according to claim 11, 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 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.根据权利要求13所述的测试装置,其特征在于,所述测试模块,被配置为执行:14. The testing device according to claim 13, wherein the testing module is configured to execute: 从所述第二待测试功能的测试数据中获取输入数据;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.根据权利要求11所述的测试装置,其特征在于,当所述目标待测试功能为第三待测试功能,且所述第三待测试功能的测试需求种类为所述前端界面显示和后端接口调用的混合测试需求时,所述测试模块,被配置为执行:15. The test device according to claim 11, characterized in that when the target function to be tested is a 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.根据权利要求15所述的测试装置,其特征在于,所述测试模块,被配置为执行:16. The testing device according to claim 15, wherein the testing module is configured to execute: 基于所述调用脚本数据调用实例建立语句,获取所述第三待测试功能对应的实例的第二类模型的返回数据。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.一种电子设备,其特征在于,包括:17. An electronic device, comprising: 处理器;processor; 用于存储所述处理器可执行指令的存储器;a memory for storing instructions executable by the processor; 其中,所述处理器被配置为执行所述指令,以实现如权利要求1至8中任一项所述的测试方法。The processor is configured to execute the instructions to implement the testing method according to any one of claims 1 to 8. 18.一种计算机可读存储介质,其特征在于,当所述计算机可读存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行如权利要求1至8中任一项所述的测试方法。18 . A computer-readable storage medium, characterized in that when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the testing method according to any one of claims 1 to 8. 19.一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序,所述计算机程序存储在可读存储介质中,计算机设备的至少一个处理器从所述可读存储介质读取并执行所述计算机程序,使得所述计算机设备执行如权利要求1至8中任一项所述的测试方法。19. A computer program product, characterized in that the computer program product comprises a computer program, the computer program 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.
CN202210346268.5A 2022-03-31 2022-03-31 A testing method, device, electronic equipment and storage medium Active CN114860576B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210346268.5A CN114860576B (en) 2022-03-31 2022-03-31 A testing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210346268.5A CN114860576B (en) 2022-03-31 2022-03-31 A testing method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114860576A CN114860576A (en) 2022-08-05
CN114860576B true CN114860576B (en) 2024-12-31

Family

ID=82629730

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210346268.5A Active CN114860576B (en) 2022-03-31 2022-03-31 A testing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114860576B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106326102A (en) * 2015-07-06 2017-01-11 阿里巴巴集团控股有限公司 Test method and apparatus

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104965790B (en) * 2015-07-17 2018-04-27 小米科技有限责任公司 Method for testing software and system based on crucial word drive
CN108399132B (en) * 2018-03-21 2021-01-08 腾讯科技(深圳)有限公司 Scheduling test method, device and storage medium
CN110162468B (en) * 2019-04-26 2024-07-09 腾讯科技(深圳)有限公司 Test method, test device and computer readable storage medium
CN111459798A (en) * 2020-03-03 2020-07-28 深圳壹账通智能科技有限公司 Test method, test device, test medium, and electronic apparatus
CN111767226B (en) * 2020-06-30 2023-10-27 上海云轴信息科技有限公司 Cloud computing platform resource testing method, system and equipment
CN113434405B (en) * 2021-06-24 2023-06-13 青岛海尔科技有限公司 Method and device for determining test file, storage medium and electronic device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106326102A (en) * 2015-07-06 2017-01-11 阿里巴巴集团控股有限公司 Test method and apparatus

Also Published As

Publication number Publication date
CN114860576A (en) 2022-08-05

Similar Documents

Publication Publication Date Title
US10705942B1 (en) Simulated testing of API
WO2021184725A1 (en) User interface test method and apparatus, storage medium, and computer device
US20150106723A1 (en) Tools for locating, curating, editing, and using content of an online library
WO2016122942A1 (en) Dynamic inference of voice command for software operation from help information
CN109074278B (en) Validating stateful dynamic links in mobile applications
WO2023279963A1 (en) Neural network training method and apparatus, and computer device, storage medium and program
US9507751B2 (en) Managing seed data
CN108073429A (en) A kind of means of payment collocation method, device, equipment and storage medium
CN113568621B (en) A data processing method and device for page embedding
CN113157256B (en) Method and device for generating interface code, electronic equipment, storage medium and product
CN113778897A (en) Automatic test method, device, equipment and storage medium of interface
CN117389890A (en) Method and device for generating test case, electronic equipment and storage medium
CN112256252B (en) Interface generation method and device, storage medium and electronic equipment
CN112433730A (en) Code detection rule generation method and device and electronic equipment
US10019519B2 (en) Methods and systems for utilizing global entities in software applications
WO2020006090A1 (en) Skill-generating method, apparatus, and electonic device
CN114860576B (en) A testing method, device, electronic equipment and storage medium
CN112395194A (en) Method and device for accessing test platform
US20240303415A1 (en) Collaborative coauthoring with artificial intelligence
CN111240787A (en) Interactive help method and system based on real scene semantic understanding
CN116594676A (en) Application packaging method, device, equipment and storage medium
JP7029557B1 (en) Judgment device, judgment method and judgment program
CN114896165A (en) Test method, device, electronic device and storage medium for conversational robot system
US20200151241A1 (en) Webpage component replication system and method
Demmel et al. Data Synthesis Is Going Mobile—On Community-Driven Dataset Generation for Android Devices

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant