CN108920382A - Method for generating test case, device, storage medium and server - Google Patents
Method for generating test case, device, storage medium and server Download PDFInfo
- Publication number
- CN108920382A CN108920382A CN201810857956.1A CN201810857956A CN108920382A CN 108920382 A CN108920382 A CN 108920382A CN 201810857956 A CN201810857956 A CN 201810857956A CN 108920382 A CN108920382 A CN 108920382A
- Authority
- CN
- China
- Prior art keywords
- test case
- template
- test
- preliminary date
- graph data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
Abstract
The present invention relates to software test fields, and in particular to a kind of method for generating test case, device, storage medium and server, the method includes:The graph data for obtaining tested software, converts general data swap file for the graph data;The general data swap file is read, the preliminary date of test case is obtained;Test case template is obtained, the test case template is parsed and obtains test case preparation item in the test case template;The test case preliminary date and the test case preparation item are matched according to setting logic, by the corresponding test case preparation item of preliminary date write-in test case template of the test case, generates the test case with specified template.The present invention can fast and efficiently generate test case, and the test case generated has specification, unified format.
Description
Technical field
The present invention relates to software test fields, and in particular to a kind of method for generating test case, device, storage medium and clothes
Business device.
Background technique
Growing stronger day by day and gradually moving to maturity with Software Industry, software test is also evolving.From it is initial by
The part-time test of software programmers sets up independent full-time test organization to software company.Test job is also from simple random test
Develop into the testing process with mature specification, testing process includes:Establishment test plan writes test case, setup test
Data implement the multinomial contents such as test, test assessment.Wherein test case is the base for constituting design and formulating test process
Plinth, testing example design and to write be one of most important link in software test activity.And currently, for test case
It writes, is all to be written in test case template one by one from the analysis document of test case by tester, is consumed
The time taken is more, and greater probability occur leading to the test case lattice write due to different tester's thinking habit differences
The skimble-scamble problem of formula.
Summary of the invention
For overcome the above technical problem, the especially prior art can not efficiently, write to unified standard asking for test case
Topic, spy propose following technical scheme:
In a first aspect, the present invention provides a kind of generation methods of test case, including:
The graph data for obtaining tested software, converts general data swap file for the graph data;
The general data swap file is read, the preliminary date of test case is obtained;
Test case template is obtained, the test case template is parsed and obtains test case in the test case template
Preparation item;
The test case preliminary date and the test case preparation item are matched according to setting logic, the test is used
The corresponding test case preparation item of preliminary date write-in test case template of example, generates the test case with specified template.
Further, the preliminary date of the test case includes the priority of test case;It is described to use the test
The corresponding test case preparation item of preliminary date write-in test case template of example, including:
The priority for obtaining test case carries out the preliminary date of the test case according to the height of the priority
According to ranking results the corresponding test case preparation of test case template is written in the preliminary date of the test case by sequence
?.
Further, the preliminary date of the test case includes the incidence relation of test case;It is described by the test
The corresponding test case preparation item of preliminary date write-in test case template of use-case, including:
The incidence relation for obtaining test case, divides according to preliminary date of the incidence relation to the test case
According to group result the corresponding test case preparation item of test case template is written in the preliminary date of the test case by group.
Further, described to generate with after the test case for specifying template, further include:
The quantity for counting the test case, by the quantity of the test case compared with the quantity of the preliminary date
Compared with obtaining the conversion ratio of test case.
Further, the graph data includes system testing graph data, integration testing graph data and unit testing
The different types of graph data of graph data;It is described to convert general data swap file for the graph data, including:
The general data that the graph data is converted into respective file format is exchanged according to the type of the graph data
File.
Preferably, the acquisition test case template, including:
Corresponding test case module is obtained according to the file format type of general data swap file;The test case
Template includes system testing use-case module, integration testing use-case module and unit testing use-case module.
Second aspect, the present invention also provides a kind of Test cases technology devices, including:
Conversion module:For obtaining the graph data of tested software, general data exchange is converted by the graph data
File;
Data acquisition module:For reading the general data swap file, the preliminary date of test case is obtained;
Template parsing module:For obtaining test case template, parses the test case template and obtain the test use
Test case preparation item in example template;
Write module:The test case preliminary date and the test case preparation item are matched, by the test case
The corresponding test case preparation item of preliminary date write-in test case template, generating has the test case for specifying template.
Further, described device further includes:
Evaluate module:For counting the quantity of the test case, by the quantity of the test case and the prepared number
According to quantity compare, obtain the conversion ratio of test case.
The third aspect, the present invention also provides a kind of computer readable storage medium, the computer readable storage medium
On be stored with computer program, which realizes above-mentioned method for generating test case when being executed by processor.
Fourth aspect, the present invention also provides a kind of server, the terminal includes one or more processors, storage
Device, one or more application program, wherein one or more of application programs are stored in the memory and are configured
To be executed by one or more of processors, one or more of application programs are configured to carry out above-mentioned test case
Generation method.
Compared with prior art, the present invention having the advantages that:
The invention proposes a kind of method for generating test case, the figure of the function logic by obtaining description tested software
Then data obtain the preliminary date of test case, and the stent of parsing test case by parsing the graph data
Plate obtains the preparation item of test case, and then the test case preliminary date and the preparation item in test template match,
The preliminary date is written in the preparation item in test case template, finally the generation in specified template has specified format
The test case of specification, the uniform format of test case write is kept with this, while that improves test case writes efficiency, mentions
The reading experience for rising test case avoids leading to the test case format write not because different tester's thinking habits are different
Unified problem, to improve Efficiency of Software Testing.
The additional aspect of the present invention and advantage will be set forth in part in the description, these will become from the following description
Obviously, or practice through the invention is recognized.
Detailed description of the invention
Above-mentioned and/or additional aspect and advantage of the invention will become from the following description of the accompanying drawings of embodiments
Obviously and it is readily appreciated that, wherein:
Fig. 1 is an embodiment flow diagram of method for generating test case of the present invention;
Fig. 2 is another embodiment flow diagram of method for generating test case of the present invention;
Fig. 3 is the another embodiment flow diagram of method for generating test case of the present invention;
Fig. 4 is an embodiment schematic diagram of Test cases technology device of the present invention;
Fig. 5 is an example structure schematic diagram of server of the present invention.
Specific embodiment
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end
Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached
The embodiment of figure description is exemplary, and for explaining only the invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singular " one " used herein, " one
It is a ", " described " and "the" may also comprise plural form.It is to be further understood that being arranged used in specification of the invention
Diction " comprising " refers to that there are the feature, integer, step, operations, but it is not excluded that in the presence of or addition it is one or more other
Feature, integer, step, operation.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology art
Language and scientific term), there is meaning identical with the general understanding of those of ordinary skill in fields of the present invention.Should also
Understand, those terms such as defined in the general dictionary, it should be understood that have in the context of the prior art
The consistent meaning of meaning, and unless idealization or meaning too formal otherwise will not be used by specific definitions as here
To explain.
It will be appreciated by those skilled in the art that of the invention so-called " application ", " software ", " computer program " and similar
The concept of statement is same concept well known to those skilled in the art, refer to instructed by series of computation machine and related data money
The computer software for being suitable for electronics operation of the organic construction in source.Unless specified, this name itself is not by programming language kind
Class, rank, the operating system of operation of also not rely by it or platform are limited.In the nature of things, this genus is not also by any
The terminal of form is limited.
In one embodiment, the present invention provides a kind of method for generating test case, is applied in software test, such as Fig. 1
It is shown, it the described method comprises the following steps:
S100:The graph data for obtaining tested software, converts general data swap file for the graph data.
In the development process of software, it is soft to generally comprise the descriptions such as the files such as requirement documents, detailed design document, design UI
The document of each functional module of part, tester is designed according to those documents using process of the analysis tool to software test,
Combing, judges whether each module of tested software works normally by testing, by analysis tool by the function of tested software
Logic carries out step dismantling, while adding the different scenes for testing each step, as tested software described in the present embodiment
Then graph data converts general data file for the graph data, be by graph data in the general data file
Conversion can convenient reading document format, the document format of the general data swap file includes CSV format, CSV format
Belong to spreadsheet file format, in spreadsheet file format, is stored in unit after the graph data conversion of tested software
In lattice, each cell carries out tissue according to row and column structure, and every a line in the document of CSV format indicates a record, often
Item record includes one or more fields by separators;Optionally, the document format of the general data swap file
It further include XLSX format, TXT plain text format, html format etc..
S200:The general data swap file is read, test case preliminary date is obtained.
After the graph data of tested software is converted into general data swap file, taken for different document formats
Different modes reads the general switch data, obtains the preliminary date of test case, and test case is description software test
The document of process specific steps, the data of a test case include test input parameter, test when condition, test when
After configuration surroundings, anticipated output result etc., such as the general data swap file of parsing CSV format, the in this document is read
The preliminary date of one test case of a line storage, in this test case preliminary date comprising use-case number, testing background,
Precondition, test environment, testing procedure, expected results etc., each item data have in general switch file separator into
Row interval or each item data are corresponding with corresponding character string, match so as to subsequent with test case template.
S300:Test case template is obtained, the test case template is parsed and obtains survey in the test case template
Example preparation item on probation.
For the format of unified test case, the test case format write because tester's thinking habit is different is avoided
Disunity in the present embodiment, reaches unified test case by the test case template for obtaining unified and writes, specifically,
The test case template is obtained from preset test case template library, then parses the test case template, obtains institute
The test case preparation item in test case template is stated, the preparation item identifies the operation letter recorded needed for a test case
Breath, preferably, enabling to the operation information for the test case write more comprising prepared item more abundant in test case template
Clearly, so that the tester for not contacting tested software can also test software, the preparation item includes
Use-case number, testing background, precondition, test environment, testing procedure, expected results etc..
S400:The test case preliminary date and the test case preparation item are matched according to setting logic, it will be described
The corresponding test case preparation item of preliminary date write-in test case template of test case, generates the test with specified template
Use-case.
After the test case preparation item in the preliminary date and test template for obtaining test case, according to setting
The preliminary date and the prepared item are mutually matched by logic, since each single item preliminary date is in general data swap file
Have that separator is spaced or each single item preliminary date has corresponding character string to mark, optionally, in the present embodiment, root
Preparation item according to mark and test case template of the preliminary date in general data swap file matches, the mark
Including character string denotation or serial number mark, corresponding test case in test case template then is written into each single item preliminary date
In preparation item, to generate the test case with specified template, keep the output format of test case unified with this, test is used
Writing for example is more convenient, succinct, and that improves test case writes efficiency and reading experience.
The present embodiment proposes a kind of method for generating test case, the figure of the function logic by obtaining description tested software
Then graphic data obtains the preliminary date of test case, and the fixation of parsing test case by parsing the graph data
Template obtains the preparation item of test case, then by the test case preliminary date and the preparation item phase in test template
Match, the preliminary date is written in the preparation item in test case template, finally the generation in specified template has specified
The test case of format specification, the uniform format of test case write is kept with this, while that improves test case writes effect
Rate promotes the reading experience of test case, avoids leading to the test case write because different tester's thinking habits are different
The skimble-scamble problem of format, to improve Efficiency of Software Testing.
A kind of embodiment of the invention, as shown in Fig. 2, the preliminary date of the test case includes the preferential of test case
Grade;It is described that the test case preliminary date and the test case preparation item are matched according to setting logic, the test is used
The corresponding test case preparation item of preliminary date write-in test case template of example, including:
S410:The test case preliminary date and the test case preparation item are matched according to setting logic, obtains and surveys
The priority of example on probation, is ranked up the preliminary date of the test case according to the height of the priority, according to sequence
As a result by the corresponding test case preparation item of preliminary date write-in test case template of the test case.
In tested software, partial function is the basic function of software, is related to whether entire software can normally be transported
Row, the severity level of the function in software is higher, correspondingly, when testing the software, corresponding to the high function of severity level
The priority of test case also should be higher, guarantees that the premise of software test is the basic function normal use of software, if software
Basic function can not normal use, the subsequent test job to software can not pass through substantially, and subsequent test does not also continue to hold
Capable necessity.It include the priority of test case in the present embodiment, in the preliminary date of the test case, when use will be being tested
When the preliminary date of example is written in the preparation item of test case document, the priority of each test case is obtained, is then pressed
The preliminary date of the test case is ranked up according to the height of the priority, according to ranking results by the test case
The corresponding test case preparation item of preliminary date write-in test case template, there is the survey for specifying template with what this guaranteed output
In example on probation, the higher test case of priority, which is shown in, to be located further forward, by the high Test Case Prioritization of priority in preceding, priority
Low Test Case Prioritization guarantees when being tested according to test case document tested software rear, can be soft to being tested
The basic function of part is preferentially tested, and guarantees the normal operation of test job.
A kind of embodiment of the invention, as shown in figure 3, the preliminary date of the test case includes the association of test case
Relationship;It is described that the test case preliminary date and the test case preparation item are matched according to setting logic, by the test
The corresponding test case preparation item of preliminary date write-in test case template of use-case, including:
S420:The test case preliminary date and the test case preparation item are matched according to setting logic, obtains and surveys
The incidence relation of example on probation, is grouped according to preliminary date of the incidence relation to the test case, is tied according to grouping
The corresponding test case preparation item of test case template is written in the preliminary date of the test case by fruit.
In the application, a plurality of test case is generally required to the test of functional module same in tested software, also,
Exist between different function module call, the relationship of cooperation, in the present embodiment, the preliminary date of the test case includes test
The incidence relation of use-case, after obtaining test case preliminary data, the association that test case is obtained from the preliminary data is closed
System, is then grouped test case according to the incidence relation, and test then is being written in the preliminary date of test case
When the corresponding test case preparation item of use-case template, the preliminary date write-in test of the test case is used according to group result
The corresponding test case preparation item of example template, to allow, there are multiple test cases of incidence relation to write on test case mould
In same packet zone in plate, guarantee can be to same functional module when testing tested software or there are incidence relations
Functional module comprehensively tested.
A kind of embodiment of the invention, it is described to generate with after the test case for specifying template, further include:
The quantity for counting the test case, by the quantity of the test case compared with the quantity of the preliminary date
Compared with obtaining the conversion ratio of test case.
In specified template after write-in, generation test case, the quantity of the test case of generation is counted, in general,
Every a line preliminary date can be written into the test case preparation item, generate a test case, it is contemplated that the process turns
There are invalid datas in the success rate or preliminary date of change, by the quantity phase of the quantity of the test case and the preliminary date
Compare, the conversion ratio of test case is obtained with this, so as to obtain whether the mode for automatically generating test case is able to satisfy
Actual test demand, if the conversion ratio of test case is greater than the conversion ratio by the test case of manual compiling, the automatic life
Efficiency is write at what the mode of test case can not only improve test case, moreover it is possible to which guarantee test case writes quality.
A kind of embodiment of the invention, the graph data include system testing graph data, integration testing graph data
And the different types of graph data of unit testing graph data;It is described to convert general data exchange text for the graph data
Part, including:
The general data that the graph data is converted into respective file format is exchanged according to the type of the graph data
File.
In the different phase of software test, according to the difference of test emphasis, the test to software includes to software system
Unified test examination, the system testing include the test to a function point, to the test of performance indicator, to the components testing in interface
Deng;It further include the functional test to integrated module or interface, referred to as integration testing;Further include to the function in software code into
Row test, referred to as unit testing.In the present embodiment, according to the difference of test, the graph data of the tested software includes system
The different types of graph datas such as resolution chart data, integration testing graph data and unit testing graph data;Then it is inciting somebody to action
When the graph data is converted into general data swap file, the graph data is converted according to the type of the graph data
For the general data swap file of respective file format, for example, when graph data is system testing graph data, by the system
Unified test attempts the general data swap file that graphic data is converted into csv file format;When graph data is integration testing figure number
According to when, convert the integration testing graph data to the general data swap file of XLSX file format;When graph data is
When unit testing graph data, it converts the system testing graph data to the general data swap file of TXT file format.
On the basis of the above embodiments, a kind of embodiment of the invention, the acquisition test case template, including:
Corresponding test case module is obtained according to the file format type of general data swap file;The test case
Template includes system testing use-case module, integration testing use-case module and unit testing use-case module.
Different types of graph data is converted into the general data swap file of different file formats, in the present embodiment,
When obtaining test template, corresponding test case module is obtained according to the file format type of the general data swap file,
The test case template includes system testing use-case module, integration testing use-case module and unit testing use-case module, difference
Test case template in include test case preparation item it is different, compiled to complete the test case under different testing requirements
It writes.
A kind of embodiment of the invention, it is described generate have pre- solid plate test case after, further include:
It detects whether the test case preliminary date changes, if changing, obtains the changed survey
Example preliminary date on probation matches the test case preparation item in the test case with pre- solid plate, becomes described
The test case preliminary date of change re-writes in the test case preparation item.
In entire test process, the function logic of tested software may change, testing requirement it can also happen that
Change, when the function of tested software, logic change, the functional requirement of the tested software changes, corresponding to test
The graph data of use-case will change, it is preferred that in the present embodiment, the variation of the graph data of tested software is due to surveying
Examination personnel change, after graph data variation, the test case preliminary date can also change, described after detecting
When test case preliminary date changes, the changed test case preliminary date is obtained, matching is described to be had in advance
The changed test case preliminary date is re-write institute by the test case preparation item in the test case of solid plate
It states in test case preparation item, and indeclinable test case preliminary date is then not necessarily to change, guarantee the spirit of test case
The different testing requirements living for changing, adapting to tested software different phase.
As shown in figure 4, in another embodiment, the present invention provides a kind of Test cases technology devices, including:
Conversion module 100:For obtaining the graph data of tested software, general data is converted by the graph data and is handed over
Exchange of notes part;
Data acquisition module 200:For reading the general data swap file, the preliminary date of test case is obtained;
Template parsing module 300:For obtaining test case template, parses the test case template and obtain the test
Test case preparation item in use-case template;
Write module 400:The test case preliminary date and the test case preparation item are matched, the test is used
The corresponding test case preparation item of preliminary date write-in test case template of example, generates the test case with specified template.
A kind of embodiment of the invention, described device further include:
Evaluate module:For counting the quantity of the test case, by the quantity of the test case and the prepared number
According to quantity compare, obtain the conversion ratio of test case.
The preliminary date of a kind of embodiment of the invention, the test case includes the priority of test case;The volume
Writing module 400 is executed the corresponding test case preparation item of preliminary date write-in test case template of the test case, packet
It includes:
The priority for obtaining test case carries out the preliminary date of the test case according to the height of the priority
According to ranking results the corresponding test case preparation of test case template is written in the preliminary date of the test case by sequence
?.
The preliminary date of a kind of embodiment of the invention, the test case includes the incidence relation of test case;It is described
Module 400 is write to execute the corresponding test case preparation item of preliminary date write-in test case template of the test case,
Including:
The incidence relation for obtaining test case, divides according to preliminary date of the incidence relation to the test case
According to group result the corresponding test case preparation item of test case template is written in the preliminary date of the test case by group.
A kind of embodiment of the invention, the graph data include system testing graph data, integration testing graph data
And the different types of graph data of unit testing graph data;The execution of conversion module 100 converts the graph data to
General data swap file, including:
The general data that the graph data is converted into respective file format is exchanged according to the type of the graph data
File.
A kind of embodiment of the invention, the template parsing module 300 obtain test case template, including:
Corresponding test case module is obtained according to the file format type of general data swap file;The test case
Template includes system testing use-case module, integration testing use-case module and unit testing use-case module.
In another embodiment, the present invention provides a kind of computer readable storage medium, computer-readable storage mediums
Computer program is stored in matter, which realizes Test cases technology side described in above-described embodiment when being executed by processor
Method.Wherein, the computer readable storage medium includes but is not limited to any kind of disk (including floppy disk, hard disk, CD, CD-
ROM and magneto-optic disk), ROM (Read-Only Memory, read-only memory), RAM (Random AcceSS Memory, immediately
Memory), EPROM (EraSable Programmable Read-Only Memory, Erarable Programmable Read only Memory),
(Electrically EraSable ProgrammableRead-Only Memory, electric erazable programmable is read-only to be deposited EEPROM
Reservoir), flash memory, magnetic card or light card.It is, storage equipment includes by equipment (for example, computer, mobile phone) with energy
Any medium for the form storage or transmission information enough read can be read-only memory, disk or CD etc..
A kind of computer readable storage medium provided in an embodiment of the present invention is, it can be achieved that obtain the figure number of tested software
According to converting general data swap file for the graph data;The general data swap file is read, test case is obtained
Preliminary date;Test case template is obtained, the test case template is parsed and obtains test in the test case template
Use-case preparation item;The test case preliminary date and the test case preparation item are matched according to setting logic, by the survey
The corresponding test case preparation item of preliminary date write-in test case template of example on probation, generating, there is the test of specified template to use
Example.By proposing a kind of method for generating test case, the graph data of the function logic by obtaining description tested software, then
The preliminary date of test case is obtained by parsing the graph data, and the fixed form of parsing test case obtains test
Then the preparation item of use-case matches the test case preliminary date and the preparation item in test template, by the preparation
Data are written in the preparation item in test case template, and finally the generation in specified template has the test of specified format specification
Use-case, the uniform format of test case write is kept with this, while improving the efficiency of writing of test case, promotes test case
Reading experience, avoid causing the test case format write is skimble-scamble to ask because different tester's thinking habits are different
Topic, to improve Efficiency of Software Testing.
The reality of above-mentioned method for generating test case may be implemented in computer readable storage medium provided in an embodiment of the present invention
Example is applied, concrete function realizes the explanation referred in embodiment of the method, and details are not described herein.
In addition, the present invention also provides a kind of servers in another embodiment, as shown in figure 5, the server includes
The devices such as processor 503, memory 505, input unit 507 and display unit 509.It will be understood by those skilled in the art that
Structure devices shown in Fig. 5 do not constitute the restriction to Servers-all, may include components more more or fewer than diagram, or
Person combines certain components.Memory 505 can be used for storing computer program 501 and each functional module, and the operation of processor 503 is deposited
The computer program 501 in memory 505 is stored up, thereby executing the various function application and data processing in server.Storage
Device 505 can be built-in storage or external memory, or including both built-in storage and external memory.Built-in storage may include
Read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM),
Flash memory or random access memory.External memory may include hard disk, floppy disk, ZIP disk, USB flash disk, tape etc..Institute of the present invention
Disclosed memory includes but is not limited to the memory of these types.Memory 505 disclosed in this invention be only used as example and
Non- be used as limits.
Input unit 507 is used to receive the input of signal and receives the input of user, and input unit 507 may include touch surface
Plate and other input equipments, touch panel collect user on it or nearby touch operation (such as user using finger,
The operation of any suitable object or attachment such as stylus on touch panel or near touch panel), and according to presetting
The corresponding attachment device of driven by program;Other input equipments can include but is not limited to physical keyboard, function key (for example plays
Control button, switch key etc.), trace ball, mouse, one of operating stick etc. or a variety of.Display unit 509 can be used for showing
The information of user's input is supplied to the information of user and the various menus of computer equipment.Liquid can be used in display unit 509
The forms such as crystal display, Organic Light Emitting Diode.Processor 503 is the control centre of computer equipment, using various interfaces and
The various pieces of the entire computer of connection, by running or executing the software program being stored in memory 503 and/or mould
Block, and the data being stored in memory are called, perform various functions and handle data.In one embodiment, described
Server includes one or more processors 503, and one or more memories 505, one or more computer programs
501, wherein one or more of computer programs 101 be stored in memory 505 and be configured as by one or
Multiple processors 503 execute, and one or more of computer programs 501 are configured to carry out test described in above embodiments
Case generation method.One or more processors 503 shown in Fig. 5 are able to carry out, realize conversion module shown in Fig. 4
100, data acquisition module 200, template parsing module 300, the function of writing module 400.
A kind of server provided in an embodiment of the present invention is, it can be achieved that obtain the graph data of tested software, by the figure
Data are converted into general data swap file;The general data swap file is read, the preliminary date of test case is obtained;It obtains
Test case template is taken, the test case template is parsed and obtains test case preparation item in the test case template;Root
The test case preliminary date and the test case preparation item are matched according to setting logic, by the preparation number of the test case
According to the corresponding test case preparation item of write-in test case template, the test case with specified template is generated.By proposing one
Kind method for generating test case, the graph data of the function logic by obtaining description tested software, then by described in parsing
Graph data obtains the preliminary date of test case, and parses the preparation of the fixed form acquisition test case of test case
, then the test case preliminary date and the preparation item in test template are matched, the preliminary date is written and is surveyed
In preparation item in example template on probation, finally the generation in specified template has the test case of specified format specification, with this
The uniform format of test case write is kept, while that improves test case writes efficiency, promotes the reading body of test case
It tests, avoids leading to the skimble-scamble problem of test case format write because different tester's thinking habits are different, to mention
High Efficiency of Software Testing.
The embodiment of the method for generating test case of above-mentioned offer may be implemented in server provided in an embodiment of the present invention, tool
Body function realizes the explanation referred in embodiment of the method, and details are not described herein.
The above is only some embodiments of the invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.
Claims (10)
1. a kind of method for generating test case, which is characterized in that include the following steps:
The graph data for obtaining tested software, converts general data swap file for the graph data;
The general data swap file is read, the preliminary date of test case is obtained;
Test case template is obtained, the test case template is parsed and obtains test case preparation in the test case template
?;
The test case preliminary date and the test case preparation item are matched according to setting logic, by the test case
The corresponding test case preparation item of test case template is written in preliminary date, generates the test case with specified template.
2. the method according to claim 1, wherein the preliminary date of the test case includes test case
Priority;The corresponding test case preparation item of preliminary date write-in test case template by the test case, including:
The priority for obtaining test case, arranges the preliminary date of the test case according to the height of the priority
According to ranking results the corresponding test case preparation item of test case template is written in the preliminary date of the test case by sequence.
3. the method according to claim 1, wherein the preliminary date of the test case includes test case
Incidence relation;The corresponding test case preparation item of preliminary date write-in test case template by the test case, packet
It includes:
The incidence relation for obtaining test case, is grouped according to preliminary date of the incidence relation to the test case,
The corresponding test case preparation item of test case template is written into the preliminary date of the test case according to group result.
4. the method according to claim 1, wherein it is described generate the test case with specified template after,
Further include:
The quantity of the test case is compared with the quantity of the preliminary date, is obtained by the quantity for counting the test case
To the conversion ratio of test case.
5. the method according to claim 1, wherein the graph data includes system testing graph data, collection
At resolution chart data and the different types of graph data of unit testing graph data;It is described convert the graph data to it is logical
With data interchange file, including:
The graph data is converted to according to the type of the graph data general data swap file of respective file format.
6. according to the method described in claim 5, it is characterized in that, the acquisition test case template, including:
Corresponding test case module is obtained according to the file format type of general data swap file;The test case template
Including system testing use-case module, integration testing use-case module and unit testing use-case module.
7. a kind of Test cases technology device, which is characterized in that including:
Conversion module:For obtaining the graph data of tested software, general data swap file is converted by the graph data;
Data acquisition module:For reading the general data swap file, the preliminary date of test case is obtained;
Template parsing module:For obtaining test case template, parses the test case template and obtain the test case mould
Test case preparation item in plate;
Write module:The test case preliminary date and the test case preparation item are matched, by the pre- of the test case
The corresponding test case preparation item of test case template is written in standby data, generates the test case with specified template.
8. device according to claim 7, which is characterized in that described device further includes:
Evaluate module:For counting the quantity of the test case, by the quantity of the test case and the preliminary date
Quantity compares, and obtains the conversion ratio of test case.
9. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium
Program, the computer program realize method for generating test case as claimed in any one of claims 1 to 6 when being executed by processor.
10. a kind of server, which is characterized in that including:
One or more processors;
Memory;
One or more application program, wherein one or more of application programs are stored in the memory and are configured
To be executed by one or more of processors, one or more of application programs are configured to carry out according to claim 1
To 6 described in any item method for generating test case.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810857956.1A CN108920382B (en) | 2018-07-31 | 2018-07-31 | Test case generation method and device, storage medium and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810857956.1A CN108920382B (en) | 2018-07-31 | 2018-07-31 | Test case generation method and device, storage medium and server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108920382A true CN108920382A (en) | 2018-11-30 |
CN108920382B CN108920382B (en) | 2022-04-01 |
Family
ID=64393201
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810857956.1A Active CN108920382B (en) | 2018-07-31 | 2018-07-31 | Test case generation method and device, storage medium and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108920382B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109542794A (en) * | 2018-12-04 | 2019-03-29 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of Software Automatic Testing Method applied to embedded system |
CN112131091A (en) * | 2019-06-24 | 2020-12-25 | 百度在线网络技术(北京)有限公司 | Test method and device and electronic equipment |
CN113419961A (en) * | 2021-07-09 | 2021-09-21 | 平安国际智慧城市科技股份有限公司 | Method, device, equipment and storage medium for establishing case library for business test |
CN116383094A (en) * | 2023-06-05 | 2023-07-04 | 中国空气动力研究与发展中心计算空气动力研究所 | Test case library construction method, device, equipment and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976220A (en) * | 2010-09-27 | 2011-02-16 | 北京神州泰岳软件股份有限公司 | Unit test system |
CN102541730A (en) * | 2011-12-08 | 2012-07-04 | 北京空间飞行器总体设计部 | Semantic identification and automatic generation method for spacecraft test script |
US20130275946A1 (en) * | 2012-04-16 | 2013-10-17 | Oracle International Corporation | Systems and methods for test development process automation for a test harness |
CN103675528A (en) * | 2013-11-26 | 2014-03-26 | 许继电气股份有限公司 | Relay protection device automatic testing method and device based on tagged words |
CN103838672A (en) * | 2014-03-04 | 2014-06-04 | 中国工商银行股份有限公司 | Automated testing method and device for all-purpose financial statements |
CN105426312A (en) * | 2015-12-31 | 2016-03-23 | 北京经纬恒润科技有限公司 | Test suite generation method and device for smoke tests |
CN107766256A (en) * | 2017-11-23 | 2018-03-06 | 中广核工程有限公司 | A kind of method for transformation and system of software unit testing use-case |
CN107832229A (en) * | 2017-12-03 | 2018-03-23 | 中国直升机设计研究所 | A kind of system testing case automatic generating method based on NLP |
-
2018
- 2018-07-31 CN CN201810857956.1A patent/CN108920382B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976220A (en) * | 2010-09-27 | 2011-02-16 | 北京神州泰岳软件股份有限公司 | Unit test system |
CN102541730A (en) * | 2011-12-08 | 2012-07-04 | 北京空间飞行器总体设计部 | Semantic identification and automatic generation method for spacecraft test script |
US20130275946A1 (en) * | 2012-04-16 | 2013-10-17 | Oracle International Corporation | Systems and methods for test development process automation for a test harness |
CN103675528A (en) * | 2013-11-26 | 2014-03-26 | 许继电气股份有限公司 | Relay protection device automatic testing method and device based on tagged words |
CN103838672A (en) * | 2014-03-04 | 2014-06-04 | 中国工商银行股份有限公司 | Automated testing method and device for all-purpose financial statements |
CN105426312A (en) * | 2015-12-31 | 2016-03-23 | 北京经纬恒润科技有限公司 | Test suite generation method and device for smoke tests |
CN107766256A (en) * | 2017-11-23 | 2018-03-06 | 中广核工程有限公司 | A kind of method for transformation and system of software unit testing use-case |
CN107832229A (en) * | 2017-12-03 | 2018-03-23 | 中国直升机设计研究所 | A kind of system testing case automatic generating method based on NLP |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109542794A (en) * | 2018-12-04 | 2019-03-29 | 中国航空工业集团公司西安航空计算技术研究所 | A kind of Software Automatic Testing Method applied to embedded system |
CN112131091A (en) * | 2019-06-24 | 2020-12-25 | 百度在线网络技术(北京)有限公司 | Test method and device and electronic equipment |
CN112131091B (en) * | 2019-06-24 | 2024-04-16 | 百度在线网络技术(北京)有限公司 | Test method and device and electronic equipment |
CN113419961A (en) * | 2021-07-09 | 2021-09-21 | 平安国际智慧城市科技股份有限公司 | Method, device, equipment and storage medium for establishing case library for business test |
CN116383094A (en) * | 2023-06-05 | 2023-07-04 | 中国空气动力研究与发展中心计算空气动力研究所 | Test case library construction method, device, equipment and storage medium |
CN116383094B (en) * | 2023-06-05 | 2023-08-25 | 中国空气动力研究与发展中心计算空气动力研究所 | Test case library construction method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN108920382B (en) | 2022-04-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108920382A (en) | Method for generating test case, device, storage medium and server | |
CN110998516B (en) | Automated dependency analyzer for heterogeneous programming data processing systems | |
Harman et al. | Search based software engineering for software product line engineering: a survey and directions for future work | |
CN106471476B (en) | For the editor to optimized code and the technology of the optimized debugging of continuation and enhancing | |
EP3411804B1 (en) | Automatic template generation based on previous documents | |
CN106598869A (en) | Method and device for realizing automatic software testing and electronic equipment | |
KR101477287B1 (en) | Test module generating apparatus, test sequence generating apparatus, generating method, program and test apparatus | |
CN101996131A (en) | Automatic test method and automatic test platform for graphic user interface (GUI) based on x extensive makeup language (XML) packaging key word | |
CN111858371A (en) | Software testing method, system, storage medium and computer equipment | |
CN103098051A (en) | Search engine optmization assistant | |
CN104281563A (en) | Method and system for discovering relationships in tabular data | |
JP2022003512A (en) | Method and apparatus for constructing quality evaluation model, electronic device, storage medium, and computer program | |
CN104657828A (en) | Digitalization method, data matching method, code recommendation method and related devices | |
CN109542412A (en) | Interface message generation method, device, computer equipment and storage medium | |
CN109359020A (en) | Start time test method and device, computer installation and storage medium | |
CN102541731A (en) | Platform-agnostic diagnostic data collection and display | |
CN106598834A (en) | UI (User Interface) testing method and device | |
US20220021578A1 (en) | Method for configuring modeling parameters, electronic device and computer storage medium thereof | |
CN108984393A (en) | A kind of unit testing code automatic generation method and device | |
US6763360B2 (en) | Automated language and interface independent software testing tool | |
CN104320793B (en) | A kind of Automated testing method of cell phone short messages and system | |
Chekanov | Scientific data analysis using Jython Scripting and Java | |
CN113138937A (en) | Test method and device | |
CN100570576C (en) | A kind of method of testing of embedded system and system | |
US20220334808A1 (en) | Methods, systems, and computer readable media for creating and using minimum dictionary language (mdl) to access data in closed-domain data sets |
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 |