CN106227667A - A kind of method for generating test case of the Mobile solution of IFML based on extension - Google Patents
A kind of method for generating test case of the Mobile solution of IFML based on extension Download PDFInfo
- Publication number
- CN106227667A CN106227667A CN201610607871.9A CN201610607871A CN106227667A CN 106227667 A CN106227667 A CN 106227667A CN 201610607871 A CN201610607871 A CN 201610607871A CN 106227667 A CN106227667 A CN 106227667A
- Authority
- CN
- China
- Prior art keywords
- ifml
- model
- interactive stream
- test case
- 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.)
- Granted
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 108
- 238000000034 method Methods 0.000 title claims abstract description 33
- 230000003542 behavioural effect Effects 0.000 claims abstract description 8
- 230000002452 interceptive effect Effects 0.000 claims description 106
- 230000014509 gene expression Effects 0.000 claims description 30
- 230000001960 triggered effect Effects 0.000 claims description 17
- 230000009471 action Effects 0.000 claims description 11
- 238000005516 engineering process Methods 0.000 claims description 10
- 230000008569 process Effects 0.000 claims description 8
- 238000013461 design Methods 0.000 claims description 7
- 230000008859 change Effects 0.000 claims description 6
- 230000005540 biological transmission Effects 0.000 claims description 4
- 230000003993 interaction Effects 0.000 claims description 4
- 230000000977 initiatory effect Effects 0.000 claims description 2
- 238000007689 inspection Methods 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000009191 jumping Effects 0.000 description 3
- 238000004088 simulation Methods 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000012010 growth Effects 0.000 description 2
- 230000000750 progressive effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000010998 test method Methods 0.000 description 2
- 241000282693 Cercopithecidae Species 0.000 description 1
- 238000013142 basic testing Methods 0.000 description 1
- 238000009227 behaviour therapy Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001351 cycling effect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 230000035699 permeability Effects 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 230000017423 tissue regeneration Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3676—Test management for coverage analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
Abstract
The present invention relates to the method for generating test case of the Mobile solution of IFML model based on extension, first set up model, i.e. draw out the IFML model of its correspondence for Mobile solution to be tested;Set up the IFML that model uses, it is in former IFML standard base, add the extension content for Mobile solution modeling, extension subtype toolbar ToolBar and screen container is added including for view container, add extension subtype for view component and move control, add extension subtype mobile end system event, mobile terminal event and mobile terminal behavioral activity event for event Event, add extension subtype mobile terminal behavioral activity for behavioral activity.Satisfactory test case is generated according to selected Testing criteria.
Description
Technical field
The present invention is the method for generating test case of the mobile terminal application of a kind of IFML model based on extension, mainly relates to
And software test, IFML standard, the technology such as model-based testing method.
Background technology
Along with day by day popularizing of intelligent machine and panel computer, corresponding software market is also developing rapidly growth.Moving should
It is used in while having increasingly abundanter function and also needs to the various operating environments that reply causes because of special element
Change, its program complexity is also in growth exponentially.This is just as one the most time-consuming in software life-cycle
Part, scope and the workload of Mobile solution test considerably increase the most especially.
Existing in engineering, the most universal actually used test way is still based on manual testing, and certainly this deposits
In many shortcomings: manual testing needs to consume substantial amounts of manpower and time, has postponed the time that product comes into the market;The most just
Owing to manual testing consumes huge, random testing method often can only be used pith to be tested and have ignored other portions
Point, adding the mistakes and omissions problem that manual testing is likely to occur, cause Test coverage degree the highest, even test process itself also can go out
Existing mistake.
The cost that manual testing is high makes either academia or industrial quarters, has all turned one's attention to automatization's survey
Examination.Various automated test tool emerges in an endless stream, and wherein also contains mobile terminal: they are accepting the operation of self-defining
After behavior sequence, can in selected terminal and system testing results use-case, and analyze these operation whether occur defect or
Person's mistake also records and points out.But the operation behavior sequence as instrument input need nonetheless remain for manually generated, and this is still that
The work of a large amount of human resources of individual consumption, is also the bottleneck improving automatic test degree further simultaneously.Other automatization
Method of testing also includes monkey test etc., although this class testing is without manually generated behavioral test sequence, but there is test
Skewness, the important defect such as the infull lower side of Test coverage degree, typically can only be useful in specific application or application
Specific part on.
In recent years, along with extensively application and the requirement of software test automation of Object-oriented Software Development technology, especially
Being gradually popularizing of software development technique based on uml model, method for testing software based on model has gradually obtained software and has opened
Send out personnel and the recognition and acceptance of software test personnel.Test model produced by this method of testing contributes to software global design
And adjustment, and test case coverage rate based on auto-building model is higher, coordinates the corresponding automated test frame can be
Bigization ground improves the automaticity of test, and effectively reduces the huge consumption that manual testing is brought.But it's a pity, though
So there is more and more such testing tool to occur, but to apply and to also have the biggest deficiency or unaccommodated on mobile terminals
Local: the model that first major part uses only does not carries out spy for mobile terminal for PC end or page end have carried out design
Change;Another point is then that test case still have employed traditional design, tests, and ignore shifting based on function
The interface that moved end is paid attention to is with mutual.
The modeling language for front end interactive stream that IFML standard is released as OMG association, interactive stream modeling language
(Interaction Flow Modeling Language is called for short IFML), it is possible to describe software the most in the form of images
In the Front-end Design of system represent between content, and user mutual, and Behavior-Based control etc., catered to mobile end rightly
End emphasizes the feature that front end is mutual.Therefore, based on using IFML standard, automated testing method based on model, energy are used
Enough generate more reasonably efficiently for the cycle tests of mobile terminal, this automatization to improving mobile terminal further
Test degree has bigger help.
Summary of the invention
It is an object of the invention to, based on IFML (InteractionFlowModelingLanguage) standard, propose one
Plant mobile terminal application test data auto generation scheme, and combine current existing automated test tool, carry further
The automatic test degree of high mobile terminal.With the addition of the extension of Mobile solution modeling.Then IFML is used for application to be measured
Set up model measurement use-case.
The method for generating test case of the Mobile solution of a kind of IFML model based on extension, it is characterised in that described in it
Method comprises the following steps:
Set up model, i.e. draw out the IFML model of its correspondence for Mobile solution to be tested.Set up model to use
The IFML arrived, is in former IFML standard base, adds the extension content for Mobile solution modeling, holds including for view
Device ViewContainer adds extension subtype toolbar ToolBar and screen container Screen, for view component
ViewComponent adds extension subtype and moves control MoibleComponent, adds extension for event Event
Subtype mobile end system event MobileSystemEvent, mobile terminal event MobileElementEvent and mobile terminal row
For life event MobileActionEvent, add extension subtype mobile terminal behavioral activity for behavioral activity Action
MobileAction.IFML based on this extension, according to the interaction design of Mobile solution to be measured, draw its correspondence IFML mould
Type;
After reading the IFML model of Mobile solution to be measured, the service condition applied according to this modeling also generates correspondence
Test case.The generation step of test case is as follows:
1) according to the IFML model of above-mentioned application to be measured, the initial page of application is determined, and using this initial page as mould
The initial state of type.Determine all of parameter in this IFML model simultaneously, and according to the default value DefaultValue of each parameter
The default value of expression formula initiation parameter;
2) determine visible view container and view component according to current initialization state, and search out can trigger mutual
Stream;
3) interactive stream the most not performed is selected, if the most all interactive streams triggered all were performed or nothing
Interactive stream may select, then rollback is to performing state before a upper interactive stream, returns step 2);If cannot rollback, it is meant that institute
Having all interactive streams triggered under state to be the most performed, the most all of Test cases technology is complete, Test cases technology mistake
Journey terminates with regard to this;
4) according to the interactive stream of above-mentioned selection, perform this interactive stream may with the transmission of parameter, simultaneously according to mutual
Cell therefor and assembly are set to invisible by the view elements that stream flows out, will be corresponding according to the view elements that interactive stream points to
Container and assembly are set to visible, and generate the operation behavior of correspondence;
5) generate corresponding operation behavior according to aforesaid operations, and carry out record;
6) repeat 2), 3), 4), 5) step, until having reached predetermined loop termination condition;Period, if in this circulation
In the sequence of operation that formed of the sequence of operations behavior recorded cover according to the Testing criteria selected before not
The place covered, then record this sequence of operation as a test case;
7) state before the supreme interactive stream of rollback, returns step 2).
When performing interactive stream, the expression formula in this IFML model is resolved, it is judged that the institute of interactive stream branch of execution
The precondition needed, and calculate that user may need the input content performed according to preposition requirement.To in this IFML model
Expression formula, i.e. Expression element type and its subtype in IFML standard resolve: specifically comprise
InteractionFlowExpression, ActivationExpression, JavaExpression etc.
(InteractionFlowExpression is generally held by Event, indicates with the form of Expression and triggers this Event
The rear final InteractionFlow performed, i.e. which bar interactive stream is;ActivationExpression, for most
IFML element type is held, and can trigger so that under the form instruction present circumstances of expression formula, this IFML element is the most visible;
JavaExpression is generally used for auxiliary and represents the internal logic of IFML element, and the DefaultValue attribute such as parameter is
JavaExpression type, for representing parameter default number before not using, such as the JavaExpression of Action
Also being the type, for representing the concrete logic that Action performs, its concrete content is to change parameter each in IFML model
Become), and pass through the content of this parsing executable expressions or obtain precondition etc..
Step 7) the rollback content of rollback operation mainly comprise following some: the interactive stream information performed, currently
Each parameter information, current visible view container and view component, the interactive stream information that currently can trigger, the behaviour recorded
Make behavioural information.
This method for generating test case uses multiple Testing criteria, such as Condition Coverage Testing criterion, path coverage criterion and
Limit coverage criterion and its derivative coverage criterion etc..
Step 6) circulation termination condition refer to be set up before Test cases technology in order to retrain and to control test case
The parameter generated, such as test case maximum number of steps, test case minimal steps number, the maximum cycle of circulation in application
Deng, in simulation process, each interactive stream group has its relevant data of reference record of correspondence, in order to judge that this is mutual at present
The simulation of stream group whether beyond requirement, requirement if more than, then can terminate the circulation of this mutual flow resistance.
Further, the test case ultimately generated itself has higher readability, can be by current automatic test
Instrument accepts and automatically performs test.
The present invention based on IFML standard come from the 1.0 formal officials of IFML standard that in March, 2015, OMG tissue was issued
Document, has following important concept to need to illustrate in this standard:
1.ViewContainer, i.e. view container, what it represented is the interface of a globality.One view container, its
Inside can comprise multiple daughter element;
2.ViewComponent, i.e. view component, representative is a control on globality interface.One sets of views
Part, the most individually shows, is typically held by ViewContainer;
3.InteractionFlow, i.e. interactive stream, represent and be currently located the page or container to another page or container jumping
The process turned, represents the transfer of view focus;
4.Event, i.e. event, refer to affect an event of this application system state, and it is lower containing multiple
Subtype.It often holds multiple interactive stream that may be triggered, but can only trigger a wherein interactive stream every time;
5.Action, i.e. activity, representative is one piece of the affair logic that will be performed, and is often caused tactile by event
Send out.Itself can be containing corresponding ActionEvent (one of event) simultaneously, can be from movable property after having performed the affair logic
The interactive stream of tissue regeneration promoting forwards view focus to other element up;
6.Parameter, i.e. parameter information, the most not individualism, but held by other members, it is used for participating in member
The calculating of middle Expression, represents the state holding element;
7.Expression, i.e. internal logic expression formula, it defines one group of expression formula, this group with specific linguistic form
Expression formula eventually provides a result, for assisting the logical lines such as the judgement of the change of IFML Model Parameter and state
For.
The present invention is directed to above-mentioned described IFML standard and carried out corresponding extension, concrete extension content is as follows:
1) it is that ViewContainer types of elements with the addition of Screen Yu ToolBar subtype: Screen type represents shifting
The globality interface of dynamic terminal, ToolBar represents the toolbar interface being likely to occur on this mobile terminal;
2) it is that ViewComponent types of elements with the addition of mobile terminal subtype MobileComponent, and under it again
Degree with the addition of subtype Button, Text, Image and Icon:Button and represents the control of type of button on mobile terminal, and emphasizing can
Click on, can trigger event, Text represents large-area content of text control, and Image represents large-scale picture control, and Icon represents
Small-sized icon control;
3) for the interface that mobile terminal is exclusive, with the addition of subtype for ViewContainer types of elements
MobileSystemContainer, with the addition of subtype for ViewComponent types of elements
MobileSystemComponent, and under MobileSystemContainer add example subtype SettingPanel and
NotificationArea, under MobileSystemComponent add example subtype SettingItem and
Notification (corresponding with above-mentioned SettingPanel and NotificationArea respectively):
MobileSystemContainer with MobileSystemComponent represents the exclusive view container in mobile terminal and sets of views
Part, SettingPanel represents the setting interface that mobile terminal often has, and SettingItem then represents specific components therein,
NotificationArea represents the interface, message notifying hurdle of mobile terminal, and Notification represents that message notifying therein is believed
Breath;
4) it is that Action type element with the addition of mobile terminal subtype MobileAction, and under it, adds subtype
Example CameraAction and MicrophoneAction, with the addition of mobile terminal subtype for ActionEvent types of elements
MobileActionEvent, and its lower add subtype example CameraActionEvent and
MicrophoneActionEvent:MobileAction and MobileActionEvent represents the behavior work that mobile terminal is exclusive
Dynamic event triggered with it, CameraAction represents the photograph in mobile terminal and photography behavior, CameraActionEvent
Then representing the event that corresponding behavior is triggered, MicrophoneAction then represents the call behavior of mobile terminal,
MicrophoneActionEvent represents the event of its correspondence;
5) it is that the SystemEvent subtype interpolation MobileSystemEvent subtype under Event represents mobile terminal
System event, and add subtype example BatteryEvent, StorageEvent, SensorEvent,
NotificationEvent and ConnectionEvent;Add for the ViewElementEvent subtype element under Event
MobileElementEvent subtype represents user's alternative events of mobile terminal, and at its lower interpolation subtype example
ClickEvent, LongPressEvent, SwipeEvent, TouchEvent, ScrollEvent:BatteryEvent represent
Mobile terminal power supply causes relevant event, and StorageEvent represents the event of its storage associated trigger, and SensorEvent represents
The event of sensor-triggered, NotificationEvent represents that mobile terminal message end pushes the event triggered,
ConnectionEvent represents the event that the connection (as network connects, NFC, WIFI etc.) of mobile terminal triggers, ClickEvent table
Showing the event that the clicking operation of user triggers, LongPressEvent represents the long event triggered by operation, SwipeEvent table
Showing the event that the operation that horizontally slips triggers, TouchEvent represents the event that touch operation triggers, and ScrollEvent represents upper and lower
The event of slide trigger;
6) it is that Expression element type adds JavaExpression subtype for assisting expression internal logic table
Reach formula, and represent its logical operation for Action element type and subtype interpolation JavaExpression member variable thereof: should
The content of JavaExpression is specially java statement and expression formula, for the parameter in IFML model carried out assignment and
Change;
Beneficial effect, IFML standard is the modeling language for front end interactive stream, it is possible to retouch the most in a graphical form
State in the Front-end Design of software system represent between content, and user mutual, and Behavior-Based control etc., cater to rightly
Mobile terminal emphasizes the feature that front end is mutual.Based on using IFML standard, use automated testing method based on model,
Can generate more reasonably efficiently for the test case of mobile terminal.Therefore based on IFML
(InteractionFlowModelingLanguage) standard, it is achieved mobile terminal application test data auto generation, and tie
Close current existing automated test tool, improve the automatic test degree of mobile terminal further.Test case is one group
Comprise the sequence of operation of the formatting of interactive unit and interactive operation information, automatically can be performed by multiple automated test tool.
The present invention uses model-based testing method, it is achieved that Mobile solution test data auto generation, improves Test coverage
Rate.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the method for generating test case embodiment one and two of the present invention.
Fig. 2 is the particular flow sheet of the method for generating test case embodiment one of the present invention.
Fig. 3 is the particular flow sheet of the method for generating test case embodiment two of the present invention.
Fig. 4 is the test case schematic diagram that the method for generating test case of the present invention ultimately generates.
Detailed description of the invention
Below by drawings and Examples, technical scheme is described in further detail.
Fig. 1 is the schematic flow sheet of the method for generating test case embodiment one and two of the present invention.Embodiment one, two is whole
Keeping consistent in body flow process, it differs primarily in that and generates the mode that test case is used.Whole flow process is by reading
IFML model generates required test case, is broadly divided into two parts: IFML model read and parsing and based on IFML
Modeling generates test case.First front portion have read the information in IFML model, then for the difference of this model
Information carries out the initialization on basis: UML structure initialization represents the initialization of its UML data structure relied on, and thresholding is initial
Changing the initialization representing the parameter information arrived used in this IFML model, interactive stream initializes and then represents each in this IFML model
Element instance and the initialization of its relation with each other.Rear portion then passes through IFML pattern die on the basis of front portion
Intend the service condition of tested application, generate corresponding test case according to the coverage criterion selected;Need during generating
Resolving for the expression formula in IFML, be adapted to assist in condition judges the derivation with preposition input.
As in figure 2 it is shown, this is method for generating test case embodiment one tested by IFML modeling of the present invention
Examination application process obtains the particular flow sheet of satisfactory test case, comprises the steps:
Step 101, parameter initialization, belong to here by this expression formula of DefaultValue resolved and calculate under parameter
Property, give the numerical value of acquiescence when parameter starts most.
Step 102, determines that by IFML model the initial page of tested application, the most initial ViewContainer regard
Figure container, the namely place of view focus.
Step 103, determines current visible view container and view component according to the view container being currently located, wherein also
ActivationExpression expression element possible on each assembly need to be calculated, the result of calculation meeting shadow that this expression formula is final
Ring current component the most visible.
Step 104, according to view container visible in step 103 and assembly, checks from the interactive stream that currently can trigger
The most whether there is the interactive stream not triggered, if it is jump to step 107, be not, jump to step 105.
Step 105, checks whether can perform front situation, the most not by the supreme interactive stream of rollback under current state
For the most initial situation;If it is, enter step 106, it not to show that this emulation the most all terminates.
Step 106, the situation before rollback supreme interactive stream execution, the particular content of rollback includes: performed
Interactive stream information, current each parameter information, the view container at active view focus place, the interactive stream that currently can trigger believe
Breath, the operation behavior information recorded, restarts to perform step 103.
Step 107, selects in the interactive stream not triggered, and is set to by this interactive stream in the current situation
It is triggered.
Step 108, checks whether this situation has reached termination condition after selecting current interactive stream, particularly as follows: before
Whether the number of steps experienced has exceeded the maximum number set, and currently whether the accumulative experience quantity of this interactive stream has exceeded setting
The maximum number maximum number of circulation (the most whether reached).If meeting condition, then it represents that be a destination node, it is impossible at this herein
Place continues emulation and goes down, and jumps directly to step 106 and carries out rollback;If being unsatisfactory for, represent and still be possible to can continue to imitate
Really go down, redirect progressive rapid 109.
The most whether step 109, checks whether the current interactive stream selected contains brother's interactive stream, contain and belong to same thing
Other interactive streams of part element.When sometimes, then mean that this Event element is possibly together with InteractionFlowExpression table
Reaching formula element selects current interactive stream the most feasible for auxiliary judgment, proceeds to step 110;When not having, then this Event element
This interactive stream can only be triggered, it is not necessary to judge, jump directly to step 112.
Step 110, calculates above-mentioned InteractionFlowExpression expression element, and derives possible institute
The preposition input needed.
Step 111, inputs the preposition input (being likely not to have) obtained in 110 steps as parameter, and inspection should
InteractionFlowExpression the most finally selects current interactive stream after calculating, if it is, represent input
Derive rationally, enter step 112;If it is not, then represent that current interactive stream cannot select, cannot emulate under this situation, enter step
Rapid 106 carry out rollback.
Step 112, according to interactive stream may with Wire Parameters information carry out the transmission of parameter values.
Step 113, the container or the assembly that point to according to interactive stream determine the view container being currently located, complete view focus
Transfer, if the tactile originator of this interactive stream is Action element type, the most also need to perform the logical expression within this element
JavaExpression。
Step 114, according to this interactive stream and above-mentioned possible input parameter information, generates corresponding operation behavior letter
Breath, and recorded.
Whether step 115, check after current interactive stream, cover according to the coverage criterion fixed in advance
The part the most not covered, if then jumping to step 116;If not then jumping to step 103 to carry out next round circulation.
Step 116, using the operation behavior information recorded the most in order as an entirety, i.e. one operation sequence
Row, preserve as a test case, and update Test coverage progress, the most also need to jump to step 103 and enter
Next round circulates.
As it is shown on figure 3, this be the present invention method for generating test case embodiment two by IFML model intend tested
Application process obtains the particular flow sheet of satisfactory test case, comprises the steps:
Step 201, determines that by IFML model the initial page of tested application, the most initial ViewContainer regard
Figure container, the namely place of view focus.
Step 202, next interactive stream that each interactive stream of static calculation may trigger after triggering, ignoring can in practical situation
Can occur interactive stream is invisible and InteractionFlowExpression select permeability.
Step 203, updates current basal information according to static calculation result, comprises: the accumulative interactive stream information selected, mesh
Front place view container, the interactive stream information that may be able to trigger at present.
Step 204, checks whether reach termination condition after selecting this interactive stream, particularly as follows: the step experienced before)
Whether exceeded set maximum number, currently the accumulative experience quantity of this interactive stream whether exceeded set maximum number (be i.e.
The no maximum number having reached circulation), etc..If meeting condition, then jump to step 209;If being unsatisfactory for, redirect progressive rapid
205。
Step 205, checks the most whether there is the interactive stream not triggered from the interactive stream that currently may be able to trigger, as
Fruit is to jump to step 206, is not to jump to step 207.
Step 206, selects a wherein interactive stream not triggered, is recorded, and be labeled as triggering, afterwards
Return step 202 to start the cycle over.
Step 207, check under current state whether can the supreme interactive stream of rollback select before situation, the most non-at the beginning of
Beginning situation;If it is, enter step 208, it not to show that this emulation the most all terminates.
Step 208, the situation before rollback supreme interactive stream selection, the particular content of rollback only includes the most chosen
The interactive stream information crossed, and restart to perform step 202.
Step 209, determines candidate's interactive stream group of this traversal generation, is i.e. selected also one by one in above-mentioned circulation
The interactive stream recorded selects information, in this, as candidate's interactive stream group, checks this interactive stream group to be in the following step
No can be appropriately carried out, carry out following circulation using this interactive stream group Article 1 interactive stream as initial interactive stream simultaneously.
Step 210, parameter initialization, belong to here by this expression formula of DefaultValue resolved and calculate under parameter
Property, give the numerical value of acquiescence when parameter starts most.
Step 211, selects current interactive stream to start the cycle over, each bar interactive stream of interactive stream group is carried out inspection one by one and
Perform.
Step 212, checks that this interactive stream is the most visible, particularly as follows: check this interactive stream place Event event and
Whether the ViewComponent view component at Event place has ActivationExpression on it, if had, calculates
The value of this expression formula, in order to judge that under current state, the element instance of its correspondence is the most visible, if visible, then jumps to step
213;Invisible, represent that this interactive stream cannot correctly perform, jump to step 208 and carry out rollback.
The most whether step 213, checks whether the current interactive stream selected contains brother's interactive stream, contain and belong to same thing
Other interactive streams of part element.When sometimes, then mean that this Event element is possibly together with InteractionFlowExpression table
Reaching formula element selects current interactive stream the most feasible for auxiliary judgment, proceeds to step 214;When not having, then this Event element
This interactive stream can only be triggered, it is not necessary to judge, jump directly to step 216.
Step 214, calculates above-mentioned InteractionFlowExpression expression element, and derives possible institute
The preposition input needed.
Step 215, inputs the preposition input (being likely not to have) obtained in 214 steps as parameter, and inspection should
InteractionFlowExpression the most finally selects current interactive stream after calculating, if it is, represent input
Derive rationally, enter step 216;If it is not, then represent that current interactive stream cannot select, simulate unsuccessfully, jump to step 208 and enter
Row rollback.
Step 216, according to interactive stream may with Wire Parameters information carry out the transmission of parameter values.
Step 217, the container or the assembly that point to according to interactive stream determine the view container being currently located, complete view focus
Transfer, if the tactile originator of this interactive stream is Action element type, the most also need to perform the logical expression within this element
JavaExpression。
Step 218, according to this interactive stream and above-mentioned possible input parameter information, generates corresponding operation behavior letter
Breath, and recorded.
Step 219, checks that whether the interactive stream that emulates at present is the last item in this interactive stream group, if
It is to show that this interactive stream group all have passed through inspection, all can be appropriately carried out, jump to step 220, jump out above-mentioned following
Ring;If not the last item, then show the follow-up interactive stream also having and not being examined, therefore jump to step 211 repetitive cycling.
Step 220, this path of inspection simulation at present, before whether having covered according to selected Testing criteria not
Once the place covered, if it is, jump to step 221;If it is not, then jump to step 208 to carry out rollback.
Step 221, records current interactive stream group as a basic test use-case, and updates Test coverage degree, finally
Jump to step 208 and carry out rollback.
As shown in Figure 4, this is the test case schematic diagram that the method for generating test case of the present invention ultimately generates:
Being the schematic diagram of a test case ultimately generated in figure, it is in the nature one group of operation behavior having permanent order
The sequence of operation of composition.
In figure, each Rounded Box and the arrow being derived from are expressed as an operation behavior, and Rounded Box represents this operation of triggering
The concrete control of behavior, arrow represents concrete operation content.
In Rounded Box, type attribute represents that the type of control: Screen represents overall page, and Button represents type of button
Control, Image representative image type control, Icon representative icon type control, Text represents large area present disclosure type control
Part;Name attribute represents the title of this control or significant text thereon;Id attribute represent this control in a program
Concrete label, for assisting the location of this control.
Arrow represents concrete operation content, and its operating main body is that Rounded Box (control) that this arrow is derived.
Above arrow, (right) represents the particular type of operation: Click represents clicking operation;Swipe represents the operation that horizontally slips, now
Below arrow, (left) can contain left (to the left) or the concrete direction of right (to the right) this slide of character mark;
Scroll represents and slides up and down operation, and now below arrow, (left) can contain up (upwards) or down (downwards) character mark
The concrete direction of this slide;LongPress represents long by operation, and now below arrow, (how much (left) can contain XXs
Second), XXm (how many minutes) character is for representing the long time pressed;Select represents the concrete operations choosing from list;
Input represents input operation, and now below arrow, (left) can build square frame, wherein comprise input control name (control
Title or significant text), id (control concrete label in a program) and value (should input in this operation
Numerical value).
Claims (6)
1. the method for generating test case of the Mobile solution of an IFML model based on extension, it is characterised in that its described side
Method comprises the following steps:
Set up model, i.e. draw out the IFML model of its correspondence for Mobile solution to be tested;Set up what model used
IFML, is in former IFML standard base, adds the extension content for Mobile solution modeling, including for view container
ViewContainer adds extension subtype toolbar ToolBar and screen container Screen, for view component
ViewComponent adds extension subtype and moves control MoibleComponent, adds extension for event Event
Subtype mobile end system event MobileSystemEvent, mobile terminal event MobileElementEvent and mobile terminal row
For life event MobileActionEvent, add extension subtype mobile terminal behavioral activity for behavioral activity Action
MobileAction.IFML based on this extension, according to the interaction design of Mobile solution to be measured, draw its correspondence IFML mould
Type;
After reading the IFML model of Mobile solution to be measured, the service condition applied according to this modeling the test generating correspondence
Use-case;The generation step of test case is as follows:
1) according to the IFML model of above-mentioned application to be measured, the initial page of application is determined, and using this initial page as model
Initial state.Determine all of parameter in this IFML model simultaneously, and express according to the default value DefaultValue of each parameter
The default value of formula initiation parameter;
2) determine visible view container and view component according to the current state of model, and search out the interactive stream that can trigger;
3) interactive stream the most not performed is selected, if the most all interactive streams triggered all were performed or no interactions
Stream is optional, then rollback is to performing state before a upper interactive stream, returns step 2);If cannot rollback, it is meant that all shapes
Under state, all interactive streams triggered are performed the most, and the most all of Test cases technology is complete, and Test cases technology process is just
This terminates;
4) according to the interactive stream of above-mentioned selection, perform this interactive stream may with the transmission of parameter, simultaneously according to interactive stream stream
Cell therefor and assembly are set to invisible by the view elements gone out, according to interactive stream point to view elements by cell therefor
It is set to visible with assembly, and generates the operation behavior of correspondence;
5) generate corresponding operation behavior according to aforesaid operations, and carry out record;
6) repeat 2), 3), 4), 5) step, until having reached predetermined loop termination condition;Period, if remembered in the cycle
The sequence of operation that sequence of operations behavior under Lu is formed did not covered before covering according to the Testing criteria selected
Place, then this sequence of operation is recorded as a test case;
7) state before the supreme interactive stream of rollback, returns step 2).
2., according to the method for generating test case of the Mobile solution based on IFML model described in claim 1, its feature exists
In, when performing interactive stream, the expression formula in this IFML model is resolved, it is judged that required for the interactive stream branch of execution
Precondition, and calculate that user may need the input content performed according to preposition requirement;Expression in IFML standard
Element type and its subtype resolve, specifically comprise InteractionFlowExpression,
ActivationExpression、JavaExpression;InteractionFlowExpression is generally held by Event
Have, indicate the final InteractionFlow performed after triggering this Event with the form of Expression, i.e. which interactive stream is
Article one,;ActivationExpression, is held by most IFML element type, indicates at present with the form of expression formula
In the case of whether this IFML element visible can trigger;JavaExpression is generally used for auxiliary and represents that the inside of IFML element is patrolled
Volume, the DefaultValue attribute such as parameter is JavaExpression type, for representing parameter writing from memory before not using
Recognizing numerical value, if the JavaExpression of Action is also the type, for representing the concrete logic that Action performs, it is concrete
Content be the change to parameter each in IFML model, and by the content of this parsing executable expressions or obtain preposition bar
Part.
3., according to the method for generating test case of the mobile terminal based on IFML model described in claim 1, its feature exists
In, step 7) the rollback content of rollback operation mainly comprise following some: the interactive stream information performed, current each parameter
Information, current visible view container and view component, the interactive stream information that currently can trigger, the operation behavior recorded
Information.
4., according to the method for generating test case of the mobile terminal based on IFML model described in claim 1, its feature exists
In, this method for generating test case uses multiple Testing criteria, as Condition Coverage Testing criterion, path coverage criterion and limit cover
Criterion and its derivative coverage criterion.
5., according to the method for generating test case of the mobile terminal based on IFML model described in claim 1, its feature exists
In, step 6) circulation termination condition refer to be set up before Test cases technology in order to retrain and to control Test cases technology
Parameter, such as test case maximum number of steps, test case minimal steps number, the maximum cycle etc. of circulation in application, at mould
During plan, each interactive stream group has its relevant data of reference record of correspondence, in order to judge the mould of this interactive stream group at present
Intend whether beyond requirement, requirement if more than, then can terminate the circulation of this mutual flow resistance.
6., according to the method for generating test case of the described mobile terminal based on IFML model of claim a kind, its feature exists
In the test case ultimately generated, itself there is certain form, can be accepted by current automated test tool and automatically hold
Row test.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610607871.9A CN106227667B (en) | 2016-07-28 | 2016-07-28 | A kind of method for generating test case of the mobile application of the IFML based on extension |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610607871.9A CN106227667B (en) | 2016-07-28 | 2016-07-28 | A kind of method for generating test case of the mobile application of the IFML based on extension |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106227667A true CN106227667A (en) | 2016-12-14 |
CN106227667B CN106227667B (en) | 2019-03-19 |
Family
ID=57534206
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610607871.9A Active CN106227667B (en) | 2016-07-28 | 2016-07-28 | A kind of method for generating test case of the mobile application of the IFML based on extension |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106227667B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107844421A (en) * | 2017-10-31 | 2018-03-27 | 平安科技(深圳)有限公司 | Interface test method, device, computer equipment and storage medium |
CN110502237A (en) * | 2019-09-07 | 2019-11-26 | 创新奇智(广州)科技有限公司 | A kind of software interface prototype method and tool based on state diagram |
CN113934646A (en) * | 2021-12-17 | 2022-01-14 | 中建电子商务有限责任公司 | System and method for software testing |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103995781A (en) * | 2014-06-10 | 2014-08-20 | 浪潮通用软件有限公司 | Method for generating component testing use cases based on model |
-
2016
- 2016-07-28 CN CN201610607871.9A patent/CN106227667B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103995781A (en) * | 2014-06-10 | 2014-08-20 | 浪潮通用软件有限公司 | Method for generating component testing use cases based on model |
Non-Patent Citations (3)
Title |
---|
KAREL FRAJTÁK等: "Transformation of IFML Schemas to Automated Tests", 《PROCEEDINGS OF THE 2015 CONFERENCE ON RESEARCH IN ADAPTIVE AND CONVERGENT SYSTEMS》 * |
MARCO BRAMBILLA 等: "Extending the Interaction Flow Modeling Language (IFML) for Model Driven Development of Mobile Applications Front End", 《INTERNATIONAL CONFERENCE ON MOBILE WEB AND INFORMATION SYSTEMS》 * |
殷永峰: "《基于UML状态图的面向对象软件测试用例生成》", 《系统工程与电子技术》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107844421A (en) * | 2017-10-31 | 2018-03-27 | 平安科技(深圳)有限公司 | Interface test method, device, computer equipment and storage medium |
CN107844421B (en) * | 2017-10-31 | 2020-08-14 | 平安科技(深圳)有限公司 | Interface testing method and device, computer equipment and storage medium |
CN110502237A (en) * | 2019-09-07 | 2019-11-26 | 创新奇智(广州)科技有限公司 | A kind of software interface prototype method and tool based on state diagram |
CN113934646A (en) * | 2021-12-17 | 2022-01-14 | 中建电子商务有限责任公司 | System and method for software testing |
Also Published As
Publication number | Publication date |
---|---|
CN106227667B (en) | 2019-03-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105739983B (en) | Shell script editing device and its implementation | |
Rivero et al. | Mockup-driven development: providing agile support for model-driven web engineering | |
CN103853611B (en) | The method and electronic equipment that text between application program is fast replicated | |
CN109284473A (en) | The editor of online teaching courseware and generation method and system | |
CN111538668B (en) | Mobile terminal application testing method, device, equipment and medium based on reinforcement learning | |
CN105955888A (en) | Page debugging and previewing method and system | |
CN109032568A (en) | Generation method, terminal device and the storage medium of programmed logic | |
CN105740153A (en) | Cloud testing method and device | |
CN105843734A (en) | Automatic test method and device and computing device | |
CN104461855A (en) | Automatic Web testing method, system and device | |
CN110941467A (en) | Data processing method, device and system | |
CN103631590B (en) | The edit methods of automatic test script | |
CN109254910A (en) | A kind of test method of application program, device, electronic equipment and storage medium | |
CN112558824A (en) | Page display method and device and computer storage medium | |
CN112558954A (en) | Information extraction method, device, medium and electronic equipment combining RPA and AI | |
CN106227667A (en) | A kind of method for generating test case of the Mobile solution of IFML based on extension | |
Bernaschina et al. | Online model editing, simulation and code generation for web and mobile applications | |
Xue | Automated mobile apps testing from visual perspective | |
CN102929636B (en) | A kind of human-computer interaction interface creation method and device | |
CN113010168B (en) | User interface generation method based on scene tree | |
CN111708699A (en) | Intelligent integrated detection system for Android application program | |
Losada et al. | Applying Usability Engineering in InterMod Agile Development Methodology. A Case Study in a Mobile Application. | |
CN109885297B (en) | Method for selecting component interaction target of prototype design tool | |
CN114579118A (en) | Programming method and system, equipment, storage medium | |
CN114416533A (en) | Artificial intelligence-based use case generation method and system for vehicle-mounted electronic product |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |