bme - thesis (2014)

18
Model-based test generation for iOS Csaba Szabó - B.Sc. thesis Information Technology, System Engineering sector Consultants: István Dr. Ráth (BME MIT) Zoltán Ujhelyi (BME MIT)

Upload: csaba-szabo

Post on 31-Jul-2015

80 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: BME - Thesis (2014)

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)

Page 2: BME - Thesis (2014)

Motivation• Complex mobile applications

• Need for testing

• Lots of multi-platform frameworks

• Just a few of them are model-based

• Missing tests

Page 3: BME - Thesis (2014)

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

Page 4: BME - Thesis (2014)

KIF (Keep It Functional)

• Objective-C tests

• Integrated into the Xcode IDE

• Has access to user interface elements through AccessibiltiyLabel property

• Expected result validation

Page 5: BME - Thesis (2014)
Page 6: BME - Thesis (2014)

KIF problems

• There’s no AccessibilityLabel validation

• One test method = one runnable test

• It’s easier to visualise graphically a scenario

Page 7: BME - Thesis (2014)

Solution

• Graphical editor

• Code generation

• Model validation

• One model - more tests

Page 8: BME - Thesis (2014)

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&

Page 9: BME - Thesis (2014)

Eclipse plug-in• Extendable

• Modelling - EMF

• Graphical editor - BPMN2

• Code generation - Xtend

• Eclipse ITG project(ITG = iOS Test Generator)

Page 10: BME - Thesis (2014)

BPMN2 base test editor• Mainly for SOA modelling

• New element addition

• Extending the EMF model

• EMF model processing

• Branching

• More test generation

Page 11: BME - Thesis (2014)
Page 12: BME - Thesis (2014)

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

Page 13: BME - Thesis (2014)

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

Page 14: BME - Thesis (2014)

Validation techniques

• The framework contains more validations:

• BPMN2 graphical model validation

• KIF test step validation

• AccessibilityLabel validation

Page 15: BME - Thesis (2014)

Test validation

Page 16: BME - Thesis (2014)

Workflow

Test%crea)on% Saving% Model%processing%

Test%genera)on%Code%genera)on%

Test%file%copying%

BPMN2 EMF

XtendFrom Eclipe to the Xcode project

Page 17: BME - Thesis (2014)

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

Page 18: BME - Thesis (2014)

Summary• Customized graphical editor

• More test generation

• Code generation for Objective-C language

• Model validation

• Eclipse IDE integration

• Demo application and tests