CN107908544A - A kind of use-case test method and terminal device - Google Patents

A kind of use-case test method and terminal device Download PDF

Info

Publication number
CN107908544A
CN107908544A CN201710717092.9A CN201710717092A CN107908544A CN 107908544 A CN107908544 A CN 107908544A CN 201710717092 A CN201710717092 A CN 201710717092A CN 107908544 A CN107908544 A CN 107908544A
Authority
CN
China
Prior art keywords
case
test
target
tested
output data
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
CN201710717092.9A
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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201710717092.9A priority Critical patent/CN107908544A/en
Publication of CN107908544A publication Critical patent/CN107908544A/en
Pending legal-status Critical Current

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/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 invention belongs to field of computer technology, more particularly to a kind of use-case test method and terminal device.The present invention chooses a use-case not being tested as current target use-case from use-case storehouse, test request message corresponding with the target use-case is constructed according to the target use-case first, then the test request message is sent to test object, finally test output data is compared with default anticipated output data and carrys out discriminating test result.After judging the test result of target use-case, return to perform and a step of use-case not being tested is as current target use-case is chosen from use-case storehouse, until the use-case in the use-case storehouse was tested.Tester only needs the use-case of pending test being added in the use-case storehouse in advance, the a series of test process such as test request message construction, test request message transmission, the reception of test output data, comparing and result judgement can be carried out automatically, greatly improve testing efficiency.

Description

A kind of use-case test method and terminal device
Technical field
The invention belongs to field of computer technology, more particularly to a kind of use-case test method and terminal device.
Background technology
As software systems constantly develop towards the direction of complication, in the test process to software systems, in order to Comprehensively its function can be tested, generally require to perform substantial amounts of test case, and current use-case is tested, generally still It is to be performed by hand by tester, efficiency is extremely inefficient.
The content of the invention
In view of this, an embodiment of the present invention provides a kind of use-case test method and terminal device, to solve by test Personnel perform the problem of inefficiency caused by use-case test by hand.
The first aspect of the embodiment of the present invention provides a kind of use-case test method, can include:
A use-case not being tested is chosen from use-case storehouse to be included as current target use-case, the use-case storehouse More than one use-case to be tested added in advance;
Test request message corresponding with the target use-case is constructed according to the target use-case;
Obtain the test object in the target use-case;
The test request message is sent to the test object;
Receive the test output data that the test object returns;
The test output data is compared with the default anticipated output data of the target use-case;
If the test output data is consistent with the anticipated output data, judge that the target use-case test passes through, If the test output data and the anticipated output data are inconsistent, judge that the target use-case test is abnormal;
Return to perform and a step of use-case not being tested is as current target use-case is chosen from use-case storehouse, directly Use-case into the use-case storehouse was tested.
The second aspect of the embodiment of the present invention provides a kind of computer-readable recording medium, the computer-readable storage Media storage has computer program, and the computer program realizes following steps when being executed by processor:
A use-case not being tested is chosen from use-case storehouse to be included as current target use-case, the use-case storehouse More than one use-case to be tested added in advance;
Test request message corresponding with the target use-case is constructed according to the target use-case;
Obtain the test object in the target use-case;
The test request message is sent to the test object;
Receive the test output data that the test object returns;
The test output data is compared with the default anticipated output data of the target use-case;
If the test output data is consistent with the anticipated output data, judge that the target use-case test passes through, If the test output data and the anticipated output data are inconsistent, judge that the target use-case test is abnormal;
Return to perform and a step of use-case not being tested is as current target use-case is chosen from use-case storehouse, directly Use-case into the use-case storehouse was tested.
The third aspect of the embodiment of the present invention provide a kind of use-case test terminal device, including memory, processor with And the computer program that can be run in the memory and on the processor is stored in, the processor performs the calculating Following steps are realized during machine program:
A use-case not being tested is chosen from use-case storehouse to be included as current target use-case, the use-case storehouse More than one use-case to be tested added in advance;
Test request message corresponding with the target use-case is constructed according to the target use-case;
Obtain the test object in the target use-case;
The test request message is sent to the test object;
Receive the test output data that the test object returns;
The test output data is compared with the default anticipated output data of the target use-case;
If the test output data is consistent with the anticipated output data, judge that the target use-case test passes through, If the test output data and the anticipated output data are inconsistent, judge that the target use-case test is abnormal;
Return to perform and a step of use-case not being tested is as current target use-case is chosen from use-case storehouse, directly Use-case into the use-case storehouse was tested.
Existing beneficial effect is the embodiment of the present invention compared with prior art:The embodiment of the present invention is chosen from use-case storehouse One use-case not being tested constructs according to the target use-case used with the target first as current target use-case The corresponding test request message of example, then obtains the test object in the target use-case, the test request message is sent To the test object, the test output data that the test object returns finally is obtained, by the test output data and in advance If anticipated output data be compared, if it is described test output data it is consistent with the anticipated output data, judgement described in The test of target use-case passes through, if the test output data and the anticipated output data are inconsistent, judges that the target is used Example test is abnormal.After judging the test result of target use-case, return perform from use-case storehouse choose one not by The step of use-case tested is as current target use-case, until the use-case in the use-case storehouse was tested.Tester Member only needs the use-case of pending test being added in the use-case storehouse in advance, you can automatic progress test request message construction, Test request message sends, tests a series of test process such as output data reception, comparing and result judgement, greatly carries High testing efficiency.
Brief description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, drawings in the following description be only the present invention some Embodiment, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of one embodiment flow chart of use-case test method in the embodiment of the present invention;
Fig. 2 is signal streams of a kind of step S101 of use-case test method under an application scenarios in the embodiment of the present invention Cheng Tu;
Fig. 3 is signal streams of a kind of step S102 of use-case test method under an application scenarios in the embodiment of the present invention Cheng Tu;
Fig. 4 is that test output data is stored into default data in a kind of use-case test method in the embodiment of the present invention The schematic flow diagram of shared pool;
Fig. 5 is the schematic block diagram that use-case provided in an embodiment of the present invention tests terminal device;
Fig. 6 is the Program modual graph of use-case test program provided in an embodiment of the present invention.
Embodiment
Goal of the invention, feature, advantage to enable the present invention is more obvious and understandable, below in conjunction with the present invention Attached drawing in embodiment, is clearly and completely described the technical solution in the embodiment of the present invention, it is clear that disclosed below Embodiment be only part of the embodiment of the present invention, and not all embodiment.Based on the embodiments of the present invention, this area All other embodiment that those of ordinary skill is obtained without making creative work, belongs to protection of the present invention Scope.
Referring to Fig. 1, a kind of one embodiment of use-case test method can include in the embodiment of the present invention:
Step S101, a use-case not being tested is chosen from use-case storehouse as current target use-case.
The use-case storehouse includes more than one use-case to be tested added in advance.Usually, before being tested, survey Examination personnel need the use-case of this pending test being added in the use-case storehouse in advance.
Preferably, step S101 can specifically include step as shown in Figure 2:
Step S1011, chosen according to default use-case priority orders from the use-case storehouse highest priority not by The use-case tested.
The use-case priority can be configured by tester according to the significance level of each use-case, it is preferable that Each use-case in the use-case storehouse can be arranged according to the order of priority from high in the end, easy to perform use-case test When it is tested successively.
The use-case priority can also be set automatically by system, for example, can according to each use-case test content come Priority is set, the use-case for carrying out functional authorization is arranged to high priority, will be into row boundary value, improper value and configuration testing Use-case be arranged to middle priority, will be tested for the property and the use-case of pressure test be arranged to low priority.Surveyed for same The use-case of content is tried, priority can be set added to the time sequencing in the use-case storehouse according to it, the use-case first added The priority for the use-case that priority is added after being higher than.
Step S1012, the use-case for judging to choose according to default use-case dependence whether there is and not be tested Preposition use-case.
The use-case dependence have recorded the test input number of the dependence between two use-cases, wherein postposition use-case According to the test output data for preposition use-case.For example, if use-case A and use-case B, there are use-case dependence, the test of use-case B need to To be tested in use-case A and complete to carry out afterwards, the test input data of use-case B is the test output data of use-case A, then use-case B is The postposition use-case of use-case A, use-case A are the preposition use-case of use-case B.Preposition use-case is the basis that postposition use-case performs, therefore, it is necessary to Ensure that preposition use-case will be performed prior to postposition use-case.
If the use-case chosen has the preposition use-case not being tested, step S1013 is performed, if that chooses is described The preposition use-case not being tested is not present in use-case, then performs step S1014.
Step S1013, the preposition use-case of the use-case of selection is determined as to current target use-case.
Step S1014, the use-case of selection is determined as to current target use-case.
Step S102, test request message corresponding with the target use-case is constructed according to the target use-case.
Preferably, step S102 can specifically include step as shown in Figure 3:
Step S1021, judge that the target use-case whether there is preposition use-case according to default use-case dependence.
If the target use-case performs step S1022, if preposition use is not present in the target use-case there are preposition use-case Example, then perform step S1023.
Step S1022, obtained from default data sharing pond described in the test output data conduct of the preposition use-case The test input data of target use-case.
Often all there is stronger dependence between modules, unit between complicated software system, but current Test method is still to carry out the test of each individually use-case in isolation, and, test effect is poor between each use-case independently of one another.For This can set a data shared pool, and the intermediary of data transfer is carried out as multiple use-cases there are dependence.If for example, For use-case A and use-case B there are use-case dependence, use-case B is the postposition use-case of use-case A, and use-case A is the preposition use-case of use-case B.Then When testing use-case A, tested output data and be stored into data sharing pond, until when testing use-case B, These data are read from data sharing pond to ensure the execution of test.Meanwhile the test output data of use-case B can continue to make To carry out testing required data to use-case C, and so on.The dependence between multiple use-cases is taken into full account, to centre Data are preserved, and are transmitted between the use-case there are dependence.
Step S1023, test input data is obtained from the target use-case.
If target use-case is not present preposition use-case, its test run without relying on other use-cases, directly acquire and its Corresponding test input data.
Step S1024, the request method in the target use-case is obtained.
The request method can include GET, POST, PUT, DELETE etc., and wherein GET is asking for query resource information Mode is sought, POST is the request method of renewal resource information, and PUT is the request method of increase resource information, and DELETE is to delete The request method of resource information.
Step S1025, the test request message is constructed according to the request method and the test input data.
For example, if the request method of target use-case is GET, enter in GET methods, test input data is put into In GET methods, the test request message of query resource information is constructed.
Step S103, the test object in the target use-case is obtained.
The test object is the targeted Internet resources object of the target use-case, can be positioned by unified resource (Uniform Resource Locator, URL) is accorded with to indicate the Internet resources object.
Step S104, the test request message is sent to the test object.
The test object performs relevant behaviour after the test request message is received, according to request method therein Make, operating result (testing output data) is packaged into response message and is sent to test request side.
Step S105, the test output data that the test object returns is received.
After the response message that the test object returns is received, generally require and the response message parsed, Therefrom extract required test output data.
Step S106, the test output data and the default anticipated output data of the target use-case are compared It is right;
If the test output data is consistent with the anticipated output data, step S107 is performed, if the test is defeated Go out data and the anticipated output data are inconsistent, then perform step S108.
Step S107, judge that the target use-case test passes through.
Preferably, after step S107, it can also judge that the target use-case is according to default use-case dependence It is no there are postposition use-case, if the target use-case stores the test output data of the target use-case there are postposition use-case Enter in default data sharing pond, so that the postposition use-case obtains the test of the target use-case from the data sharing pond Test input data of the output data as the postposition use-case, if postposition use-case is not present in the target use-case, need not hold This process of row.
Step S108, judge that the target use-case test is abnormal.
After the step S107 or step S108, return and perform step S101, i.e., one is chosen from use-case storehouse not The use-case being tested until the use-case in the use-case storehouse was tested, then terminates this as current target use-case Test.
Preferably, after this test is terminated, the use-case test method can also include step as shown in Figure 4:
Step S401, the test result of the use-case in the use-case storehouse is counted, obtains each test object Test percent of pass.
The test percent of pass of a certain test object is right with being directed to this for the use-case number that test object test passes through As the ratio of total use-case number.If for example, share 50 use-cases in the use-case storehouse, wherein, 10 use-cases are directed to survey Object A is tried, test has passed through 9, and 20 use-cases are directed to test object B, and test has passed through 19, what 20 use-cases were directed to It is test object C, test has passed through 20, then the test percent of pass of test object A is 90%, and the test of test object B passes through Rate is 95%, and the test percent of pass of test object C is 100%.
Step S402, test object of the percent of pass less than predetermined threshold value will be tested and is determined as preferred test object.
The threshold value can be configured according to actual conditions, and the present embodiment is not especially limited this.For example, it can incite somebody to action It is arranged to 95%, then test object A is determined as preferred test object.
Step S403, in the use-case storehouse, increase is to the use-case that preferably test object is tested.
The test percent of pass of the preferably test object is relatively low, illustrates in the test object there may be problem, it is necessary to survey Examination personnel carry out problem investigation and positioning, and solve the problems, such as exist.Before tested next time, to preferred test object Stress test is carried out, the use-case that the preferred test object is tested in increase in the use-case storehouse, is improved to described excellent Accounting of the use-case that test object is tested in whole use-case storehouse is selected, for example, in this test, to preferred test object The test case of A shares 10, accounts for and always uses the 20% of number of cases, then, can be by the survey to preferred test object A in next time tests Example on probation increases to 20, improves the accounting in whole use-case storehouse, and more comprehensively, more preferred test object is surveyed Examination.
Alternatively, after this test is terminated, the test result of the use-case in the use-case storehouse can also be carried out Statistics, counts use-case sum, by using number of cases, unsuccessfully with number of cases, percent of pass etc. index, and is sent in a manner of mail In the mailbox of nominative testing personnel, the use-case for performing failure, there is provided link interface, test output number is checked for tester According to the contrast between anticipated output data, problem investigation and positioning are carried out easy to tester.
In conclusion the embodiment of the present invention chooses a use-case not being tested as current target from use-case storehouse Use-case, constructs test request message corresponding with the target use-case according to the target use-case first, then described in acquisition Test object in target use-case, the test request message is sent to the test object, finally obtains the test pair As the test output data of return, the test output data is compared with default anticipated output data, if the survey It is consistent with the anticipated output data to try output data, then judges that the target use-case test passes through, if the test output number According to inconsistent with the anticipated output data, then judge that the target use-case test is abnormal.In the test result to target use-case After being judged, return to perform and step of the use-case not being tested as current target use-case is chosen from use-case storehouse Suddenly, until the use-case in the use-case storehouse was tested.Tester only needs the use-case of pending test being added in advance In the use-case storehouse, you can automatic progress test request message construction, test request message are sent, test output data receives, The a series of test process such as comparing and result judgement, greatly improves testing efficiency.
Corresponding to the use-case test method described in foregoing embodiments, Fig. 5 shows that use-case provided in an embodiment of the present invention is surveyed The schematic block diagram of terminal device is tried, for convenience of description, illustrate only and the relevant part of the embodiment of the present invention.
In the present embodiment, use-case test terminal device can be desktop PC, notebook, palm PC and The computing devices such as cloud server.Use-case test terminal device may include:Processor 50, memory 51 and it is stored in described In memory 51 and the computer program 52 that can be run on the processor 50.
The processor 50 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor Deng.
The memory 51 can be the internal storage unit of the use-case test terminal device 5, such as use-case test is eventually The hard disk or memory of end equipment 5.The memory 51 can also be the External memory equipment of the use-case test terminal device 5, Such as the plug-in type hard disk being equipped with the use-case test terminal device 5, intelligent memory card (Smart Media Card, SMC), Secure digital (Secure Digital, SD) blocks, flash card (Flash Card) etc..Further, the memory 51 may be used also The internal storage unit of terminal device 5 is tested both to include the use-case or including External memory equipment.The memory 51 is used In other programs and data needed for the storage computer program and use-case test terminal device 5.The memory 51 can be also used for temporarily storing the data that has exported or will export.
Referring to Fig. 6, it is the Program modual graph of computer program 52 provided in an embodiment of the present invention.In the present embodiment, The computer program 52 can be divided into one or more modules, and one or more of modules are stored in described In memory 51, and as performed by the processor 50, to complete the present invention.For example, in figure 6, the computer program 52, namely use-case test program can be divided into target use-case choose module 601, request message constructing module 602, test pair As acquisition module 603, request message sending module 604, output data receiving module 605, data comparing module 606, first are sentenced 607 and second determination module 608 of cover half block.Module alleged by the present invention is the series of computation machine for referring to complete specific function Programmed instruction section, the execution in terminal device is tested than program more suitable for describing the computer program 52 in the use-case Journey.The function of the program module 601-608 will specifically be introduced by being described below.
Target use-case choose module 601, for from use-case storehouse choose a use-case not being tested as currently Target use-case, the use-case storehouse include more than one use-case to be tested added in advance;
Request message constructing module 602, for constructing survey corresponding with the target use-case according to the target use-case Try request message;
Test object acquisition module 603, for obtaining the test object in the target use-case;
Request message sending module 604, for sending the test request message to the test object;
Output data receiving module 605, the test output data returned for receiving the test object;
Data comparing module 606, for testing output data and the default anticipated output of the target use-case by described Data are compared;
First determination module 607, if consistent with the anticipated output data for the test output data, judges institute The test of target use-case is stated to pass through;
Second determination module 608, if inconsistent for the test output data and the anticipated output data, judges The target use-case test is abnormal.
Further, the target use-case is chosen module 601 and can be included:
Limit priority use-case chooses unit, for being chosen according to default use-case priority orders from the use-case storehouse The use-case not being tested of highest priority;
First judging unit, for according to default use-case dependence judge choose the use-case with the presence or absence of not by The preposition use-case tested, the use-case dependence have recorded the dependence between two use-cases, wherein postposition use-case Test the test output data that input data is preposition use-case;
First determination unit, if there is the preposition use-case not being tested for the use-case chosen, by selection The preposition use-case of the use-case is determined as current target use-case;
Second determination unit, if the preposition use-case not being tested is not present for the use-case chosen, will choose The use-case be determined as current target use-case.
Further, the request message constructing module 602 can include:
Second judging unit, for judging that the target use-case whether there is preposition use according to default use-case dependence Example, the use-case dependence have recorded the dependence between two use-cases, and the test input data of wherein postposition use-case is The test output data of preposition use-case;
First input data acquiring unit, if being total to for the target use-case there are preposition use-case from default data Enjoy test input data of the test output data that the preposition use-case is obtained in pond as the target use-case;
Second input data acquiring unit, if preposition use-case is not present for the target use-case, is used from the target Test input data is obtained in example;
Request method acquiring unit, for obtaining the request method in the target use-case;
Request message structural unit, for constructing the test according to the request method and the test input data Request message.
Further, can also include in the computer program 52:
Postposition use-case judgment module, after judging that the target use-case whether there is according to default use-case dependence Use-case is put, the use-case dependence have recorded the test input number of the dependence between two use-cases, wherein postposition use-case According to the test output data for preposition use-case;
Output data memory module, if for the target use-case there are postposition use-case, by the survey of the target use-case Examination output data is stored into default data sharing pond, obtained from the data sharing pond so as to the postposition use-case described in Test input data of the test output data of target use-case as the postposition use-case.
Further, can also include in the computer program 52:
As a result statistical module, for being counted to the test result of the use-case in the use-case storehouse, obtains each described The test percent of pass of test object;
It is preferred that test object determining module, is determined as preferably for will test test object of the percent of pass less than predetermined threshold value Test object;
Use-case increases module, for the use-case that the preferred test object is tested in increase in the use-case storehouse.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, may be referred to the corresponding process in preceding method embodiment, details are not described herein.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and is not described in detail or remembers in some embodiment The part of load, may refer to the associated description of other embodiments.
Those of ordinary skill in the art may realize that each embodiment described with reference to the embodiments described herein Module, unit and/or method and step, can be realized with the combination of electronic hardware or computer software and electronic hardware.This A little functions are performed with hardware or software mode actually, application-specific and design constraint depending on technical solution.Specially Industry technical staff can realize described function to each specific application using distinct methods, but this realization is not It is considered as beyond the scope of this invention.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method can be with Realize by another way.For example, device embodiment described above is only schematical, for example, the unit Division, is only a kind of division of logic function, can there is other dividing mode, such as multiple units or component when actually realizing Another system can be combined or be desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or The mutual coupling, direct-coupling or communication connection discussed can be the indirect coupling by some interfaces, device or unit Close or communicate to connect, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit The component shown may or may not be physical location, you can with positioned at a place, or can also be distributed to multiple In network unit.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units integrate in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is used as independent production marketing or use When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially The part to contribute in other words to the prior art or all or part of the technical solution can be in the form of software products Embody, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server, or network equipment etc.) performs the complete of each embodiment the method for the present invention Portion or part steps.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey The medium of sequence code.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to before Embodiment is stated the present invention is described in detail, it will be understood by those of ordinary skill in the art that:It still can be to preceding State the technical solution described in each embodiment to modify, or equivalent substitution is carried out to which part technical characteristic;And these Modification is replaced, and the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical solution.

Claims (10)

  1. A kind of 1. use-case test method, it is characterised in that including:
    A use-case not being tested is chosen from use-case storehouse includes one as current target use-case, the use-case storehouse The use-case to be tested added in advance above;
    Test request message corresponding with the target use-case is constructed according to the target use-case;
    Obtain the test object in the target use-case;
    The test request message is sent to the test object;
    Receive the test output data that the test object returns;
    The test output data is compared with the default anticipated output data of the target use-case;
    If the test output data is consistent with the anticipated output data, judge that the target use-case test passes through, if institute State test output data and the anticipated output data are inconsistent, then judge that the target use-case test is abnormal;
    Return to perform and a step of use-case not being tested is as current target use-case is chosen from use-case storehouse, until institute The use-case stated in use-case storehouse was tested.
  2. 2. use-case test method according to claim 1, it is characterised in that it is described according to the target use-case construct with The corresponding test request message of the target use-case includes:
    Judge that the target use-case whether there is preposition use-case, the use-case dependence note according to default use-case dependence The dependence between two use-cases is recorded, the wherein test input data of postposition use-case exports number for the test of preposition use-case According to;
    If the target use-case, there are preposition use-case, the test that the preposition use-case is obtained from default data sharing pond is defeated Go out test input data of the data as the target use-case;
    If preposition use-case is not present in the target use-case, test input data is obtained from the target use-case;
    Obtain the request method in the target use-case;
    The test request message is constructed according to the request method and the test input data.
  3. 3. use-case test method according to claim 1, it is characterised in that pass through it judging that the target use-case is tested Afterwards, further include:
    Judge that the target use-case whether there is postposition use-case, the use-case dependence note according to default use-case dependence The dependence between two use-cases is recorded, the wherein test input data of postposition use-case exports number for the test of preposition use-case According to;
    If the test output data of the target use-case is stored into default data by the target use-case there are postposition use-case In shared pool, so that the postposition use-case obtains the test output data conduct of the target use-case from the data sharing pond The test input data of the postposition use-case.
  4. 4. use-case test method according to claim 1, it is characterised in that choose one in the storehouse from use-case and be not tested The use-case tried includes as current target use-case:
    The use-case not being tested of highest priority is chosen from the use-case storehouse according to default use-case priority orders;
    The use-case for judging to choose according to default use-case dependence whether there is the preposition use-case not being tested, described Use-case dependence have recorded the dependence between two use-cases, and the wherein test input data of postposition use-case is preposition use-case Test output data;
    If the use-case chosen has the preposition use-case not being tested, the preposition use-case of the use-case of selection is determined For current target use-case;
    If the preposition use-case not being tested is not present in the use-case chosen, the use-case of selection is determined as current Target use-case.
  5. 5. use-case test method according to any one of claim 1 to 4, it is characterised in that in the use-case storehouse After use-case was tested, further include:
    The test result of use-case in the use-case storehouse is counted, obtains the test percent of pass of each test object;
    Test object of the percent of pass less than predetermined threshold value will be tested and be determined as preferred test object;
    Increase is to the use-case that preferably test object is tested in the use-case storehouse.
  6. 6. a kind of computer-readable recording medium, the computer-readable recording medium storage has computer program, its feature exists In realizing the use-case test method as any one of claim 1 to 5 when the computer program is executed by processor Step.
  7. 7. a kind of use-case tests terminal device, including memory, processor and it is stored in the memory and can be described The computer program run on processor, it is characterised in that the processor realizes following step when performing the computer program Suddenly:
    A use-case not being tested is chosen from use-case storehouse includes one as current target use-case, the use-case storehouse The use-case to be tested added in advance above;
    Test request message corresponding with the target use-case is constructed according to the target use-case;
    Obtain the test object in the target use-case;
    The test request message is sent to the test object;
    Receive the test output data that the test object returns;
    The test output data is compared with the default anticipated output data of the target use-case;
    If the test output data is consistent with the anticipated output data, judge that the target use-case test passes through, if institute State test output data and the anticipated output data are inconsistent, then judge that the target use-case test is abnormal;
    Return to perform and a step of use-case not being tested is as current target use-case is chosen from use-case storehouse, until institute The use-case stated in use-case storehouse was tested.
  8. 8. use-case according to claim 7 tests terminal device, it is characterised in that described to be constructed according to the target use-case Going out test request message corresponding with the target use-case includes:
    Judge that the target use-case whether there is preposition use-case, the use-case dependence note according to default use-case dependence The dependence between two use-cases is recorded, the wherein test input data of postposition use-case exports number for the test of preposition use-case According to;
    If the target use-case, there are preposition use-case, the test that the preposition use-case is obtained from default data sharing pond is defeated Go out test input data of the data as the target use-case;
    If preposition use-case is not present in the target use-case, test input data is obtained from the target use-case;
    Obtain the request method in the target use-case;
    The test request message is constructed according to the request method and the test input data.
  9. 9. use-case according to claim 7 tests terminal device, it is characterised in that is judging that the target use-case test is logical After crossing, further include:
    Judge that the target use-case whether there is postposition use-case, the use-case dependence note according to default use-case dependence The dependence between two use-cases is recorded, the wherein test input data of postposition use-case exports number for the test of preposition use-case According to;
    If the test output data of the target use-case is stored into default data by the target use-case there are postposition use-case In shared pool, so that the postposition use-case obtains the test output data conduct of the target use-case from the data sharing pond The test input data of the postposition use-case.
  10. 10. the use-case test terminal device according to any one of claim 7 to 9, it is characterised in that described from use-case storehouse One use-case not being tested of middle selection includes as current target use-case:
    The use-case not being tested of highest priority is chosen from the use-case storehouse according to default use-case priority orders;
    The use-case for judging to choose according to default use-case dependence whether there is the preposition use-case not being tested, described Use-case dependence have recorded the dependence between two use-cases, and the wherein test input data of postposition use-case is preposition use-case Test output data;
    If the use-case chosen has the preposition use-case not being tested, the preposition use-case of the use-case of selection is determined For current target use-case;
    If the preposition use-case not being tested is not present in the use-case chosen, the use-case of selection is determined as current Target use-case.
CN201710717092.9A 2017-08-21 2017-08-21 A kind of use-case test method and terminal device Pending CN107908544A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710717092.9A CN107908544A (en) 2017-08-21 2017-08-21 A kind of use-case test method and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710717092.9A CN107908544A (en) 2017-08-21 2017-08-21 A kind of use-case test method and terminal device

Publications (1)

Publication Number Publication Date
CN107908544A true CN107908544A (en) 2018-04-13

Family

ID=61840021

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710717092.9A Pending CN107908544A (en) 2017-08-21 2017-08-21 A kind of use-case test method and terminal device

Country Status (1)

Country Link
CN (1) CN107908544A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918290A (en) * 2019-01-17 2019-06-21 平安科技(深圳)有限公司 Auto-screening method, device, computer equipment and the storage medium of target device
CN109960653A (en) * 2019-02-18 2019-07-02 天津五八到家科技有限公司 Regression testing method, device, equipment and storage medium
CN112286795A (en) * 2020-09-28 2021-01-29 长沙市到家悠享网络科技有限公司 Software testing method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102214140A (en) * 2011-06-21 2011-10-12 中兴通讯股份有限公司 Method and system for automatic software testing
US20130290937A1 (en) * 2009-07-29 2013-10-31 International Business Machines Corporation Efficient extraction of software dependencies from program code
CN104657270A (en) * 2015-02-28 2015-05-27 北京嘀嘀无限科技发展有限公司 Method and system for testing
CN105224461A (en) * 2015-10-23 2016-01-06 网易(杭州)网络有限公司 A kind of generation method and apparatus of integration testing use-case
CN105824746A (en) * 2015-01-05 2016-08-03 中国移动(深圳)有限公司 Method and device for automatically generating test scheduling based on use case dependencies

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130290937A1 (en) * 2009-07-29 2013-10-31 International Business Machines Corporation Efficient extraction of software dependencies from program code
CN102214140A (en) * 2011-06-21 2011-10-12 中兴通讯股份有限公司 Method and system for automatic software testing
CN105824746A (en) * 2015-01-05 2016-08-03 中国移动(深圳)有限公司 Method and device for automatically generating test scheduling based on use case dependencies
CN104657270A (en) * 2015-02-28 2015-05-27 北京嘀嘀无限科技发展有限公司 Method and system for testing
CN105224461A (en) * 2015-10-23 2016-01-06 网易(杭州)网络有限公司 A kind of generation method and apparatus of integration testing use-case

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918290A (en) * 2019-01-17 2019-06-21 平安科技(深圳)有限公司 Auto-screening method, device, computer equipment and the storage medium of target device
CN109918290B (en) * 2019-01-17 2022-03-15 平安科技(深圳)有限公司 Automatic screening method and device for target equipment, computer equipment and storage medium
CN109960653A (en) * 2019-02-18 2019-07-02 天津五八到家科技有限公司 Regression testing method, device, equipment and storage medium
CN112286795A (en) * 2020-09-28 2021-01-29 长沙市到家悠享网络科技有限公司 Software testing method, device and storage medium

Similar Documents

Publication Publication Date Title
CN110473083B (en) Tree risk account identification method, device, server and storage medium
CN107908544A (en) A kind of use-case test method and terminal device
CN110201393A (en) Configuration data storage method and device and electronic equipment
CN108681975A (en) A kind of household services approaches to IM, device and equipment
CN108776616A (en) A kind of method, block chain node and the system of determining block chain node trusted status
CN108601023A (en) Home-network linkups authentication method, device, electronic equipment and storage medium
CN110377522A (en) The test method for scene of trading, calculates equipment and medium at device
CN108492188A (en) Lead referral method, apparatus, equipment and storage medium
CN107483381A (en) The monitoring method and device of interlock account
CN109255480A (en) Between servant lead prediction technique, device, computer equipment and storage medium
CN108647240A (en) A kind of method, apparatus, electronic equipment and the storage medium of statistics visit capacity
CN115865779A (en) Communication path selection method, system, terminal equipment and storage medium
CN110457576A (en) Account-classification method, device, computer equipment and storage medium
CN109447553A (en) A kind of checking method of inventory, system and terminal device
CN110222323A (en) A kind of voucher generation method, device, readable storage medium storing program for executing and terminal device
CN109858927A (en) A kind of trade company's checking method, device, computer readable storage medium and server
CN109739700A (en) A kind of interface test method and device
CN116781602A (en) Financial data transmission path optimization method, device and storage medium
CN110443265A (en) A kind of behavioral value method and apparatus based on corporations
CN108228744A (en) The management method and device of a kind of vehicle diagnostic data
CN106815128A (en) Log-output method and device, electronic equipment
CN109684198A (en) Data capture method to be tested, device, medium, electronic equipment
CN109003181B (en) Suspicious user determination method, device, equipment and computer readable storage medium
CN106101117B (en) A kind of fishing website blocking-up method, device and system
CN112667753A (en) Method for excavating entity node path and computer equipment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180413

RJ01 Rejection of invention patent application after publication