CN112328500A - Method for automatically generating black box test case - Google Patents

Method for automatically generating black box test case Download PDF

Info

Publication number
CN112328500A
CN112328500A CN202011367528.4A CN202011367528A CN112328500A CN 112328500 A CN112328500 A CN 112328500A CN 202011367528 A CN202011367528 A CN 202011367528A CN 112328500 A CN112328500 A CN 112328500A
Authority
CN
China
Prior art keywords
black box
box test
test case
boundary value
test cases
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
CN202011367528.4A
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.)
Chengdu Ghostcloud Technology Co ltd
Original Assignee
Chengdu Ghostcloud Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Ghostcloud Technology Co ltd filed Critical Chengdu Ghostcloud Technology Co ltd
Priority to CN202011367528.4A priority Critical patent/CN112328500A/en
Publication of CN112328500A publication Critical patent/CN112328500A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

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

Abstract

The invention relates to the field of software testing, in particular to a method for automatically generating a black box test case, which comprises the following steps: s1, the user inputs the data of the tested object according to the requirement; s2, selecting a black box test case design method; s3, generating a black box test case, solving the problems of long time and low coverage of the black box test case, shortening the software development period and improving the efficiency.

Description

Method for automatically generating black box test case
Technical Field
The invention relates to the field of software testing, in particular to a method for automatically generating a black box test case.
Background
Under the development that software testing is more and more emphasized, software testing flow is more systematic, software testing becomes an indispensable important step in the software development life cycle, the black box test case is tested from the corresponding relation of input data and output data from the perspective of a user, no matter in a traditional development mode or an agile development mode, the user is necessary to design the black box test case, the black box test case needs to be reusable, and under the condition of high coverage, the user needs to spend a large amount of time to design the black box test case, so that the practicability is poor, and the efficiency is low.
Disclosure of Invention
Based on the problems, the invention provides a method for automatically generating the black box test case, which solves the problems of long time and low coverage of the black box test case, shortens the software development period and improves the efficiency.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
a method for automatically generating a black box test case comprises the following steps:
s1, the user inputs the data of the tested object according to the requirement;
s2, selecting a black box test case design method;
and S3, generating a black box test case.
Further, the data of the object to be measured includes a type of the object to be measured, an input of the object to be measured, and an input rule.
Further, the design method of the black box test case comprises an equivalence class division method, a boundary value analysis method, a judgment table method or an orthogonal test method.
Further, the equivalence class partitioning method requires that black box test cases are collections of things with the same attributes or methods.
Further, in the boundary value analysis method, a user finds out a boundary value of the black box test case, and selects the boundary value and a value adjacent to the boundary value.
Further, the judgment table method obtains a result through an exhaustion condition, and combines all black box test cases generated according to the exhaustion condition to obtain a policy table.
Further, the orthogonal test method is to find out a minority of black box test cases which replace the comprehensive black box test cases, and design the minority of black box test cases into a table.
Compared with the prior art, the invention has the beneficial effects that: when the user uses the system, the idea of the system can be used for rapidly designing the black box test case, different tested objects are supported, and the efficiency is greatly improved in the software development life cycle.
Drawings
FIG. 1 is a flow chart of example 1.
Detailed Description
The invention will be further described with reference to the accompanying drawings. Embodiments of the present invention include, but are not limited to, the following examples.
Example 1
As shown in fig. 1, a method for automatically generating a black box test case includes the following steps:
s1, the user inputs the data of the tested object according to the requirement;
the data of the measured object comprises the type of the measured object, the input of the measured object and the input rule.
S2, selecting a black box test case design method;
the design method of the black box test case comprises an equivalence class division method, a boundary value analysis method, a judgment table method or an orthogonal test method, and specifically comprises the following steps:
the equivalence class division method requires that the black box test cases are object sets with the same attribute or method;
in the boundary value analysis method, a user finds out a boundary value of a black box test case, and selects the boundary value and a value adjacent to the boundary value;
the judgment table method obtains a result through an exhaustion condition, and combines all black box test cases generated according to the exhaustion condition to obtain a policy table;
the orthogonal test method is to find out a complete black box test case with a small number, and design the small number of black box test cases into a table.
And S3, generating a black box test case.
Example 2
The type of the tested object is a form, an equivalence class division method is adopted in the design of the black box test case, and the specific process is as follows:
s1, selecting the type of the tested object as a new added form by the user, wherein the input rule is as follows:
(1) a user name, any character within 5 bits and must be filled;
(2) cipher, English character within 12 bits and must be filled;
(3) and the industry pull-down option presets three options and is not required to be filled.
S2, selecting a black box test case design method as an equivalence class division method;
s3, generating a black box test case according to the following functions:
(1) checking an input range:
a. detecting an integer type;
b. the lower boundary value is less than or equal to the upper boundary value;
c. when incorrect, the input is prompted to be input again;
(2) an equivalence class division method is applied to divide the input range, and an effective interval and two ineffective intervals are returned;
(3) applying a random number generator to generate a specified number (input from a command line) of random values for each interval, noting that there are no repeated values in the returned values;
and S34, calling functions 1 to 3 by the main program to generate a black box test case.
Example 3
The type of the tested object is a form, a black box test case is designed by adopting a boundary value analysis method, and the specific process is as follows:
s1, selecting the type of the tested object as a new added form by the user, wherein the input rule is as follows:
(1) a user name, any character within 5 bits and must be filled;
(2) cipher, English character within 12 bits and must be filled;
(3) and the industry pull-down option presets three options and is not required to be filled.
S2, selecting a black box test case design method as a boundary value analysis method;
s3, generating a black box test case according to the following functions:
(1) checking an input range:
a. detecting an integer type;
b. the lower boundary value is less than or equal to the upper boundary value;
c. when incorrect, the input is prompted to be input again;
(2) applying a boundary value analysis method, removing boundary values of all the intervals, returning the boundary values, and paying attention to no repeated value in the returned boundary values;
(3) applying a random number generator to generate a specified number (input from a command line) of random values for each interval, noting that there are no repeated values in the returned values;
and S34, calling functions 1 to 3 by the main program to generate a black box test case.
The above is an embodiment of the present invention. The specific parameters in the above embodiments and examples are only for the purpose of clearly illustrating the invention verification process of the inventor and are not intended to limit the scope of the invention, which is defined by the claims, and all equivalent structural changes made by using the contents of the specification and the drawings of the present invention should be covered by the scope of the present invention.

Claims (7)

1. A method for automatically generating a black box test case is characterized in that: comprises the following steps
S1, the user inputs the data of the tested object according to the requirement;
s2, selecting a black box test case design method;
and S3, generating a black box test case.
2. The method of claim 1, wherein the method comprises: the data of the measured object comprises the type of the measured object, the input of the measured object and the input rule.
3. The method of claim 1, wherein the method comprises: the design method of the black box test case comprises an equivalence class division method, a boundary value analysis method, a judgment table method or an orthogonal test method.
4. The method of claim 3, wherein the method comprises: the equivalence class partitioning method requires that black box test cases be collections of things with the same attributes or methods.
5. The method of claim 3, wherein the method comprises: in the boundary value analysis method, a user finds out a boundary value of a black box test case, and selects the boundary value and a value adjacent to the boundary value.
6. The method of claim 3, wherein the method comprises: the judgment table method obtains results through exhaustion conditions, and combines all black box test cases generated according to the exhaustion conditions to obtain a policy table.
7. The method of claim 3, wherein the method comprises: the orthogonal test method is to find out a small number of black box test cases which replace the whole black box test cases, and design the small number of black box test cases into a table.
CN202011367528.4A 2020-11-27 2020-11-27 Method for automatically generating black box test case Pending CN112328500A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011367528.4A CN112328500A (en) 2020-11-27 2020-11-27 Method for automatically generating black box test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011367528.4A CN112328500A (en) 2020-11-27 2020-11-27 Method for automatically generating black box test case

Publications (1)

Publication Number Publication Date
CN112328500A true CN112328500A (en) 2021-02-05

Family

ID=74309132

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011367528.4A Pending CN112328500A (en) 2020-11-27 2020-11-27 Method for automatically generating black box test case

Country Status (1)

Country Link
CN (1) CN112328500A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593145A (en) * 2008-05-29 2009-12-02 福建升腾资讯有限公司 Designing method of high-efficiency high-coverage-rate function test case
CN104346278A (en) * 2014-09-28 2015-02-11 上海新炬网络技术有限公司 Matrix-model-based software testing method
CN107844417A (en) * 2017-10-20 2018-03-27 东软集团股份有限公司 Method for generating test case and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593145A (en) * 2008-05-29 2009-12-02 福建升腾资讯有限公司 Designing method of high-efficiency high-coverage-rate function test case
CN104346278A (en) * 2014-09-28 2015-02-11 上海新炬网络技术有限公司 Matrix-model-based software testing method
CN107844417A (en) * 2017-10-20 2018-03-27 东软集团股份有限公司 Method for generating test case and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
万映红主编, 西安交通大学出版社 *

Similar Documents

Publication Publication Date Title
US20070094541A1 (en) Method and apparatus for generating test execution sequences automatically for a software testing process
CN110716870B (en) Automatic service testing method and device
CN112232006B (en) Standard cell library verification method and device, electronic equipment and storage medium
CN109933535A (en) Generation method, device and the server of test case
CN104346278A (en) Matrix-model-based software testing method
CN105335281A (en) Method and device for automatic mock of external dependency
CN105224458A (en) A kind of database method of testing and system
US6449750B1 (en) Design verification device, method and memory media for integrated circuits
CN111309581A (en) Application performance detection method and device in database upgrading scene
CN111475402B (en) Program function testing method and related device
US7024345B1 (en) System and method for testing parameterized logic cores
CN105279092A (en) Software testing method and apparatus
CN114416547A (en) Test case based test method
CN110597728A (en) Method, device and system for constructing test data
CN105447003B (en) A kind of parameter sets generation method and equipment
CN112328500A (en) Method for automatically generating black box test case
CN111475397A (en) Method for batch test of form data by single submission
CN110489349B (en) JSON configuration file-based interface test method
US11443092B2 (en) Defect weight formulas for analog defect simulation
CN114064469A (en) Interface automation test method and storage medium
CN106055468A (en) Method and system for automatic testing of interface
CN110795142A (en) Configuration file generation method and device
CN114924992B (en) Formalized FPGA software security verification method and verification system
CN110399298A (en) A kind of test method and device
CN111290938A (en) Android semi-automatic testing method based on manual assistance

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: 20210205

RJ01 Rejection of invention patent application after publication