CN108984388A - A kind of method and terminal device generating automatic test cases - Google Patents

A kind of method and terminal device generating automatic test cases Download PDF

Info

Publication number
CN108984388A
CN108984388A CN201810554444.8A CN201810554444A CN108984388A CN 108984388 A CN108984388 A CN 108984388A CN 201810554444 A CN201810554444 A CN 201810554444A CN 108984388 A CN108984388 A CN 108984388A
Authority
CN
China
Prior art keywords
information
automatic test
test cases
interface
parameter
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
CN201810554444.8A
Other languages
Chinese (zh)
Other versions
CN108984388B (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.)
Ping An E Wallet Electronic Commerce Co Ltd
Original Assignee
Ping An E Wallet Electronic Commerce 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 Ping An E Wallet Electronic Commerce Co Ltd filed Critical Ping An E Wallet Electronic Commerce Co Ltd
Priority to CN201810554444.8A priority Critical patent/CN108984388B/en
Publication of CN108984388A publication Critical patent/CN108984388A/en
Application granted granted Critical
Publication of CN108984388B publication Critical patent/CN108984388B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

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

Abstract

The present invention is suitable for field of computer technology, provides a kind of method and terminal device for generating automatic test cases, comprising: obtains the solicited message of the target interface triggering in the management tool that user passes through manual test use-case;Target interface is the interactive interface for creating automatic test cases for user, and solicited message generates automatic test cases for requesting;The application programming interfaces for calling the management tool of automatic test cases indicate that information and output parameter indicate information by the corresponding input parameter of application programming interfaces acquisition request information;User is obtained according to the input paramete information of input parameter instruction information input, and obtains the output parameter information that user indicates information input according to output parameter;Automatic test cases are generated according to input paramete information and output parameter information.The present invention is not necessarily to switch test platform, and the time that can save switching platform is avoided that demand test is omitted or test redundancy, realization improve the purpose of testing efficiency again.

Description

A kind of method and terminal device generating automatic test cases
Technical field
The invention belongs to field of computer technology more particularly to a kind of method for generating automatic test cases and terminal to set It is standby.
Background technique
At present manual test use-case and interface automatic test cases respectively by different test case management platforms into Row is write and is managed.Since the technical threshold of interface automatic test design is high, operational trials personnel are difficult to complete independently craft This two work of case designing and automation case designing.When a complete testing requirement need by manual test use-case with When interface automatic test cases are tested, tester is during the test, it may be necessary to which frequent switching manual test is used Example management tool and the management tool of interface automatic test cases are tested, and so, are on the one hand easy to cause demand Test is omitted or test redundancy, on the other hand the time consumed by the frequent switching test case management tool due to reduce test effect Rate.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of method and terminal device for generating automatic test cases, with It solves the prior art during the test, needs the management in manual test case management tool and interface automatic test cases Frequent switching is tested between tool, causes demand test to omit or test redundancy, and because of frequent switching test case pipe Time consumed by platform and the problem of reduce testing efficiency.
The first aspect of the embodiment of the present invention provides a kind of method for generating automatic test cases, comprising:
Obtain the solicited message of the target interface triggering in the management tool that user passes through manual test use-case;Wherein, institute Stating target interface is the interactive interface for creating automatic test cases for user, and the solicited message generates certainly for requesting Dynamicization test case, the solicited message include interface message, and the interface message is requested for identifying the solicited message The achievable functional information of the automatic test cases of generation;
The application programming interfaces for calling the management tool of automatic test cases obtain institute by the application programming interfaces State the corresponding input parameter instruction information of solicited message and output parameter instruction information;
The user is obtained according to the input paramete information of input parameter instruction information input, and obtains user's root According to the output parameter information of output parameter instruction information input;
Automatic test cases are generated according to the input paramete information and the output parameter information.
The second aspect of the embodiment of the present invention provides a kind of terminal device, including memory, processor and is stored in In the memory and the computer program that can run on the processor, when the processor executes the computer program It performs the steps of
Obtain the solicited message of the target interface triggering in the management tool that user passes through manual test use-case;Wherein, institute Stating target interface is the interactive interface for creating automatic test cases for user, and the solicited message generates certainly for requesting Dynamicization test case, the solicited message include interface message, and the interface message is requested for identifying the solicited message The achievable functional information of the automatic test cases of generation;
The application programming interfaces for calling the management tool of automatic test cases obtain institute by the application programming interfaces State the corresponding input parameter instruction information of solicited message and output parameter instruction information;
The user is obtained according to the input paramete information of input parameter instruction information input, and obtains user's root According to the output parameter information of output parameter instruction information input;
Automatic test cases are generated according to the input paramete information and the output parameter information.
The third aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, and the computer program performs the steps of when being executed by processor
Obtain the solicited message of the target interface triggering in the management tool that user passes through manual test use-case;Wherein, institute Stating target interface is the interactive interface for creating automatic test cases for user, and the solicited message generates certainly for requesting Dynamicization test case, the solicited message include interface message, and the interface message is requested for identifying the solicited message The achievable functional information of the automatic test cases of generation;
The application programming interfaces for calling the management tool of automatic test cases obtain institute by the application programming interfaces State the corresponding input parameter instruction information of solicited message and output parameter instruction information;
The user is obtained according to the input paramete information of input parameter instruction information input, and obtains user's root According to the output parameter information of output parameter instruction information input;
Automatic test cases are generated according to the input paramete information and the output parameter information.
Implement a kind of method for generating automatic test cases provided in an embodiment of the present invention and terminal device with following The utility model has the advantages that
The embodiment of the present invention is surveyed by increasing in the management tool of manual test use-case for creating automation for user The interactive interface of example on probation generates automatic test cases according to the relevant parameter of user's input, reduces automatic test use The technical threshold of example design and the design efficiency for improving automatic test cases;It is used since user does not need code Design test Example, can reduce error probability;Tester can input phase in the management tool of manual test use-case according to testing requirement Close parameter create automatic test cases, and the management tool of manual test use-case can call manual test use-case and Automatic test cases are tested, and switch test platform is not needed, and the time that can save switching platform is avoided that demand again Test is omitted or test redundancy, realizes the purpose for improving testing efficiency.
Detailed description of the invention
It 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, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of implementation flow chart of the method for generation automatic test cases that one embodiment of the invention provides;
Fig. 2 be another embodiment of the present invention provides a kind of generation automatic test cases method implementation flow chart;
Fig. 3 is a kind of structural block diagram for terminal device that one embodiment of the invention provides;
Fig. 4 be another embodiment of the present invention provides a kind of terminal device schematic diagram.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
Referring to Figure 1, Fig. 1 is a kind of realization of the method for generation automatic test cases that one embodiment of the invention provides Flow chart.The executing subject of the authority setting method of application program is terminal device in the present embodiment, can be used for managing test and uses Example, terminal device includes but is not limited to smart phone, tablet computer, personal digital assistant (Personal Digital Assistant, PDA), the mobile terminals such as wearable device, can also include desktop computer.Generation as shown in the figure, which automates, surveys The method of example on probation can include:
S101: the solicited message of the target interface triggering in the management tool that user passes through manual test use-case is obtained;Its In, target interface is the interactive interface for creating automatic test cases for user, and the solicited message is generated for requesting Automatic test cases, the solicited message include interface message, and the interface message is for identifying information institute before the application Request the achievable functional information of automatic test cases generated.
Test case management tool is installed in advance, test case management tool refers to tool to software in terminal device Entire test input, implementation procedure and test result carry out the process of record management.Test case management tool may include The management tool of manual test use-case and the management tool of automatic test cases, the management tool of manual test use-case are used for Manual test use-case is managed, the management tool of automatic test cases is used for management automation test case.Manual test use-case Management tool include but is not limited to TestManager, Wiki, TestLink, TestDirector etc.;Automatic test cases Management tool include but is not limited to VisualStudio.
Terminal device is detecting the management tool of starting manual test use-case, and detects for triggering terminal equipment exhibition When showing the instruction of target interface, responds the instruction and show the target interface of the management tool of manual test use-case, target interface It is the interactive interface for creating automatic test cases for user.
Later, terminal device detects and obtains the target interface triggering in the management tool that user passes through manual test use-case Solicited message, which generates automatic test cases for requesting, which includes interface message, interface letter Breath requests the achievable functional information of automatic test cases generated for identification request information.Interface message may include Interface identifier, interface identifier can be divided by type of service, can also be divided by function etc..For example, interface identifier can be receipts Money, payment etc. are also possible to pay, transfer accounts.
Specifically, the target interface in the management tool of test case may include for user selection interface message or The achievable functional information of automation use-case to be generated, the management tool that the available user of terminal device passes through test case In target interface selection interface message or the achievable functional information of automation use-case to be generated, and believed according to interface Breath or the achievable functional information of automation use-case to be generated generate solicited message.
Wherein, terminal device is getting the to be generated of the target interface selection in the management tool that user passes through test case At automation use-case achievable functional information when, can be determined according to functional information and the default corresponding relationship of interface message should Interface message corresponding to functional information, thus according to interface message or the achievable functional information of automation use-case to be generated Generate solicited message.
Optionally, solicited message further includes testing requirement information, and testing requirement information may include testing procedure.Terminal is set The standby testing requirement information that can also be obtained user and input or select in target interface.
S102: calling the application programming interfaces of the management tool of automatic test cases, passes through the application programming interfaces Obtain the corresponding input parameter instruction information of the solicited message and output parameter instruction information.
Terminal device calls the application program of the management tool of automatic test cases to connect when getting the solicited message Mouth (Application Programming Interface, API), passes through the management tool of the API and automatic test cases It is communicated, the management tool for triggering automatic test cases parses solicited message, to obtain and solicited message The input parameter instruction information and output parameter instruction information matched.
Wherein, input parameter instruction information is used to indicate tester and fills in input parameter, and output parameter indicates that information is used In instruction, tester fills in desired output parameter.
Optionally, terminal device can be determined according to the interface message for including in solicited message belonging to the API for needing to call Interface type, according to determining interface type and the achievable functional information of automation use-case to be generated, further really The target API for needing to call calmly, to be communicated by target API with the management tool of automatic test cases, triggering is certainly The management tool of dynamicization test case is parsed to obtain the interface message for including in solicited message to solicited message, to obtain Information is indicated with the matched input parameter instruction information of solicited message and output parameter.
Specifically, when interface message includes interface identifier, terminal device can need to call according to interface identifier determination API belonging to interface type, according to determining interface type and the achievable functional information of automation use-case to be generated, Further determine that the target API that needs call.
Interface type includes the interface of query type, and (such as get type), is repaired the interface (e.g., post type) for increasing type Change the interface (e.g., put type) of type, delete the interface (e.g., delete type) of type.
The interface of get type is for obtaining uniform resource identifier (Uniform Resource Identifier, URI) Resource is shown.It generally refers to obtain the interface of information, such as the function of list query, clicks inquiry button and just call one A get interface, then returns out information.The interface of get type is for pulling down content from server.
The interface of post type is for creating resource, and server-side is in specified uniform resource identifier A new object is created on (UniformResource Identifier, URI), by the address of new resources message in response A part return.The usually function of submission form, for example what is registered, upload, be posted by etc is exactly post interface. The interface of post type is used to content shift server onto up.
The interface of put type is used to update a resource on URI, if server-side allows, put can be used for creating One resource.
The interface of put type is for deleting specified URI resource.
Further, S102 may include S1021~S1022, specific as follows:
S1021: calling the application programming interfaces of the management tool of automatic test cases, passes through the application programming interfaces Obtain the matched interface parameters of interface message for including with the solicited message.
The interface message that acquisition request information includes, and interface message is parsed, it obtains matched with interface message Interface parameters, interface parameters may include interface direction, interface transmission data agreement etc..Interface direction refers to data transmitting side To such as client to server;Interface transmission data agreement can be extensible markup language (Extensible Markup Language, XML) or JavaScript object representation (JavaScriptObject Notation, JSON), JOSN is one The data interchange format of lightweight of the kind based on JavaScript language.
S1022: obtaining according to the interface parameters and the matched use-case template of the interface parameters, and according to the matching Use-case template determine input parameter instruction information and output parameter indicate information.
Terminal device is after getting interface parameters, according to the achievable function of automatic test cases of request generation Information and interface parameters obtain the automation generated with request from the database of the management tool of automatic test cases and survey The achievable functional information of example on probation and the matched use-case template of interface parameters, are extracted defeated from the use-case template got Enter parameter instruction information and output parameter instruction information, and the input parameter of extraction is indicated that information and output parameter indicate Information is shown.Input parameter instruction information is used to indicate tester and fills in input parameter, and output parameter indicates that information is used In instruction, tester fills in desired output parameter.
Further, when solicited message further includes testing requirement information, S102 may include S1023~S1024, terminal Equipment can execute S1021~S1022 or S1023~S1024 after executing S101, wherein terminal device is executing S101 When determining that the solicited message got includes testing requirement information, S1023~S1024 is executed, otherwise executes S1021~S1022. S1023~S1024 is specific as follows:
S1023: calling the application programming interfaces of the management tool of automatic test cases, passes through the application programming interfaces Obtain the matched interface parameters of interface message for including with the solicited message.
S1023 is identical as S1021, referring specifically to the associated description of S1021, does not repeat herein.
S1024: according to the interface parameters and the testing requirement acquisition of information and the matched use of the interface parameters Example template, and determine that input parameter instruction information and output parameter indicate information according to the matched use-case template.
Terminal device obtains testing requirement information from solicited message, and believes getting the interface for including with solicited message When ceasing matched interface parameters, the automatic test for obtaining in platform and generating with request can be managed from automatic test cases and is used The achievable functional information of example, interface parameters and the matched use-case template of testing requirement information, with from the use-case got Input parameter instruction information is extracted in template and output parameter indicates information.
Testing requirement information may include testing procedure and/or need function items to be tested etc..It include surveying in use-case template Try is rapid, testable function items information.
S103: the user is obtained according to the input paramete information of input parameter instruction information input, and described in acquisition User indicates the output parameter information of information input according to output parameter.
Terminal device obtains user for showing the interaction of input parameter instruction information and output parameter instruction information In interface, the defeated of information input is indicated according to the input paramete information of input parameter instruction information input and according to output parameter Parameter information out.Input paramete information is the parameter information for being passed to the interface, and output parameter information refers to the parameter of desired output Information.
S104: automatic test cases are generated according to the input paramete information and the output parameter information.
Terminal device can call automatic test cases management tool according to the interface identifier for including in interface message API requests the achievable functional information of automatic test cases generated since interface message is used for identification request information, because This, the achievable functional information of automatic test cases that terminal can be generated according to request, from the pipe of automatic test cases It is obtained in the database of science and engineering tool and the matched use-case template of the achievable functional information of the interface, auto-control test case Input paramete information and output parameter information are updated to matched use-case template by management tool, are created by input paramete information And the automatic test cases that output parameter information is constituted.
Optionally, when generating automatic test cases, terminal device can also obtain the automatic test cases of generation Title, and establish the incidence relation between the automatic test cases and its title.The title can be manually entered by user, It can also be allocated with terminal device according to interface message and title allocation strategy.
Title allocation strategy is used to identify the allocation rule of the title of automatic test cases, the name of automatic test cases The allocation rule of title can be by interface type and the achievable function distribution automatic test cases of automatic test cases Title;Or the name of the distribution automatic test cases of the type of service according to belonging to interface type and automatic test cases Claim.Type of service belonging to the achievable function of automatic test cases or automatic test cases can be determined by testing requirement.
Specifically, test case management equipment can determine according to the interface identifier that interface message includes and need to call Interface type belonging to API, according to determining interface type and the automation achievable functional information of use-case, distribution automation The title of test case;Or determine that type of service belonging to automation use-case to be generated is distributed according to determining interface type The title of automatic test cases.Same interface type can correspond to multiple interface identifier.
Wherein, interface type includes the interface of query type, (such as get type), interface (e.g., the post class for increasing type Type), modification type interface (e.g., put type), delete type interface (e.g., delete type).
Above scheme, by increasing in the management tool of manual test use-case for creating automatic test for user The interactive interface of example generates automatic test cases according to the relevant parameter of user's input, reduces automatic test cases and set The technical threshold of meter and the design efficiency for improving automatic test cases;Since user does not need code Design test case, Error probability can be reduced;Tester can input related ginseng according to testing requirement in the management tool of manual test use-case Number creation automatic test cases, and manual test use-case and automatic can be called in the management tool of manual test use-case Change test case to be tested, do not need switch test platform, the time that can save switching platform is avoided that demand is tested again It omits or test redundancy, realization improves the purpose of testing efficiency.
Refer to Fig. 2, Fig. 2 be another embodiment of the present invention provides a kind of generation automatic test cases method reality Existing flow chart.The executing subject of the authority setting method of application program is terminal device in the present embodiment, can be used for managing test Use-case, terminal device include but is not limited to smart phone, tablet computer, personal digital assistant (Personal Digital Assistant, PDA), the mobile terminals such as wearable device, can also include desktop computer.Generation automation in the present embodiment The difference of the method for test case embodiment corresponding with Fig. 1 is S205~S208.Generation automatic test as shown in the figure The method of use-case can include:
S201: the solicited message of the target interface triggering in the management tool that user passes through manual test use-case is obtained;Its In, target interface is the interactive interface for creating automatic test cases for user, and the solicited message is generated for requesting Automatic test cases, the solicited message include interface message, and the interface message is for identifying information institute before the application Request the achievable functional information of automatic test cases generated.
S201 is identical as the S101 of a upper embodiment in the present embodiment, referring specifically to the correlation of S101 in a upper embodiment Description, does not repeat herein.
S202: calling the application programming interfaces of the management tool of automatic test cases, passes through the application programming interfaces Obtain the corresponding input parameter instruction information of the solicited message and output parameter instruction information.
S202 is identical as the S102 of a upper embodiment in the present embodiment, referring specifically to the correlation of S102 in a upper embodiment Description, does not repeat herein.
S203: the user is obtained according to the input paramete information of input parameter instruction information input, and described in acquisition User indicates the output parameter information of information input according to output parameter.
S203 is identical as the S103 of a upper embodiment in the present embodiment, referring specifically to the correlation of S103 in a upper embodiment Description, does not repeat herein.
S204: automatic test cases are generated according to the input paramete information and the output parameter information.
S204 is identical as the S104 of a upper embodiment in the present embodiment, referring specifically to the correlation of S104 in a upper embodiment Description, does not repeat herein.
S205: it if detecting the control instruction for triggering the automatic test cases operation, obtains by described automatic The the first test knot generated when changing the first test parameter that test case is tested, and running the automatic test cases Fruit data.
Terminal device detect user by interactive interface and trigger any management tool by manual test use-case it is raw At automatic test cases operation control instruction when, respond the control instruction, pass through automatic test cases management tool The automatic test cases are run, the first test parameter tested by the automatic test cases, and operation are obtained The first test result data generated when the automatic test cases.
First test parameter includes the input paramete information of the automatic test cases, output parameter information, output ginseng Number information refers to the parameter information of desired output, and the first test result data refers to the result data of each parameter of desired output.
S206: the automatic test is generated according to first test parameter and first test result data and is used The test report of example.
Terminal device by the first test parameter for establishing the titles of the automatic test cases, the automatic test cases with And the incidence relation between the first test result data of the automatic test cases, generate the test of the automatic test cases It reports, includes title, the first test parameter and the first test result data of the automatic test cases in the test report.
It optionally, can also include S207~S208 after S205, specific as follows:
S207: the second test parameter and the second test result of the manual test use-case of user's input are obtained.
Terminal device passes through the management of manual test use-case in the management tool for detecting user's starting manual test use-case Tool operation manual test use-case is tested, and is opened in the management tool of manual test use-case for inputting manual test use When the interactive interface of the test data of example, the second test for obtaining the manual test use-case that user is inputted by the interactive interface is joined Several and the second test result data.Second test parameter includes the title, input paramete information, output ginseng of manual test use-case Number information, the second test result data is the test result data of each output parameter of manual test use-case.
S208: according to first test parameter, first test result data, second test parameter and institute It states the second test result data and generates test report.
Terminal device establish the title of the automatic test cases, the automatic test cases the first test parameter and Incidence relation between first test result data of the automatic test cases, and establish manual test use-case title, Association between second test parameter of the manual test use-case and the second test result data of the manual test use-case is closed System generates according to the first test parameter, the first test result data, the second test parameter and the second test result data and tests Report, so that user checks by the test report relevant test data and manual test use-case of automatic test cases Relevant test data.
Above scheme, by increasing in the management tool of manual test use-case for creating automatic test for user The interactive interface of example generates automatic test cases according to the relevant parameter of user's input, reduces automatic test cases and set The technical threshold of meter and the design efficiency for improving automatic test cases;Since user does not need code Design test case, Error probability can be reduced;Tester can input related ginseng according to testing requirement in the management tool of manual test use-case Number creation automatic test cases, and manual test use-case and automatic can be called in the management tool of manual test use-case Change test case to be tested, do not need switch test platform, the time that can save switching platform is avoided that demand is tested again It omits or test redundancy, realization improves the purpose of testing efficiency.
Terminal device can also generate test report by the management tool of manual test use-case, so that tester passes through The test report of generation understands the relevant test data of automatic test cases;It can also be by the dependence test of manual test use-case Data and the relevant test data of automatic test cases are summarized, and tester, which passes through a test report, can be appreciated that The test data of manual test use-case and automatic test cases.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
Referring to Fig. 3, Fig. 3 is a kind of structural block diagram for terminal device that one embodiment of the invention provides, terminal device packet The each unit included is used to execute each step in the corresponding embodiment of FIG. 1 to FIG. 2.It is respectively corresponded to referring specifically to Fig. 1 and Fig. 2 Embodiment in associated description.For ease of description, only the parts related to this embodiment are shown.Referring to Fig. 3, terminal is set Standby 3 include:
Solicited message acquiring unit 310, for obtaining target circle in the management tool that user passes through manual test use-case The solicited message of face triggering;Wherein, target interface is the interactive interface for creating automatic test cases for user, described to ask Ask information for request generate automatic test cases, the solicited message includes interface message, the interface message be used for mark Know the solicited message and requests the achievable functional information of automatic test cases generated;
Indicate information acquisition unit 320, the application programming interfaces of the management tool for calling automatic test cases lead to It crosses the application programming interfaces and obtains the corresponding input parameter instruction information of the solicited message and output parameter instruction information;
Parameter acquiring unit 330 is believed for obtaining the user according to the input parameter of input parameter instruction information input Breath, and obtain the output parameter information that the user indicates information input according to output parameter;
Generation unit 340 is surveyed for generating automation according to the input paramete information and the output parameter information Example on probation.
Optionally, terminal device 3 further include:
Test data acquiring unit 350, if for detecting the control instruction for triggering the automatic test cases operation, Then obtain the first test parameter tested by the automatic test cases, and the operation automatic test cases When the first test result data for generating;
Test report production unit 360, for according to first test parameter and first test result data Generate the test report of the automatic test cases.
Optionally, test data acquiring unit 350 is also used to: obtaining the second of the manual test use-case of user's input Test parameter and the second test result;
Test report production unit 360 is also used to: according to first test parameter, first test result data, Second test parameter and second test result data generate test report.
Further, instruction information acquisition unit 320 is specifically used for:
Call automatic test cases management tool application programming interfaces, by the application programming interfaces obtain with The matched interface parameters of the interface message that the solicited message includes;
According to interface parameters acquisition and the matched use-case template of the interface parameters, and according to the matched use-case Template determines that input parameter instruction information and output parameter indicate information.
Further, the solicited message further includes testing requirement information;Instruction information acquisition unit 320 is specifically used for:
Call automatic test cases management tool application programming interfaces, by the application programming interfaces obtain with The matched interface parameters of the interface message that the solicited message includes;
According to the interface parameters and the testing requirement acquisition of information and the matched use-case template of the interface parameters, Determine that input parameter instruction information and output parameter indicate information according to the matched use-case template.
Referring to Fig. 4, Fig. 4 be another embodiment of the present invention provides a kind of terminal device schematic diagram.As shown in figure 4, The terminal device 4 of the embodiment includes: processor 40, memory 41 and is stored in the memory 41 and can be at the place The computer program 42 run on reason device 40, such as the control program of terminal device.The processor 40 executes the computer The step in above-mentioned each embodiment of the method for generating automatic test cases, such as S101 shown in FIG. 1 are realized when program 42 To S104.Alternatively, the processor 40 realizes each unit in above-mentioned each Installation practice when executing the computer program 42 Function, such as the function of module 310 to 360 shown in Fig. 3.
Illustratively, the computer program 42 can be divided into one or more units, one or more of Unit is stored in the memory 41, and is executed by the processor 40, to complete the present invention.One or more of lists Member can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing the computer journey Implementation procedure of the sequence 42 in the terminal device 4.For example, the computer program 42 can be divided into solicited message acquisition Unit, instruction information acquisition unit, parameter acquiring unit, generation unit, test data acquiring unit and test report production Unit etc., each unit concrete function are as described above.
The terminal device may include, but be not limited only to, processor 40, memory 41.Those skilled in the art can manage Solution, Fig. 4 is only the example of terminal device 4, does not constitute the restriction to terminal device 4, may include more or more than illustrating Few component perhaps combines certain components or different components, such as the terminal device can also be set including input and output Standby, network access equipment, bus etc..
Alleged processor 40 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made 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 is also possible to any conventional processor Deng.
The memory 41 can be the internal storage unit of the terminal device 4, such as the hard disk or interior of terminal device 4 It deposits.The memory 41 is also possible to the External memory equipment of the terminal device 4, such as be equipped on the terminal device 4 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge Deposit card (Flash Card) etc..Further, the memory 41 can also both include the storage inside list of the terminal device 4 Member also includes External memory equipment.The memory 41 is for storing needed for the computer program and the terminal device Other programs and data.The memory 41 can be also used for temporarily storing the data that has exported or will export.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of method for generating automatic test cases characterized by comprising
Obtain the solicited message of the target interface triggering in the management tool that user passes through manual test use-case;Wherein, the mesh The face of demarcating is the interactive interface for creating automatic test cases for user, and the solicited message generates automation for requesting Test case, the solicited message include interface message, and the interface message requests to generate for identifying the solicited message The achievable functional information of automatic test cases;
The application programming interfaces for calling the management tool of automatic test cases, by being asked described in application programming interfaces acquisition Ask the corresponding input parameter instruction information of information and output parameter instruction information;
The user is obtained according to the input paramete information of input parameter instruction information input, and obtains the user according to defeated The output parameter information of parameter instruction information input out;
Automatic test cases are generated according to the input paramete information and the output parameter information.
2. the method according to claim 1, wherein described according to the input paramete information and the output Parameter information generates after automatic test cases, further includes:
If detecting the control instruction for triggering the automatic test cases operation, obtains and pass through the automatic test cases The first test parameter tested, and the first test result data generated when the operation automatic test cases;
The test of the automatic test cases is generated according to first test parameter and first test result data Report.
3. according to the method described in claim 2, it is characterized in that, if described detect the triggering automatic test cases fortune Capable control instruction then obtains the first test parameter tested by the automatic test cases, and described in operation After the first test result data generated when automatic test cases, further includes:
Obtain the second test parameter and the second test result of the manual test use-case of user's input;
It is surveyed according to first test parameter, first test result data, second test parameter and described second Test result data generate test report.
4. method according to any one of claims 1 to 3, which is characterized in that the pipe for calling automatic test cases The application programming interfaces of science and engineering tool obtain the corresponding input parameter instruction letter of the solicited message by the application programming interfaces Breath and output parameter indicate information, comprising:
Call automatic test cases management tool application programming interfaces, by the application programming interfaces obtain with it is described The matched interface parameters of the interface message that solicited message includes;
According to interface parameters acquisition and the matched use-case template of the interface parameters, and according to the matched use-case template Determine that input parameter instruction information and output parameter indicate information.
5. method according to any one of claims 1 to 3, which is characterized in that the solicited message further includes testing requirement Information;
The application programming interfaces of the management tool for calling automatic test cases obtain institute by the application programming interfaces State the corresponding input parameter instruction information of solicited message and output parameter instruction information, comprising:
Call automatic test cases management tool application programming interfaces, by the application programming interfaces obtain with it is described The matched interface parameters of the interface message that solicited message includes;
According to the interface parameters and the testing requirement acquisition of information and the matched use-case template of the interface parameters, and root Determine that input parameter instruction information and output parameter indicate information according to the matched use-case template.
6. a kind of terminal device, which is characterized in that the terminal device includes memory, processor and is stored in the storage In device and the computer program that can run on the processor, the processor are realized as follows when executing the computer program Step:
Obtain the solicited message of the target interface triggering in the management tool that user passes through manual test use-case;Wherein, the mesh The face of demarcating is the interactive interface for creating automatic test cases for user, and the solicited message generates automation for requesting Test case, the solicited message include interface message, and the interface message requests to generate for identifying the solicited message The achievable functional information of automatic test cases;
The application programming interfaces for calling the management tool of automatic test cases, by being asked described in application programming interfaces acquisition Ask the corresponding input parameter instruction information of information and output parameter instruction information;
The user is obtained according to the input paramete information of input parameter instruction information input, and obtains the user according to defeated The output parameter information of parameter instruction information input out;
Automatic test cases are generated according to the input paramete information and the output parameter information.
7. terminal device according to claim 6, which is characterized in that described according to the input paramete information and described After output parameter information generates automatic test cases, following step is also realized when the processor executes the computer program It is rapid:
If detecting the control instruction for triggering the automatic test cases operation, obtains and pass through the automatic test cases The first test parameter tested, and the first test result data generated when the operation automatic test cases;
The test report of the automatic test cases is generated according to the test parameter and the test result data.
8. terminal device according to claim 6, which is characterized in that the management tool for calling automatic test cases Application programming interfaces, obtain the solicited message corresponding input parameter instruction information and output parameter instruction information, packet It includes:
The application programming interfaces of the management tool of automatic test cases are called, the interface for including with the solicited message is obtained and believes Cease matched interface parameters;
According to interface parameters acquisition and the matched use-case template of the interface parameters, and according to the matched use-case template Determine that input parameter instruction information and output parameter indicate information.
9. according to the described in any item terminal devices of claim 6 to 8, which is characterized in that the solicited message further includes test Demand information;
The application programming interfaces of the management tool for calling automatic test cases, obtain the corresponding input of the solicited message Parameter indicates that information and output parameter indicate information, comprising:
The application programming interfaces of the management tool of automatic test cases are called, the interface for including with the solicited message is obtained and believes Cease matched interface parameters;
According to the interface parameters and the testing requirement acquisition of information and the matched use-case template of the interface parameters, and root Determine that input parameter instruction information and output parameter indicate information according to the matched use-case template.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 5 of realization the method.
CN201810554444.8A 2018-06-01 2018-06-01 Method and terminal equipment for generating automatic test case Active CN108984388B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810554444.8A CN108984388B (en) 2018-06-01 2018-06-01 Method and terminal equipment for generating automatic test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810554444.8A CN108984388B (en) 2018-06-01 2018-06-01 Method and terminal equipment for generating automatic test case

Publications (2)

Publication Number Publication Date
CN108984388A true CN108984388A (en) 2018-12-11
CN108984388B CN108984388B (en) 2023-10-27

Family

ID=64540396

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810554444.8A Active CN108984388B (en) 2018-06-01 2018-06-01 Method and terminal equipment for generating automatic test case

Country Status (1)

Country Link
CN (1) CN108984388B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083526A (en) * 2019-03-15 2019-08-02 深圳壹账通智能科技有限公司 Applied program testing method, device, computer installation and storage medium
CN110532169A (en) * 2019-07-08 2019-12-03 平安科技(深圳)有限公司 Interface testing case generation method, device, computer equipment and storage medium
CN110727597A (en) * 2019-10-15 2020-01-24 杭州安恒信息技术股份有限公司 Method for completing use case based on log troubleshooting invalid codes
CN110928777A (en) * 2019-11-15 2020-03-27 深圳前海微众银行股份有限公司 Test case processing method, device, equipment and storage medium
CN111061637A (en) * 2019-12-13 2020-04-24 广州品唯软件有限公司 Interface test method, interface test device and storage medium
CN111459495A (en) * 2020-03-30 2020-07-28 招商局金融科技有限公司 Unit test code file generation method, electronic device and storage medium
CN111638875A (en) * 2020-06-05 2020-09-08 中国银行股份有限公司 Opposite terminal generation method and system
CN112241372A (en) * 2020-10-22 2021-01-19 北京字节跳动网络技术有限公司 Terminal testing method and device and electronic equipment
CN112416744A (en) * 2020-01-21 2021-02-26 上海哔哩哔哩科技有限公司 Test control system, method and equipment
CN113204495A (en) * 2021-05-31 2021-08-03 广州方硅信息技术有限公司 Automatic testing method and device based on B/S architecture, storage medium and equipment
CN113238904A (en) * 2021-05-25 2021-08-10 海光信息技术股份有限公司 Interface switching device, interface testing method and interface switching system
CN113407444A (en) * 2021-06-03 2021-09-17 中科曙光国际信息产业有限公司 Interface test case generation method, device, equipment and storage medium
CN113434395A (en) * 2021-06-22 2021-09-24 中国平安人寿保险股份有限公司 Automatic generation method, device, equipment and medium of test case
CN115047836A (en) * 2022-06-27 2022-09-13 中国核动力研究设计院 Test case generation and loading method and system based on DCS system periodic test

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6148277A (en) * 1997-12-18 2000-11-14 Nortel Networks Corporation Apparatus and method for generating model reference tests
US20030204784A1 (en) * 2002-04-29 2003-10-30 Jorapur Gopal P. System and method for automatic test case generation
CN106874202A (en) * 2017-02-14 2017-06-20 网易无尾熊(杭州)科技有限公司 Method, device and readable storage medium storing program for executing for unit testing
CN107481766A (en) * 2017-08-28 2017-12-15 郑州云海信息技术有限公司 A kind of method of testing and device
CN107766190A (en) * 2017-10-31 2018-03-06 平安科技(深圳)有限公司 Interface test method, device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6148277A (en) * 1997-12-18 2000-11-14 Nortel Networks Corporation Apparatus and method for generating model reference tests
US20030204784A1 (en) * 2002-04-29 2003-10-30 Jorapur Gopal P. System and method for automatic test case generation
CN106874202A (en) * 2017-02-14 2017-06-20 网易无尾熊(杭州)科技有限公司 Method, device and readable storage medium storing program for executing for unit testing
CN107481766A (en) * 2017-08-28 2017-12-15 郑州云海信息技术有限公司 A kind of method of testing and device
CN107766190A (en) * 2017-10-31 2018-03-06 平安科技(深圳)有限公司 Interface test method, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄颖: "软件功能测试用例自动化生成与优化研究", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》, no. 01, pages 138 - 170 *

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083526A (en) * 2019-03-15 2019-08-02 深圳壹账通智能科技有限公司 Applied program testing method, device, computer installation and storage medium
CN110532169A (en) * 2019-07-08 2019-12-03 平安科技(深圳)有限公司 Interface testing case generation method, device, computer equipment and storage medium
CN110727597B (en) * 2019-10-15 2023-03-10 杭州安恒信息技术股份有限公司 Method for checking invalid code completion case based on log
CN110727597A (en) * 2019-10-15 2020-01-24 杭州安恒信息技术股份有限公司 Method for completing use case based on log troubleshooting invalid codes
CN110928777A (en) * 2019-11-15 2020-03-27 深圳前海微众银行股份有限公司 Test case processing method, device, equipment and storage medium
CN110928777B (en) * 2019-11-15 2023-04-07 深圳前海微众银行股份有限公司 Test case processing method, device, equipment and storage medium
CN111061637A (en) * 2019-12-13 2020-04-24 广州品唯软件有限公司 Interface test method, interface test device and storage medium
CN111061637B (en) * 2019-12-13 2023-08-18 广州品唯软件有限公司 Interface testing method, interface testing device and storage medium
CN112416744A (en) * 2020-01-21 2021-02-26 上海哔哩哔哩科技有限公司 Test control system, method and equipment
CN111459495A (en) * 2020-03-30 2020-07-28 招商局金融科技有限公司 Unit test code file generation method, electronic device and storage medium
CN111459495B (en) * 2020-03-30 2023-03-31 招商局金融科技有限公司 Unit test code file generation method, electronic device and storage medium
CN111638875A (en) * 2020-06-05 2020-09-08 中国银行股份有限公司 Opposite terminal generation method and system
CN111638875B (en) * 2020-06-05 2023-09-22 中国银行股份有限公司 Opposite terminal generation method and system
CN112241372A (en) * 2020-10-22 2021-01-19 北京字节跳动网络技术有限公司 Terminal testing method and device and electronic equipment
CN113238904A (en) * 2021-05-25 2021-08-10 海光信息技术股份有限公司 Interface switching device, interface testing method and interface switching system
CN113238904B (en) * 2021-05-25 2023-04-28 海光信息技术股份有限公司 Interface switching device, interface testing method and interface switching system
CN113204495A (en) * 2021-05-31 2021-08-03 广州方硅信息技术有限公司 Automatic testing method and device based on B/S architecture, storage medium and equipment
CN113407444A (en) * 2021-06-03 2021-09-17 中科曙光国际信息产业有限公司 Interface test case generation method, device, equipment and storage medium
CN113407444B (en) * 2021-06-03 2022-11-25 中科曙光国际信息产业有限公司 Interface test case generation method, device, equipment and storage medium
CN113434395A (en) * 2021-06-22 2021-09-24 中国平安人寿保险股份有限公司 Automatic generation method, device, equipment and medium of test case
CN113434395B (en) * 2021-06-22 2024-04-30 中国平安人寿保险股份有限公司 Automatic generation method, device, equipment and medium for test cases
CN115047836A (en) * 2022-06-27 2022-09-13 中国核动力研究设计院 Test case generation and loading method and system based on DCS system periodic test

Also Published As

Publication number Publication date
CN108984388B (en) 2023-10-27

Similar Documents

Publication Publication Date Title
CN108984388A (en) A kind of method and terminal device generating automatic test cases
CN107861870B (en) Interface test and test data generation method, device, terminal and storage medium
CN108304201B (en) Object updating method, device and equipment
US9483386B2 (en) Information interaction test device and method based on automatic generation of associated test cases
US8904355B2 (en) Test script generation system
CN108415832A (en) Automatic interface testing method, device, equipment and storage medium
CN103984626B (en) A kind of method and device for generating test case script
CN110276074B (en) Distributed training method, device, equipment and storage medium for natural language processing
CN111427561A (en) Service code generation method and device, computer equipment and storage medium
CN111045911B (en) Performance test method, performance test device, storage medium and electronic equipment
CN113032244B (en) Interface test method, device, computer system and computer readable storage medium
CN106487712B (en) For accessing the method, apparatus and server of multiple external systems
CN110084567A (en) E-seal application method, device, equipment and computer readable storage medium
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
US10536536B1 (en) Resource discovery agent computing device, software application, and method
CN105739979A (en) Workflow selection method based on probability service process
CN113448570A (en) Data processing method and device, electronic equipment and storage medium
CN113515271A (en) Service code generation method and device, electronic equipment and readable storage medium
CN113032256B (en) Automated testing method, apparatus, computer system, and readable storage medium
CN114282760A (en) Workflow generation method and device combining dynamic form and dynamic flow
CN114756301A (en) Log processing method, device and system
CN110737427B (en) Internet technology architecture, construction method and device thereof, electronic equipment and medium
CN109992561A (en) Industrial real-time computing technique, storage medium and calculating equipment
CN113656268B (en) Performance test method and device for business service, electronic equipment and storage medium
CN112130935B (en) API aggregation and data processing method and system based on interface description language

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