CN114896165A - Testing method and device of conversation robot system, electronic equipment and storage medium - Google Patents

Testing method and device of conversation robot system, electronic equipment and storage medium Download PDF

Info

Publication number
CN114896165A
CN114896165A CN202210607775.XA CN202210607775A CN114896165A CN 114896165 A CN114896165 A CN 114896165A CN 202210607775 A CN202210607775 A CN 202210607775A CN 114896165 A CN114896165 A CN 114896165A
Authority
CN
China
Prior art keywords
test
response
robot system
request
test case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210607775.XA
Other languages
Chinese (zh)
Inventor
孙秋成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN202210607775.XA priority Critical patent/CN114896165A/en
Publication of CN114896165A publication Critical patent/CN114896165A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

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

Abstract

The present disclosure relates to a testing method, apparatus, electronic device, storage medium, and computer program product for a conversation robot system. The method comprises the following steps: acquiring a test case corresponding to a response test task of the session robot system; generating a response test request corresponding to the test case according to the test method corresponding to the test case; sending the response test request to a session robot system, wherein the session robot system is used for responding to the session content carried by the response test request and outputting corresponding actual response content; and receiving actual response content returned by the conversation robot system, and determining a test result corresponding to the response test task according to the actual response content. According to the method and the device, the response test request can be generated and the session robot system can be triggered to respond according to the test method corresponding to the test case after the test case is obtained, the inquiry information for testing the session robot system is prevented from being manually input one by one, and the test efficiency of the session robot system is effectively improved.

Description

Testing method and device of conversation robot system, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of automated testing, and in particular, to a method and an apparatus for testing a session robot system, an electronic device, a storage medium, and a computer program product.
Background
With the development of computer technology, the interaction between users and the conversation robot system is increased. In the interaction process, the client can generate a request after receiving query information input by a user and send the request to the conversation robot system, and the conversation robot system is triggered to return corresponding reply information according to the received request, so that the effect of timely response is achieved. To ensure that the user can obtain correct reply information, the session robot system is often required to be tested.
In the related art, a tester can input session content for testing on a client, send the session content to a session robot system, and obtain a test result according to reply information of the session robot system.
However, in the above-mentioned testing method, the tester needs to manually input a plurality of session contents one by one to perform a multi-aspect test on the session robot system, which causes a problem of low testing efficiency.
Disclosure of Invention
The present disclosure provides a testing method and apparatus for a session robot system, an electronic device, a storage medium, and a computer program product, so as to at least solve the problem of low testing efficiency of the session robot system in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided a testing method of a conversation robot system, including:
acquiring a test case corresponding to a response test task of the session robot system;
generating a response test request corresponding to the test case according to the test method corresponding to the test case;
sending the response test request to the session robot system, wherein the session robot system is used for responding to the session content carried by the response test request and outputting corresponding actual response content;
and receiving the actual response content returned by the session robot system, and determining a test result corresponding to the response test task according to the actual response content.
In an exemplary embodiment, the generating a response test request corresponding to the test case according to the test method corresponding to the test case includes:
importing the test case parameters corresponding to the test case into the test method corresponding to the test case;
and constructing a response test request corresponding to the test case based on the test case parameters according to the test request generation mode indicated by the test method, and determining a request sending condition corresponding to the response test request.
In an exemplary embodiment, the test case parameters are multiple groups of test case parameters, the test method is multiple test methods for different types of session contents, and the importing the test case parameters corresponding to the test case into the test method corresponding to the test case includes:
acquiring parameter type labels of each group of test case parameters;
for each test method, acquiring target test case parameters from the multiple groups of test case parameters, and importing the target test case parameters into the test method; and the parameter type label of the target test case parameter is matched with the session content type of the test method.
In an exemplary embodiment, the sending the answer test request to the conversation robot system includes:
responding to a request sending condition corresponding to the response test request, and calling a preset virtual client to send the response test request to a remote process calling interface of the session robot system; the remote procedure call interface is used for responding the response test request and calling the semantic recognition service to recognize the session content carried by the response test request and output the corresponding actual response content.
In an exemplary embodiment, the receiving the actual response content returned by the conversation robot system includes:
receiving a response message returned by the session robot system aiming at the response test request;
and analyzing the response message according to the transmission protocol corresponding to the response test request to obtain the actual response content carried by the response message.
In an exemplary embodiment, the determining a test result corresponding to the response test task according to the actual response content includes:
obtaining expected response content corresponding to the test case;
determining the test result of the conversational robot system based on a difference between the expected response content and the actual response content.
In an exemplary embodiment, after determining a test result corresponding to the response test task according to the actual response content, the method further includes:
and acquiring a preset test report template, and generating a test report according to the test result and the test report template.
According to a second aspect of the embodiments of the present disclosure, there is provided a testing apparatus of a conversation robot system, including:
the test case acquisition unit is configured to execute the acquisition of a test case corresponding to a response test task of the conversation robot system;
the request generating unit is configured to execute a test method corresponding to the test case and generate a response test request corresponding to the test case;
a request sending unit configured to execute sending the response test request to the session robot system, wherein the session robot system is used for responding to the session content carried by the response test request and outputting corresponding actual response content;
and the test result acquisition unit is configured to execute receiving of the actual response content returned by the conversation robot system and determine a test result corresponding to the response test task according to the actual response content.
In an exemplary embodiment, the request generating unit includes:
the parameter import module is configured to import the test case parameters corresponding to the test cases into the test methods corresponding to the test cases;
and the request construction module is configured to execute a test request generation mode indicated by the test method, construct a response test request corresponding to the test case based on the test case parameters, and determine a request sending condition corresponding to the response test request.
In an exemplary embodiment, the test case parameters are multiple groups of test case parameters, the test methods are multiple test methods for different types of session contents, and the parameter importing module is specifically configured to execute:
acquiring parameter type labels of each group of test case parameters;
for each test method, acquiring target test case parameters from the multiple groups of test case parameters, and importing the target test case parameters into the test method; and the parameter type label of the target test case parameter is matched with the session content type of the test method.
In an exemplary embodiment, the request sending unit is specifically configured to perform:
responding to a request sending condition corresponding to the response test request, and calling a preset virtual client to send the response test request to a remote process calling interface of the session robot system; the remote procedure call interface is used for responding the response test request and calling the semantic recognition service to recognize the session content carried by the response test request and output the corresponding actual response content.
In an exemplary embodiment, the test result obtaining unit is specifically configured to perform:
receiving a response message returned by the session robot system aiming at the response test request;
and analyzing the response message according to the transmission protocol corresponding to the response test request to obtain the actual response content carried by the response message.
In an exemplary embodiment, the test result obtaining unit is specifically configured to perform:
obtaining expected response content corresponding to the test case;
determining the test result of the conversational robot system based on a difference between the expected response content and the actual response content.
In an exemplary embodiment, the apparatus further comprises:
and the test report generating unit is configured to acquire a preset test report template and generate a test report according to the test result and the test report template.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement a method of testing a conversational robot system as claimed in any one of the above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions, when executed by a processor of an electronic device, enable the electronic device to perform a method of testing a conversation robot system as described in any one of the above.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising instructions which, when executed by a processor of an electronic device, enable the electronic device to perform the method of testing a conversational robot system as described in any one of the above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the terminal can obtain a test case corresponding to a response test task of the session robot system, a response test request corresponding to the test case is generated according to a test method corresponding to the test case, the response test request is further sent to the session robot system, the session robot system can respond to session content carried by the response test request and output corresponding actual response content, and then the terminal can receive the actual response content returned by the session robot system and determine a test result corresponding to the response test task according to the actual response content. According to the method and the device, after the test case is obtained, the response test request can be automatically generated and the session robot system is triggered to respond according to the test method corresponding to the test case, the condition that the query information for testing the session robot system is manually input one by one is avoided, and the test efficiency of the session robot system is effectively improved.
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 present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a diagram illustrating an application environment of a method for testing a conversational robot system, according to an example embodiment.
FIG. 2 is a flow chart illustrating a method of testing a conversational robotic system, according to an example embodiment.
FIG. 3 is a flowchart illustrating a step of generating a response test request in accordance with an exemplary embodiment.
Fig. 4 is a flowchart illustrating a step of obtaining actual response content according to an exemplary embodiment.
FIG. 5 is a flow chart illustrating another method of testing a conversational robotic system, according to an example embodiment.
FIG. 6 is a block diagram illustrating a testing apparatus of a conversational robotic system, according to an example embodiment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in 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 above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) referred to in the present disclosure are both information and data that are authorized by the user or sufficiently authorized by various parties.
The testing method of the session robot system provided by the present disclosure can be applied to an application environment as shown in fig. 1, where the application environment may include a terminal and the session robot system, and the terminal may communicate with the session robot system through a network. The conversation robot system can carry out semantic recognition on information sent by a user and return corresponding response content to simulate human and user conversation, can be provided with a corresponding data storage system, and can store data to be processed and called by the conversation robot system.
In the disclosure, a terminal may obtain a test case corresponding to a response test task for a session robot system, and generate a response test request corresponding to the test case according to a test method corresponding to the test case, and further may send the response test request to the session robot system, after receiving the response test request, the session robot system may respond to session content carried by the response test request, and output corresponding actual response content, and after receiving actual response content returned by the session robot system, the terminal may determine a test result corresponding to the response test task according to the actual response content. The terminal may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The conversation robot system can be realized by an independent server or a server cluster consisting of a plurality of servers.
Fig. 2 is a flowchart illustrating a testing method of a session robot system according to an exemplary embodiment, and as shown in fig. 2, for example, the method is used in a terminal, and may include the following steps.
In step S210, a test case corresponding to the response test task for the session robot system is acquired.
As an example, the answer test task may be a task that tests the performance of the conversational robot system in interacting with the user's answer, such as testing how the conversational robot system answers received conversational content.
The test case may be a task description for the response test task, and may embody test contents or policies in the response test task, and the contents of the test case may include, for example, at least one of the following: test case parameters, test targets, test steps, expected results.
In practical application, a corresponding test case can be constructed for a response test task of the session robot system in advance, and then when the terminal performs a response test on the session robot, the test case corresponding to the response test task can be obtained.
In step S220, a response test request corresponding to the test case is generated according to the test method corresponding to the test case.
As an example, the test method may be used to indicate a generation manner of the response test request, for example, the test method may be a request generation logic for generating a response test request of a specified type, or may be a model or function for generating a response test request.
The response test request may be information for requesting the conversation robot system to respond to the specified conversation content, in other words, the response test request may trigger the conversation robot system to respond to the specified conversation content, wherein the specified conversation content may be determined based on the test case.
After the test case corresponding to the response test task is obtained, the test method corresponding to the test case can be determined. Each test case may be a test case set for a specified session content, for example, the session content may be text or picture, or may include both text and picture, and the test cases for testing different types of session content may have corresponding test methods, respectively, and after obtaining the test cases, the test methods corresponding to the test cases may be obtained, and response test requests corresponding to the test cases may be generated according to the test methods.
In step S230, the response test request is sent to the session robot system, and the session robot system is configured to output corresponding actual response content in response to the session content carried in the response test request.
After generating the response test request, the request may be sent to the conversational robotic system. The session robot system may respond to the received response test request, analyze the request, obtain session content (the session content may also be referred to as a test query) carried in the response test request, and acquire and output actual response content for the session content.
In step S240, the actual response content returned by the session robot system is received, and the test result corresponding to the response test task is determined according to the actual response content.
In a specific implementation, the conversation robot system can return the actual response content to the terminal after outputting the actual response content. After receiving the actual response content, the terminal may determine a test result of the response test task according to the actual response content.
In the test method of the session robot system, the terminal can obtain the test case corresponding to the response test task of the session robot system, generate the response test request corresponding to the test case according to the test method corresponding to the test case, and further send the response test request to the session robot system, the session robot system can respond to the session content carried by the response test request and output the corresponding actual response content, and the terminal can receive the actual response content returned by the session robot system and determine the test result corresponding to the response test task according to the actual response content. According to the method and the device, after the test case is obtained, the response test request can be automatically generated and the session robot system is triggered to respond according to the test method corresponding to the test case, the condition that the query information for testing the session robot system is manually input one by one is avoided, and the test efficiency of the session robot system is effectively improved.
In an exemplary embodiment, as shown in fig. 3, in step S220, generating a response test request corresponding to the test case according to the test method corresponding to the test case may include:
in step S310, test case parameters corresponding to the test case are imported into the test method corresponding to the test case.
As an example, the test case parameters may be parameter information for describing test case contents, and the test case parameters may include at least one of the following information: session content, answer test account number, answer test request type. The session content can include text-form session content and/or picture-form session content, and specific text information can be set through test case parameters aiming at the text-form session content; or, the session content may be set by the test case parameters and generated by clicking preset information, for example, in an actual application, after the session robot returns response content for information sent by the user client, options of "solved" and "unsolved" may be provided correspondingly, or an associated problem option may be provided for a problem sent by the user, the user may trigger the user client to send corresponding text information by clicking any option, without manual input by the user, and in this embodiment, the text information may also be set by the test case parameters and generated by clicking the preset option, so as to simulate various dialog scenarios between the user and the session robot system in an actual response process.
In practical application, after the test case is obtained, the parameters of the test case can be obtained and introduced into the test method corresponding to the test case, so that the test method can receive the relevant parameters for generating the response test request. For example, the test case parameters may be recorded in a table file, for example, the test case parameters are pre-stored in an Excel table, and when the terminal acquires the test case parameters of the test case, the terminal may acquire the test case parameters from the table data reading tool, for example, the test case parameters are read by an xlrd tool, where the xlrd tool is an extension tool used for reading Excel table information in Python language.
In step S320, a response test request corresponding to the test case is constructed based on the test case parameters according to the test request generation manner indicated by the test method, and a request sending condition corresponding to the response test request is determined.
After the test case parameters are imported into the test method, a response test request corresponding to the test case can be constructed according to a test request generation mode indicated by the test method and by combining the test case parameters, and a request sending condition corresponding to the constructed response test request can be determined based on the test case parameters.
For example, when executing a test method, one or more test methods may be stored in a record file of the test method in advance, and the terminal may import test case parameters into a preset test framework, and execute each test in the record file one by one through the test framework, where the test framework may also be referred to as an automation test framework, and may provide a reusable basic automation test module, for example, the preset test framework may be a pytest framework, which is a test framework for Python language, and when executing the test case, the test framework may execute a test method at the beginning of a test in a record file in a preset directory _ py format or an _ test.
In this embodiment, by importing the test case parameters corresponding to the test case into the test method corresponding to the test case, constructing the response test request corresponding to the test case based on the test case parameters according to the test request generation manner indicated by the test method, and determining the request sending condition corresponding to the response test request, the corresponding test request can be quickly constructed based on the test case parameters, so that a tester is prevented from generating the response test request by compiling a large number of coding manners, and the test efficiency of the session robot system is effectively improved.
In an exemplary embodiment, the test case may include a plurality of test cases, each test case has a corresponding set of test case parameters, and accordingly, the test case parameters are a plurality of sets of test case parameters, and the test method may be a plurality of test methods for different types of session contents, and in step S310, importing the test case parameters corresponding to the test case into the test method corresponding to the test case may include:
acquiring parameter type labels of each group of test case parameters; aiming at each test method, acquiring target test case parameters from multiple groups of test case parameters, and importing the target test case parameters into the test method; and matching the parameter type labels of the target test case parameters with the session content types of the test methods.
As an example, the parameter type tag may indicate the type of session content tested by the test case parameters.
In a specific implementation, the parameter type labels may be set in advance for the test case parameters corresponding to each group of test cases. After reading the multiple groups of test case parameters, the multiple test methods can be obtained, the parameter type label of each group of test case parameters is read, further, for each test method, the target test case parameters corresponding to the test method can be obtained from the multiple groups of test cases, and then the target test case parameters are imported into the test method. In other words, in this embodiment, multiple groups of test case parameters may be screened through the parameter type tag, for example, after the test instruction is received, the session content type to be tested indicated by the test instruction may be determined, and further, for the session content type, according to the parameter type tag, the matched test case parameters may be obtained from the read multiple groups of test case parameters, and the test case parameters are introduced into the corresponding test method.
In this embodiment, by obtaining the parameter type labels of each group of test case parameters, obtaining the target test case parameters from the groups of test case parameters according to the parameter type labels for each test method, and importing the target test case parameters into the test method, the test case parameters can be correctly imported into the matched test method, and the accuracy of the generated response test request is ensured.
In an exemplary embodiment, in step S230, sending the response test request to the conversation robot system may include the steps of:
responding to a request sending condition corresponding to the response test request, and calling a preset virtual client to send the response test request to a remote process calling interface of the session robot system; the remote procedure call interface is used for responding to the response test request and calling the semantic recognition service to recognize the session content carried by the response test request and output the corresponding actual response content.
In a specific implementation, a virtual client, also called a test client, created by simulating a client (such as a client App installed on a user mobile terminal) that has been released for use may be pre-packaged, and may be used as an object for sending a response test request to the session robot system during a session robot system test process.
After the test case parameters corresponding to the test case are imported into the test method corresponding to the test case, a response test request can be constructed and a request sending condition corresponding to the request can be determined. When detecting that the request sending condition is satisfied, the terminal may invoke a Remote Procedure Call (rpc) interface where the virtual client sends a response test request to the session robot system. Specifically, for example, the terminal may construct rpc a request (e.g., a grpc request) and, when a request sending condition is satisfied, invoke the virtual client, which sends rpc the request to a rpc interface (e.g., a grpc interface) of the session robot system.
After the session robot system receives the response test request through the remote process call interface, the remote process call interface can respond to the response test request, call a pre-constructed semantic recognition server to recognize session contents carried in the response test request, and output corresponding actual response contents according to recognition results. For example, after receiving the response test request, the remote process call interface may preprocess the response test request through a console of the session robot system, and the console may further perform rule configuration, and further may invoke a semantic recognition service to recognize the preprocessed response test request, obtain session content carried therein, and match actual response content whose confidence level meets a preset condition in a preset knowledge base through means such as vector retrieval, an algorithm model, and the like.
In this embodiment, in response to a request sending condition corresponding to a response test request being met, a preset virtual client may be called to send the response test request to a remote procedure call interface of the session robot system, where the remote procedure call interface is used to respond to the response test request, and a semantic recognition service may be called to recognize session content carried by the response test request and output corresponding actual response content.
In an exemplary embodiment, as shown in fig. 4, the receiving the actual response content returned by the conversational robot system in step S240 may include:
in step S41O, a response message returned by the conversation robot system in response to the response test request is received.
In a specific implementation, when the terminal communicates with the session robot system, the terminal may communicate through a preset transmission Protocol, and the preset transmission Protocol may use a Protocol of a serialized data structure that is platform-independent, language-independent, extensible, lightweight, and efficient, and can be used for network communication and data storage, for example, when the response test request is a grpc request, data transmission between the terminal and the session robot system may be performed through a Protocol bus (google Protocol buffer) data Protocol, and the Protocol may be used to define a serialized data format for data exchange. When the conversation robot system communicates based on a preset transmission protocol, if the conversation robot system responds to the response test request and outputs the actual response content, a response message can be generated based on the actual response content, and the response message can be a data object.
In step S42O, the response message is parsed according to the transmission protocol corresponding to the response test request, so as to obtain the actual response content carried by the response message.
And then after receiving the response message returned by the session robot system, analyzing the response message according to the transmission protocol corresponding to the response test request to obtain the actual response content carried by the response message. For example, when the response test request is a grpc request, the terminal and the session robot system communicate via a ProtoBuf protocol, a response message returned by the session robot system may be a pb (ProtoBuf) data object, and when the terminal executes a test method via a preset test framework (e.g., a pytest framework, which is an open source software test framework for Python language), the test framework cannot directly process the data object, the response message may be parsed based on the ProtoBuf protocol, and actual response content, such as a string (string), that the test framework can tell is obtained according to a parsing result.
In this embodiment, the response message returned by the session robot system in response to the response test request may be received, and the response message may be analyzed according to the transmission protocol corresponding to the response test request, so as to obtain the actual response content carried by the response message, accurately identify the actual response content returned by the session robot system, and provide a basis for subsequently obtaining a reliable test result.
In an exemplary embodiment, in step S240, determining a test result corresponding to the response test task according to the actual response content includes:
obtaining expected response content corresponding to the test case; based on the difference between the expected response content and the actual response content, a test result of the conversation robot system is determined.
Specifically, for each test case, corresponding expected response content may be preset for the session content of the test case, and the expected response content may be a correct reply for the session content. After receiving the actual response content returned by the conversation robot system, the terminal may obtain the expected response content corresponding to the test case, and determine the test result of the conversation robot system based on the difference between the expected response content and the actual response content, for example, if the difference degree between the actual response content and the expected response content is less than or equal to a preset threshold value, it may be determined that the test is passed, and if the difference degree between the actual response content and the expected response content is greater than the preset threshold value, it may be determined that the test is failed.
In practical applications, it is also possible to make an assertion (assertion) based on the contents of the expected response and the contents of the actual response (assertion is a kind of first-order logic in a program), and to take the result of the assertion as a test result.
In the embodiment, expected response content corresponding to the test case can be obtained, the test result of the conversation robot system is determined based on the difference between the expected response content and the actual response content, and an accurate and reliable test report can be quickly obtained.
In an exemplary embodiment, after step S240, the method may further include the steps of:
and acquiring a preset test report template, and generating a test report according to the test result and the test report template.
In specific implementation, a test report template may be preset, for example, a plurality of layout contents may be preset in the test report template, and a display style of the layout contents may also be predefined for each layout content. And then after obtaining the test result, obtaining a preset test report template, and generating a test report according to the test result and the test report template, for example, importing the test result into the test report template to obtain a test report in html format.
In the embodiment, the test report can be generated according to the test result and the preset test report template, so that the problem that the quality of the test report is uneven due to manual writing of the test report can be avoided, the report standard is unified, the test report responding to the test task does not need to be manually sorted by testers, and the test efficiency is improved.
In order to enable those skilled in the art to better understand the above steps, the embodiments of the present disclosure are illustrated below by way of an example, but it should be understood that the embodiments of the present disclosure are not limited thereto.
In practical application, a mobile phone client can be downloaded and installed in advance on a mobile phone of a user, when related information needs to be inquired for the session robot system, the user can input a problem at the mobile phone client and send the problem to the back end of the client through the mobile phone client, and then remote process call service (such as grpc service) of the session robot system is called through the back end of the client.
In some ways of testing the conversation robot system, a tester can repeat the process of using the conversation robot system by a user, and input a plurality of problems for testing in a mobile phone one by one; or, the test may be performed by using a test tool (e.g., a meter) of the third-party platform, and during the test, a channel for sending the remote procedure call request may be defined by using an interface test function of the test tool, and a corresponding request may be constructed by writing a related code according to the channel definition content, and after the request is constructed, the request may be sent to the interface of the session robot system, and a test result may be obtained according to information returned by the session robot system. However, the former needs to be manually input one by one, the latter also needs a tester to write a large number of resource packages such as jar packages for code generation requests, and the tester needs to manually write a test report after the test is finished, so that the problem that the testing efficiency of the session robot system is low exists.
Based on this, the present disclosure provides a testing method for a session robot system, as shown in fig. 5, a tester may pre-configure a test case set through a form file, and set up an applicable testing method, where the test case set records test case parameters corresponding to a plurality of test cases. During testing, the terminal can call xlrd to read test case parameters recorded in the form file and transmit the test case parameters to a pytest test framework, and further, when the test framework executes a test method, the test case parameters can be led into a corresponding test method, a response test request is generated according to the test method, and meanwhile, a pre-packaged public virtual client is called to send the response test request to a grpc interface of the session robot system. Aiming at a received response test request, the session robot system can call a semantic recognition service to recognize the response test request, actual response content aiming at a recognition result is obtained, a pb data object is generated according to a transmission protocol ProtoBuf corresponding to the response test request and returned to a virtual client, the virtual client forwards the data object to a terminal, the terminal can obtain actual response content which can be used as assertion after calling a method for analyzing the pb data object, the actual response content can be transmitted to a pytest framework, the pytest framework can obtain corresponding expected response content from a test case set, the expected response content and the actual response content are asserted, and a test report is generated according to the assertion result.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
It is understood that the same/similar parts between the embodiments of the method described above in this specification can be referred to each other, and each embodiment focuses on the differences from the other embodiments, and it is sufficient that the relevant points are referred to the descriptions of the other method embodiments.
Based on the same inventive concept, the embodiment of the present disclosure further provides a testing apparatus for a conversation robot system, which is used for implementing the above-mentioned testing method for the conversation robot system.
FIG. 6 is a block diagram of a testing apparatus of a conversational robotic system, shown in accordance with an example embodiment. Referring to fig. 6, the apparatus includes a test case acquisition unit 601, a request generation unit 602, a request transmission unit 603, and a test result acquisition unit 604.
A test case obtaining unit 601 configured to execute obtaining of a test case corresponding to a response test task for the session robot system;
a request generating unit 602 configured to execute a response test request corresponding to the test case according to a test method corresponding to the test case;
a request sending unit 603 configured to execute sending the response test request to the session robot system, where the session robot system is configured to output corresponding actual response content in response to the session content carried in the response test request;
a test result obtaining unit 604, configured to execute receiving the actual response content returned by the session robot system, and determine a test result corresponding to the response test task according to the actual response content.
In an exemplary embodiment, the request generating unit includes:
the parameter import module is configured to import the test case parameters corresponding to the test cases into the test methods corresponding to the test cases;
and the request construction module is configured to execute a test request generation mode indicated by the test method, construct a response test request corresponding to the test case based on the test case parameters, and determine a request sending condition corresponding to the response test request.
In an exemplary embodiment, the test case parameters are multiple groups of test case parameters, the test methods are multiple test methods for different types of session contents, and the parameter importing module is specifically configured to execute:
acquiring parameter type labels of each group of test case parameters;
for each test method, acquiring target test case parameters from the multiple groups of test case parameters, and importing the target test case parameters into the test method; and the parameter type label of the target test case parameter is matched with the session content type of the test method.
In an exemplary embodiment, the request sending unit is specifically configured to perform:
responding to a request sending condition corresponding to the response test request, and calling a preset virtual client to send the response test request to a remote process calling interface of the session robot system; the remote procedure call interface is used for responding the response test request and calling the semantic recognition service to recognize the session content carried by the response test request and output the corresponding actual response content.
In an exemplary embodiment, the test result obtaining unit is specifically configured to perform:
receiving a response message returned by the session robot system aiming at the response test request;
and analyzing the response message according to the transmission protocol corresponding to the response test request to obtain the actual response content carried by the response message.
In an exemplary embodiment, the test result obtaining unit is specifically configured to perform:
obtaining expected response content corresponding to the test case;
determining the test result of the conversational robot system based on a difference between the expected response content and the actual response content.
In an exemplary embodiment, the apparatus further comprises:
and the test report generating unit is configured to acquire a preset test report template and generate a test report according to the test result and the test report template.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The modules in the testing device of the session robot system can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Fig. 7 is a block diagram illustrating an electronic device 700 for implementing a method for testing a conversational robotic system, according to an example embodiment. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a gaming console, a tablet device, a medical device, an exercise device, a personal digital assistant, and so forth.
Referring to fig. 7, electronic device 700 may include one or more of the following components: processing component 702, memory 704, power component 706, multimedia component 708, audio component 710, input/output (I/O) interface 712, sensor component 714, and communication component 716.
The processing component 702 generally controls overall operation of the electronic device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 702 may include one or more processors 720 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 702 may include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operations at the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 704 may be implemented by any type or combination of volatile or non-volatile storage 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 disk, optical disk, or graphene memory.
The power supply component 706 provides power to the various components of the electronic device 700. The power components 706 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 700.
The multimedia component 708 includes a screen providing an output interface between the electronic device 700 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 700 is in an operation 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 a focal length and optical zoom capability.
The audio component 710 is configured to output and/or input audio signals. For example, the audio component 710 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 may detect an open/closed state of the electronic device 700, the relative positioning of components, such as a display and keypad of the electronic device 700, the sensor assembly 714 may also detect a change in the position of the electronic device 700 or components of the electronic device 700, the presence or absence of user contact with the electronic device 700, the orientation or acceleration/deceleration of the device 700, and a change in the temperature of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 714 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 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 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 electronic device 700 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, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 704 comprising instructions, executable by the processor 720 of the electronic device 700 to perform the above-described method is also provided. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided that includes instructions executable by the processor 720 of the electronic device 700 to perform the above-described method.
It should be noted that the descriptions of the above-mentioned apparatus, the electronic device, the computer-readable storage medium, the computer program product, and the like according to the method embodiments may also include other embodiments, and specific implementations may refer to the descriptions of the related method embodiments, which are not described in detail herein.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for testing a conversational robot system, comprising:
acquiring a test case corresponding to a response test task of the session robot system;
generating a response test request corresponding to the test case according to the test method corresponding to the test case;
sending the response test request to the session robot system, wherein the session robot system is used for responding to the session content carried by the response test request and outputting corresponding actual response content;
and receiving the actual response content returned by the session robot system, and determining a test result corresponding to the response test task according to the actual response content.
2. The method according to claim 1, wherein the generating of the response test request corresponding to the test case according to the test method corresponding to the test case comprises:
importing the test case parameters corresponding to the test case into the test method corresponding to the test case;
and constructing a response test request corresponding to the test case based on the test case parameters according to the test request generation mode indicated by the test method, and determining a request sending condition corresponding to the response test request.
3. The method according to claim 2, wherein the test case parameters are multiple groups of test case parameters, the test method is multiple test methods for different types of session contents, and the importing the test case parameters corresponding to the test case into the test method corresponding to the test case comprises:
acquiring parameter type labels of each group of test case parameters;
for each test method, acquiring target test case parameters from the multiple groups of test case parameters, and importing the target test case parameters into the test method; and the parameter type label of the target test case parameter is matched with the session content type of the test method.
4. The method of claim 2, wherein said sending the response test request to the conversational robotic system comprises:
responding to a request sending condition corresponding to the response test request, and calling a preset virtual client to send the response test request to a remote process calling interface of the session robot system; the remote procedure call interface is used for responding the response test request and calling the semantic recognition service to recognize the session content carried by the response test request and output the corresponding actual response content.
5. The method of claim 1, wherein said receiving said actual response content returned by said conversational robotic system comprises:
receiving a response message returned by the session robot system aiming at the response test request;
and analyzing the response message according to the transmission protocol corresponding to the response test request to obtain the actual response content carried by the response message.
6. The method according to claim 1, wherein the determining the test result corresponding to the response test task according to the actual response content comprises:
obtaining expected response content corresponding to the test case;
determining the test result of the conversational robot system based on a difference between the expected response content and the actual response content.
7. A testing apparatus of a conversation robot system, comprising:
the test case acquisition unit is configured to execute and acquire a test case corresponding to a response test task of the session robot system;
the request generating unit is configured to execute a test method corresponding to the test case and generate a response test request corresponding to the test case;
a request sending unit configured to execute sending the response test request to the session robot system, wherein the session robot system is used for responding to the session content carried by the response test request and outputting corresponding actual response content;
and the test result acquisition unit is configured to execute receiving of the actual response content returned by the conversation robot system and determine a test result corresponding to the response test task according to the actual response content.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of any one of claims 1 to 6.
9. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of any of claims 1-6.
10. A computer program product comprising instructions which, when executed by a processor of an electronic device, enable the electronic device to perform the method of any of claims 1 to 6.
CN202210607775.XA 2022-05-31 2022-05-31 Testing method and device of conversation robot system, electronic equipment and storage medium Pending CN114896165A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210607775.XA CN114896165A (en) 2022-05-31 2022-05-31 Testing method and device of conversation robot system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210607775.XA CN114896165A (en) 2022-05-31 2022-05-31 Testing method and device of conversation robot system, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114896165A true CN114896165A (en) 2022-08-12

Family

ID=82726779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210607775.XA Pending CN114896165A (en) 2022-05-31 2022-05-31 Testing method and device of conversation robot system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114896165A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117762772A (en) * 2023-11-14 2024-03-26 深圳高灯云科技有限公司 Interface testing method, device, computer equipment, storage medium and product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117762772A (en) * 2023-11-14 2024-03-26 深圳高灯云科技有限公司 Interface testing method, device, computer equipment, storage medium and product

Similar Documents

Publication Publication Date Title
CN106569800B (en) Front-end interface generation method and device
CN111274131A (en) Interface testing method and device, electronic equipment and storage medium
CN114240882A (en) Defect detection method and device, electronic equipment and storage medium
CN106547547B (en) data acquisition method and device
CN111221733A (en) Information processing method and device, mobile terminal and storage medium
CN115185717B (en) Interface calling method and device, electronic equipment and storage medium
CN107562500B (en) Debugging device, method and equipment
CN110704030A (en) Interface configuration information generation method and device, electronic equipment and storage medium
CN108984417B (en) Software testing method, device, terminal and storage medium
CN112948704A (en) Model training method and device for information recommendation, electronic equipment and medium
CN114741292A (en) Test script management method and device, electronic equipment and storage medium
CN114217803A (en) Page function problem processing method and device and electronic equipment
CN114896165A (en) Testing method and device of conversation robot system, electronic equipment and storage medium
CN106909481B (en) Interface test method, interface test device and electronic equipment
CN112416751A (en) Processing method and device for interface automation test and storage medium
CN113157256A (en) Interface code generation method and device, electronic equipment, storage medium and product
CN104991857A (en) Method and apparatus for trace debugging
CN110213062B (en) Method and device for processing message
CN111209195A (en) Method and device for generating test case
CN111079040A (en) Resource sniffing method, device, terminal, server and storage medium
CN110928854A (en) Data import method and device and electronic equipment
CN113626321B (en) Bridging test method, device, system and storage medium
CN114428737A (en) Communication method, device, equipment and storage medium based on micro service system
CN114780334A (en) Power consumption monitoring method, power consumption monitoring device and storage medium
CN109947640B (en) Regression test-based core function coverage statistical method and device

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