CN107402878A - Method of testing and device - Google Patents

Method of testing and device Download PDF

Info

Publication number
CN107402878A
CN107402878A CN201610339412.7A CN201610339412A CN107402878A CN 107402878 A CN107402878 A CN 107402878A CN 201610339412 A CN201610339412 A CN 201610339412A CN 107402878 A CN107402878 A CN 107402878A
Authority
CN
China
Prior art keywords
response
answer
parameter
test
engine
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.)
Granted
Application number
CN201610339412.7A
Other languages
Chinese (zh)
Other versions
CN107402878B (en
Inventor
王昌
范亚平
孙胜方
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke 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 Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201610339412.7A priority Critical patent/CN107402878B/en
Publication of CN107402878A publication Critical patent/CN107402878A/en
Application granted granted Critical
Publication of CN107402878B publication Critical patent/CN107402878B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/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

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)
  • Electrically Operated Instructional Devices (AREA)

Abstract

This application discloses method of testing and device.One embodiment of methods described includes:At least one expected answer of the Question Classification to be tested and response rule associated with each response rule respectively are read from the response logical message of the Question Classification to be tested of response engine;The parameter involved by each response rule of the Question Classification to be tested is extracted, forms the parameter sets for the answer for influenceing the Question Classification to be tested;For each expected answer, assignment is carried out for the parameter sets according to the response rule associated by the expection answer, the test case for being tested the response engine is generated using call by value parameter set as input parameter and using the expection answer as expected results.The embodiment realizes the test data auto generation of response engine.

Description

Method of testing and device
Technical field
The application is related to field of computer technology, and in particular to intelligent robot technology field, especially Its method of testing and device.
Background technology
Automatic-answering back device machine people system needs to provide different answer for different situations in response Case, i.e. when influenceing the condition difference of answer, the result of appearance also can be different.In actual verification , it is necessary to which automatic-answering back device machine people applies with the conditions of to special scenes during answer accuracy Whether correct answer can be answered according to the response logic of setting to be tested.
In the prior art number is tested generally according to the specific question and answer of response logic engineer of setting According to by straight after the completion of response logical process after then question and answer test data is inputted to question and answer interface Connect and compare actual answer and expected answer.However, test case time length is arranged during artificial treatment, Need to analyze the information such as interface, the key to the issue word of various influence answers, and response logic occurs Need to reanalyse test case corresponding to response logic and renewal during change.
The content of the invention
The purpose of the application is to propose a kind of improved method of testing and device, more than solving The technical problem that background section is mentioned.
In a first aspect, this application provides a kind of method of testing, methods described includes:From response The Question Classification to be tested is read in the response logical message of the Question Classification to be tested of engine At least one expected answer and response rule associated with each response rule respectively;Extract Parameter involved by each response rule of the Question Classification to be tested, formed and treated described in influenceing The parameter sets of the answer of test problem classification;For each expected answer, answered according to the expection Response rule associated by case carries out assignment for the parameter sets, by call by value parameter collection cooperation Generated for input parameter and using the expection answer as expected results for entering to the response engine The test case of row test.
In certain embodiments, the response logical message is stored with the structure of binary tree , wherein, each non-leaf nodes of binary tree is respectively used to record the value bar of single parameter Part, each leaf node of binary tree are respectively used to record expected answer.
In certain embodiments, the response logic of the Question Classification to be tested from response engine Read in information the Question Classification to be tested at least one expected answer and respectively with it is each The associated response rule of response rule, including:The binary tree is traveled through, by the binary tree In the information of each leaf node record be identified as being expected answer;For in the binary tree Each leaf node, successively access father node up to root node from leaf node and read The value condition of single parameter recorded in each father node, it polymerize the single parameter read The associated response rule of the expection answer that is recorded with being formed with the leaf node of value condition Then.
In certain embodiments, methods described also includes:Input in the test case is joined Number input to the response engine is handled;The reality that will be exported after response engine processing As a result the expected results associated with the input parameter in the test case are compared, raw Into test result.
In certain embodiments, methods described also includes:Input in the test case is joined Number input is handled to test with engine, wherein the test is to be in advance based on testing with engine The form of input parameter is modified and generated to the input interface in the response engine in use-case 's;The actual result exported after the test is handled with engine is with the input parameter described The expected results associated in test case are compared, and generate test result.
Second aspect, this application provides a kind of test device, described device includes:Read single Member, for being treated described in the reading from the response logical message of the Question Classification to be tested of response engine Test problem classification at least one expected answer and respectively with each response rule it is associated Response rule;Extracting unit, for extracting each response rule of the Question Classification to be tested Involved parameter, form the parameter sets for the answer for influenceing the Question Classification to be tested;It is raw Into unit, for for each expected answer, according to the response rule associated by the expection answer Assignment is carried out for the parameter sets, call by value parameter set is as input parameter and pre- by this Phase answer generates the test case for being tested the response engine as expected results..
In certain embodiments, the response logical message is stored with the structure of binary tree , wherein, each non-leaf nodes of binary tree is respectively used to record the value bar of single parameter Part, each leaf node of binary tree are respectively used to record expected answer.
In certain embodiments, the reading unit is further used for:The binary tree is traveled through, The information of each leaf node record in the binary tree is identified as being expected answer;For Each leaf node in the binary tree, successively accessed from leaf node father node up to Root node and the value condition for reading the single parameter recorded in each father node, polymerization are read To single parameter the expection answer that is recorded with being formed to the leaf node of value condition it is related The response rule of connection.
In certain embodiments, described device also includes:First input block, for by described in Input parameter in test case is inputted to the response engine and handled;First comparing unit, For will after the response engine processing actual result that exports with the input parameter in the survey The expected results associated in example on probation are compared, and generate test result.
In certain embodiments, described device also includes:Second input block, for by described in Input parameter in test case is inputted to test and handled with engine, wherein the test is used Engine is the form for being in advance based on input parameter in test case to the input in the response engine Interface is modified and generated;Second comparing unit, for the test to be handled with engine The expected results that the actual result exported afterwards associates with the input parameter in the test case It is compared, generates test result.
The method of testing and device that the application provides, by the way that the parameter extraction of answer logic will be influenceed And expected answer is combined by way of preset parameter and generates test case so that test case can To automatically generate, and the test case generated can reflect response engine exactly with more complete Response logic.
Brief description of the drawings
Retouched by reading with reference to the detailed of being made to non-limiting example of being made of the following drawings State, other features, objects and advantages will become more apparent upon:
Fig. 1 is that the application can apply to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for testing of the application;
Fig. 3 shows that Fig. 2 corresponds in embodiment showing for data store organisation in response logical message It is intended to
Fig. 4 is the flow chart according to one embodiment of the method for testing of the application;
Fig. 5 is the structural representation according to one embodiment of the test device of the application;
Fig. 6 is adapted for for realizing the terminal device of the embodiment of the present application or the computer of server The structural representation of system.
Embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is appreciated that , specific embodiment described herein is used only for explaining related invention, rather than to the hair Bright restriction.It also should be noted that for the ease of description, illustrate only in accompanying drawing with About the related part of invention.
It should be noted that in the case where not conflicting, embodiment and embodiment in the application In feature can be mutually combined.Describe this in detail below with reference to the accompanying drawings and in conjunction with the embodiments Application.
Fig. 1, which is shown, can apply the method for testing of the application or the embodiment of test device to show Example sexual system framework 100.
As shown in figure 1, system architecture 100 can include terminal device 101,102,103, Network 104 and server 105.Network 104 is in the and of terminal device 101,102,103 The medium of communication link is provided between server 105.Network 104 can include various connection classes Type, such as wired, wireless communication link or fiber optic cables etc..
User can pass through network 104 and server 105 with using terminal equipment 101,102,103 Interaction, to receive or send the message such as test request.Can on terminal device 101,102,103 To be provided with various telecommunication customer end applications, such as web browser applications, software test application Deng.
Terminal device 101,102,103 can be various electronic equipments, including but not limited to intelligence Can mobile phone, tablet personal computer, E-book reader, MP3 player (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio aspect 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert compression Standard audio aspect 4) player, pocket computer on knee and desktop computer etc..
Server 105 can be to provide the server of various services, for example, to terminal device 101, 102nd, the application shown on 103 provides the background server supported.Background server can dock The data such as the test request received are handled, and result (such as test result) is anti- Feed terminal device.
It should be noted that the method for testing that the embodiment of the present application is provided is typically by server 105 are performed, and correspondingly, test device is generally positioned in server 105.
It should be understood that the number of the terminal device, network and server in Fig. 1 is only to illustrate Property.According to needs are realized, can have any number of terminal device, network and server.
With continued reference to Fig. 2, the stream of one embodiment of method of testing according to the application is shown Journey 200.Described method of testing, comprises the following steps:
Step 201, read from the response logical message of the Question Classification to be tested of response engine At least one expected answer of Question Classification to be tested and respectively with each response rule it is associated Response rule.
In the present embodiment, electronic equipment can read the response logic letter corresponding to response engine Breath.Wherein, response logical message be prestore, for the response logic to response engine The information being described.Specifically, response logical message can include what is be related in response logic The regular and each expected answer of each answer.It is expected that regular and associated expection answer can be by According to certain way associated storage.Electronic equipment can be when reading the response logical message, can Corresponding reading manner enters row information and read in a manner of use is with associated storage, you can will be each It is expected that answer and response rule associated with each response rule respectively.Wherein, response is advised It can then include obtaining corresponding to the restrained parameters of the expection answer and these parameters Value condition.Optionally, the operation in step 201 can be electronic equipment in response to from outside Triggered after the request of the test case of the generation response engine received.
Fig. 3 shows the schematic diagram of data store organisation in response logical message.Wherein, it is to be measured Examination Question Classification shares 3 expected answers, i.e. answer 1, answer 2, answer 3.With answer 1 The response logic of association is that parameter 1 is equal to 1, and the response logic associated with answer 2 is parameter 1 Equal to 2, the response logic associated with answer 3 is that parameter 2 is sky.
In some optional implementations of the present embodiment, above-mentioned response logical message is with y-bend What the structure of tree was stored.Wherein, each non-leaf nodes of binary tree is respectively used to record The value condition of single parameter, each leaf node of binary tree are respectively used to record expected answer. Optionally, what leaf node was recorded can be the mark of expected answer, it is contemplated that answer it is specific Description content can be stored in other positions, and the detailed description is answered with corresponding expection The mark associated storage of case.In this way, binary tree only need to mark carry out storage can take it is smaller Memory space, in subsequent treatment only need that mark is carried out processing and can also further improved The efficiency of subsequent treatment, the test case generated can also take less space.
In some optional implementations of above-mentioned implementation, above-mentioned steps 201 specifically can be with It is achieved by the steps of:First, the section of the binary tree for storing response logical message is traveled through Point, the information of each leaf node record in binary tree is identified as being expected answer;Afterwards, For each leaf node in binary tree, successively accessed from leaf node father node up to Root node and the value condition for reading the single parameter recorded in each father node, will read The value condition of single parameter polymerize, so as to get what is recorded with the leaf node It is expected that the response rule that answer is associated.
Step 202, the parameter involved by each response rule of Question Classification to be tested is extracted, Form the parameter sets for the answer for influenceing Question Classification to be tested.
In the present embodiment, the response rule that each response rule obtained by step 201 is associated The parameter being related in then influences whether the final result of Question Classification to be tested, therefore, above-mentioned electricity Sub- equipment (such as server shown in Fig. 1) can extract these parameters, and that is extracted is each Individual parameter can form the parameter sets for the answer for influenceing Question Classification to be tested.
By taking the response logical message described by schematic diagram in Fig. 3 as an example, each response rule is related to Parameter include parameter 1 and parameter 2.That is, it is to be tested to constitute influence for parameter 1 and parameter 2 The parameter sets of the answer of Question Classification.
Step 203, for each expected answer, advised according to the response associated by the expection answer Assignment then is carried out for parameter sets, and uses call by value parameter set to be used as input parameter and should It is expected that answer generates the test case for being tested response engine as expected results.
In the present embodiment, for each expected answer accessed in step 201, electronics Equipment can be first respectively it is anticipated that the response rule associated by answer be to obtained by step 202 Parameter sets in parameters carry out assignment.For an expected answer, associated by it Response rule may relate to some parameters in parameter sets, and other parameters may not by Response condition is related to.When carrying out assignment, the parameter being related to can be according to corresponding to the parameter Value condition carries out assignment, and the parameter being not directed to can then carry out random assignment or according to default Rule carry out assignment.It should be noted that value condition is also likely to be some corresponding to parameter Parameter is null value.
Afterwards, electronic equipment can using the set of call by value parameter after assignment as input parameter, And using the expection answer as expected results, and will both associated storage generation test cases.Institute The test case of generation can be used to test above-mentioned response engine.
Continue by taking the response logical message described by schematic diagram in Fig. 3 as an example, parameter 1 and parameter 2 constitute the parameter sets for the answer for influenceing Question Classification to be tested.For being expected answer 1, its Corresponding response rule is that parameter 1 is equal to 1, can be regular by the ginseng in parameter sets by this Number 1 is entered as 1, the parameter 2 in parameter sets is entered as into 1, afterwards by the parameter after assignment Gather (i.e. parameter 1=1, parameter 2=2) as input parameter and by the mark (example of answer 1 As 1) formed test case as expected results.Similarly, for answer 2, the test generated Input parameter can be parameter 1=2, parameter 2=1 in use-case, it is contemplated that result 2;For answer Input parameter can be that parameter 1 is that 3, parameter 2 is empty in 3 test cases generated, it is contemplated that As a result it is 3.
In some optional implementations of the present embodiment, after step 203, above-mentioned test Method also includes:Input parameter in test case is inputted to response engine and handled;Will The expection that the actual result exported after response engine processing associates with input parameter in test case As a result it is compared, generates test result.In the implementation, given birth to for step 203 Into test case, electronic equipment can first by the input parameter in test case input to should Engine is answered, corresponding processing is performed to trigger response engine;Then, electronic equipment can obtain The actual result exported after response engine processing;Then, electronic equipment can by actual result with The expected results that above-mentioned input parameter associates in test case are compared, so as to according to comparison As a result test result is generated.Generally, when comparison result is consistent for both, then this time test logical Cross, otherwise test and do not pass through.It should be noted that expected results are expected in test case During the mark of answer, both marks can be compared when being compared.
The method that above-described embodiment of the application provides is by will influence the parameter extraction of answer logic And expected answer is combined by way of preset parameter and generates test case so that test case can To automatically generate, and the test case generated can reflect response engine with complete and accurate Response logic.
With further reference to Fig. 4, it illustrates the flow 400 of another of method of testing embodiment. The flow 400 of the method for testing, comprises the following steps:
Step 401, read from the response logical message of the Question Classification to be tested of response engine At least one expected answer of Question Classification to be tested and respectively with each response rule it is associated Response rule.
In the present embodiment, the specific processing of step 401 may be referred to Fig. 2 and correspond to embodiment Step 201, repeat no more here.
Step 402, the parameter involved by each response rule of Question Classification to be tested is extracted, Form the parameter sets for the answer for influenceing Question Classification to be tested.
In the present embodiment, in the present embodiment, the specific processing of step 402 may be referred to figure The step 202 of 2 corresponding embodiments, is repeated no more here.
Step 403, for each expected answer, advised according to the response associated by the expection answer Assignment then is carried out for parameter sets, and uses call by value parameter set to be used as input parameter and should It is expected that answer generates the test case for being tested response engine as expected results.
In the present embodiment, in the present embodiment, the specific processing of step 403 may be referred to figure The step 203 of 2 corresponding embodiments, is repeated no more here.
Step 404, the input parameter in test case is inputted to test and handled with engine.
In the present embodiment, according to the parameter format of input parameter in the test case generated, The input interface in response engine can be modified in advance, generation can be used for receiving test use The test engine of input parameter in example.So as to what electronic equipment can generate step 403 The input parameter of test case is inputted into the test engine so that test engine can be suitable Profit is handled input parameter.Optionally, the operation of step 403 can be that electronic equipment rings It should be triggered in the test request that user sends.
Step 405, the actual result exported after test is handled with engine is being surveyed with input parameter The expected results associated in example on probation are compared, and generate test result.
In the present embodiment, test can be exported with engine after being handled according to input parameter Actual result, electronic equipment can obtain the actual result and by the actual result and input parameters The expected results associated in test case are compared, so as to determine to test according to comparison result As a result.
Figure 4, it is seen that compared with embodiment corresponding to Fig. 2, the survey in the present embodiment The test that the flow 400 of method for testing is formed after the interface to have modified response engine is entered with engine Row test, solves the problems, such as that some response engines can not be inputted with parameter mode, improves The applicable versatility of testing scheme.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, the application provides A kind of one embodiment of test device, the device embodiment are implemented with the method shown in Fig. 2 Example is corresponding, and the device specifically can apply in various electronic equipments.
As shown in figure 5, the test device 500 described in the present embodiment includes:Reading unit 501, Extracting unit 502 and generation unit 503.Wherein, reading unit 501 is used for from response engine Question Classification to be tested response logical message in read at least one of Question Classification to be tested It is expected that answer and response rule associated with each response rule respectively;Extracting unit 502 For extracting the parameter involved by each response rule of Question Classification to be tested, form influence and treat The parameter sets of the answer of test problem classification;Generation unit 503 is used to answer for each expection Case, assignment is carried out for parameter sets according to the response rule associated by the expection answer, will have been assigned Value parameter set is generated for corresponding as input parameter and using the expection answer as expected results Answer the test case that engine is tested.
In the present embodiment, the reading unit 501 of test device 500, the and of extracting unit 502 The specific processing of generation unit 503 may be referred to Fig. 2 and correspond to the step 201 of embodiment, step 202 and step 203, repeat no more here.
In some optional implementations of the present embodiment, response logical message is with binary tree What structure was stored, wherein, each non-leaf nodes of binary tree is respectively used to record single The value condition of parameter, each leaf node of binary tree are respectively used to record expected answer.Should The specific processing of implementation may be referred to Fig. 2 and correspond to corresponding implementation in embodiment, this In repeat no more.
In some optional implementations of the present embodiment, reading unit 501 is further used for: Binary tree traversal, the information of each leaf node record in binary tree is identified as expection and answered Case;For each leaf node in binary tree, father node is successively accessed from leaf node Up to root node and the value condition of the single parameter recorded in each father node is read, is polymerize The expection answer that the value condition of the single parameter read is recorded with being formed with the leaf node Associated response rule.The specific processing of the implementation may be referred to Fig. 2 and correspond to embodiment In corresponding implementation, repeat no more here.
In some optional implementations of the present embodiment, test device 500 also includes:First Input block (not shown), for inputting to response engine the input parameter in test case Row processing;First comparing unit (not shown), for the reality exported after response engine is handled As a result it is compared with the expected results that input parameter associates in test case, generation test knot Fruit.The specific processing of the implementation may be referred to Fig. 2 and correspond to corresponding realization side in embodiment Formula, repeat no more here.
In some optional implementations of the present embodiment, test device 500 also includes:Second Input block (not shown), for the input parameter in test case to be inputted to test engine Handled, wherein test is the form pair that is in advance based on input parameter in test case with engine Input interface in response engine is modified and generated;Second comparing unit (not shown), Closed for the actual result that is exported after test is handled with engine with input parameter in test case The expected results of connection are compared, and generate test result.The specific processing of the implementation can be with The embodiment with reference to corresponding to figure 4, is repeated no more here.
Below with reference to Fig. 6, it illustrates suitable for for realizing the terminal device of the embodiment of the present application Or the structural representation of the computer system 600 of server.
As shown in fig. 6, computer system 600 includes CPU (CPU) 601, its Can according to the program being stored in read-only storage (ROM) 602 or from storage part 608 The program that is loaded into random access storage device (RAM) 603 and perform various appropriate actions And processing.In RAM 603, also it is stored with system 600 and operates required various program sums According to.CPU 601, ROM 602 and RAM 603 are connected with each other by bus 604.Input / output (I/O) interface 605 is also connected to bus 604.
I/O interfaces 605 are connected to lower component:Importation 606 including keyboard, mouse etc.; Including cathode-ray tube (CRT), liquid crystal display (LCD) etc. and loudspeaker etc. Output par, c 607;Storage part 608 including hard disk etc.;And including such as LAN card, The communications portion 609 of the NIC of modem etc..Communications portion 609 is via such as The network of internet performs communication process.Driver 610 is also according to needing to be connected to I/O interfaces 605.Detachable media 611, such as disk, CD, magneto-optic disk, semiconductor memory etc., Be arranged on as needed on driver 610, in order to the computer program that reads from it according to Need to be mounted into storage part 608.
Especially, in accordance with an embodiment of the present disclosure, can be with above with reference to the process of flow chart description It is implemented as computer software programs.For example, embodiment of the disclosure includes a kind of computer journey Sequence product, it includes being tangibly embodied in the computer program on machine readable media, the meter Calculation machine program bag contains the program code for being used for the method shown in execution flow chart.In such implementation In example, the computer program can be downloaded and installed by communications portion 609 from network, And/or it is mounted from detachable media 611.
Flow chart and block diagram in accompanying drawing, it is illustrated that according to the system of the various embodiments of the application, Architectural framework in the cards, function and the operation of method and computer program product.This point On, each square frame in flow chart or block diagram can represent a module, program segment or code A part, a part for the module, program segment or code is used for comprising one or more The executable instruction of logic function as defined in realization.It should also be noted that at some as replacement In realization, the function of being marked in square frame can also be with different from the order marked in accompanying drawing hair It is raw.For example, two square frames succeedingly represented can essentially perform substantially in parallel, they Sometimes can also perform in the opposite order, this is depending on involved function.It is also noted that It is, each square frame and block diagram in block diagram and/or flow chart and/or the square frame in flow chart Combination, function or the special hardware based system of operation it can be realized as defined in execution, Or it can be realized with the combination of specialized hardware and computer instruction.
Being described in unit involved in the embodiment of the present application can be real by way of software It is existing, it can also be realized by way of hardware.Described unit can also be arranged on processing In device, for example, can be described as:A kind of processor includes reading unit, extracting unit and life Into unit.Wherein, the title of these units is not formed to the unit in itself under certain conditions Restriction, for example, reading unit is also described as " from the problem to be tested of response engine Read in the response logical message of classification Question Classification to be tested at least one expected answer and The unit of the response rule associated with each response rule respectively ".
As on the other hand, present invention also provides a kind of nonvolatile computer storage media, The nonvolatile computer storage media can be described in above-described embodiment included in device Nonvolatile computer storage media;Can also be individualism, without non-in supplying terminal Volatile computer storage medium.Above-mentioned nonvolatile computer storage media be stored with one or The multiple programs of person, when one or more of programs are performed by an equipment so that described Equipment:Read from the response logical message of the Question Classification to be tested of response engine described to be measured Try Question Classification at least one expected answer and respectively with each response rule is associated answers Answer rule;Extract the parameter involved by each response rule of the Question Classification to be tested, shape Into the parameter sets for the answer for influenceing the Question Classification to be tested;For each expected answer, Assignment is carried out for the parameter sets according to the response rule associated by the expection answer, will have been assigned Value parameter set is generated for institute as input parameter and using the expection answer as expected results State the test case that response engine is tested.
Above description is only the preferred embodiment of the application and saying to institute's application technology principle It is bright.It will be appreciated by those skilled in the art that invention scope involved in the application, and it is unlimited In the technical scheme that the particular combination of above-mentioned technical characteristic forms, while it should also cover and not depart from In the case of the inventive concept, it is combined by above-mentioned technical characteristic or its equivalent feature And the other technical schemes formed.Such as features described above and (but not limited to) disclosed herein The technical scheme that technical characteristic with similar functions is replaced mutually and formed.

Claims (10)

1. a kind of method of testing, it is characterised in that methods described includes:
Read from the response logical message of the Question Classification to be tested of response engine described to be tested At least one expected answer of Question Classification and response associated with each response rule respectively Rule;
The parameter involved by each response rule of the Question Classification to be tested is extracted, forms shadow Ring the parameter sets of the answer of the Question Classification to be tested;
It is the ginseng according to the response rule associated by the expection answer for each expected answer Manifold, which is closed, carries out assignment, makees using call by value parameter set as input parameter and by the expection answer The test case for being tested the response engine is generated for expected results.
2. according to the method for claim 1, it is characterised in that the response logical message It is to be stored with the structure of binary tree, wherein, each non-leaf nodes difference of binary tree For recording the value condition of single parameter, each leaf node of binary tree is respectively used to record It is expected that answer.
3. according to the method for claim 2, it is characterised in that described from response engine At least the one of the Question Classification to be tested is read in the response logical message of Question Classification to be tested Individual expected answer and response rule associated with each response rule respectively, including:
The binary tree is traveled through, the information of each leaf node record in the binary tree is distinguished It is defined as being expected answer;
For each leaf node in the binary tree, father is successively accessed from leaf node Node is up to root node and reads the value condition of the single parameter recorded in each father node, It polymerize the value condition of single parameter that reads to form the expection recorded with the leaf node The associated response rule of answer.
4. according to the method described in one of claim 1-3, it is characterised in that methods described is also Including:
Input parameter in the test case is inputted to the response engine and handled;
By the actual result exported after response engine processing with the input parameter in the survey The expected results associated in example on probation are compared, and generate test result.
5. according to the method described in one of claim 1-3, it is characterised in that methods described is also Including:
Input parameter in the test case is inputted to test and handled with engine, wherein The test is that the form for being in advance based on input parameter in test case draws to the response with engine Input interface in holding up is modified and generated;
The actual result exported after the test is handled with engine is with the input parameter described The expected results associated in test case are compared, and generate test result.
6. a kind of test device, it is characterised in that described device includes:
Reading unit, for from the response logical message of the Question Classification to be tested of response engine Read at least one expected answer of the Question Classification to be tested and advised respectively with each response Then associated response rule;
Extracting unit, for extracting involved by each response rule of the Question Classification to be tested Parameter, form the parameter sets of the answer for influenceing the Question Classification to be tested;
Generation unit, for for each expected answer, according to associated by the expection answer should Answer rule for the parameter sets carry out assignment, using call by value parameter set as input parameter simultaneously The test for being tested the response engine is generated using the expection answer as expected results Use-case.
7. device according to claim 6, it is characterised in that the response logical message It is to be stored with the structure of binary tree, wherein, each non-leaf nodes difference of binary tree For recording the value condition of single parameter, each leaf node of binary tree is respectively used to record It is expected that answer.
8. device according to claim 7, it is characterised in that the reading unit enters one Walk and be used for:
The binary tree is traveled through, the information of each leaf node record in the binary tree is distinguished It is defined as being expected answer;
For each leaf node in the binary tree, father is successively accessed from leaf node Node is up to root node and reads the value condition of the single parameter recorded in each father node, It polymerize the value condition of single parameter that reads to form the expection recorded with the leaf node The associated response rule of answer.
9. according to the device described in one of claim 6-8, it is characterised in that described device is also Including:
First input block, answered for the input parameter in the test case to be inputted to described Engine is answered to be handled;
First comparing unit, for the actual result that will be exported after response engine processing and institute State the expected results that input parameter associates in the test case to be compared, generation test knot Fruit.
10. according to the device described in one of claim 6-8, it is characterised in that described device Also include:
Second input block, used for the input parameter in the test case to be inputted to test Engine is handled, wherein the test is to be in advance based on input parameter in test case with engine Form the input interface in the response engine is modified and generated;
Second comparing unit, for the actual result that is exported after the test is handled with engine with The expected results that the input parameter associates in the test case are compared, generation test As a result.
CN201610339412.7A 2016-05-19 2016-05-19 Test method and device Active CN107402878B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610339412.7A CN107402878B (en) 2016-05-19 2016-05-19 Test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610339412.7A CN107402878B (en) 2016-05-19 2016-05-19 Test method and device

Publications (2)

Publication Number Publication Date
CN107402878A true CN107402878A (en) 2017-11-28
CN107402878B CN107402878B (en) 2020-09-01

Family

ID=60389150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610339412.7A Active CN107402878B (en) 2016-05-19 2016-05-19 Test method and device

Country Status (1)

Country Link
CN (1) CN107402878B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110109828A (en) * 2019-04-15 2019-08-09 深圳壹账通智能科技有限公司 Question and answer interface test method, device, computer equipment and storage medium
CN111988195A (en) * 2019-05-24 2020-11-24 北京京东尚科信息技术有限公司 Response scheme determination method, device, equipment and medium for packet test
CN112286787A (en) * 2020-06-29 2021-01-29 北京京东尚科信息技术有限公司 Automatic test method and system for intelligent response system and electronic equipment
CN112308571A (en) * 2019-07-15 2021-02-02 北京京东尚科信息技术有限公司 Intelligent customer service response method and device, storage medium and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102368246A (en) * 2011-09-15 2012-03-07 张德长 Automatic-answer robot system
CN103176896A (en) * 2011-12-23 2013-06-26 阿里巴巴集团控股有限公司 Generating method and generating device of test cases
CN103186457A (en) * 2011-12-29 2013-07-03 阿里巴巴集团控股有限公司 Method and device for automatically generating test case
US8560948B2 (en) * 2005-12-23 2013-10-15 Michael Hu User support system integrating FAQ and helpdesk features and FAQ maintenance capabilities
CN104731895A (en) * 2015-03-18 2015-06-24 北京京东尚科信息技术有限公司 Auto-answer method and device
CN104809062A (en) * 2015-04-22 2015-07-29 北京京东尚科信息技术有限公司 Test method and system of artificial intelligence answering system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8560948B2 (en) * 2005-12-23 2013-10-15 Michael Hu User support system integrating FAQ and helpdesk features and FAQ maintenance capabilities
CN102368246A (en) * 2011-09-15 2012-03-07 张德长 Automatic-answer robot system
CN103176896A (en) * 2011-12-23 2013-06-26 阿里巴巴集团控股有限公司 Generating method and generating device of test cases
CN103186457A (en) * 2011-12-29 2013-07-03 阿里巴巴集团控股有限公司 Method and device for automatically generating test case
CN104731895A (en) * 2015-03-18 2015-06-24 北京京东尚科信息技术有限公司 Auto-answer method and device
CN104809062A (en) * 2015-04-22 2015-07-29 北京京东尚科信息技术有限公司 Test method and system of artificial intelligence answering system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李臻贤: "中文问答***知识库的自动构建问题研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110109828A (en) * 2019-04-15 2019-08-09 深圳壹账通智能科技有限公司 Question and answer interface test method, device, computer equipment and storage medium
CN111988195A (en) * 2019-05-24 2020-11-24 北京京东尚科信息技术有限公司 Response scheme determination method, device, equipment and medium for packet test
CN112308571A (en) * 2019-07-15 2021-02-02 北京京东尚科信息技术有限公司 Intelligent customer service response method and device, storage medium and electronic equipment
CN112286787A (en) * 2020-06-29 2021-01-29 北京京东尚科信息技术有限公司 Automatic test method and system for intelligent response system and electronic equipment

Also Published As

Publication number Publication date
CN107402878B (en) 2020-09-01

Similar Documents

Publication Publication Date Title
CN108038469A (en) Method and apparatus for detecting human body
CN105184160B (en) A kind of method of the Android phone platform application program malicious act detection based on API object reference relational graphs
CN107644209A (en) Method for detecting human face and device
CN109508681A (en) The method and apparatus for generating human body critical point detection model
CN107908789A (en) Method and apparatus for generating information
CN107766940A (en) Method and apparatus for generation model
CN110275861B (en) Data storage method and device, storage medium and electronic device
CN107516090A (en) Integrated face identification method and system
CN109492772A (en) The method and apparatus for generating information
CN107958247A (en) Method and apparatus for facial image identification
CN107360137A (en) Construction method and device for the neural network model of identifying code identification
CN107590807A (en) Method and apparatus for detection image quality
CN107346336A (en) Information processing method and device based on artificial intelligence
CN107729928A (en) Information acquisition method and device
CN107402878A (en) Method of testing and device
CN107578034A (en) information generating method and device
CN108229485A (en) For testing the method and apparatus of user interface
CN109684901A (en) Image processing apparatus and image processing method
CN109360028A (en) Method and apparatus for pushed information
CN107491674A (en) Feature based information carries out the method and device of user's checking
CN107862339A (en) Method and apparatus for output information
CN107563360A (en) Information acquisition method and device
CN107305579A (en) The method of testing and device of intelligent Answer System
CN107729246A (en) For the auxiliary test methods of intended application, device, equipment and storage medium
CN107291775A (en) The reparation language material generation method and device of error sample

Legal Events

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