CN106776336A - Test script generation method and device, method for testing software and device - Google Patents

Test script generation method and device, method for testing software and device Download PDF

Info

Publication number
CN106776336A
CN106776336A CN201611242140.5A CN201611242140A CN106776336A CN 106776336 A CN106776336 A CN 106776336A CN 201611242140 A CN201611242140 A CN 201611242140A CN 106776336 A CN106776336 A CN 106776336A
Authority
CN
China
Prior art keywords
test script
judgment
rule
test
trigger event
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201611242140.5A
Other languages
Chinese (zh)
Inventor
李�昊
朱昭俊
刘威
李军杰
许晓飞
范萍
王倩
苏赛
谢刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Ship Communication Research Institute
Original Assignee
Wuhan Ship Communication Research Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Ship Communication Research Institute filed Critical Wuhan Ship Communication Research Institute
Priority to CN201611242140.5A priority Critical patent/CN106776336A/en
Publication of CN106776336A publication Critical patent/CN106776336A/en
Pending legal-status Critical Current

Links

Classifications

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

Landscapes

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

Abstract

The invention discloses a kind of test script generation method and device, method for testing software and device, belong to software testing technology field.The test script generation method includes:Various trigger events, various Rule of judgment and various handling processes are provided, trigger event, Rule of judgment and handling process are corresponding with the type of type of service and communication equipment;Receive user's trigger event selected from various trigger events, the Rule of judgment selected from various Rule of judgment and the handling process selected from various handling processes;Trigger event, the Rule of judgment of selection, the handling process combination of selection that will be selected, generation test script, test script be used for when selection trigger event occur when, judge whether the Rule of judgment of selection is satisfied, and selection Rule of judgment be satisfied when according to handling process processing business.The present invention can greatly reduce testing cost.

Description

Test script generation method and device, method for testing software and device
Technical field
The present invention relates to software testing technology field, more particularly to a kind of test script generation method and device, software are surveyed Method for testing and device.
Background technology
Software test (English:Software Testing) it is that program is operated under conditions of regulation, by examining Core compares reality output and anticipated output, discovery procedure mistake, weigh software quality, and whether it can be met design will The process being estimated is sought, correctness, integrality, security and the quality of software can be identified.
When the communication equipment in communication system carries out software test, it is necessary to match somebody with somebody measurement equipment for equipment under test is equipped with, match somebody with somebody Measurement equipment is connected with equipment under test, and software test is carried out to equipment under test.In order to support the testing requirements such as abnormality test and matching The actual conditions of equipment under test, it usually needs tester's customized development test script, and the testing results pin on measurement equipment This realizes software test.
Realize it is of the invention during, inventor find prior art at least there is problems with:
The test script of customized development does not possess versatility, and the test script that matching is all developed in each software test will be aobvious Writing increases testing cost.
The content of the invention
It is high in order to solve the problems, such as prior art customized development test script cost of implementation, the embodiment of the invention provides one Plant test script generation method and device, method for testing software and device.The technical scheme is as follows:
In a first aspect, a kind of test script generation method is the embodiment of the invention provides, the test script generation method Including:
Various trigger events, various Rule of judgment and various handling processes, the trigger event, the judgement are provided Condition and the handling process are corresponding with the type of type of service and communication equipment;
Receive trigger event, the selection from various Rule of judgment that user selects from various trigger events Rule of judgment and the handling process selected from various handling processes;
The trigger event, the Rule of judgment of selection, the handling process combination of selection that will be selected, generation are surveyed Training sheet, the test script be used for when selection the trigger event occur when, judge selection the Rule of judgment whether It is satisfied, and when the Rule of judgment of selection is satisfied according to the handling process processing business.
Alternatively, the test script generation method also includes:
After the trigger event, the Rule of judgment or the handling process that receive user's selection, to User's output parameter input frame;
Receive the parameter of the user input, the parameter of input be used for the trigger event of selection, described sentence Broken strip part or the handling process combine to generate the test script.
Alternatively, the trigger event includes that manual trigger event, interface trigger event, data altering event, timing are touched Hair event and random trigger events, the manual trigger event are the event of the instruction triggers of user input, the interface triggering Event is the event that interface changes triggering to data frame, transmission data frame or connection status, the data altering event For internal data changes the event of triggering, the clocked flip event is the event for reaching cycle time triggering, it is described with Machine trigger event is the event of random time triggering;
The Rule of judgment includes artificial decision condition, data frame decision condition, interface decision condition, data judging condition With time decision condition, the artificial decision condition is the condition judged by user, and the data frame decision condition is root According to the condition that the content of the data frame for receiving is judged, the interface decision condition is to be carried out according to the connection status of interface The condition of judgement, the data judging condition is the condition judged according to the content of internal data, and the time judges bar Part is the condition that the time recorded according to communication equipment is judged;
The handling process include send data frame, change data, set interface, set timing, set test script and Output prompt message, the transmission data frame is the flow that data frame is sent by interface, and the change data are internal to change The flow of the content of data, the setting interface is the flow of the connection status for changing interface, and the setting timing is logical to change The flow of the setting of the time or timer of letter equipment record, the setting test script is the operation shape for changing test script The flow of state, the output prompt message is the flow to user's output information by man-machine interface.
Preferably, the transmission data frame includes:
Obtain the form of data frame;
Information is inserted in the form of the data frame for obtaining;
Data frame encapsulation is carried out according to communication protocol and testing requirement, data frame is obtained;
Configuration according to setting sends the data frame for obtaining.
Second aspect, the embodiment of the invention provides a kind of test script generating means, the test script generating means Including:
First output module, it is described for providing various trigger events, various Rule of judgment and various handling processes Trigger event, the Rule of judgment and the handling process are corresponding with the type of type of service and communication equipment;
First input module, for receiving trigger event that user selects from various trigger events, from described many Plant the Rule of judgment selected in Rule of judgment and the handling process selected from various handling processes;
Generation module, for the trigger event that will be selected, the Rule of judgment for selecting, the processing stream for selecting Cheng Zuhe, generates test script, and the test script is used to, when the trigger event of selection occurs, judge the described of selection Whether Rule of judgment is satisfied, and when the Rule of judgment of selection is satisfied according to the handling process processing business.
Alternatively, the test script generating means also include:
Second output module, for receiving the trigger event, the Rule of judgment or the institute of user's selection After stating handling process, to user's output parameter input frame;
Second input module, the parameter for receiving the user input, the parameter of input is used for the institute with selection The combination of trigger event, the Rule of judgment or the handling process is stated to generate the test script.
The third aspect, the embodiment of the invention provides a kind of method for testing software, and the method for testing software includes:
Receive the test open command that user is input into after equipment under test access;
Whether sent out according to the trigger event in multiple test scripts that the test open command cycle detection is previously generated Raw, the test script is the trigger event that user is selected from the various trigger events for providing, the various judgement bars for providing The handling process combination producing selected in the Rule of judgment, the various handling processes that are selected in part;
When the trigger event in the test script occurs, judge whether the Rule of judgment in the test script is expired Foot;
When the Rule of judgment in the test script is satisfied, industry is processed according to the handling process in the test script Business;
Generate and output test result to the user.
Alternatively, the method for testing software also includes:
The control instruction of the user input is received, the control instruction includes creating test script, or modification test One kind in script, interface, internal data, timer;
New test script is created and run according to the control instruction, or is changed the running status of test script, connect One kind in connection status, the content of internal data, the state of timer of mouth.
Fourth aspect, the embodiment of the invention provides a kind of software testing device, and the software testing device includes:
First receiver module, for receiving the test open command that user is input into after equipment under test access;
Detection trigger module, for being tested in multiple test scripts that open command cycle detection is previously generated according to described Trigger event whether occur, the test script be by user from provide various trigger events in select trigger event, The handling process combination producing selected in the Rule of judgment, the various handling processes that are selected in the various Rule of judgment for providing;
Determination module, for when the trigger event in the test script occurs, judging sentencing in the test script Whether broken strip part is satisfied;
Processing module, for when the Rule of judgment in the test script is satisfied, according in the test script Handling process processing business;
Output module, outputs test result for generating and to the user.
Alternatively, the software testing device also includes:
Second receiver module, the control instruction for receiving the user input, the control instruction includes creating tests One kind in script, or modification test script, interface, internal data, timer;
Control module, for being created according to the control instruction and runs new test script, or changes test script Running status, the connection status of interface, the content of internal data, the state of timer in one kind.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
For the common feature of the miscellaneous service of various communication equipments, various trigger events, Rule of judgment are exported to user Selected with handling process, and trigger event, Rule of judgment and the handling process combination that user is selected, you can generation test Script, highly versatile effectively helps tester to carry out the establishment of script, reduces the professional degree and complexity of software test, enters And the efficiency of software test is improved, greatly reduce the cost of customized development test script.
Brief description of the drawings
Technical scheme in order to illustrate more clearly the embodiments of the present invention, below will be to that will make needed for embodiment description Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those of ordinary skill in the art, on the premise of not paying creative work, other can also be obtained according to these accompanying drawings Accompanying drawing.
Fig. 1 is a kind of schematic flow sheet of test script generation method that the embodiment of the present invention one is provided;
Fig. 2 is a kind of structural representation of test script generating means that the embodiment of the present invention two is provided;
Fig. 3 is a kind of schematic flow sheet of method for testing software that the embodiment of the present invention three is provided;
Fig. 4 is a kind of structural representation of software testing device that the embodiment of the present invention four is provided;
Fig. 5 is a kind of hardware structure diagram of software testing device that the embodiment of the present invention five is provided.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention Formula is described in further detail.
Embodiment one
A kind of test script generation method is the embodiment of the invention provides, is particularly well-suited to carry out marine communication agreement soft Part is tested, and referring to Fig. 1, the test script generation method includes:
Step 101:Various trigger events, various Rule of judgment and various handling processes, trigger event, judgement are provided The handling process of condition and business is corresponding with the type of type of service and communication equipment.
In implementing, for the common feature of the miscellaneous service of various communication equipments, set up and composition test pin is provided Various trigger events originally, Rule of judgment and handling process, summarize all kinds of interface industry of the communication equipment using data frame interaction The universal way of business treatment and behavior.Tester exploitation test script when, can provide various trigger events, Rule of judgment and To tester, tester only needs to according to equipment under test, testing requirement (whether the data frame as sent meets to handling process Whether whether communication protocol, the satisfactory span of content of data frame for sending, data frame at the appointed time send, many Whether the data frame whether the transmission order of individual data frame correct, abnormal shield, whether certain class data frame sends) etc. actually Situation automatically generates test script by therefrom selecting, and simulates the data frame interaction process logic of complexity between communication equipment, Abnormality test is supported, highly versatile can effectively help tester to carry out the establishment of test script, reduce the special of software test Industry degree and complexity, improve the efficiency of software test, greatly reduce the cost of customized development test script.
Alternatively, trigger event includes manual trigger event, interface trigger event, data altering event, clocked flip thing Part and random trigger events.
Wherein, manual trigger event is the event of the instruction triggers of user input, and interface trigger event is arrived for interface Data frame, the event for sending data frame or connection status change triggering, data altering event are tactile for internal data changes The event of hair, clocked flip event is the event for reaching cycle time triggering, and random trigger events are the thing of random time triggering Part.
For example, manual trigger event can be with certain instruction of user input, interface trigger event can be to receive certain class number According to frame, data altering event can be updated for certain internal data, and clocked flip event can be to perform processing stream with last time Interval time between journey reaches setting time, and random trigger events can be when performing the interval between handling process with last time Between reach the aperiodic time.
Alternatively, Rule of judgment includes artificial decision condition, data frame decision condition, interface decision condition, data judging Condition and time decision condition.
Wherein, artificial decision condition is the condition judged by user, is received according to data frame decision condition The condition that the content of data frame is judged, interface decision condition is the condition judged according to the connection status of interface, number It is the condition judged according to the content of internal data according to decision condition, time decision condition is to be recorded according to communication equipment The condition that time is judged.
An option, data frame is selected to judge from the multiple options for providing for example, artificial decision condition can be user Condition can be that the data frame for receiving includes setting content, and interface decision condition can be interface in connection status, number It is setting content according to the content that decision condition can be internal data, time decision condition can be to perform handling process with last time Between interval time reach setting time.
Alternatively, handling process includes sending data frame, change data, sets interface, set timing, set test script With output prompt message.
Alternatively, it is the flow that data frame is sent by interface to send data frame, and change data are to change internal data The flow of content, set interface be change interface connection status flow, set timing be change communication equipment record when Between or timer setting flow, set test script be change test script running status flow, output prompting Information is the flow to user's output information by man-machine interface.
For example, it can be to be replied message to communication equipment to send data frame, change data can be to update internal data Content, setting interface can send data frame for configuration interface, set the data that timing can be modification timer record, set Test script can be to start the operation of certain test script, and output prompt message can be to inform user test result.
Preferably, sending data frame can include:
Obtain the form of data frame;
Information is inserted in the form of the data frame for obtaining;
Data frame encapsulation is carried out according to communication protocol and testing requirement, data frame is obtained;
Configuration according to setting sends the data frame for obtaining.
Wherein, the encapsulation of data frame includes but is not limited to frame number and the renewal of verification sum, the data of data frame content turn Change, add frame head and data frame postamble.The configuration of setting can include the sending object of data frame, transmission interface, transmission times, Forward delay interval etc..It should be noted that the configuration of the information inserted and setting be all handling process selection send data frame it After set, referring specifically to step 102.
Send data frame detailed process in, it is necessary to first obtain data frame form (need to generally preset, some Can be prototype with the data frame for receiving under special applications scene);Then insert information in the form of data frame, data generally from Obtained in internal data or the data frame of reception, it is different to realize interface data also dependent on software test requirement input abnormal data The often execution (source of data can set in advance) of test;Automatic packaging, envelope are completed to data frame then according to communication protocol Dress operation is decomposed into renewal frame number, update verification and, data frame content data transposition, interpolation data frame initial and tail sections etc. several Micromotion, is automatically performed by test device, and tester can also pre-set verification and the numerical value of mistake, to realize logarithm According to the abnormality test of frame structure;Last communication object, communication interface, transmission times, forward delay interval according to script design etc. is matched somebody with somebody The data frame after sending encapsulation is put, tester can pre-enter and the exception such as the forward delay interval in time limit is for example responded beyond system Set, the abnormality test of choma section is tapped with achievement unit.
Step 102:Receive trigger event, the selection from various Rule of judgment that user selects from various trigger events Rule of judgment and the handling process selected from various handling processes.
Alternatively, the test script generation method can also include:
After the trigger event, Rule of judgment or the handling process that receive user's selection, it is input into user's output parameter Frame;
The parameter of user input is received, the parameter of input is used for and the trigger event, Rule of judgment or processing stream for selecting Cheng Zuhe is generating test script.
In actual applications, when handling process selection sends data frame, can be to inserting information in user's output data frame With send data frame according to configuration input interface.Wherein, user can be according to communication protocol, the type of business and test need Setting is asked to insert information.Specifically, information is inserted to can come from internal data (data of device storage inside, are different from and pass through The data of reception), it is also possible to from the data that equipment under test sends, could also be from the data of user input.
(need to generally be set in advance, it is necessary to determine the source of data frame to be sent first in the detailed process for sending data frame It is fixed, can be prototype with the data frame for receiving under some special applications scenes);Then needed more according to communication protocol and Business Processing Part field data in new data frame prototype, data are obtained generally from internal data or the data frame of reception, tester It is input into abnormal data to realize the execution of interface data abnormality test also dependent on software test requirement;Then according to communication protocol To data frame complete automatic packaging, encapsulation operation be decomposed into renewal frame number, update verification and, data frame content data transposition, Several micromotions such as interpolation data frame initial and tail sections, are automatically performed by test device, and tester can also implement artificial encapsulation (being for example manually entered verification and the numerical value of mistake), to realize the abnormality test to data frame structure;Last foundation script design Communication object, communication interface, transmission times, forward delay interval etc. the data frame after sending encapsulation is set, tester can be input into Abnormal transmission sets (forward delay interval that the time limit is for example responded beyond system), and the abnormality test of choma section is tapped with achievement unit.
In implementing, trigger event, Rule of judgment and handling process can be provided in the way of following list respectively Give user's selection.For example, in the page of the output to user, setting three following lists, first drop-down list is included manually Trigger event, interface trigger event, data altering event, clocked flip event, five options of random trigger events, under second Drawing list includes artificial decision condition, data frame decision condition, interface decision condition, data judging condition, time decision condition Five options, the 3rd drop-down list includes sending data frame, change data, sets interface, set timing, set test pin Originally, six options of prompt message.
User selects trigger event, Rule of judgment and handling process according to actual conditions such as equipment under test, testing requirements.Example Such as, heartbeat service selection clocked flip event, time decision condition (consistent with trigger event), send data frame (specially group Broadcast heartbeat message), the parameter of setting includes cycle time, the content of data frame;And for example, time calibration service selection interface triggering (specially data frame is the correct time calibration report of verification for event (specially receiving data frame), data frame decision condition Text), change data (local clock is specially set);For another example, device parameter sets service selection interface trigger event (tool online Body is to receive data frame), (specially data frame is that the correct device parameter of verification sets report online to data frame decision condition Text), change data (specially updating internal data using the data in message) and transmission data frame be (specially to upper management Equipment sends device parameter online equipment success message);And for example, trigger voltage alarm business selection data altering event is (specific Be artificial change builtin voltage data), data judging condition (specially builtin voltage data exceed setting value), send data frame (specially sending voltage alarm information to upper management equipment).
Step 103:Trigger event, the Rule of judgment of selection, the handling process combination of selection that will be selected, generation test pin This.
Wherein, test script be used for when selection trigger event occur when, judge whether the Rule of judgment of selection is satisfied, And when the Rule of judgment of selection is satisfied according to handling process processing business.The trigger event of different test scripts, judge bar Part, handling process at least one of difference, each test script independent operating.Generally when software test is carried out, circulation Detect whether the trigger event in each test script occurs, judge whether Rule of judgment is satisfied if trigger event occurs, And handling process is performed when Rule of judgment is satisfied.
In implementing, test script correspondence realize outside input, once outside output, once outside look into Ask or an internal event.It is if there is multiple events, then corresponding to generate multiple test scripts.If multiple event correlations, Then using the setting of trigger event, Rule of judgment and handling process, the association of multiple test scripts is realized.For example, multiple tests Script selects identical trigger event, then can be with parallel running;And for example, the result of a handling process for test script is another The trigger event of individual test script is (especially by the test pin that handling process selection is set for setting test script and operation This), then can be by two test script series operations.
The embodiment of the present invention exports various triggering things for the common feature of the miscellaneous service of various communication equipments to user Part, Rule of judgment and handling process are selected, and trigger event, Rule of judgment and the handling process combination that user is selected, Can generation test script, highly versatile, effective establishment for helping tester to carry out script, the professional degree of reduction software test And complexity, and then improve software test efficiency, greatly reduce customized development test script cost.
Embodiment two
A kind of test script generating means are the embodiment of the invention provides, referring to Fig. 2, the test script generating means bag Include:
First output module 201, for providing various trigger events, various Rule of judgment and various handling processes, touches The handling process of hair event, Rule of judgment and business is corresponding with the type of type of service and communication equipment;
First input module 202, for receiving trigger event that user selects from various trigger events, from various judgements The Rule of judgment selected in condition and the handling process selected from various handling processes;
Generation module 203, the handling process for the trigger event that will be selected, the Rule of judgment for selecting, selection is combined, raw Into test script, test script is used to, when the trigger event of selection occurs, judge whether the Rule of judgment of selection is satisfied, and When the Rule of judgment of selection is satisfied according to handling process processing business.
Alternatively, trigger event includes manual trigger event, interface trigger event, data altering event, clocked flip thing Part and random trigger events.
Wherein, manual trigger event is the event of the instruction triggers of user input, and interface trigger event is arrived for interface Data frame, the event for sending data frame or connection status change triggering, data altering event are tactile for internal data changes The event of hair, clocked flip event is the event for reaching cycle time triggering, and random trigger events are the thing of random time triggering Part.
Alternatively, Rule of judgment includes artificial decision condition, data frame decision condition, interface decision condition, data judging Condition and time decision condition.
Wherein, artificial decision condition is the condition judged by user, is received according to data frame decision condition The condition that the content of data frame is judged, interface decision condition is the condition judged according to the connection status of interface, number It is the condition judged according to the content of internal data according to decision condition, time decision condition is to be recorded according to communication equipment The condition that time is judged.
Alternatively, handling process includes sending data frame, change data, sets interface, set timing, set test script With output prompt message.
Alternatively, it is the flow that data frame is sent by interface to send data frame, and change data are to change internal data The flow of content, set interface be change interface connection status flow, set timing be change communication equipment record when Between or timer setting flow, set test script be change test script running status flow, output prompting Information is the flow to user's output information by man-machine interface.
Preferably, sending data frame can include:
Obtain the form of data frame;
Information is inserted in the form of the data frame for obtaining;
Data frame encapsulation is carried out according to communication protocol and testing requirement, data frame is obtained;
Configuration according to setting sends the data frame for obtaining.
Alternatively, the test script generating means can also include:
Second output module, for after the trigger event, Rule of judgment or the handling process that receive user's selection, to User's output parameter input frame;
Second input module, the parameter for receiving user input, the parameter of input be used for the trigger event of selection, sentence Broken strip part or handling process combine to generate test script.
The embodiment of the present invention exports various triggering things for the common feature of the miscellaneous service of various communication equipments to user Part, Rule of judgment and handling process are selected, and trigger event, Rule of judgment and the handling process combination that user is selected, Can generation test script, highly versatile, effective establishment for helping tester to carry out script, the professional degree of reduction software test And complexity, and then improve software test efficiency, greatly reduce customized development test script cost.
Embodiment three
A kind of method for testing software is the embodiment of the invention provides, referring to Fig. 3, the method for testing software can include:
Step 301:Receive the test open command that user is input into after equipment under test access.
Step 302:It is according to the trigger event in multiple test scripts that test open command cycle detection is previously generated No generation.
In the present embodiment, test script be by user from provide various trigger events in select trigger event, carry The handling process combination producing selected in the Rule of judgment, the various handling processes that are selected in the various Rule of judgment for supplying, specifically Embodiment one is may refer to, be will not be described in detail herein.
Step 303:When the trigger event in test script occurs, whether the Rule of judgment in discriminating test script is expired Foot.
Step 304:When the Rule of judgment in test script is satisfied, industry is processed according to the handling process in test script Business.
Step 305:Generate and output test result to user.
In actual applications, all of ruuning situation (including test result) can be all recorded in daily record, such as received Test open command, detection the triggered time whether occur, trigger event occur when Rule of judgment whether be satisfied, Rule of judgment quilt Processing procedure etc. when meeting, the analyze data of communication system simulation operation is provided for tester.
It should be noted that in test process, mainly artificial traffic equipment and equipment under test exchange data frames, and utilize The transmitting-receiving situation of log recording data frame, tester checks that daily record may know that test result.
Alternatively, the method for testing software can also include:
The control instruction of user input is received, control instruction includes modification test script, interface, internal data, timer In one kind;
Change running status, the connection status of interface, the content of internal data, the timing of test script according to control instruction One kind in the state of device.
It is rapid to build and the required test scene of operation by way of manual intervention, the software test needed for realizing.
The embodiment of the present invention exports various triggering things for the common feature of the miscellaneous service of various communication equipments to user Part, Rule of judgment and handling process are selected, and trigger event, Rule of judgment and the handling process combination that user is selected, Can generation test script, highly versatile, effective establishment for helping tester to carry out script, the professional degree of reduction software test And complexity, and then improve software test efficiency, greatly reduce customized development test script cost.
Example IV
A kind of software testing device is the embodiment of the invention provides, referring to Fig. 4, the software testing device includes:
First receiver module 401, for receiving the test open command that user is input into after equipment under test access;
Detection trigger module 402, for according in test multiple test scripts for previously generating of open command cycle detection Trigger event whether occur, test script be by user from provide various trigger events in select trigger event, provide Various Rule of judgment in the handling process combination producing that selects in the Rule of judgment, the various handling processes that select;
Determination module 403, for when in test script trigger event occur when, the Rule of judgment in discriminating test script Whether it is satisfied;
Service Processing Module 404, for when the Rule of judgment in test script is satisfied, according to the place in test script Reason flow processing business;
Result treatment module 405, outputs test result for generating and to user.
Alternatively, the software testing device can also include:
Second receiver module, the control instruction for receiving user input, control instruction includes modification test script, connects One kind in mouth, internal data, timer;
Control module, running status, the connection status of interface, internal number for changing test script according to control instruction According to content, the state of timer in one kind.
The embodiment of the present invention exports various triggering things for the common feature of the miscellaneous service of various communication equipments to user Part, Rule of judgment and handling process are selected, and trigger event, Rule of judgment and the handling process combination that user is selected, Can generation test script, highly versatile, effective establishment for helping tester to carry out script, the professional degree of reduction software test And complexity, and then improve software test efficiency, greatly reduce customized development test script cost.
Embodiment five
The embodiment of the present invention provides a kind of software testing device, and referring to Fig. 5, device 500 includes processor 501, memory 502nd, communication interface 503, Man Machine Interface 504, timer 505.
Memory 502 can be used to store software program and application module, and processor 501 is by running storage in memory 502 software program and application module, so that the various function application of performs device 500 and data processing.Memory 502 Storing program area and storage data field can mainly be included, wherein, storing program area can storage program area, at least one function institute Application program for needing etc.;Storage data field can store data (such as test script) for being created according to the treatment of device 500 etc.. Additionally, memory 502 can include high-speed random access memory (English:Random Access Memory, referred to as:RAM), Nonvolatile memory (English can also be included:Non-volatile memory), for example, at least one disk memory, Flush memory device or other volatile solid-state parts.
Processor 501 is the control centre of device 500, using various interfaces and connection whole device 500 each Part.
Specifically, communication interface 503 is used for the connection of realization and equipment under test, is specifically as follows Ethernet interface or string Mouthful.
Timer 505 is used to realize, is that processor 501 provides timing.
Processor 501 is by operation or performs software program and application module of the storage in memory 502, and calls The data in memory 502 are stored, processor 501 is used to realize, receive user by Man Machine Interface 504 sets tested The test open command being input into after standby access;According in multiple test scripts that test open command cycle detection is previously generated Trigger event whether occur, test script be by user from provide various trigger events in select trigger event, provide Various Rule of judgment in the handling process combination producing that selects in the Rule of judgment, the various handling processes that select;Work as test When trigger event in script occurs, whether the Rule of judgment in discriminating test script is satisfied;When the judgement in test script When condition is satisfied, according to the handling process processing business in test script;Generate and by Man Machine Interface 504 to user Output test result.
Alternatively, processor 501 can also be realized, the control instruction of user input is received by Man Machine Interface 504, Control instruction includes the one kind in modification test script, interface, internal data, timer;Change test pin according to control instruction One kind in this running status, the connection status of interface, the content of internal data, the state of timer.
The embodiment of the present invention exports various triggering things for the common feature of the miscellaneous service of various communication equipments to user Part, Rule of judgment and handling process are selected, and trigger event, Rule of judgment and the handling process combination that user is selected, Can generation test script, highly versatile, effective establishment for helping tester to carry out script, the professional degree of reduction software test And complexity, and then improve software test efficiency, greatly reduce customized development test script cost.
It should be noted that:The test script generating means that above-described embodiment is provided are in production test script, software is surveyed Trial assembly is put in software test, is only carried out with the division of above-mentioned each functional module for example, in practical application, can be according to need Will and above-mentioned functions distribution is completed by different functional module, will the internal structure of device be divided into different function moulds Block, to complete all or part of function described above.In addition, the test script generating means of above-described embodiment offer and survey Examination scenario generation method, software testing device and method for testing software embodiment belong to same design, and it is detailed that it implements process See embodiment of the method, repeat no more here.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware To complete, it is also possible to instruct the hardware of correlation to complete by program, described program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all it is of the invention spirit and Within principle, any modification, equivalent substitution and improvements made etc. should be included within the scope of the present invention.

Claims (10)

1. a kind of test script generation method, it is characterised in that the test script generation method includes:
Various trigger events, various Rule of judgment and various handling processes, the trigger event, the Rule of judgment are provided And the handling process is corresponding with the type of type of service and communication equipment;
Receive the trigger event that user selects from various trigger events, the judgement selected from various Rule of judgment Condition and the handling process selected from various handling processes;
The trigger event, the Rule of judgment of selection, the handling process combination of selection that will be selected, generation test pin This, the test script is used for when the trigger event of selection occurs, and whether judge the Rule of judgment of selection is expired Foot, and when the Rule of judgment of selection is satisfied according to the handling process processing business.
2. test script generation method according to claim 1, it is characterised in that the test script generation method is also wrapped Include:
After the trigger event, the Rule of judgment or the handling process that receive user's selection, to described User's output parameter input frame;
The parameter of the user input is received, the parameter of input is used for the trigger event, the judgement bar with selection Part or the handling process combine to generate the test script.
3. test script generation method according to claim 1 and 2, it is characterised in that the trigger event includes artificial Trigger event, interface trigger event, data altering event, clocked flip event and random trigger events, the artificial triggering thing Part for user input instruction triggers event, the interface trigger event be interface to data frame, transmission data frame or Person's connection status changes the event of triggering, and the data altering event changes the event of triggering for internal data, described fixed When trigger event be reach cycle time triggering event, the random trigger events be random time triggering event;
The Rule of judgment include artificial decision condition, data frame decision condition, interface decision condition, data judging condition and when Between decision condition, the artificial decision condition is the condition judged by user, is connect according to the data frame decision condition The condition that the content of the data frame for receiving is judged, the interface decision condition is to be judged according to the connection status of interface Condition, the data judging condition is the condition judged according to the content of internal data, and the time decision condition is The condition that the time recorded according to communication equipment is judged;
The handling process includes sending data frame, change data, sets interface, set timing, set test script and output Prompt message, the transmission data frame is the flow that data frame is sent by interface, and the change data are change internal data Content flow, the setting interface be change interface connection status flow, the setting timing for change communication set The flow of the setting of the time or timer of note, the setting test script is the running status for changing test script Flow, the output prompt message is the flow to user's output information by man-machine interface.
4. test script generation method according to claim 3, it is characterised in that the transmission data frame includes:
Obtain the form of data frame;
Information is inserted in the form of the data frame for obtaining;
Data frame encapsulation is carried out according to communication protocol and testing requirement, data frame is obtained;
Configuration according to setting sends the data frame for obtaining.
5. a kind of test script generating means, it is characterised in that the test script generating means include:
First output module, for providing various trigger events, various Rule of judgment and various handling processes, the triggering Event, the Rule of judgment and the handling process are corresponding with the type of type of service and communication equipment;
First input module, for receiving trigger event that user selects from various trigger events, various sentencing from described The Rule of judgment selected in broken strip part and the handling process selected from various handling processes;
Generation module, for the trigger event that will be selected, the Rule of judgment for selecting, the handling process group for selecting Close, generate test script, the test script is used to, when the trigger event of selection occurs, judge the judgement of selection Whether condition is satisfied, and when the Rule of judgment of selection is satisfied according to the handling process processing business.
6. test script generating means according to claim 5, it is characterised in that the test script generating means are also wrapped Include:
Second output module, at the trigger event, the Rule of judgment or the place for receiving user's selection After reason flow, to user's output parameter input frame;
Second input module, the parameter for receiving the user input, the parameter of input is used to be touched with the described of selection Hair event, the Rule of judgment or the handling process combine to generate the test script.
7. a kind of method for testing software, it is characterised in that the method for testing software includes:
Receive the test open command that user is input into after equipment under test access;
Whether occurred according to the trigger event in multiple test scripts that the test open command cycle detection is previously generated, institute It is choosing in trigger event, the various Rule of judgment of offer that user is selected from the various trigger events for providing to state test script The handling process combination producing selected in Rule of judgment, the various handling processes selected;
When the trigger event in the test script occurs, judge whether the Rule of judgment in the test script is satisfied;
When the Rule of judgment in the test script is satisfied, according to the handling process processing business in the test script;
Generate and output test result to the user.
8. method for testing software according to claim 7, it is characterised in that the method for testing software also includes:
The control instruction of the user input is received, the control instruction includes modification test script, interface, internal data, meter When device in one kind;
Change running status, the connection status of interface, the content of internal data, the timing of test script according to the control instruction One kind in the state of device.
9. a kind of software testing device, it is characterised in that the software testing device includes:
First receiver module, for receiving the test open command that user is input into after equipment under test access;
Detection trigger module, for touching in test multiple test scripts for previously generating of open command cycle detection Whether hair event occurs, and the test script is trigger event, the offer that user is selected from the various trigger events for providing Various Rule of judgment in the handling process combination producing that selects in the Rule of judgment, the various handling processes that select;
Determination module, for when the trigger event in the test script occurs, judging the judgement bar in the test script Whether part is satisfied;
Processing module, for when the Rule of judgment in the test script is satisfied, according to the treatment in the test script Flow processing business;
Output module, outputs test result for generating and to the user.
10. software testing device according to claim 9, it is characterised in that the software testing device also includes:
Second receiver module, the control instruction for receiving the user input, the control instruction include modification test script, One kind in interface, internal data, timer;
Control module, running status, the connection status of interface, internal number for changing test script according to the control instruction According to content, the state of timer in one kind.
CN201611242140.5A 2016-12-29 2016-12-29 Test script generation method and device, method for testing software and device Pending CN106776336A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611242140.5A CN106776336A (en) 2016-12-29 2016-12-29 Test script generation method and device, method for testing software and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611242140.5A CN106776336A (en) 2016-12-29 2016-12-29 Test script generation method and device, method for testing software and device

Publications (1)

Publication Number Publication Date
CN106776336A true CN106776336A (en) 2017-05-31

Family

ID=58925438

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611242140.5A Pending CN106776336A (en) 2016-12-29 2016-12-29 Test script generation method and device, method for testing software and device

Country Status (1)

Country Link
CN (1) CN106776336A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108170124A (en) * 2017-12-20 2018-06-15 中国铁道科学研究院通信信号研究所 A kind of test script automatic creation system and method based on row control project data
CN110225246A (en) * 2019-05-28 2019-09-10 北京字节跳动网络技术有限公司 Generation method, device, electronic equipment and the computer readable storage medium of event scripts
CN110347581A (en) * 2019-05-20 2019-10-18 菜鸟智能物流控股有限公司 Test method and device and electronic equipment
CN111367613A (en) * 2020-03-18 2020-07-03 杭州和利时自动化有限公司 Event triggering system and method, electronic equipment and storage medium
CN111435227A (en) * 2018-12-25 2020-07-21 中移(杭州)信息技术有限公司 Smart home equipment testing method, device, equipment and medium
CN113468069A (en) * 2021-07-22 2021-10-01 腾讯科技(成都)有限公司 Application testing method and device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609341A (en) * 2011-07-08 2012-07-25 李康 Hardware equipment automation testing system and testing method thereof
CN102855127A (en) * 2011-06-28 2013-01-02 基信康信息技术(上海)有限公司 Device and method for generating testing script
CN105677306A (en) * 2014-11-18 2016-06-15 中兴通讯股份有限公司 Automation script compiling method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855127A (en) * 2011-06-28 2013-01-02 基信康信息技术(上海)有限公司 Device and method for generating testing script
CN102609341A (en) * 2011-07-08 2012-07-25 李康 Hardware equipment automation testing system and testing method thereof
CN105677306A (en) * 2014-11-18 2016-06-15 中兴通讯股份有限公司 Automation script compiling method and device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108170124A (en) * 2017-12-20 2018-06-15 中国铁道科学研究院通信信号研究所 A kind of test script automatic creation system and method based on row control project data
CN111435227A (en) * 2018-12-25 2020-07-21 中移(杭州)信息技术有限公司 Smart home equipment testing method, device, equipment and medium
CN111435227B (en) * 2018-12-25 2023-07-21 中移(杭州)信息技术有限公司 Smart home equipment testing method, device, equipment and medium
CN110347581A (en) * 2019-05-20 2019-10-18 菜鸟智能物流控股有限公司 Test method and device and electronic equipment
CN110347581B (en) * 2019-05-20 2023-05-26 菜鸟智能物流控股有限公司 Test method and device and electronic equipment
CN110225246A (en) * 2019-05-28 2019-09-10 北京字节跳动网络技术有限公司 Generation method, device, electronic equipment and the computer readable storage medium of event scripts
CN110225246B (en) * 2019-05-28 2021-07-20 北京字节跳动网络技术有限公司 Event script generation method and device, electronic equipment and computer readable storage medium
CN111367613A (en) * 2020-03-18 2020-07-03 杭州和利时自动化有限公司 Event triggering system and method, electronic equipment and storage medium
CN113468069A (en) * 2021-07-22 2021-10-01 腾讯科技(成都)有限公司 Application testing method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106776336A (en) Test script generation method and device, method for testing software and device
CN105450476B (en) A kind of regression test system and test method
CN107402880A (en) A kind of method of testing and electronic equipment
CN102724079B (en) Method and system for auxiliary configuration of Ethernet equipment
CN104156314A (en) Code reuse method applied to test system
CN106100935A (en) Charging equipment of electric automobile communication protocol consistency test device and method
Gao et al. What is AI software testing? and why
CN107729228A (en) Interface test method, device, storage medium and processor
US7275231B2 (en) High level validation of designs and products
CN105988904A (en) Self-adaptive testing method and system
CN109726830A (en) Equipment routing inspection method, apparatus, electronic equipment and storage medium
CN107179971A (en) Automatic coding and system for CAN troubleshooting
CN109857671A (en) Generation method, device, server and the storage medium of test case
CN108965274A (en) The analysis method and device of DBC file
CN114003451B (en) Interface testing method, device, system and medium
CN105740117B (en) Chip adjustment method and device
CN107703773A (en) A kind of method for testing software and device based on hardware-in-loop simulation system
CN104899042B (en) A kind of embedded machine vision detection program developing method and system
CN110347976A (en) Method, system, device and the storage medium of quick equipment leading out data model
CN107632909A (en) Method and system for ATE function
Kuroiwa et al. Testing environment for CPS by cooperating model checking with execution testing
CN107679159A (en) Generation method, device, server and the storage medium that fault diagnosis class problem replies
CN110457023A (en) Task creation method, apparatus, storage medium and electronic equipment
CN103457957B (en) A kind of network penetration test macro and method with adaptation function
CN106557419A (en) The method of testing and device of program

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