CN109857671A - Generation method, device, server and the storage medium of test case - Google Patents
Generation method, device, server and the storage medium of test case Download PDFInfo
- Publication number
- CN109857671A CN109857671A CN201910117501.0A CN201910117501A CN109857671A CN 109857671 A CN109857671 A CN 109857671A CN 201910117501 A CN201910117501 A CN 201910117501A CN 109857671 A CN109857671 A CN 109857671A
- Authority
- CN
- China
- Prior art keywords
- case
- event
- test
- configuration file
- test case
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a kind of generation method of test case, device, server and storage mediums.This method comprises: receiving the use-case event of object to be measured;The use-case event is parsed, the use-case configuration file of the use-case event is generated;It decomposes and converts the use-case configuration file, obtain the test case of the corresponding use-case event.Using this method, test data auto generation can be realized, so that human resources when reducing product test consume, the product test period is shortened, improves testing efficiency, simultaneously, it ensure that the diversity of test case, and then increase coverage area of the test case in product test.
Description
Technical field
The present invention relates to the generation method of software testing technology field more particularly to test case, device, server and deposit
Storage media.
Background technique
Software test component with higher in software development is soft especially in the research and development of high-precision software product
The quality of part test directly affects the safety and stability of software product.In general, the key of software test is institute's shape
At test case, test case quality directly have decided on whether effectively carry out the functional test of software under testing, thus
Find and solve as early as possible institute's problem.
In realizing process of the present invention, there are following defects for the generation of inventor's discovery test case: current test is used
Example mainly by Test Engineer manual editing before testing and write, thus require a great deal of time with energy and think
It examines the problem of being likely to occur in software product operational process and writes dependence test use-case, thereby increase the work of Test Engineer
It measures, causes the consuming of human resources, while the test case that this kind of mode is formed can not contain all problems to be tested of lid,
Cause test coverage relatively narrow.
Summary of the invention
The embodiment of the invention provides a kind of generation method of test case, device, server and storage medium, Neng Goushi
Existing test data auto generation, while increasing coverage area of the test case in product test.
In a first aspect, the embodiment of the invention provides a kind of generation methods of test case, comprising:
Receive the use-case event of object to be measured;
The use-case event is parsed, the use-case configuration file of the use-case event is generated;
It decomposes and converts the use-case configuration file, obtain the test case of the corresponding use-case event.
Further, the use-case event includes following at least one:
The exception that the problem of client user of the object to be measured feeds back event, the operation object to be measured grab in real time
Event and the task events of editor's input.
Further, the parsing use-case event, generates the use-case configuration file of the use-case event, comprising:
Analysis determines the corresponding use-case configuration template of the use-case event, and extracts the key of the event in the use-case event
Information, the event key message include: the occurrence scene of event, the generation correlation time of event and event description;
The event key message is filled to the use-case configuration text that the use-case event is generated to the use-case configuration template
Part.
Further, the use-case configuration file is converted in the decomposition, obtains the test case of the corresponding use-case event,
Include:
The use-case configuration file is parsed, determines the corresponding tag along sort of use-case configuration file;
It obtains and the matched test operation script of the tag along sort;
The event key message of the use-case configuration file is decomposed, at least one valid data are obtained;
Each valid data are filled to the corresponding position of the test operation script, the corresponding use-case configuration is obtained
The test case of file.
Further, the generation method of the test case further include:
The test case is sent to audit terminal, and receives the audit feedback information for being directed to the test case;
When the audit feedback information is that audit passes through, remember that the test case is use-case to be tested and stores to test
Use-case library.
Further, the generation method of the test case further include:
Test verification is carried out to the use-case to be detected.
It is further, described that test verification is carried out to the use-case to be detected, comprising:
At least one object to be measured is tested using the use-case to be tested and obtains test result;
The test accuracy of the use-case to be tested is counted based on the test result;
If the test accuracy reaches given threshold, remember that the use-case to be tested is validity test use-case, and right
The validity test use-case carries out test-types label.
Second aspect, the embodiment of the invention provides the generating means of test case, comprising:
Event receiving module, for receiving the use-case event of object to be measured;
Event parsing module generates the use-case configuration file of the use-case event for parsing the use-case event;
Conversion module is decomposed, converts the use-case configuration file for decomposing, obtains the test of the corresponding use-case event
Use-case.
The third aspect, the embodiment of the invention provides a kind of servers, comprising:
One or more processors;
Storage device, for storing one or more programs;
One or more of programs are executed by one or more of processors, so that one or more of processors
Realize the generation method of test case provided in an embodiment of the present invention.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage mediums, are stored thereon with computer journey
Sequence, the program realize the generation method of test case provided in an embodiment of the present invention when being executed by processor.
In the generation method of above-mentioned test case, device, server and storage medium, the use of object to be measured is received first
Example event;Then the use-case event is parsed, the use-case configuration file of the use-case event is generated;It finally decomposes and converts the use
Example configuration file obtains the test case of the corresponding use-case event.Above-mentioned technical proposal, can be after receiving use-case event
Use-case configuration file is automatically generated, and use-case configuration file is subjected to decomposition conversion, it is thus achieved that the automatic life of test case
At, so that human resources when reducing product test consume, the product test period is shortened, testing efficiency is improved, meanwhile,
It ensure that the diversity of test case, and then increase coverage area of the test case in product test.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of the generation method for test case that the embodiment of the present invention one provides;
Fig. 2 is a kind of flow diagram of the generation method of test case provided by Embodiment 2 of the present invention;
Fig. 3 is the implementation flow chart for the Test cases technology that the present embodiment two provides;
Fig. 4 is a kind of flow diagram of the generation method for test case that the embodiment of the present invention three provides;
Fig. 5 is a kind of structural schematic diagram of the generating means for test case that the embodiment of the present invention four provides;
Fig. 6 is a kind of hardware structural diagram for server that the embodiment of the present invention five provides.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just
Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Fig. 1 is a kind of flow diagram of the generation method for test case that the embodiment of the present invention one provides, and this method is suitable
The case where for generating test case for use-case event, this method can be executed by the generating means of test case, wherein should
Device can be by software and or hardware realization, and can specifically be integrated in the server for generating test case.
It is understood that the generation method of test case provided by the present embodiment, is suitable for Android, IOS, web net
Page exploitation etc. arbitrarily needs the case where testing system operation.Specifically, after receiving use-case event, server
The corresponding use-case configuration file of use-case event can be automatically generated according to use-case configuration template, and then use-case configuration file is divided
Solution conversion, to obtain corresponding test case.In the prior art scheme, mainly by the carry out hand before testing of Test Engineer
Dynamic to edit and write, testing efficiency is low, the limited coverage area of test case.Using the life of test case provided in this embodiment
At method, test case can be automatically generated, improve testing efficiency and increases the coverage area of test case.
The generation method of test case provided in this embodiment is specifically believed that by the generation of the test case in server
Device executes.
As shown in Figure 1, a kind of generation method for test case that the embodiment of the present invention one provides, including operate as follows:
S110, the use-case event for receiving object to be measured.
In the present embodiment, object to be measured specifically can be each application program in client or system operation end, operation
Inside perhaps operation process etc., what the use-case event of object to be measured specifically can refer to occur during operating system various forms of asks
The anomalous events such as topic, loophole.In general, use-case event occurs in client or the operation end of system, after there is exception, by taking
Device be engaged in receive the use-case event.Server can obtain use-case event automatically and front and back occurs while receiving use-case event
The exception informations such as operation scenario, operating procedure, the module of exception and system log.For example, client is utilizing multimedia
Occur dodging the case where moving back when picture, server can obtain its exception information for this use-case event, and be the use-case thing
The label of part addition event type.
Further, use-case event includes following at least one:
The anomalous event and volume that the problem of client user of object to be measured feeds back event, operation object to be measured grab in real time
Collect the task events of input.
Specifically, use-case event can be for when client occurs abnormal, user actively uploads asking for feedback to server
Topic event, or the anomalous event of object to be measured grabbed in real time by way of HTTP or local search for server, can also
For the task events of test man manual editing input.
S120, the parsing use-case event, generate the use-case configuration file of use-case event.
In the present embodiment, after server receives use-case event, the exception that can include to use-case event based on this step
Information is parsed, to generate corresponding use-case configuration file.Specifically, it can be given birth to automatically according to the use-case configuration template of setting
At corresponding configuration file.For example, its specific exception information, the mark of binding events type can be obtained by parsing use-case event
It signs, may recognize that and occur dodging the anomalous event moved back when the use-case event is multimedia picture, then search in template and more
Occur dodging when media play picture moving back relevant content, accordingly generates and dodge the configuration file moved back about multimedia.
S130, conversion use-case configuration file is decomposed, obtains the test case to application examples event.
In the present embodiment, decomposing conversion use-case configuration file specifically can refer to by parsing use-case configuration file, to use-case
Specific test content is specified in the description and classification that configuration file is refined, and corresponding for test content Auto-matching
Script and testing procedure, to generate test case.Above-mentioned example is connect, occurs dodging the use-case moved back when for multimedia picture
Event can be decomposed information that use-case configuration file includes by parsing its use-case configuration file, and by valid data therein
Be converted to the automatized script suitable for test case, thus Auto-matching script corresponding with multimedia picture and according to
Testing procedure is ranked up, and moves back phenomenon so that whether test will appear sudden strain of a muscle under the operation scenario of multimedia picture.
Optionally, while decomposing conversion use-case configuration file generation test case, corresponding test case explanation is generated
Report, convenient for being inquired test case and being examined.Wherein, test case descriptive statement may include the event of use-case event
Type, use-case profile information, script information etc., to be illustrated to the test case of generation.
A kind of generation method for test case that the embodiment of the present invention one provides, receives the use-case thing of object to be measured first
Part;Then the use-case event is parsed, the use-case configuration file of the use-case event is generated;The conversion use-case is finally decomposed to match
File is set, the test case of the corresponding use-case event is obtained.Through the above technical solutions, can be after receiving use-case event
Use-case configuration file is automatically generated, and use-case configuration file is subjected to decomposition conversion, it is thus achieved that the automatic life of test case
At, so that human resources when reducing product test consume, the product test period is shortened, testing efficiency is improved, meanwhile,
It ensure that the diversity of test case, and then increase coverage area of the test case in product test.
Embodiment two
Fig. 2 is a kind of flow diagram of the generation method of test case provided by Embodiment 2 of the present invention, the present embodiment
It is optimized based on above-described embodiment, in the present embodiment, will further parse the use-case event, and generate the use-case
The use-case configuration file of event optimizes are as follows: analysis determines the corresponding use-case configuration template of the use-case event, and extracts the use
Event key message in example event, the event key message includes: the generation correlation time of the occurrence scene of event, event
And event description;The event key message is filled to the use-case that the use-case event is generated to the use-case configuration template
Configuration file.Not in the details of the present embodiment description referring to embodiment one.
As shown in Fig. 2, a kind of generation method of test case provided by Embodiment 2 of the present invention, specifically includes following behaviour
Make:
S210, the use-case event for receiving object to be measured.
Illustratively, the use-case event of object to be measured actively can upload the problem of feeding back event to server for user,
For example, system prompt mail sends failure and asks the user whether to upload to server when user sends mail using client
Exception information, at this point, user may be selected exception information being uploaded to server, so that server be made to receive the use-case of client
Event.It is to be measured right that the use-case event of object to be measured can also be grabbed in real time by way of HTTP or local search for server
The anomalous event of elephant, for example, server can be real by way of HTTP or local search when user uses multimedia picture
When monitor the system running state of client, sudden strain of a muscle can be grabbed in time and move back this use by abnormal phenomenon, the server such as moving back if there is sudden strain of a muscle
Example event and automatic collection exception information.The use-case event of object to be measured can also be the task thing of test man manual editing input
Part, for example, test man will test the problem of application program frequent Caton of some in client, at this point, test man can
Manual editing's exception information relevant to the application program Caton forms use-case event and is input to server.
S220, the corresponding use-case configuration template of determining use-case event is analyzed, and extracts the letter of the event key in use-case event
Breath, event key message includes: the occurrence scene of event, the generation correlation time of event and event description.
In the present embodiment, use-case configuration template, which is particularly used in provide for use-case event, generates corresponding configuration file
Template, use-case configuration template can define in advance.Illustratively, defined in advance in use-case configuration template test-types,
The variable name etc. of each position in pattern, template, wherein test-types be defined as interface testing, path testing, driving test, can
By property test etc., style definitions are document, table etc., and variable name can be exceptional value, file path, type of error etc..
It is understood that containing event type in the exception information of use-case event when server receives use-case event
Label and event key message can be analyzed first according to the label of event type true during parsing use-case event
The corresponding use-case configuration template of the fixed use-case event, and according to the geochemical anomalies studying outgoing event key message of use-case event,
Event key message specifically includes: the occurrence scene of event, the generation correlation time of event and event description.For example,
The occurrence scene of event is Android system multimedia picture;The generation correlation time of event is that user has browsed local first
Picture and the selection Target Photo to be played, then click and start to play, multimedia has occurred at this time and dodges the use-case event moved back;
Event description may include that can not identify that the format, picture and multimedia of picture be incompatible or multimedia run-time error etc..
S230, event key message is filled to use-case configuration template, generates the use-case configuration file of use-case event.
Specifically, the event key message of extraction is filled to use-case configuration template after determining use-case configuration template
Corresponding position, with generate comprising event key message use-case event configuration file.Wherein, use-case configuration template is in advance
Definition.Use-case configuration template may include fixed information (such as module path, class name) and/or need the variable that obtains (such as
The number and parameter name of object oriented to be measured and its place file path, event type label, use-case event relevant parameter
Deng).
Optionally, have in the use-case configuration template of some events type portion be it is fixed, define in advance, institute
Only the position filled need to will be needed to be defined as variable position, in this way when filling event key message to use-case configuration template,
Only in variable position, filling variate-value produces corresponding test case.
Dodge the use-case event moved back when illustratively, for multimedia picture, in corresponding use-case configuration template
The occurrence scene of event is defined in fixed bit for the multimedia picture in Android system, therefore it may only be necessary in use-case
The variable informations such as file path that correlation time, object to be measured occurs of variable position filling event in configuration template.
S240, conversion use-case configuration file is decomposed, obtains the test case of the corresponding use-case event.
Specifically, by parsing use-case configuration file, to description and classification that use-case configuration file is refined, and it is automatic
Corresponding script and testing procedure are matched, to generate test case.It is dodged when illustratively, for multimedia picture
The use-case event moved back, by parsing its use-case configuration file, the information that can include by use-case configuration file is converted to EXCEL file
Or the automatized script suitable for test case of other forms, and be ranked up according to testing procedure, so that test is in more matchmakers
Whether will appear sudden strain of a muscle under the operation scenario of body playing pictures and moves back phenomenon.
Further, Fig. 3 is the implementation flow chart for the Test cases technology that the present embodiment two provides, as shown in figure 3, this reality
It applies example and use-case configuration file is converted into above-mentioned decomposition, obtain the test case of the corresponding use-case event, be specifically optimized for following
Step:
It should be noted that the present embodiment do not limit step S2401 and step S2403 execute sequence, it is preferred that step
S2401 and step S2403 can be executed parallel.
S2401, the parsing use-case configuration file, determine the corresponding tag along sort of use-case configuration file.
It is understood that containing tag along sort in the present embodiment use-case configuration file generated, tag along sort can
To fill during generating configuration file according to the exception information of use-case event, it can also be defined on use-case configuration template in advance
Fixed bit in.By parsing the use-case configuration file generated according to this use-case configuration template, it may be determined that the use-case corresponding to it
The tag along sort of event.
S2402, it obtains and the matched test operation script of the tag along sort.
Specifically, the process parsed using above-mentioned S2401 to use-case configuration file, is actually equivalent to use-case configuration file
The refinement of progress describes and sorts out, this step can the corresponding test operation script of Auto-matching according to tag along sort.Wherein, it tests
Operation script refers to file or code suitable for test case, includes in the test operation script being matched to according to tag along sort
The code for being tested for what type of use-case event, how building operation scenario, how executing operating procedure etc..
The use-case event moved back, the survey that can be matched to according to tag along sort are dodged when illustratively, for multimedia picture
Examination operation script includes following information: the test case is that the test of setback row is dodged for multimedia;When using the test case
It runs multimedia and enters the mode of playing pictures;The execution step of the test case is to browse local picture and choosing first
The Target Photo to be played is selected, then clicks and starts to play out, and tests the use-case that multimedia sudden strain of a muscle is moved back whether can occur at this time
Event.
S2403, the event key message for decomposing the use-case configuration file obtain at least one valid data.
In the present embodiment, this step can also decompose the information for including in use-case configuration file, specifically, can
To decompose to the event key message for including in use-case configuration file, at least one then is obtained from event key message
Valid data.
It is appreciated that event key message include the occurrence scene of event, event generation correlation time and
Event description, such as using the occurrence scene of event as when valid data, just configures the use-case when the one such information of selection
The corresponding event occurrence scene of file is made that limitation, will be only used for needle according to the test case that this use-case configuration file generates
The use-case event of this occurrence scene is tested;When by the generation correlation time of the occurrence scene of event, event simultaneously conduct
When valid data, limitation is all made that the corresponding occurrence scene of use-case configuration file and correlation time, then is matched according to this use-case
The test case for setting file generated is only used for while meeting above-mentioned occurrence scene and the use-case event of correlation time is surveyed
Examination.
S2404, each valid data are filled to the corresponding position of the test operation script, obtains the corresponding use
The test case of example configuration file.
In the present embodiment, this step is by filling the valid data of acquisition to the test being matched to according to tag along sort
In the corresponding position for operating script, test case can be generated.For example, dodging the use-case thing moved back when being directed to multimedia picture
Part includes being tested, such as in the test operation script being matched to according to tag along sort for what type of use-case event
The scripted code what is built operation scenario, how to execute operating procedure etc., by the valid data (occurrence scene of such as event of acquisition
With the generation correlation time of event) it fills to the corresponding position of test operation script, such as by " Android system multimedia figure
The valid data of piece " fill into test operation script the corresponding position for describing how to build operation scenario, by " user is clear first
It has look at local picture and the selection Target Photo to be played, then clicks and start to play, multimedia has occurred at this time dodged and move back
The valid data of use-case event " fill into test operation script the corresponding position for describing how to execute operating procedure, thus raw
At complete scripted code, corresponding test case is obtained, when realizing to multimedia picture, user has selected target figure
Piece and click start after broadcasting, if can occur to dodge the test of setback row.
A kind of generation method for test case that the present embodiment two provides, receives the use-case event of object to be measured first;So
Post analysis determines the corresponding use-case configuration template of use-case event, and extracts the event key message in use-case event;Event is closed
Key information is filled to use-case configuration template, and the use-case configuration file of use-case event is generated;Conversion use-case configuration file is finally decomposed,
Corresponding test case is obtained, and embodies the generating process of test case.Through the above technical solutions, can be by the thing of extraction
Part key message is filled to the corresponding position of use-case configuration template, to automatically generate the use-case configuration comprising event key message
File, decomposition conversion can be carried out to use-case configuration file by then leading to, and automatic to fill test operation script, thus generating can be produced
The test case of product test shortens the product test period, improves so that human resources when reducing product test consume
Testing efficiency, meanwhile, it ensure that the diversity of test case, and then increase covering model of the test case in product test
It encloses.
Embodiment three
Fig. 4 is a kind of flow diagram of the generation method for test case that the embodiment of the present invention three provides.The present embodiment
Above-described embodiment is further optimized, step S440 is increased on the basis of the above embodiments, is sent out to audit terminal
The test case is sent, and receives the audit feedback information for being directed to the test case;When the audit feedback information is audit
By when, remember that the test case is use-case to be tested and to store to test case library;And increase step S450, to described
Use-case to be detected carries out test verification.The technical detail not described in the present embodiment can be found in embodiment one and embodiment two.
As shown in figure 4, a kind of generation method of test case provided in this embodiment, specifically includes following operation:
S410, the use-case event for receiving object to be measured.
Specifically, use-case event can be for when client occurs abnormal, user actively uploads asking for feedback to server
Topic event, or the anomalous event of object to be measured grabbed in real time by way of HTTP or local search for server, can also
For the task events of test man manual editing input.
S420, parsing use-case event, generate the use-case configuration file of use-case event.
Specifically, server during parsing use-case event, can be analyzed according to the label of event type determine first
The corresponding use-case configuration template of the use-case event, and according to the geochemical anomalies studying outgoing event key message of use-case event, so
The event key message of extraction is filled to the corresponding position of use-case configuration template afterwards, to generate the use for including event key message
The configuration file of example event.
S430, conversion use-case configuration file is decomposed, obtains the test case to application examples event.
Specifically, by parsing use-case configuration file, it may be determined that the corresponding tag along sort of use-case configuration file, and according to point
Class label can the corresponding test operation script of Auto-matching;By decomposing the event key message of use-case configuration file, can get
At least one valid data;Valid data are filled to the corresponding position of test operation script, can obtain and application examples is configured
The test case of file.
S440, test case is sent to audit terminal, and receive the audit feedback information for being directed to test case.
Specifically, the test case of generation is sent to audit terminal by server, for auditor after Test cases technology
The test case automatically generated is audited, and receives audit feedback information.Optionally, test case is by way of mail
It is sent to the correspondence auditor of audit terminal, auditor fills in audit feedback information and is back to clothes by way of mail
Business device.Wherein, audit feedback information further includes Auditing Principal other than whether test case passes through in addition to including, convenient for test
The certification and inspection of use-case.
S450, when audit feedback information be audit pass through when, note test case be use-case to be tested and store to test use
Example library.
In the present embodiment, when test case audit passes through, test case is denoted as use-case to be tested and is stored to survey
In example library on probation, at this point, the test case has passed through the audit of auditor, it can be used for corresponding use-case event
It is tested.But for the validity for fully ensuring that test case, it is also necessary to it is examined by multiple actual test, because
This, which is temporarily marked as use case storage to be tested in test case library.
It is appreciated that if test case the audit fails, can be modified by auditor manual editing, or audit eventually
The error message of the test case is back to server by end, and server regenerates test case and is sent to audit terminal,
Until test case audit passes through.
S460, test verification is carried out to use-case to be detected.
Specifically, use-case to be detected refers to the audit by auditor, but the test examined without actual test
Use-case.In order to fully ensure that the validity of test case, when corresponding use-case event occurs again, using use-case to be detected
Multiple actual test is carried out, to use-case event to examine the validity of the test case.
Further, test verification is carried out to use-case to be detected, comprising:
At least one object to be measured is tested using use-case to be tested and obtains test result;
The test accuracy of use-case to be tested is counted based on test result;
If test accuracy reaches given threshold, remember that use-case to be tested is validity test use-case, and to validity test
Use-case carries out test-types label.
Specifically, repeatedly being tested using use-case to be tested at least one object to be measured, according to the survey repeatedly tested
Test result counts the test accuracy of use-case to be tested, if test accuracy reaches given threshold, is denoted as effective survey
Example on probation, when to occur corresponding use-case event again, can call directly validity test use-case, to guarantee the effective of test
Property.
Illustratively, it is assumed that the sudden strain of a muscle of picture when use-case to be tested can be used for testing multimedia is moved back, then can be used this to
The use-case event moved back is dodged when examining use-case to above-mentioned multimedia picture repeatedly to be tested, if user's click play it
Afterwards, multimedia operating status is consistent with expected results, then remembers that this test result is to pass through or is correct;If multimedia
Operating status be not inconsistent with expected results, still remain exception, then remember that this test result is not pass through or be mistake.It needs
Illustrate, if use-case to be tested is 95% by the test accuracy repeatedly tested, given threshold 90%, test is correctly
Rate is higher than given threshold, then the use-case to be tested is labeled as validity test use-case.Meanwhile validity test use-case is tested
Type mark, when the test-types of the event type of the use-case event occurred again and this validity test use-case label is consistent,
It no longer needs to carry out test verification to this validity test use-case, calls directly validity test use-case and tested.
It is understood that containing use-case to be tested and the two kinds of test of validity test use-case in test case library
Use-case, wherein use-case to be tested can be exchanged into validity test use-case after test verification, to ensure that having for test case
Effect property and it is comprehensive.
A kind of generation method of test case provided in this embodiment receives the use-case event of object to be measured, then first
By filling event key message to use-case configuration template, the use-case configuration file of use-case event is generated;It is configured by parsing
File simultaneously decomposes event key message, the valid data of acquisition is filled to matched test operation script, it can be achieved that automatic raw
At test case, testing efficiency is improved, increases the coverage area of test case.In addition, careful by the way that test case to be sent to
Core terminal is audited, and the test case storage that audit is passed through simultaneously carries out test verification to use-case to be detected, ensure that test
The validity of use-case and comprehensive.
Example IV
Fig. 5 is a kind of structural schematic diagram of the generating means for test case that the embodiment of the present invention four provides.The device is suitable
The case where for generating test case for use-case event, which can integrate by software and or hardware realization, and specifically
In the server for generating test case.
As shown in figure 5, the device includes:
Event receiving module 510, for receiving the use-case event of object to be measured;
Event parsing module 520 generates the use-case configuration file of the use-case event for parsing the use-case event;
Conversion module 530 is decomposed, converts the use-case configuration file for decomposing, obtains the survey of the corresponding use-case event
Example on probation.
A kind of generating means of test case provided in this embodiment, the use of object to be measured is received by event receiving module
Example event;The use-case event is parsed by event parsing module, generates the use-case configuration file of the use-case event;By dividing
It solves conversion module and decomposes the conversion use-case configuration file, obtain corresponding test case.It realizes and automatically generates test case,
Testing efficiency is improved, the coverage area of test case is increased.
Further, event parsing module includes:
Event key message extraction module determines the corresponding use-case configuration template of the use-case event for analyzing, and mentions
The event key message in the use-case event is taken, the event key message includes: the generation of the occurrence scene of event, event
Correlation time and event description;
Configuration file generation module generates institute for filling the event key message to the use-case configuration template
State the use-case configuration file of use-case event.
Further, decomposing conversion module includes:
Script obtains module, for parsing the use-case configuration file, determines the corresponding tag along sort of use-case configuration file,
Determine at least one event valid data for obtaining the corresponding use-case event;It obtains and is grasped with the matched test of the tag along sort
Make script;
Event key message decomposing module obtains at least for decomposing the event key message of the use-case configuration file
One valid data;
Each valid data are filled to the corresponding position of the test operation script, are obtained by Test cases technology module
The test case of the use-case configuration file must be corresponded to.
On the basis of the above embodiments, the generating means of test case further include:
Transceiver module is audited, for sending the test case to audit terminal, and is received for the test case
Audit feedback information;
Test case enters library module, for remembering that the test case is when the audit feedback information is that audit passes through
Use-case to be tested is simultaneously stored to test case library.
Further, the generating means of test case further include:
Test verification module, for carrying out test verification to the use-case to be detected.
Further, test verification module includes:
Statistical module, for test knot to be tested at least one object to be measured and obtained using the use-case to be tested
Fruit;The test accuracy of the use-case to be tested is counted based on the test result;
Test case determining module, if remembered described to be checked for judging that the test accuracy reaches given threshold
Testing use-case is validity test use-case, and carries out test-types label to the validity test use-case.
The generating means of test case provided in this embodiment can realize the life of the test case in above-mentioned any embodiment
At method and have corresponding function and beneficial effect, the technical detail of detailed description not can be found in above-mentioned in the present embodiment
Meaning embodiment.
Embodiment five
Fig. 6 is a kind of hardware structural diagram for server that the embodiment of the present invention five provides.As shown in fig. 6, this implementation
A kind of server that example provides, comprising: processor 610 and storage device 620.Processor in the server can be one or
Multiple, in Fig. 6 by taking a processor 610 as an example, processor 610 and storage device 620 in the server can be by total
Line or other modes connect, in Fig. 6 for being connected by bus.
One or more of programs are executed by one or more of processors 610, so that one or more of places
Manage the generation method that device realizes any test case into example IV of embodiment one.
Storage device 620 in the server is used as a kind of computer readable storage medium, can be used for storing one or more
A program, described program can be software program, computer executable program and module, use as tested in the embodiment of the present invention
Corresponding program instruction/the module of generation method of example is (for example, the module in the generating means of attached test case shown in fig. 5, packet
It includes: event receiving module 510, event parsing module 520 and decomposition conversion module 530).Processor 610 passes through operation storage
Software program, instruction and module in storage device 620, at the various function application and data of server
Reason, i.e., the generation method of test case in realization above method embodiment.
Storage device 620 mainly includes storing program area and storage data area, wherein storing program area can store operation system
Application program needed for system, at least one function;Storage data area, which can be stored, uses created data etc. according to server
(event key message, event category label in such as above-described embodiment).In addition, storage device 620 may include high speed with
Machine access memory, can also include nonvolatile memory, a for example, at least disk memory, flush memory device or its
His non-volatile solid state memory part.In some instances, storage device 620 can further comprise remote relative to processor 610
The memory of journey setting, these remote memories can pass through network connection to server.The example of above-mentioned network includes but not
It is limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Also, when one or more program included in above-mentioned server is by one or more of processors 610
When execution, program is proceeded as follows:
Receive the use-case event of object to be measured;The use-case event is parsed, the use-case configuration text of the use-case event is generated
Part;It decomposes and converts the use-case configuration file, obtain the test case of the corresponding use-case event.
The generation method for the test case that the server and above-described embodiment that the present embodiment proposes propose belongs to same invention
Design, the technical detail of detailed description not can be found in above-mentioned any embodiment in the present embodiment, and the present embodiment have with
The identical beneficial effect of the generation method of implementation of test cases.
On the basis of the above embodiments, the present embodiment also provides a kind of computer readable storage medium, is stored thereon with
Computer program, the generating means device which is tested use-case realize that the embodiment of the present invention one to example IV mentions when executing
The generation method of the test case of confession, this method comprises:
Receive the use-case event of object to be measured;
The use-case event is parsed, the use-case configuration file of the use-case event is generated;
It decomposes and converts the use-case configuration file, obtain the test case of the corresponding use-case event.
Certainly, a kind of storage medium comprising computer executable instructions, computer provided by the embodiment of the present invention
The generation method for the test case that executable instruction is not limited to the described above operates, and any embodiment of that present invention institute can also be performed
Relevant operation in the generation method of the test case of offer, and have corresponding function and beneficial effect.
By the description above with respect to embodiment, it is apparent to those skilled in the art that, the present invention
It can be realized by software and required common hardware, naturally it is also possible to which by hardware realization, but in many cases, the former is more
Good embodiment.Based on this understanding, technical solution of the present invention substantially in other words contributes to the prior art
Part can be embodied in the form of software products, which can store in computer readable storage medium
In, floppy disk, read-only memory (Read-Only Memory, ROM), random access memory (Random such as computer
Access Memory, RAM), flash memory (FLASH), hard disk or CD etc., including some instructions are with so that a computer is set
Standby (can be personal computer, server or the network equipment etc.) executes method described in each embodiment of the present invention.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that
The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention
It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also
It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.
Claims (10)
1. a kind of generation method of test case characterized by comprising
Receive the use-case event of object to be measured;
The use-case event is parsed, the use-case configuration file of the use-case event is generated;
It decomposes and converts the use-case configuration file, obtain the test case of the corresponding use-case event.
2. the method according to claim 1, wherein the use-case event includes following at least one:
The anomalous event that the problem of client user of the object to be measured feeds back event, the operation object to be measured grab in real time
And the task events of editor's input.
3. the method according to claim 1, wherein the parsing use-case event, generates the use-case thing
The use-case configuration file of part, comprising:
Analysis determines the corresponding use-case configuration template of the use-case event, and extracts the letter of the event key in the use-case event
Breath, the event key message includes: the occurrence scene of event, the generation correlation time of event and event description;
The event key message is filled to the use-case configuration file that the use-case event is generated to the use-case configuration template.
4. according to the method described in claim 3, it is characterized in that, the use-case configuration file, acquisition pair are converted in the decomposition
Answer the test case of the use-case event, comprising:
The use-case configuration file is parsed, determines the corresponding tag along sort of use-case configuration file;
It obtains and the matched test operation script of the tag along sort;
The event key message of the use-case configuration file is decomposed, at least one valid data are obtained;
Each valid data are filled to the corresponding position of the test operation script, the corresponding use-case configuration file is obtained
Test case.
5. the method according to claim 1, wherein further include:
The test case is sent to audit terminal, and receives the audit feedback information for being directed to the test case;
When the audit feedback information is that audit passes through, remember that the test case is use-case to be tested and stores to test case
Library.
6. according to the method described in claim 5, it is characterized by further comprising:
Test verification is carried out to the use-case to be detected.
7. according to the method described in claim 6, it is characterized in that, described carry out test verification, packet to the use-case to be detected
It includes:
At least one object to be measured is tested using the use-case to be tested and obtains test result;
The test accuracy of the use-case to be tested is counted based on the test result;
If the test accuracy reaches given threshold, remember that the use-case to be tested is validity test use-case, and to described
Validity test use-case carries out test-types label.
8. a kind of generating means of test case characterized by comprising
Event receiving module, for receiving the use-case event of object to be measured;
Event parsing module generates the use-case configuration file of the use-case event for parsing the use-case event;
Conversion module is decomposed, converts the use-case configuration file for decomposing, obtains the test case of the corresponding use-case event.
9. a kind of server characterized by comprising
One or more processors;
Storage device, for storing one or more programs;
One or more of programs are executed by one or more of processors, so that one or more of processors are realized
Such as the generation method of test case of any of claims 1-7.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor
The generation side such as the loss treating method test case in recording and broadcasting system of any of claims 1-7 is realized when execution
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910117501.0A CN109857671A (en) | 2019-02-15 | 2019-02-15 | Generation method, device, server and the storage medium of test case |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910117501.0A CN109857671A (en) | 2019-02-15 | 2019-02-15 | Generation method, device, server and the storage medium of test case |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109857671A true CN109857671A (en) | 2019-06-07 |
Family
ID=66898006
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910117501.0A Pending CN109857671A (en) | 2019-02-15 | 2019-02-15 | Generation method, device, server and the storage medium of test case |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109857671A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110456766A (en) * | 2019-07-30 | 2019-11-15 | 北京经纬恒润科技有限公司 | A kind of method and device generating analysis use-case |
CN110825618A (en) * | 2019-10-10 | 2020-02-21 | 重庆金融资产交易所有限责任公司 | Method and related device for generating test case |
CN112214390A (en) * | 2019-07-09 | 2021-01-12 | 腾讯科技(深圳)有限公司 | Test case generation method, device, system, equipment and medium |
CN112579472A (en) * | 2020-12-30 | 2021-03-30 | 锐捷网络股份有限公司 | Automatic generation method and device of test case |
CN114116452A (en) * | 2021-10-29 | 2022-03-01 | 北京达佳互联信息技术有限公司 | Test case generation method and device, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103186460A (en) * | 2011-12-30 | 2013-07-03 | 金蝶软件(中国)有限公司 | Method, device and system for generating script of test case |
CN103631720A (en) * | 2013-12-20 | 2014-03-12 | 百度在线网络技术(北京)有限公司 | Method and device for generating test case |
CN104794057A (en) * | 2015-04-29 | 2015-07-22 | 瑞斯康达科技发展股份有限公司 | Automatic testing method and device for crossed event |
CN107656864A (en) * | 2016-11-09 | 2018-02-02 | 华东师范大学 | A kind of Mobile solution automated testing method based on probabilistic model |
CN109086199A (en) * | 2018-06-22 | 2018-12-25 | 网宿科技股份有限公司 | A kind of automation generates the method for test script, terminal and can storage medium |
-
2019
- 2019-02-15 CN CN201910117501.0A patent/CN109857671A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103186460A (en) * | 2011-12-30 | 2013-07-03 | 金蝶软件(中国)有限公司 | Method, device and system for generating script of test case |
CN103631720A (en) * | 2013-12-20 | 2014-03-12 | 百度在线网络技术(北京)有限公司 | Method and device for generating test case |
CN104794057A (en) * | 2015-04-29 | 2015-07-22 | 瑞斯康达科技发展股份有限公司 | Automatic testing method and device for crossed event |
CN107656864A (en) * | 2016-11-09 | 2018-02-02 | 华东师范大学 | A kind of Mobile solution automated testing method based on probabilistic model |
CN109086199A (en) * | 2018-06-22 | 2018-12-25 | 网宿科技股份有限公司 | A kind of automation generates the method for test script, terminal and can storage medium |
Non-Patent Citations (1)
Title |
---|
戴夫•托马斯: "《Rails 5敏捷开发》", 31 January 2018 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112214390A (en) * | 2019-07-09 | 2021-01-12 | 腾讯科技(深圳)有限公司 | Test case generation method, device, system, equipment and medium |
CN112214390B (en) * | 2019-07-09 | 2024-01-30 | 腾讯科技(深圳)有限公司 | Test case generation method, device, system, equipment and medium |
CN110456766A (en) * | 2019-07-30 | 2019-11-15 | 北京经纬恒润科技有限公司 | A kind of method and device generating analysis use-case |
CN110825618A (en) * | 2019-10-10 | 2020-02-21 | 重庆金融资产交易所有限责任公司 | Method and related device for generating test case |
CN110825618B (en) * | 2019-10-10 | 2024-01-26 | 天航长鹰(江苏)科技有限公司 | Method and related device for generating test case |
CN112579472A (en) * | 2020-12-30 | 2021-03-30 | 锐捷网络股份有限公司 | Automatic generation method and device of test case |
CN112579472B (en) * | 2020-12-30 | 2024-04-16 | 锐捷网络股份有限公司 | Automatic generation method and device for test cases |
CN114116452A (en) * | 2021-10-29 | 2022-03-01 | 北京达佳互联信息技术有限公司 | Test case generation method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109857671A (en) | Generation method, device, server and the storage medium of test case | |
Itkonen et al. | The role of the tester's knowledge in exploratory software testing | |
US9118549B2 (en) | Systems and methods for context management | |
CN106844217A (en) | Control to applying bury method and device, readable storage medium storing program for executing a little | |
CN110287109A (en) | Test method, device, computer equipment and its storage medium of protocol interface | |
CN107085549B (en) | Method and device for generating fault information | |
CN112187585A (en) | Network protocol testing method and device | |
Soliman et al. | Enriching architecture knowledge with technology design decisions | |
CN110825618A (en) | Method and related device for generating test case | |
CN106713011B (en) | Method and system for obtaining test data | |
CN107168844B (en) | Performance monitoring method and device | |
CN110245077A (en) | A kind of response method and equipment of program exception | |
CN111124937B (en) | Method and system for assisting in improving test case generation efficiency based on instrumentation function | |
Wang et al. | Efsm-oriented minimal traces set generation approach for web applications | |
Jiang et al. | Regression testing process improvement for specification evolution of real-world protocol software | |
KR20120071175A (en) | Mobile phone loading web-platform, method for offering log information using the same mobile phone, verification system and method for web-platform | |
CN115587028A (en) | Interface automation test method, system, medium and terminal | |
CN107991904B (en) | Simulated wireless block center message generator | |
KR20220091897A (en) | Method and apparatus for analyzing pattern-based interaction failures in systems-of-systems | |
CN110069400A (en) | Loophole test report generation method, device, computer equipment and storage medium | |
CN110413518A (en) | The generation method and generating means and computer readable storage medium of control object library | |
CN115494525B (en) | White box type ground parallel diagnosis system and method for satellite on-orbit fault | |
CN111931184B (en) | Anti-serialization vulnerability detection method and device | |
CN111198819B (en) | Safety testing method and device | |
CN117931632A (en) | Automatic integrated test method, device, equipment and storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190607 |