bme - thesis (2014)
TRANSCRIPT
Model-based test generation for iOS
Csaba Szabó - B.Sc. thesisInformation Technology,
System Engineering sector
Consultants: István Dr. Ráth (BME MIT) Zoltán Ujhelyi (BME MIT)
Motivation• Complex mobile applications
• Need for testing
• Lots of multi-platform frameworks
• Just a few of them are model-based
• Missing tests
Scenario based tests• Scenario test ≠ unit test
• Automated, use case based
• Mainly user interface test
• Tools:
• iOS platform
• KIF (Keep it functional) UI test framework
• Habits iOS demo application
KIF (Keep It Functional)
• Objective-C tests
• Integrated into the Xcode IDE
• Has access to user interface elements through AccessibiltiyLabel property
• Expected result validation
KIF problems
• There’s no AccessibilityLabel validation
• One test method = one runnable test
• It’s easier to visualise graphically a scenario
Solution
• Graphical editor
• Code generation
• Model validation
• One model - more tests
Xcode&applica+on&project&
KIF&tests&
Eclipse&plug7in&
EMF&model&
BPMN2&model&
Extended&BPMN2&model&
Graphical&editor&
Extended&graphical&editor&
Xtend&code&generator&
KIF&framework&
ocunit/xcunit&test&framwork&
Xcode&test&framework&
Eclipse plug-in• Extendable
• Modelling - EMF
• Graphical editor - BPMN2
• Code generation - Xtend
• Eclipse ITG project(ITG = iOS Test Generator)
BPMN2 base test editor• Mainly for SOA modelling
• New element addition
• Extending the EMF model
• EMF model processing
• Branching
• More test generation
Code generation• Xtend tempalte based code generation
• Auto-generation after model saving
• The number of tests is based on the number of branches
• Alert for the user in case of model validation error
Generated code• Xtend sablon alapú kódgenerálás
• Modell mentés után automatikusan
• Elágazások számával megegyező teszt generálódik le
• Modell validálási hiba esetés jelzem a felhasználónak a hibát
test step
expected result validation
Validation techniques
• The framework contains more validations:
• BPMN2 graphical model validation
• KIF test step validation
• AccessibilityLabel validation
Test validation
Workflow
Test%crea)on% Saving% Model%processing%
Test%genera)on%Code%genera)on%
Test%file%copying%
BPMN2 EMF
XtendFrom Eclipe to the Xcode project
Improvement capabilities
• Independent (from Eclipse) application
• Automatic Xcode project parsing to get all the AccessibilityLabels
• Improvement of the graphical editor
• Easier connection to the Xcode project
Summary• Customized graphical editor
• More test generation
• Code generation for Objective-C language
• Model validation
• Eclipse IDE integration
• Demo application and tests