CN106227667B - A kind of method for generating test case of the mobile application of the IFML based on extension - Google Patents

A kind of method for generating test case of the mobile application of the IFML based on extension Download PDF

Info

Publication number
CN106227667B
CN106227667B CN201610607871.9A CN201610607871A CN106227667B CN 106227667 B CN106227667 B CN 106227667B CN 201610607871 A CN201610607871 A CN 201610607871A CN 106227667 B CN106227667 B CN 106227667B
Authority
CN
China
Prior art keywords
ifml
model
extension
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.)
Active
Application number
CN201610607871.9A
Other languages
Chinese (zh)
Other versions
CN106227667A (en
Inventor
潘敏学
张天
陆飞
陆一飞
李宣东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University
Original Assignee
Nanjing University
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 Nanjing University filed Critical Nanjing University
Priority to CN201610607871.9A priority Critical patent/CN106227667B/en
Publication of CN106227667A publication Critical patent/CN106227667A/en
Application granted granted Critical
Publication of CN106227667B publication Critical patent/CN106227667B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/3676Test management for coverage analysis
    • 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 present invention relates to the method for generating test case of the mobile application of the IFML model based on extension, first establish model, i.e., draw out its corresponding IFML model for mobile application to be tested;Establish the IFML that model uses, it is in former IFML standard base, it joined the extension content for mobile application modeling, including adding extension subtype toolbar ToolBar and screen container for view container, the mobile control of extension subtype is added for view component, extension subtype mobile end system event, mobile terminal event and mobile terminal behavioral activity event are added for event Event, adds extension subtype mobile terminal behavioral activity for behavioral activity.Satisfactory test case is generated according to selected Testing criteria.

Description

A kind of method for generating test case of the mobile application of the IFML based on extension
Technical field
The present invention is a kind of method for generating test case of the mobile terminal application of IFML model based on extension, is mainly related to And software test, IFML standard, the technologies such as model-based testing method.
Background technique
With increasingly popularizing for intelligent machine and tablet computer, corresponding software market is also grown in rapid development.Movement is answered The various operating environments caused by also need to cope with because of special element while possessing more and more abundant function Variation, program complexity is also in growth exponentially.Originally as one the most time-consuming in software life-cycle Part, the range and workload of mobile application test are then even more to considerably increase.
Existing that more universal test method is actually used in engineering still based on manual testing, unquestionably this is deposited In many disadvantages: manual testing needs to consume a large amount of manpower and time, has postponed the time that product enters market;Simultaneously just Since manual testing's consumption is huge, can only often random testing method be used to be tested pith and have ignored other portions Point, in addition the mistakes and omissions problem that manual testing is likely to occur, causes Test coverage degree not high or even test process itself can also go out Existing mistake.
The high cost of manual testing makes either academia or industry, has all turned one's attention to automation and has surveyed Examination.Various automated test tool emerges one after another, wherein also containing mobile terminal: they are in the operation for receiving self-defining After behavior sequence, test case can be run in selected terminal and system, and analyze these operations whether occur defect or Person's mistake is simultaneously recorded and is prompted.But there is still a need for manually generated, this is still the operation behavior sequence as tool input The work of a a large amount of human resources of consumption, while being also the bottleneck for further increasing automatic test degree.Others automation Test method further includes monkey test etc., although this class testing is without manually generated behavioral test sequence, there is tests It is unevenly distributed, the important defect such as infull lower side of Test coverage degree, can only generally be useful in specific application or application Specific part on.
In recent years, with the extensive use of Object-oriented Software Development technology and the requirement of software test automation, especially It is gradually popularizing for the software development technique based on uml model, the method for testing software based on model has gradually obtained software and opened The recognition and acceptance of hair personnel and software test personnel.Test model caused by the test method facilitates software whole design And adjustment, and the test case coverage rate based on auto-building model is higher, cooperates corresponding automated test frame can be most Bigization ground improves the degree of automation of test, and effectively reduces huge consumption brought by manual testing.But unfortunately, though So there are more and more such testing tools to occur, but will be using there are also biggish insufficient or unsuitable on mobile terminals Place: one is the model largely used is only that the end PC or page end have carried out design and do not carried out for mobile terminal special Change;Another point is then that test case still uses traditional design method, is tested based on function, and ignores shifting The interface and interaction that moved end is paid attention to.
The modeling language for front end interactive stream that IFML standard is released as OMG association, interactive stream modeling language (Interaction Flow Modeling Language, abbreviation IFML), can describe software in the form of images well Show content in the Front-end Design of system, mobile end has properly been catered in interaction and behaviour control between user etc. Emphasize the feature of front end interaction in end.Therefore based on using IFML standard, using the automated testing method based on model, energy The more reasonable efficient cycle tests for being directed to mobile terminal is enough generated, this automation to mobile terminal is further increased Test degree has larger help.
Summary of the invention
It is an object of the present invention to which IFML (InteractionFlowModelingLanguage) standard of being based on, proposes one Kind mobile terminal application test data auto generation scheme, and current existing automated test tool is combined, further mention The automatic test degree of high mobile terminal.It is added to the extension of mobile application modeling.Then for be measured using IFML Establish model measurement use-case.
A kind of method for generating test case of the mobile application of the IFML model based on extension, which is characterized in that described in it Method the following steps are included:
Model is established, i.e., draws out its corresponding IFML model for mobile application to be tested.Establish model use The IFML arrived is to joined the extension content for mobile application modeling, including hold for view in former IFML standard base Device ViewContainer adds extension subtype toolbar ToolBar and screen container Screen, for view component ViewComponent adds the mobile control MoibleComponent of extension subtype, adds extension for event Event Subtype mobile end system event MobileSystemEvent, mobile terminal event MobileElementEvent and mobile terminal row For life event MobileActionEvent, extension subtype mobile terminal behavioral activity is added for behavioral activity Action MobileAction.IFML based on the extension draws its corresponding IFML mould according to the interaction design of mobile application to be measured Type;
After reading the IFML model of mobile application to be measured, according to the service condition of modeling application and generate corresponding 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 the initial page as mould The initial state of type.Parameter all in the IFML model is determined simultaneously, and according to the default value DefaultValue of each parameter The default value of expression formula initiation parameter;
2) visible view container and view component are determined according to current initialization state, and searches out triggerable interaction Stream;
3) interactive stream not executed wherein is selected, if current all triggerable interactive streams were performed or nothing Interactive stream may be selected, then retracts to the state before a upper interactive stream that executes, return step 2);If can not retract, it is meant that institute Stateful lower all triggerable interactive streams have been performed, i.e., all Test cases technologies finish, Test cases technology mistake Journey terminates with regard to this;
4) according to the interactive stream of above-mentioned selection, the transmitting for the parameter that the interactive stream may have is executed, while according to interaction Cell therefor is set as invisible with component by the view elements of stream outflow, will be corresponding according to the view elements that interactive stream is directed toward Container is set as it can be seen that and generating corresponding operation behavior with component;
5) corresponding operation behavior is generated according to aforesaid operations, and is recorded;
6) repeat 2), 3), 4), 5) step, until having reached scheduled loop termination condition;Period, if in the circulation In the sequence of operation composed by the sequence of operations behavior recorded covered according to the Testing criteria of selection before not The place of covering is then recorded the sequence of operation as a test case;
7) state before the supreme interactive stream of rollback, return step 2).
When executing interactive stream, the expression formula in the IFML model is parsed, judges the interaction flow branching institute executed The precondition needed, and according to the preposition input content for requiring to calculate that user may need to be implemented.To in the IFML model Expression formula, i.e. Expression element type in IFML standard and its subtype are parsed: specifically including InteractionFlowExpression, ActivationExpression, JavaExpression etc. (InteractionFlowExpression is usually held by Event, and instruction triggers the Event in the form of Expression Which item the InteractionFlow finally executed afterwards, i.e. interactive stream are;ActivationExpression is most IFML element type is held, and indicates that whether visible the IFML element is triggerable under present circumstances in the form of expression formula; JavaExpression indicates the internal logic of IFML element commonly used in auxiliary, as the DefaultValue attribute of parameter is JavaExpression type, for default number of the expression parameter before being not used, such as the JavaExpression of Action It also is the type, the specific logic executed for indicating Action, specific content is to change to each parameter in IFML model Become), and pass through the content of the parsing executable expressions or acquisition precondition etc..
The rollback content of step 7) rollback operation mainly includes the following: the interaction stream information executed, currently Each parameter information, current visible view container and view component, the interaction stream information that currently can trigger, the behaviour recorded Make behavioural information.
The method for generating test case uses a variety of Testing criterias, such as Condition Coverage Testing criterion, path coverage criterion and Side coverage criterion and its derivative coverage criterion etc..
Step 6) circulation suspension condition refer to set up before Test cases technology to constrain and control test case The parameter of generation, such as test case maximum number of steps, test case minimal steps number, the maximum cycle recycled in Deng each interactive stream group has its relevant data of corresponding reference record in simulation process, to judge the current interaction The requirement whether simulation of stream group has exceeded requires if more than, then can terminate the circulation of the interaction flow resistance.
Further, test case ultimately generated readability with higher itself, can be by current automatic test Tool receives and executes test automatically.
The present invention is based on IFML standard from OMG in March, 2015 tissue publication IFML standard 1.0 formal officials Document has in the standard following important concept needs to be illustrated:
1.ViewContainer, i.e. view container, what it was represented is the interface of a globality.One view container, Inside may include multiple daughter elements;
2.ViewComponent, i.e. view component, representative is a control on globality interface.One sets of views Part is not shown individually, is generally held by ViewContainer;
3.InteractionFlow, i.e. interactive stream, representative are currently located the page or container and jump to another page or container The process turned, represents the transfer of view focus;
4.Event, i.e. event refer to the event that may will affect the application system state, under contain there are many Subtype.It often holds multiple interactive streams 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 often causes to touch by event Hair.Itself can contain corresponding ActionEvent (one kind of event) simultaneously, can be from movable property after having executed the affair logic View focus is gone to other elements up by raw new interactive stream;
6.Parameter, i.e. parameter information, generally not individualism, but held by other members, for participating in member The calculating of middle Expression, to indicate the state for 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 one as a result, for assisting the logical lines such as the variation of IFML Model Parameter and the judgement of state For.
The present invention has carried out corresponding extension for above-mentioned described IFML standard, and specific extension content is as follows:
1) be added to Screen and ToolBar subtype for ViewContainer types of elements: Screen type indicates to move The globality interface of dynamic terminal, ToolBar indicate the toolbar interface being likely to occur on the mobile terminal;
2) it is added to mobile terminal types MobileComponent for ViewComponent types of elements, and under it again Degree is added to subtype Button, and Text, Image and Icon:Button indicate the control of type of button on mobile terminal, and emphasizing can It clicks, can trigger event, Text indicates that the content of text control of large area, Image indicate large-scale picture control, and Icon is indicated Small-sized icon control;
3) interface exclusive for mobile terminal is added to subtype for ViewContainer types of elements MobileSystemContainer is added to subtype for ViewComponent types of elements MobileSystemComponent, and at MobileSystemContainer add example subtype SettingPanel and NotificationArea, at MobileSystemComponent add example subtype SettingItem and Notification (corresponding with above-mentioned SettingPanel and NotificationArea respectively): MobileSystemContainer and MobileSystemComponent indicates the exclusive view container and sets of views in mobile terminal Part, SettingPanel indicates the setting interface that mobile terminal often has, and SettingItem then indicates specific components therein, NotificationArea indicates the message notifying column interface of mobile terminal, and Notification indicates message notifying letter therein Breath;
4) it is added to mobile terminal subtype MobileAction for Action type element, and in its lower addition subtype Example CameraAction and MicrophoneAction are added to mobile terminal subtype for ActionEvent types of elements MobileActionEvent, and in its lower addition subtype example CameraActionEvent and MicrophoneActionEvent:MobileAction and MobileActionEvent indicates that the exclusive behavior of mobile terminal is living Dynamic and its triggering event, CameraAction indicate photograph and photography behavior in mobile terminal, CameraActionEvent Then indicating the event that corresponding behavior is triggered, MicrophoneAction then indicates the call behavior of mobile terminal, MicrophoneActionEvent indicates its corresponding event;
5) adding MobileSystemEvent subtype for the SystemEvent subtype under Event indicates mobile terminal System event, and add subtype example BatteryEvent, StorageEvent, SensorEvent, NotificationEvent and ConnectionEvent;For the ViewElementEvent subtype element addition under Event MobileElementEvent subtype indicates user's alternative events of mobile terminal, and in its lower addition subtype example ClickEvent, LongPressEvent, SwipeEvent, TouchEvent, ScrollEvent:BatteryEvent are indicated Mobile terminal power supply causes relevant event, and StorageEvent indicates that it stores the event of associated trigger, and SensorEvent is indicated The event of sensor-triggered, NotificationEvent indicate the event of mobile terminal message end push triggering, ConnectionEvent indicates the event of connection (as being connected to the network, NFC, WIFI etc.) triggering of mobile terminal, ClickEvent table Show the event of the clicking operation triggering of user, LongPressEvent indicates the event of long press operation triggering, SwipeEvent table Show the event for the operation triggering that horizontally slips, TouchEvent indicates the event of touch operation triggering, and ScrollEvent is indicated up and down The event of slide trigger;
6) adding JavaExpression subtype for Expression element type indicates internal logic table for assisting Its logical operation is indicated up to formula, and for Action element type and its subtype addition JavaExpression member variable: should The content of JavaExpression is specially java sentence and expression formula, for the parameter in IFML model carry out assignment and Change;
Beneficial effect, IFML standard are the modeling languages for front end interactive stream, can be retouched in a graphical form well It states in the Front-end Design of software systems and shows content, interaction and behaviour control between user etc. are properly catered to Mobile terminal emphasizes the feature of front end interaction.Based on IFML standard, using the automated testing method based on model, The more reasonable efficient test case for being directed to mobile terminal can be generated.Therefore it is based on IFML (InteractionFlowModelingLanguage) standard is realized mobile terminal application test data auto generation, and is tied Existing automated test tool at present is closed, the automatic test degree of mobile terminal is further increased.Test case is one group The sequence of operation of formatting comprising interactive unit and interactive operation information can be executed automatically by a variety of automated test tools. The present invention uses model-based testing method, realizes mobile application test data auto generation, improves Test coverage Rate.
Detailed description of the invention
Fig. 1 is the flow diagram of method for generating test case embodiment one and two of the invention.
Fig. 2 is the specific flow chart of method for generating test case embodiment one of the invention.
Fig. 3 is the specific flow chart of method for generating test case embodiment two of the invention.
Fig. 4 is the test case schematic diagram that method for generating test case of the invention ultimately generates.
Specific embodiment
Below by drawings and examples, technical scheme of the present invention will be described in further detail.
Fig. 1 is the flow diagram of method for generating test case embodiment one and two of the invention.Embodiment one, two is whole It is consistent in body process, the main distinction is to generate the mode that test case uses.Whole flow process passes through 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.Front portion has read the information in IFML model first, is then directed to the difference of the model Information carries out the initialization on basis: UML structure initialization indicates the initialization for the UML data structure that it is relied on, and thresholding is initial Change the initialization for indicating the parameter information arrived used in the IFML model, interactive stream initialization then indicates each in the IFML model The initialization of element instance and its relationship with each other.Rear portion then passes through IFML pattern die on the basis of front portion The service condition of quasi- tested application, generates corresponding test case according to the coverage criterion of selection;It is needed in generating process It is parsed for the expression formula in IFML, is used to help the export of the judgement and preposition input of condition.
As shown in Fig. 2, this is the tested by IFML modeling of method for generating test case embodiment one of the invention The specific flow chart that satisfactory test case is obtained in examination application process, includes the following steps:
Step 101, parameter initialization, here by DefaultValue this expression formula category under parsing and calculating parameter Property, assign the numerical value defaulted when parameter most starts.
Step 102, the initial page of tested application, i.e., initial ViewContainer view are determined by IFML model Figure container, that is, the place of view focus.
Step 103, current visible view container and view component are determined according to the view container being currently located, wherein also Possible ActivationExpression expression element on each component need to be calculated, the final calculated result of the expression formula can shadow Whether visible ring current component.
Step 104, it according to view container visible in step 103 and component, is checked from currently triggerable interactive stream Wherein whether there is the interactive stream not triggered, if it is go to step 107, is not to go to step 105.
Step 105, check that the supreme interactive stream that whether can retract under current state executes preceding situation, i.e., whether not For most initial situation;It if it is, entering step 106, is not to show that the emulation all terminates.
Step 106, the situation before the supreme interactive stream of rollback executes, the particular content of rollback includes: to have executed Interaction stream information, current each parameter information, the view container where active view focus, current triggerable interactive stream letter Breath, the operation behavior information recorded restart to execute step 103.
Step 107, one in interactive stream that selection did not triggered, and in the current situation set this interactive stream to It has been triggered.
Step 108, check whether the situation has reached suspension condition after selecting current interactive stream, specifically: before Whether number of steps experienced has been more than the maximum number set, and whether the accumulative experience quantity of the current interactive stream has been more than setting The maximum number maximum number of circulation (whether reached).If meeting condition, then it represents that it is herein a destination node, it can not be herein Place continues emulation and goes down, and jumps directly to step 106 and retracts;If being unsatisfactory for, expression still is possible to continue to imitate Really go down, jumps progress rapid 109.
Step 109, it checks whether the interactive stream currently selected contains fraternal interactive stream, i.e., whether contains and belong to the same thing Other interactive streams of part element.When sometimes, then mean that the Event element also contains InteractionFlowExpression table It selects current interactive stream whether feasible for auxiliary judgment up to formula element, is transferred to step 110;When not having, then the Event element This interactive stream can only be triggered, without being judged, jumps directly to step 112.
Step 110, above-mentioned InteractionFlowExpression expression element is calculated, and deriving may institute The preposition input needed.
Step 111, the preposition input (may not have) obtained in 110 steps is inputted as parameter, examining should InteractionFlowExpression calculated after whether the current interactive stream of final choice, if it is, indicate input It derives rationally, enters step 112;If it is not, then indicating that current interactive stream can not select, it can not be emulated under this situation, into step Rapid 106 retract.
Step 112, the transmitting of parameter values is carried out according to the Wire Parameters information that interactive stream may have.
Step 113, the container or component that are directed toward according to interactive stream determine the view container being currently located, and complete view focus Transfer, if the touching originator of this interactive stream be Action element type, also need to execute the logical expression inside the element JavaExpression。
Step 114, according to the interactive stream and above-mentioned possible input paramete information, corresponding operation behavior letter is generated Breath, and recorded.
Step 115, it checks after by current interactive stream, whether is covered according to the coverage criterion fixed in advance The part not covered before, if then going to step 116;If not the 103 carry out next round circulations that then go to step.
Step 116, as a whole by the operation behavior information recorded in sequence before, i.e., one operation sequence Column, are saved, and update Test coverage progress as a test case, finally also need 103 entrance that go to step Next round circulation.
As shown in figure 3, this is the quasi- tested by IFML model of method for generating test case embodiment two of the invention The specific flow chart that satisfactory test case is obtained in application process, includes the following steps:
Step 201, the initial page of tested application, i.e., initial ViewContainer view are determined by IFML model Figure container, that is, the place of view focus.
Step 202, the next interactive stream that may be triggered after each interactive stream triggering of static calculation, ignoring can in actual conditions Can occur interactive stream is invisible and InteractionFlowExpression select permeability.
Step 203, current basal information is updated according to static calculation result, includes: the interaction stream information of accumulative selection, mesh Preceding place view container, the interaction stream information that may can be triggered at present.
Step 204, check whether reach suspension condition after selecting the interactive stream, specifically: step experienced before) It whether has been more than the maximum number set, whether the accumulative experience quantity of the current interactive stream has been more than that the maximum number set (is The no maximum number for having reached circulation), etc..If meeting condition, 209 are gone to step;It is rapid that progress is jumped if being unsatisfactory for 205。
Step 205, check wherein whether there is the interactive stream not triggered from the interactive stream that may currently can trigger, such as Fruit is to go to step 206, is not to go to step 207.
Step 206, a wherein interactive stream not triggered is selected, is recorded, and labeled as having triggered, later Return step 202 starts the cycle over.
Step 207, check that the supreme interactive stream that whether can retract under current state selects preceding situation, i.e., it is whether non-first Beginning situation;It if it is, entering step 208, is not to show that the emulation all terminates.
Step 208, the situation before the supreme interactive stream selection of rollback, the particular content of rollback only includes having been selected The interaction stream information crossed, and restart to execute step 202.
Step 209, it determines the candidate interactive stream group that this time traversal generates, i.e., is selected one by one simultaneously in above-mentioned circulation The interactive stream selection information recorded examines the interactive stream group to be in the following step in this, as candidate interactive stream group It is no to be appropriately carried out, while following circulations are carried out using first interactive stream of the interactive stream group as initial interactive stream.
Step 210, parameter initialization, here by DefaultValue this expression formula category under parsing and calculating parameter Property, assign the numerical value defaulted when parameter most starts.
Step 211, current interactive stream is selected to start the cycle over, to each interactive stream of interactive stream group carry out inspection one by one and It executes.
Step 212, check the interactive stream whether as it can be seen that specifically: examine Event event where the interactive stream and Whether the ViewComponent view component where Event has ActivationExpression thereon, if there is then calculating The value of the expression formula, to judge under current state its corresponding element instance whether as it can be seen that if as it can be seen that if go to step 213;It is invisible, indicate that the interactive stream can not be executed correctly, going to step 208 retracts.
Step 213, it checks whether the interactive stream currently selected contains fraternal interactive stream, i.e., whether contains and belong to the same thing Other interactive streams of part element.When sometimes, then mean that the Event element also contains InteractionFlowExpression table It selects current interactive stream whether feasible for auxiliary judgment up to formula element, is transferred to step 214;When not having, then the Event element This interactive stream can only be triggered, without being judged, jumps directly to step 216.
Step 214, above-mentioned InteractionFlowExpression expression element is calculated, and deriving may institute The preposition input needed.
Step 215, the preposition input (may not have) obtained in 214 steps is inputted as parameter, examining should InteractionFlowExpression calculated after whether the current interactive stream of final choice, if it is, indicate input It derives rationally, enters step 216;If it is not, then indicate that current interactive stream can not select, simulation failure, go to step 208 into Row retracts.
Step 216, the transmitting of parameter values is carried out according to the Wire Parameters information that interactive stream may have.
Step 217, the container or component that are directed toward according to interactive stream determine the view container being currently located, and complete view focus Transfer, if the touching originator of this interactive stream be Action element type, also need to execute the logical expression inside the element JavaExpression。
Step 218, according to the interactive stream and above-mentioned possible input paramete information, corresponding operation behavior letter is generated Breath, and recorded.
Step 219, check whether the interactive stream that emulates at present is the last item in this interactive stream group, if It is to show that the interactive stream group all have passed through inspection, can be all appropriately carried out, go to step 220, jumps out above-mentioned follow Ring;If not the last item, show subsequent there are also not examined interactive stream, therefore 211 repetitive cyclings that go to step.
Step 220, the path simulated at present is examined, before whether having covered according to selected Testing criteria not Once the place covered, if it is, going to step 221;It 208 retracts if it is not, then going to step.
Step 221, current interactive stream group is recorded as a basic test use-case, and updates Test coverage degree, finally It gos to step and 208 retracts.
As shown in figure 4, this is the test case schematic diagram that method for generating test case of the invention ultimately generates:
It is the schematic diagram of a test case ultimately generated in figure, is in the nature one group of operation behavior for having permanent order The sequence of operation of composition.
Each Rounded Box and the arrow being derived from are expressed as an operation behavior in figure, and Rounded Box indicates to trigger the operation The specific control of behavior, arrow indicate specific operation content.
Type attribute indicates the type of control in Rounded Box: Screen represents overall page, and Button represents type of button Control, Image representative image type control, Icon representative icon type control, Text represent large area present disclosure type control Part;Name attribute indicates the title or significant text thereon of the control;Id attribute indicate the control in a program Specific label, for assisting the positioning of the control.
Arrow indicates specific operation content, and operating main body is that Rounded Box (control) derived from the arrow. (right) represents the concrete type of operation above arrow: Click represents clicking operation;Swipe represents the operation that horizontally slips, at this time (left) can contain the specific direction of left (to the left) or right (to the right) the character mark slide below arrow; Scroll representative slides up and down operation, and (left) can contain up (upward) or down (downward) character mark below arrow at this time The specific direction of the slide;LongPress represents long press operation, and (left) can (how many containing XXs below arrow at this time Second), XXm (how many minute) character is used to indicate the time of long-pressing;Select represents the concrete operations of the selection one from list; Input represents input operation, and (left) can construct box below arrow at this time, wherein the name comprising input control (control Title or significant text), id (the specific label of control in a program) and value (should be inputted in this operation Numerical value).

Claims (6)

1. a kind of method for generating test case of the mobile application of the IFML model based on extension, which is characterized in that its described side Method the following steps are included:
Model is established, i.e., draws out its corresponding IFML model for mobile application to be tested;Establish what model used IFML is to joined the extension content for mobile application modeling, including be directed to view container in former IFML standard base ViewContainer adds extension subtype toolbar ToolBar and screen container Screen, for view component ViewComponent adds the mobile control MoibleComponent of extension subtype, adds extension for event Event Subtype mobile end system event MobileSystemEvent, mobile terminal event MobileElementEvent and mobile terminal row For life event MobileActionEvent, extension subtype mobile terminal behavioral activity is added for behavioral activity Action MobileAction;IFML based on the extension draws its corresponding IFML mould according to the interaction design of mobile application to be measured Type;
After reading the IFML model of mobile application to be measured, according to the service condition of modeling application and corresponding test is generated 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 the initial page as model Initial state;Parameter all in the IFML model is determined simultaneously, and is expressed according to the default value DefaultValue of each parameter The default value of formula initiation parameter;
2) visible view container and view component are determined according to the current state of model, and searches out triggerable interactive stream;
3) interactive stream not executed wherein is selected, if current all triggerable interactive streams were performed or no interactions Stream may be selected, then retracts to the state before a upper interactive stream that executes, return step 2);If can not retract, it is meant that Suo Youzhuan All triggerable interactive streams have been performed under state, i.e., all Test cases technologies finish, and Test cases technology process is just This terminates;
4) according to the interactive stream of above-mentioned selection, the transmitting for the parameter that the interactive stream has is executed, while according to interactive stream outflow Cell therefor is set as invisible with component by view elements, and the view elements being directed toward according to interactive stream are by cell therefor and group Part is set as it can be seen that and generating corresponding operation behavior;
5) corresponding operation behavior is generated according to aforesaid operations, and is recorded;
6) repeat 2), 3), 4), 5) step, until having reached scheduled loop termination condition;Period, if remembered in the cycle The sequence of operation composed by sequence of operations behavior under record does not cover before being covered according to the Testing criteria of selection Place, then recorded the sequence of operation as a test case;
7) state before the supreme interactive stream of rollback, return step 2).
2. the method for generating test case of the mobile application of the IFML model according to claim 1 based on extension, It is characterized in that, when executing interactive stream, the expression formula in the IFML model is parsed, judge the interaction flow branching institute executed The precondition needed, and according to the preposition input content for requiring to calculate that user needs to be implemented;In IFML standard Expression element type and its subtype are parsed, specifically comprising InteractionFlowExpression, ActivationExpression,JavaExpression;InteractionFlowExpression is usually held by Event Have, instruction triggers the InteractionFlow finally executed after the Event in the form of Expression, i.e. which interactive stream is One;ActivationExpression is held by most IFML element type, is indicated in the form of expression formula current In the case of the IFML element it is whether visible can trigger;JavaExpression indicates that the inside of IFML element is patrolled commonly used in auxiliary Volume;The DefaultValue attribute of parameter is JavaExpression type, for default of the expression parameter before being not used Numerical value, the JavaExpression of Action are also the type, the specific logic executed for indicating Action, specific interior Appearance is the change to each parameter in IFML model, and by the content of the parsing executable expressions or obtains precondition.
3. the method for generating test case of the mobile application of the IFML model according to claim 1 based on extension, It is characterized in that, the rollback content of step 7) rollback operation includes the following: the interaction stream information executed, current each ginseng Number information, current visible view container and view component, the interaction stream information that currently can trigger, the operation row recorded For information.
4. the method for generating test case of the mobile application of the IFML model according to claim 1 based on extension, It is characterized in that, which uses a variety of Testing criterias, including Condition Coverage Testing criterion, path coverage criterion With side coverage criterion and its derivative coverage criterion.
5. the method for generating test case of the mobile application of the IFML model according to claim 1 based on extension, Be characterized in that, step 6) circulation suspension condition refer to set up before Test cases technology to constrain and control test case The parameter of generation: test case maximum number of steps, test case minimal steps number, the maximum cycle recycled in;? Each interactive stream group has its relevant data of corresponding reference record in simulation process, to judge the current interactive stream group The requirement whether simulation has exceeded requires if more than, then can terminate the circulation of the interaction flow resistance.
6. the method for generating test case of the mobile application of the kind IFML model based on extension according to claim 1, It is characterized in that test case ultimately generated itself has certain format, is received and automatic by current automated test tool Execute test.
CN201610607871.9A 2016-07-28 2016-07-28 A kind of method for generating test case of the mobile application of the IFML based on extension Active CN106227667B (en)

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 CN106227667A (en) 2016-12-14
CN106227667B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN113934646B (en) * 2021-12-17 2022-03-22 中建电子商务有限责任公司 System and method for software testing

Citations (1)

* Cited by examiner, † Cited by third party
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

Patent Citations (1)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
《基于UML状态图的面向对象软件测试用例生成》;殷永峰;《系统工程与电子技术》;20110331;第33卷(第3期);284-286、290
Extending the Interaction Flow Modeling Language (IFML) for Model Driven Development of Mobile Applications Front End;Marco Brambilla 等;《International Conference on Mobile Web and Information Systems》;20140721;176-191
Transformation of IFML Schemas to Automated Tests;Karel Frajták等;《Proceedings of the 2015 Conference on research in adaptive and convergent systems》;20151012;509-511

Also Published As

Publication number Publication date
CN106227667A (en) 2016-12-14

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
CN104679488B (en) A kind of flow custom development platform and flow custom development approach
CN105843734A (en) Automatic test method and device and computing device
CN103914375B (en) A kind of test method and device for drawing interface software certainly
US20150347281A1 (en) Automation testing using descriptive maps
KR101637371B1 (en) System for testing an application use for a smart device and method therefor
CN111190598B (en) Gas turbine monitoring software picture configuration method based on control library drag-type development
JP2006107478A (en) Extensible flamework for designing work flow
CN109508298B (en) Graphical script test method and system
CN106227667B (en) A kind of method for generating test case of the mobile application of the IFML based on extension
CN105955888A (en) Page debugging and previewing method and system
CN110442510A (en) A kind of page properties acquisition methods, device and computer equipment, storage medium
Biswal et al. A novel approach for scenario-based test case generation
US20100313181A1 (en) Application building
CN113010168B (en) User interface generation method based on scene tree
CN106126213B (en) A kind of Android exploitation modeling method based on IFML
CN105868104B (en) A kind of cross-platform graphic user interface automatic test approach
CN117215661A (en) Event processing method, device and storage medium
Dumas et al. A graphical editor for the SMUIML multimodal user interaction description language
Kruk et al. Best practices for efficient development of JavaFX applications
CN103902274A (en) Platform for developing smart television UI (user interface)
CN109614105A (en) A kind of Android application return stack state static simulation method of Starting mode sensitivity
Paterno et al. A tool-supported approach to the refinement of interactive systems
Costa Animating user interface prototypes with formal models

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