CN112380138B - Test case compiling method and device and storage medium - Google Patents

Test case compiling method and device and storage medium Download PDF

Info

Publication number
CN112380138B
CN112380138B CN202011416899.7A CN202011416899A CN112380138B CN 112380138 B CN112380138 B CN 112380138B CN 202011416899 A CN202011416899 A CN 202011416899A CN 112380138 B CN112380138 B CN 112380138B
Authority
CN
China
Prior art keywords
case
test
standard library
verification
function
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.)
Active
Application number
CN202011416899.7A
Other languages
Chinese (zh)
Other versions
CN112380138A (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.)
Seczone Technology Co Ltd
Original Assignee
Seczone 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 Seczone Technology Co Ltd filed Critical Seczone Technology Co Ltd
Priority to CN202011416899.7A priority Critical patent/CN112380138B/en
Publication of CN112380138A publication Critical patent/CN112380138A/en
Application granted granted Critical
Publication of CN112380138B publication Critical patent/CN112380138B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

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 provides a design method, a device and a storage medium of a test case, which comprises the steps of obtaining a test point of a software application demand document, wherein the test point is a demand point in the software demand document; finding out function test method information corresponding to the test point from the function case standard library according to the test point; finding out the verification test method information corresponding to the test point from the verification case standard library according to the test point; and generating a test case according to the functional test method information and the verification test method information. The related function case standard library and the related verification case standard library are generated by extracting common points in product requirements, so that direct reference and copying can be performed in the subsequent actual case compiling process, and then a small amount of modification can be performed, so that a tester can output a relatively comprehensive test case document in a short time, and the compiling efficiency of the test case is improved.

Description

Test case compiling method and device and storage medium
Technical Field
The invention relates to the field of software, in particular to a method and a device for compiling a test case and a storage medium.
Background
With the rapid development of the internet technology, the software testing industry is more and more approved, the testing becomes an indispensable part in the software life cycle, for many companies, the quality of the testing determines the product quality, and the phenomenon is more common in most of medium and small-sized companies in China.
The test case is the most important test basis among software testers, namely a traditional waterfall type development model or an agile flow which is popular at present. In order to improve the quality of products, testers often describe test cases in great detail, wherein the description includes common verification type cases, function type cases and flow type cases, and although the detailed description of the test cases brings great benefits to the testers, such as a quick recovery process for the testers, the following problems also exist, namely the writing efficiency of the test cases is low, and particularly under the agile flow, the problem is more prominent. Too much text description results in the user not being able to quickly understand the emphasis of the test for reading and understanding.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: in the testing process, the problem of low compiling efficiency of the test cases exists.
In order to solve the technical problems, the invention adopts the technical scheme that: a first aspect of an embodiment of the present invention provides a method for writing a test case, including:
obtaining a test point of a software application demand document, wherein the test point is a demand point in the software demand document;
finding out function test case information corresponding to the test point from a function case standard library, wherein the function case standard library prestores function case information used for inducing the test point function design specification;
finding out verification test case information corresponding to the test point from a verification case standard library, wherein the verification case standard library prestores verification case information used for concluding the specification of a text box of the test point;
and generating a test case according to the functional test case information and the verification test case information.
Further, the finding out the functional test case information corresponding to the test point from the functional case standard library specifically includes:
matching the test point with function case information of a function case standard library, wherein the test point has a function design specification attribute;
and if the functional design specification attribute of the test point is successfully matched with the functional case information of the functional case standard library, directly referencing the functional case of the functional case standard library.
Further, the matching the test point with the function case information of the function case standard library further includes:
and if the matching of the test point and the function case standard library fails, acquiring the written function case.
Further, finding out the verification test case information corresponding to the test point from a verification case standard library specifically includes:
matching the verification case information of the verification case standard library of the test points, wherein the test points are provided with
There is a text box specification attribute;
and if the text box specification attribute of the test point is successfully matched with the verification case information of the verification case standard library, directly referencing the verification case of the verification case standard library.
Further, the matching the test point with the verification case information of the verification case standard library further includes:
and if the matching of the test point and the check case standard library fails, acquiring the written check case.
Further, the function case standard library comprises adding, deleting, modifying, inquiring, page turning and skipping, and batch and uploading.
Further, the standard library of the check case comprises a text box, a single-choice drop-down box and a multi-choice drop-down box.
A second aspect of the embodiments of the present invention provides a device for compiling a test case, including:
the acquisition module acquires a test point of a software application demand document, wherein the test point is a demand point in the software demand document;
the function module is used for finding out function test case information corresponding to the test point from a function case standard library, and the function case standard library is prestored with function case information used for inducing the test point function design specification;
the verification module is used for finding out verification test case information corresponding to the test point from a verification case standard library, and the verification case standard library prestores verification case information used for concluding the specification of a text box of the test point;
and the generating module generates the test case according to the functional test case information and the verification test case information.
A third aspect of the embodiments of the present invention provides a computer-readable storage medium, on which executable instructions are stored, and when executed, the method described above is performed.
The invention has the beneficial effects that: the related function case standard library and the related verification case standard library are generated by extracting common points in product requirements, so that direct reference and copying can be performed in the subsequent actual case compiling process, and then a small amount of modification can be performed, so that a tester can output a relatively comprehensive test case document in a short time, and the compiling efficiency of the test case is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It is to be understood that the drawings in the following description are of some, but not all, embodiments of the invention. For a person skilled in the art, other figures can also be obtained from the provided figures without inventive effort.
FIG. 1 is a flowchart of a test case compiling method according to a first embodiment of the present invention.
FIG. 2 is a flowchart of a second embodiment and a flowchart of a third embodiment of a test case compiling method according to the present invention.
FIG. 3 is a block diagram of an apparatus for a method of writing test cases according to the present invention.
Detailed Description
For purposes of promoting a clear understanding of the objects, aspects and advantages of the invention, reference will now be made in detail to the present embodiments of the invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements throughout. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
Example 1
Referring to fig. 1, a first aspect of the embodiment of the present invention provides a method for writing test cases, including the following steps S1 to S4:
s1, obtaining a test point of the software application requirement document, wherein the test point is a requirement point in the software requirement document;
here, the requirement document corresponds to the requirement of the product, and before the development of a product, there is a corresponding requirement specification document or description document. Site refinement is performed for these requirements.
S2, finding out function test case information corresponding to the test point from a function case standard library, wherein the function case standard library pre-stores function case information for inducing the test point function design specification;
here, the function case standard library includes addition, deletion, modification, query, page turning skip, batch and upload; the adding comprises the normal adding of a record and the adding canceling, the deleting comprises the normal deleting and the canceling, the normal modifying information is modified, the inquiring comprises the normal fuzzy inquiring of the current record and the normal accurate inquiring of the current record, the page turning and skipping is the normal page turning and skipping, the batch is the normal batch operation, and the uploading comprises the normal uploading and the abnormal uploading.
S3, finding out verification test case information corresponding to the test point from a verification case standard library, wherein the verification case standard library prestores verification case information used for inducing test point text box specifications;
here, the standard library of the check case comprises a text box, a single-choice drop-down box and a multiple-choice drop-down box, wherein the text box comprises a length input check, a character type check, a special character check and a required item check; the single selection drop-down box comprises value correctness checking and mandatory item checking; the multi-choice drop-down box comprises value correctness checking, multi-value option checking and mandatory item checking; the length input check includes an input length of 0, an input length greater than the limit, and an input length equal to the limit.
And S4, generating a test case according to the functional test case information and the verification test case information.
The related function case standard library and the related check case standard library are generated by extracting common points in product requirements, and can be directly quoted and copied in the subsequent actual case compiling process, and then a small amount of modification can be carried out, so that a tester can output a relatively comprehensive test case document in a short time, and the compiling efficiency of the test case is improved.
Example 1
Referring to fig. 2, fig. 2 is a flowchart illustrating step S2 in fig. 1 according to an embodiment of the present invention.
Compared with the method for writing test cases provided by the first embodiment of the present invention, the second embodiment of the present invention designs step S2 in detail.
As shown in fig. 2, step S2 specifically includes the following steps S21 to S23.
S21, matching the test points with function case information of a function case standard library, wherein the test points have a function design specification attribute;
s22, if the functional design specification attribute of the test point is successfully matched with the functional case information of the functional case standard library, directly referencing the functional case of the functional case standard library;
the matching of the test point with the function case information of the function case standard library further comprises:
and S23, if the matching of the test point and the function case standard library fails, acquiring the written function case.
Example 2
Referring to fig. 2, fig. 2 further includes a schematic flowchart of step S3 in fig. 1 according to an embodiment of the present invention.
Compared with the method for writing test cases provided by the first embodiment of the present invention, the third embodiment of the present invention designs step S3 in detail.
As shown in fig. 2, step S3 specifically includes the following steps S31 to S33.
S31, matching the test point with the verification case information of a verification case standard library, wherein the test point has a textbox specification attribute;
s32, if the textbox specification attribute of the test point is successfully matched with the verification case information of the verification case standard library, directly referring to the verification case of the verification case standard library;
the matching of the test point with the verification case information of the verification case standard library further comprises:
and S33, if the matching of the test point and the standard library of the check case fails, acquiring the written check case.
The method also comprises other use cases, wherein the function use case and the check use case are only a part of use cases.
Example 3
Referring to fig. 3, fig. 3 is a block diagram of a test case compiling device according to an embodiment of the present invention.
As shown in fig. 3, a fourth embodiment of the present invention provides a test case designing apparatus 100 corresponding to the test case compiling method of the present invention, including:
the obtaining module 101 is used for obtaining a test point of a software application demand document, wherein the test point is a demand point in the software demand document;
the function module 102 is used for finding out function test case information corresponding to the test point from a function case standard library, wherein the function case standard library is prestored with function case information used for inducing the test point function design specification;
the verification module 103 is used for finding out verification test case information corresponding to the test point from a verification case standard library, wherein the verification case standard library is prestored with verification case information used for inducing the specification of a text box of the test point;
and the generating module 104 generates the test case according to the functional test case information and the verification test case information.
Example 4
A fourth embodiment of the present invention provides a computer-readable storage medium having stored thereon executable instructions that, when executed, perform the method as provided in any one of the first to second embodiments of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk), among others.
It should be noted that, in the summary of the present invention, each embodiment is described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the method class embodiment, since it is similar to the product class embodiment, the description is simple, and the relevant points can be referred to the partial description of the product class embodiment.
It is further noted that, in the present disclosure, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined in this disclosure may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (7)

1. A method for writing test cases is characterized by comprising the following steps:
obtaining a test point of a software application demand document, wherein the test point is a demand point in the software demand document;
finding out function test case information corresponding to the test point from a function case standard library, wherein the function case standard library prestores function case information used for inducing the test point function design specification;
finding out verification test case information corresponding to the test point from a verification case standard library, wherein the verification case standard library prestores verification case information used for concluding the specification of a text box of the test point;
generating a test case according to the functional test case information and the verification test case information, wherein the functional case standard library and the verification case standard library are obtained through a common point in the refined product requirement;
the finding out the functional test case information corresponding to the test point from the functional case standard library specifically comprises the following steps:
matching the test point with function case information of a function case standard library, wherein the test point has a function design specification attribute;
if the functional design specification attribute of the test point is successfully matched with the functional case information of the functional case standard library, directly referencing the functional case of the functional case standard library;
finding out the verification test case information corresponding to the test point from a verification case standard library, which specifically comprises the following steps:
matching the verification case information of the verification case standard library of the test points, wherein the test points have a text box specification attribute;
and if the text box specification attribute of the test point is successfully matched with the verification case information of the verification case standard library, directly referencing the verification case of the verification case standard library.
2. The method for writing test cases according to claim 1, wherein the matching of the test points with the function case information of the function case standard library further comprises:
and if the matching of the test point and the function case standard library fails, acquiring the written function case.
3. The method for writing test cases according to claim 2, wherein the matching of the test points with the test case information of the test case standard library further comprises:
and if the matching of the test point and the check case standard library fails, acquiring the written check case.
4. The method for authoring test cases according to claim 1, wherein: the function case standard library comprises adding, deleting, modifying, inquiring, page turning and skipping, and batch and uploading.
5. The method for authoring test cases according to claim 1, wherein: the standard library of the check case comprises a text box, a single-selection drop-down box and a multi-selection drop-down box.
6. An apparatus for compiling test cases, comprising:
the acquisition module acquires a test point of a software application demand document, wherein the test point is a demand point in the software demand document;
the function module is used for finding out function test case information corresponding to the test point from a function case standard library, and the function case standard library is prestored with function case information used for inducing the test point function design specification; matching the test point with function case information of a function case standard library, wherein the test point has a function design specification attribute; if the functional design specification attribute of the test point is successfully matched with the functional case information of the functional case standard library, directly referencing the functional case of the functional case standard library;
the verification module is used for finding out verification test case information corresponding to the test point from a verification case standard library, and the verification case standard library prestores verification case information used for concluding the specification of a text box of the test point; matching the verification case information of the verification case standard library of the test points, wherein the test points have a text box specification attribute; if the textbox specification attribute of the test point is successfully matched with the verification case information of the verification case standard library, directly referencing the verification case of the verification case standard library;
and the generating module is used for generating the test case according to the functional test case information and the verification test case information, wherein the functional case standard library and the verification case standard library are obtained through a common point in the refined product requirements.
7. A computer-readable storage medium having stored thereon executable instructions that, when executed, perform the method of any one of claims 1-5.
CN202011416899.7A 2020-12-07 2020-12-07 Test case compiling method and device and storage medium Active CN112380138B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011416899.7A CN112380138B (en) 2020-12-07 2020-12-07 Test case compiling method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011416899.7A CN112380138B (en) 2020-12-07 2020-12-07 Test case compiling method and device and storage medium

Publications (2)

Publication Number Publication Date
CN112380138A CN112380138A (en) 2021-02-19
CN112380138B true CN112380138B (en) 2021-11-09

Family

ID=74590555

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011416899.7A Active CN112380138B (en) 2020-12-07 2020-12-07 Test case compiling method and device and storage medium

Country Status (1)

Country Link
CN (1) CN112380138B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113190434B (en) * 2021-04-12 2024-03-08 成都安易迅科技有限公司 Test case generation method and device, storage medium and computer equipment
CN113567797B (en) * 2021-09-27 2022-02-22 北京全路通信信号研究设计院集团有限公司 Design method and system suitable for track circuit product performance test case
CN115114176A (en) * 2022-08-30 2022-09-27 云账户技术(天津)有限公司 Assertion method, device, medium, apparatus, and program for automated test result
CN115509900B (en) * 2022-09-15 2024-02-02 上海宜软检测技术有限公司 Method and system for generating functional test cases

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102968373A (en) * 2012-11-29 2013-03-13 安科智慧城市技术(中国)有限公司 Method and device for maintaining test system
CN105893254A (en) * 2016-03-29 2016-08-24 乐视控股(北京)有限公司 Test case input method and device
CN107783901A (en) * 2017-09-26 2018-03-09 深圳市牛鼎丰科技有限公司 Method for generating test case, device, computer equipment and storage medium
CN108829604A (en) * 2018-06-28 2018-11-16 北京车和家信息技术有限公司 Method for generating test case and device based on vehicle control device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
IN2013CH05995A (en) * 2013-12-20 2015-06-26 Infosys Ltd
US10146669B2 (en) * 2014-07-25 2018-12-04 International Business Machines Corporation Indicating a readiness of a change for implementation into a computer program
CN105426312A (en) * 2015-12-31 2016-03-23 北京经纬恒润科技有限公司 Test suite generation method and device for smoke tests
US10229039B2 (en) * 2016-10-27 2019-03-12 International Business Machines Corporation Testing a virtual network function by a virtual network tester
CN107480056B (en) * 2017-07-31 2023-04-07 北京云测信息技术有限公司 Software testing method and device
CN110457200B (en) * 2018-05-08 2023-04-25 腾讯科技(上海)有限公司 Test case generation method and equipment, storage medium and electronic equipment thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102968373A (en) * 2012-11-29 2013-03-13 安科智慧城市技术(中国)有限公司 Method and device for maintaining test system
CN105893254A (en) * 2016-03-29 2016-08-24 乐视控股(北京)有限公司 Test case input method and device
CN107783901A (en) * 2017-09-26 2018-03-09 深圳市牛鼎丰科技有限公司 Method for generating test case, device, computer equipment and storage medium
CN108829604A (en) * 2018-06-28 2018-11-16 北京车和家信息技术有限公司 Method for generating test case and device based on vehicle control device

Also Published As

Publication number Publication date
CN112380138A (en) 2021-02-19

Similar Documents

Publication Publication Date Title
CN112380138B (en) Test case compiling method and device and storage medium
CN111104392B (en) Database migration method and device, electronic equipment and storage medium
CN110008743B (en) Data attribute identification method, device and equipment in block chain type account book
CN107783766B (en) Method and device for cleaning files of application program
CN106445815A (en) Automated testing method and device
CN111125008B (en) Dynamic repairing method and system of abnormal inode and related components
CN110990274A (en) Data processing method, device and system for generating test case
CN111309619A (en) Method and device for automatically generating test case
CN111930810A (en) Data rule mining method and device
CN117112060A (en) Component library construction method and device, electronic equipment and storage medium
CN106874173B (en) Page template testing method and device
CN113535817B (en) Feature broad table generation and service processing model training method and device
CN110008807B (en) Training method, device and equipment for contract content recognition model
CN108984223B (en) Program call decoupling method and device, electronic equipment and storage medium
CN112231197A (en) Page testing method and device and storage medium
CN110059087B (en) Data attribute identification method, device and equipment in block chain type account book
CN112069084A (en) Open source software configuration file detection and analysis method
US20060206540A1 (en) Generating unique name/version number pairs when names can be re-used
CN110750496A (en) File copying method, system, equipment and computer readable storage medium
CN112069083A (en) Test case design method and device and storage medium
KR102354808B1 (en) Apparatus and method for developing component
CN110309315B (en) Template file generation method and device, computer readable medium and electronic equipment
CN111325007A (en) Comment analyzing method and terminal for PPTX file
CN107229564B (en) Pressure simulation method and device
CN115129355B (en) Page repair method, system and computer equipment thereof

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