Test data generation method and device, electronic equipment and storage medium
By analyzing the user interface design diagram to generate virtual test data and then editing and updating it, the problem of low testing efficiency caused by unfinished back-end interfaces in front-end development is solved, and efficient and automated test data generation is achieved.
Patent Information
- Application Number
- CN202510898302.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-10-03
AI Technical Summary
During the software development process, front-end developers are unable to display complete data because the back-end interface has not been fully developed, resulting in inefficient front-end page development and testing. They need to simulate data for independent testing.
By parsing the user interface design, extracting page information, generating reference virtual test data, and updating it in the editing interface, the target virtual test data is automatically generated.
It improves the efficiency of test data generation, reduces the workload of front-end developers, shortens the development cycle, and enhances the flexibility and practicality of test data.
Smart Images

Figure CN120743776A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to technical fields such as image processing and natural language processing, and specifically to a test data generation method, device, electronic device, and storage medium. Background Art
[0002] During software development, front-end developers often rely on back-end interfaces to obtain data for page display. However, in the early stages of development or design, the back-end interfaces are often not yet fully developed, resulting in the front-end pages being unable to display complete data. Therefore, mock data is needed to simulate the data returned by the back-end interfaces. This allows the front-end to develop and test pages independently of the back-end, improving development efficiency. Summary of the Invention
[0003] The present disclosure aims to solve one of the technical problems in the related art at least to a certain extent.
[0004] To this end, the purpose of the present disclosure is to propose a test data generation method, device, electronic device and storage medium, which extracts the data structure framework of the test data by parsing the design diagram of the user interface, and further refines it to generate virtual test data. It has a high degree of automation, improves the efficiency of test data generation, and reduces the cost and time required for development.
[0005] According to a first aspect of the present disclosure, a test data generating method is provided, comprising:
[0006] Get the user interface diagram to be tested;
[0007] Parsing the user interface diagram to determine page information of the user interface, wherein the page information includes at least one of the following: page layout, text content, and relationships between elements on the page;
[0008] generating reference virtual test data associated with the page elements and an editing interface for the reference virtual test data according to the page information of the user interface;
[0009] The reference virtual test data is updated according to the information received in the editing interface to obtain the target virtual test data associated with the page element.
[0010] According to a second aspect of the present disclosure, there is provided a test data generating device, comprising:
[0011] An acquisition module is used to obtain the user interface diagram to be tested;
[0012] a parsing module, configured to parse the user interface diagram to determine page information of the user interface, wherein the page information includes at least one of the following: page layout, text content, and relationships between elements on the page;
[0013] A generating module, configured to generate reference virtual test data associated with the page elements and an editing interface for the reference virtual test data according to the page information of the user interface;
[0014] An updating module is configured to update the reference virtual test data according to information received in the editing interface to obtain target virtual test data associated with the page element.
[0015] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0016] at least one processor; and
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the test data generating method according to the first aspect.
[0019] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the test data generating method as described in the first aspect.
[0020] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising computer instructions, which, when executed by a processor, implement the steps of the test data generating method according to the first aspect.
[0021] The test data generation method, device, electronic device and storage medium provided by the present disclosure have the following
[0022] Beneficial effects:
[0023] The system first parses the acquired user interface image to obtain page information. From this information, it generates reference virtual test data associated with the page elements. A corresponding editing interface is then created for each reference virtual test data. Based on the editing information received in the editing interface, the corresponding reference virtual test data is updated to generate the target test data. This system automates the generation of test data from images, improving test data generation efficiency and reducing the workload of front-end developers, shortening the development cycle. Furthermore, it provides an editing interface that allows for personalized adjustment of test data or configuration of custom content, enhancing the flexibility and practicality of test data and enabling it to meet diverse testing needs.
[0024] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The above and / or additional aspects and advantages of the present disclosure will become apparent and readily understood from the following description of the embodiments in conjunction with the accompanying drawings, which are provided for a better understanding of the present solution and do not constitute a limitation of the present disclosure.
[0026] Figure 1 is a flowchart of a test data generation method proposed according to an embodiment of the present disclosure;
[0027] Figure 2 is a flowchart of a test data generation method proposed according to another embodiment of the present disclosure;
[0028] Figure 3 is a flowchart of a test data generation method proposed according to another embodiment of the present disclosure;
[0029] Figure 4 is a flowchart of a test data generation method proposed according to another embodiment of the present disclosure;
[0030] Figure 5 is a structural diagram of a test data generating device proposed according to an embodiment of the present disclosure;
[0031] Figure 6 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0032] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0033] The embodiments of the present disclosure relate to technical fields such as image processing and natural language processing.
[0034] Image processing, also known as image processing, is the use of computers to analyze images to achieve desired results. Image processing generally refers to digital image processing. A digital image is a large two-dimensional array captured by devices such as industrial cameras, video cameras, and scanners. The elements of this array are called pixels, and their values are called grayscale values. Image processing techniques generally include three components: image compression, enhancement and restoration, and matching, description, and recognition.
[0035] Natural Language Processing (NLP) encompasses two main areas: natural language understanding and natural language generation. Its research encompasses multiple levels, including characters, words, phrases, sentences, paragraphs, and texts. It serves as a bridge between machine language and human language. It aims to enable machines to understand, interpret, and generate human language, enabling effective communication between humans and machines and enabling computers to perform tasks such as language translation, sentiment analysis, and text summarization.
[0036] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0037] The test data generating method, apparatus, electronic device, and storage medium according to the embodiments of the present disclosure are described below with reference to the accompanying drawings.
[0038] It should be noted that the execution entity of the test data generation method of this embodiment is a test data generation device, which can be implemented by software and / or hardware. The device can be configured in an electronic device, and the electronic device can include but is not limited to a terminal, a server, etc.
[0039] Figure 1 It is a flowchart of a test data generation method proposed according to an embodiment of the present disclosure.
[0040] like Figure 1 As shown, the test data generation method includes:
[0041] S101: Obtain a user interface diagram to be tested.
[0042] In the embodiment of the present disclosure, the user interface diagram refers to a design diagram corresponding to the interface that currently needs to be tested during the front-end development process, which can be a user experience (UE) design diagram, in which the user interaction process, interface layout, and visual design are planned.
[0043] In the embodiment of the present disclosure, the user interface that currently needs to be tested may be determined first, and then a pre-designed user interface diagram corresponding to the user interface may be obtained.
[0044] S102: Analyze the user interface image to determine page information of the user interface.
[0045] The page information may include at least one of the following: page layout, text content, and the relationship between elements in the page.
[0046] In the embodiment of the present disclosure, image recognition technology and natural language processing technology can be used to parse the user interface diagram and identify at least one of the page layout, text content, and the relationship between elements in the page in the user interface diagram, so as to determine the page information of the user interface and generate a preliminary data structure framework.
[0047] In the present disclosure, by parsing and identifying the design drawing of the user interface, obtaining the page information of the user interface, and determining the data structure framework for generating test data, the degree of automation of test data generation can be improved, the workload of front-end developers can be reduced, and the efficiency of data structure generation can be improved.
[0048] S103: Generate reference virtual test data associated with page elements and an editing interface for the reference virtual test data according to the page information of the user interface.
[0049] The reference virtual test data refers to test data with a complete data structure, which refers to page elements (such as service interface call controls, dialog boxes, etc.) in the user interface to be tested.
[0050] It should be noted that since the test data generated based on the page information is not the data returned by the actual backend interface and may contain content that needs to be adjusted or configured, it is called reference virtual test data.
[0051] In the embodiment of the present disclosure, since there may be multiple page elements in a user interface, such as multiple service interface call controls, multiple dialog boxes, or both service interface call controls and dialog boxes, the tests between different page elements may be independent of each other or may be interrelated. Therefore, reference virtual test data associated with one or more page elements can be generated based on the page information of the user interface currently to be tested.
[0052] In an embodiment of the present disclosure, after obtaining the page information of the user interface, the data type, field name, field type and other information can be defined for each element in the page information to further refine the data structure, and the refined data structure can be filled with sample data to generate reference virtual test data associated with the page elements.
[0053] It's important to note that when defining data types, field names, and field types for each element in the page information, this information can be automatically generated based on the text descriptions and element relationships in the user interface diagram. Alternatively, if there are no text descriptions in the user interface diagram, this information can be generated based on experience. This improves the accuracy and completeness of the test data structure and avoids potential errors and issues during subsequent development.
[0054] In the embodiment of the present disclosure, after obtaining the reference virtual test data associated with the page elements, an editing interface may be generated for the developer to manually adjust the reference virtual test data or set other custom content.
[0055] It should be noted that in the present disclosure, for data called in different ways, such as through an interface call or a long connection call through a conversation, the return form and real-time requirements of the test data are different. For example, when calling test data through a long connection through a conversation, it is necessary to return corresponding data based on specific input or interaction scenarios, and support streaming return forms to improve the accuracy and real-time performance of the test data. Therefore, when generating test data, the calling method of the reference virtual test data can be determined based on the page elements corresponding to the reference virtual test data, and then the corresponding editing interface can be generated according to the calling method to provide different editing functions, such as modifying, setting trigger words, or setting the default return response content, etc.
[0056] S104: updating the reference virtual test data according to the information received in the editing interface to obtain target virtual test data associated with the page element.
[0057] In an embodiment of the present disclosure, information manually adjusted or configured by a developer can be received in the editing interface, such as the content after the name of a field in the reference virtual test information is modified, or the trigger words configured for the reference virtual test information, etc., to update the reference virtual test data, thereby obtaining the target virtual test data associated with the page elements.
[0058] In this embodiment, the acquired user interface image is first parsed to obtain page information. Reference virtual test data associated with the page elements is then generated from the page information. A corresponding editing interface is generated for each reference virtual test data. Based on the editing information received in the editing interface, the corresponding reference virtual test data is updated to generate target test data. This approach enables automated test data generation using images, improves test data generation efficiency, reduces the workload of front-end developers, and helps shorten development cycles. Furthermore, an editing interface is provided that allows personalized adjustment of test data or configuration of custom content, enhancing the flexibility and practicality of test data and enabling it to meet diverse testing requirements.
[0059] Figure 2 It is a flowchart of a test data generation method proposed in another embodiment of the present disclosure.
[0060] like Figure 2 As shown, the test data generation method includes:
[0061] S201: Obtain a user interface diagram to be tested.
[0062] S202: Analyze the user interface diagram to determine page information of the user interface.
[0063] S203: Generate reference virtual test data associated with page elements according to the page information of the user interface.
[0064] The description of the above S201 to S203 can be found in the above embodiment and will not be repeated here.
[0065] S204: Determine a data calling method corresponding to the target page element according to the type of the target page element associated with the reference virtual test data and / or the text content associated with the target page element.
[0066] The type of page element may be a control or button called by a service interface, or a dialog box, etc.
[0067] The text content associated with a page element refers to the text content annotated with the page element in the user interface diagram, which is used to describe the function of the page element.
[0068] In the disclosed embodiment, different reference virtual test data are respectively used to test the page elements associated therewith. For different types of page elements, the method of calling data may be different, such as calling through a common interface or calling through a long connection based on the full-duplex communication protocol WebSocket. Therefore, the information contained in the associated virtual test data may not be exactly the same, and it is necessary to generate an editing interface specifically to ensure the reliability of the test data.
[0069] For example, if a page element is a button, the data called by the page element is called through an interface. Or, if a page element triggers a dialog, the data call method corresponding to the page element is a persistent connection.
[0070] In the embodiment of the present disclosure, the function of the target page element can also be determined based on the text content associated with the target page element, such as calling a backend service with low real-time requirements, triggering online chat or real-time data push, etc., to determine its corresponding data calling method.
[0071] S205: Generate an editing interface for reference virtual test data according to the data calling method corresponding to the target page element.
[0072] In the disclosed embodiments, the return format and real-time requirements of test data are different for different data call methods, such as calling through an interface or calling through a long connection of a conversation. For example, when calling test data through a long connection of a conversation, it is necessary to return corresponding data based on specific input or interaction scenarios, and support streaming return forms to improve the accuracy and real-time performance of test data. Therefore, after determining the data call method corresponding to the target page element, the editing interface of the reference virtual test data associated with the target page element can be determined based on the data call method to provide different editing functions, such as modifying, setting trigger words, or setting default return response content, etc.
[0073] Optionally, the first editing interface may be generated when the data calling method corresponding to the target page element is an interface call.
[0074] In the embodiment of the present disclosure, the first editing interface only includes basic editing functions such as modifying, deleting or adding fields with respect to the reference virtual test data.
[0075] Alternatively, the second editing interface may be generated when the data calling mode corresponding to the target page element is a long connection call.
[0076] In the disclosed embodiment, when the data call method is a long connection call, it is necessary to return corresponding data based on specific input or interaction scenarios, as well as support streaming return forms. Therefore, compared with the first editing interface, the second editing interface adds configuration functions such as trigger words and default return message bodies. By providing different editing interfaces for different data call methods, the generated test data can simulate more realistic scenarios, improve the accuracy and reliability of the test data, and meet different testing requirements.
[0077] In this embodiment, the data calling method corresponding to the page element is determined by the type of page element and / or the associated text content, and then an editing interface for the test data associated with the page element is generated based on the data calling method, thereby improving the flexibility of test data generation and providing conditions for the test data to simulate different scenarios and improve the practicality of the test data.
[0078] S206: updating the reference virtual test data according to the information received in the editing interface to obtain target virtual test data associated with the page element.
[0079] The description of the above S206 can be found in the above embodiment and will not be repeated here.
[0080] It should be noted that when the editing interface is the second editing interface, developers can configure trigger words for the reference virtual test data in the first editing interface, so that corresponding data can be returned based on specific user input or interaction scenarios to simulate more realistic user interaction scenarios and improve the accuracy and reliability of test data.
[0081] Optionally, trigger information associated with the reference virtual test data may be determined based on the first input information received in the second editing interface, and then the trigger information is associated with the reference virtual test data to obtain target virtual test data associated with the page element.
[0082] The first input information is determined by the developer as needed, which is the content that can trigger the reply of corresponding reference virtual test data after the user inputs in the real-time interaction. The first input information can be a keyword, a phrase or a regular expression.
[0083] In the disclosed embodiment, the first input information received by the second editing interface can be used as trigger information (or trigger words) associated with the reference virtual test data corresponding to the second editing interface. The trigger information is then associated with the reference virtual test data to obtain target virtual test data associated with the page element. When simulating user interaction, the input information can be matched with the trigger information. If the match is successful, the target virtual test data associated with the successfully matched trigger information can be returned to the interaction interface. This can simulate more realistic user interaction scenarios and improve the accuracy and reliability of the test.
[0084] It should be noted that in order to ensure the continuity of simulation during user interaction and to meet different testing requirements, a default return message body can be configured for situations where no trigger information is matched, thus enhancing the flexibility and practicality of the virtual test data service.
[0085] Optionally, candidate test data associated with the target page element may be determined based on the second input information received in the second editing interface. The candidate test data may then be determined as return data when the target virtual test data associated with the target page element is unavailable.
[0086] The second input information may be various types of message bodies independently input by the developer, such as static text, pictures, videos, etc.
[0087] In an embodiment of the present disclosure, the second input information received by the second editing interface can be used as candidate test data associated with the target page element, and then determined as return data when the target virtual test data associated with the target page element is unavailable. When simulating user interaction, if the user input does not match the trigger information, it is returned to the user for response, thereby enhancing the flexibility and practicality of the test data service and being able to meet different testing needs.
[0088] Figure 3 It is a flowchart of a test data generation method proposed in another embodiment of the present disclosure.
[0089] like Figure 3 As shown, the test data generation method includes:
[0090] S301: Obtain a user interface diagram to be tested.
[0091] S302: Analyze the user interface diagram to determine page information of the user interface.
[0092] S303: Generate reference virtual test data associated with page elements according to the page information of the user interface.
[0093] The description of S301 to S303 can be found in the above embodiment and will not be repeated here.
[0094] S304: Determine the confidence of different contents in the reference virtual test data according to the confidence of the page information.
[0095] In the embodiment of the present disclosure, the importance of different elements in the user interface during the test process is different. The higher the importance, the higher the confidence of the corresponding page information, and the higher the confidence of the corresponding content in the generated reference virtual test data. This shows that the data structure or text description displayed in the user interface diagram plays a greater role in ensuring the reliability of the test. Modifications may affect the accuracy of the test and should not be easily modified.
[0096] S305: Determine editing attributes corresponding to different contents based on the confidence levels of different contents in the reference virtual test data.
[0097] In the embodiment of the present disclosure, the editing attributes of the corresponding content in the editing interface, such as editable or non-editable, can be determined according to the confidence level.
[0098] For example, a confidence threshold can be set as needed, and the corresponding editing attributes of content with confidence lower than the confidence threshold are determined to be editable, and the corresponding editing attributes of content with confidence higher than or equal to the confidence threshold are determined to be non-editable.
[0099] S306: Generate an editing interface for reference virtual test data based on the editing attributes corresponding to different contents.
[0100] In the embodiment of the present disclosure, an editing attribute may be added to the modification box of each part of the content in the editing interface of the reference virtual test data. When the editing attribute is non-editable, the modification box is locked and cannot be edited.
[0101] Optionally, the confidence level corresponding to each content can be displayed in the editing interface of the reference virtual test data, so that the user can intuitively determine the importance of each content in the editing interface, providing a reference for the user to determine whether to modify and how to modify, thereby improving the user experience.
[0102] S307: updating the reference virtual test data according to the information received in the editing interface to obtain target virtual test data associated with the page element.
[0103] The description of S307 can be found in the above embodiment and will not be repeated here.
[0104] In this embodiment, after the virtual test data is generated, different editing interfaces are generated according to the confidence levels of different contents in the virtual test data, thereby further improving the flexibility and reliability of the test data generation.
[0105] Figure 4 It is a flowchart of a test data generation method proposed in another embodiment of the present disclosure.
[0106] like Figure 4 As shown, the test data generation method includes:
[0107] S401: Obtain a user interface diagram to be tested.
[0108] S402: Analyze the user interface diagram to determine page information of the user interface.
[0109] S403: Generate reference virtual test data associated with page elements and an editing interface for the reference virtual test data according to the page information of the user interface.
[0110] S404: updating the reference virtual test data according to the information received in the editing interface to obtain target virtual test data associated with the page element.
[0111] The description of S401 to S404 can be found in the above embodiment and will not be repeated here.
[0112] S405: updating the format of the target virtual test data according to the corresponding data calling mode of the page element.
[0113] In the disclosed embodiment, after obtaining the target virtual test data associated with a page element, the format of the target virtual test data can be updated to generate a service link, allowing developers to call the virtual test data service through the link. Depending on the data call method, the generated service link can be a regular link or a long link.
[0114] In the embodiment of the present disclosure, for page elements whose corresponding data calling method is a long connection call, the corresponding target virtual test data can be converted into a mock service supported by real-time communication technologies such as WebSocket, and a service link that can be called is generated, thereby achieving decoupling of front-end and back-end development, accelerating the development process, and improving development efficiency.
[0115] It should be noted that in the test data generation method proposed in the present disclosure, a streaming return format can also be configured in the editing interface, which can return partial results after processing a part of the test task, thereby reducing the delay in the test process and enabling the test data to be applied in scenarios with higher real-time requirements.
[0116] Figure 5 It is a structural diagram of a test data generating device proposed in one embodiment of the present disclosure.
[0117] like Figure 5 As shown, the test data generating device 50 includes:
[0118] An acquisition module 501 is used to acquire a user interface diagram to be tested;
[0119] The parsing module 502 is configured to parse the user interface diagram to determine page information of the user interface, wherein the page information includes at least one of the following: page layout, text content, and relationships between elements on the page;
[0120] A generating module 503 is configured to generate reference virtual test data associated with page elements and an editing interface for the reference virtual test data according to page information of the user interface;
[0121] The updating module 504 is configured to update the reference virtual test data according to the information received in the editing interface to obtain target virtual test data associated with the page elements.
[0122] In some embodiments, the generation module 503 may be specifically configured to:
[0123] Determine a data calling method corresponding to the target page element based on the type of the target page element associated with the reference virtual test data and / or the text content associated with the target page element;
[0124] According to the data calling method corresponding to the target page element, an editing interface for reference virtual test data is generated.
[0125] In some embodiments, the generation module 503 may be specifically configured to:
[0126] When the data calling mode corresponding to the target page element is interface calling, a first editing interface is generated;
[0127] When the data calling mode corresponding to the target page element is a long connection call, a second editing interface is generated.
[0128] In some embodiments, the generation module 503 may be specifically configured to:
[0129] determining trigger information associated with the reference virtual test data based on the first input information received on the second editing interface;
[0130] The trigger information is associated with the reference virtual test data to obtain target virtual test data associated with the page element.
[0131] In some embodiments, the generating module 503 may also be used to:
[0132] Determining candidate test data associated with the target page element based on the second input information received in the second editing interface;
[0133] The candidate test data is determined as the return data when the target virtual test data associated with the target page element is unavailable.
[0134] In some embodiments, the generation module 503 may be specifically configured to:
[0135] Determining the confidence of different contents in the reference virtual test data according to the confidence of the page information;
[0136] Determining editing attributes corresponding to different contents based on the confidence levels of different contents in the reference virtual test data;
[0137] Based on the editing attributes corresponding to different contents, an editing interface for reference virtual test data is generated.
[0138] In some embodiments, the generating module 503 may also be used to:
[0139] In the editing interface of the reference virtual test data, the confidence level corresponding to each content is displayed.
[0140] In some embodiments, the update module 504 may also be used to:
[0141] According to the corresponding data calling mode of the page element, the format of the target virtual test data is updated.
[0142] It should be noted that the above explanation of the test data generating method is also applicable to the test data generating device of this embodiment and will not be repeated here.
[0143] In this embodiment, the acquired user interface image is first parsed to obtain page information. Reference virtual test data associated with the page elements is then generated from the page information. A corresponding editing interface is generated for each reference virtual test data. Based on the editing information received in the editing interface, the corresponding reference virtual test data is updated to generate target test data. This approach enables automated test data generation using images, improves test data generation efficiency, reduces the workload of front-end developers, and helps shorten development cycles. Furthermore, an editing interface is provided that allows personalized adjustment of test data or configuration of custom content, enhancing the flexibility and practicality of test data and enabling it to meet diverse testing requirements.
[0144] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0145] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0146] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the device 600 can also be stored in the RAM 603. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0147] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as a keyboard, mouse, etc.; output unit 607, such as various types of displays, speakers, etc.; storage unit 608, such as a magnetic disk, optical disk, etc.; and communication unit 609, such as a network card, modem, wireless communication transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0148] The computing unit 601 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the test data generation method. For example, in some embodiments, the test data generation method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the test data generation method described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to perform the test data generation method by any other appropriate means (e.g., by means of firmware).
[0149] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0150] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0151] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0152] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0153] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0154] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.
[0155] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0156] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In the description of the present disclosure, the words "if" and "if" used can be interpreted as "at the time of" or "when" or "in response to a determination" or "under the circumstances of".
[0157] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A test data generation method, comprising: Get the user interface diagram to be tested; Parsing the user interface diagram to determine page information of the user interface, wherein the page information includes at least one of the following: page layout, text content, and relationships between elements on the page; generating reference virtual test data associated with the page elements and an editing interface for the reference virtual test data according to the page information of the user interface; The reference virtual test data is updated according to the information received in the editing interface to obtain the target virtual test data associated with the page element.
2. The method according to claim 1, wherein The process of generating the editing interface of the reference virtual test data includes: Determining a data calling method corresponding to the target page element according to the type of the target page element associated with the reference virtual test data and / or the text content associated with the target page element; An editing interface for the reference virtual test data is generated according to the data calling method corresponding to the target page element.
3. The method according to claim 2, wherein: Generating the editing interface of the reference virtual test data according to the data calling mode corresponding to the target page element includes any one of the following: In a case where the data calling mode corresponding to the target page element is interface calling, generating a first editing interface; When the data calling mode corresponding to the target page element is a long connection calling mode, a second editing interface is generated.
4. The method according to claim 3, wherein: The updating of the reference virtual test data according to the information received in the editing interface to obtain the target virtual test data associated with the page element includes: determining trigger information associated with the reference virtual test data according to first input information received in the second editing interface; The trigger information is associated with the reference virtual test data to obtain target virtual test data associated with the page element.
5. The method according to claim 3, wherein: The method further comprises: determining candidate test data associated with the target page element according to second input information received in the second editing interface; The candidate test data is determined as return data when the target virtual test data associated with the target page element is unavailable.
6. The method of claim 1, wherein: The process of generating the editing interface of the reference virtual test data includes: determining the confidence levels of different contents in the reference virtual test data according to the confidence levels of the page information; Determining editing attributes corresponding to the different contents based on the confidence levels of the different contents in the reference virtual test data; An editing interface for the reference virtual test data is generated based on the editing attributes corresponding to the different contents.
7. The method according to claim 6, wherein: The method further comprises: In the editing interface of the reference virtual test data, the confidence level corresponding to each content is displayed.
8. The method according to any one of claims 1 to 7, wherein: After obtaining the target virtual test data associated with the page element, the method further includes: The format of the target virtual test data is updated according to the corresponding data calling mode of the page element.
9. A test data generating device comprising: An acquisition module is used to obtain the user interface diagram to be tested; a parsing module, configured to parse the user interface diagram to determine page information of the user interface, wherein the page information includes at least one of the following: page layout, text content, and relationships between elements on the page; A generating module, configured to generate reference virtual test data associated with the page elements and an editing interface for the reference virtual test data according to the page information of the user interface; An updating module is used to update the reference virtual test data according to information received in the editing interface to obtain target virtual test data associated with the page element.
10. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the test data generating method according to any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to enable the computer to execute the test data generating method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the test data generating method according to any one of claims 1 to 8 when being executed by a processor.