Submitted by Dipl.-Ing. Elmar Krainz

Submitted at Institut Integriert Studieren

Supervisor and First Examiner a.Univ.-Prof. Dr. Klaus Miesenberger

Second Examiner Model-Driven Develop- Prof. Dr. Roberto Manduchi ment for Accessible Mo- May 2018 bile Apps on Android

Doctoral Thesis to obtain the academic degree of Doktor der technischen Wissenschaften in the Doctoral Program Technische Wissenschaften

JOHANNES KEPLER UNIVERSITY LINZ Altenbergerstraße 69 4040 Linz, Österreich www.jku.at DVR 0093696 Sworn Declaration

I hereby declare under oath that the submitted Doctoral Thesis has been written solely by me without any third-party assistance, information other than provided sources or aids have not been used and those used have been fully documented. Sources for literal, paraphrased and cited quotes have been accurately credited. The submitted document here present is identical to the electronically submitted text document. Linz, May 2018

Dipl.-Ing. Elmar Krainz, bakk. techn. Abstract

The market for apps and mobile is on the rise and this goes hand in hand with the number of apps in the stores, which has recently hit 3 million available apps (see https://www.statista.com/statistics/266210/). Due to this development, the natural user interaction of plays a crucial role. People with disabilities benefit from the increasing digital technology in general, but only if it is accessible. However, apps are often not accessible for people with disabilities since touch screens and visual representation very often overlook their needs. According to the UN Convention on the Rights of Persons with Disabilities around 650 million people of the world’s population are handicapped. Within the European Union (EU) about 80 million people are affected by disabilities prompting the union to enact the Directive (EU) 2016/2102 which requests that websites and mobile applications of public sector bodies are accessible for all. Reviewing top apps in the Android store shows that even very popular apps such as WhatsApp, Messenger and Instagram have accessibility problems, i.e. contrast of texts and images, missing object descriptions or too small touch target sizes, pre- venting users with disabilities from having equal access to those apps (see Chapter 1). The thesis at hand presents an innovative approach, supporting the implementation of accessibility in the and development process of mobile applications from the very beginning. We propose a model-driven approach for better integration and addressing accessibility requirements in the design and development process. To prove this concept, developers receive a prototype-tool - called Accapto (Acces- sible App Tool) - to transfer an interaction prototype to a formal model. The abstract definition describes screens, elements and interaction workflows in a domain-specific description language. The model is transformed into a working app prototype for the Android platform. In the generation process, the app is created with proper platform-specific accessibility support and enhanced with additional supportive features and provides guidance to the developer to efficiently and effectively implement accessibility. In the course of the thesis, the level of accessibility of apps implemented with Accapto is evaluated against Web Content Accessibility Guidelines (WCAG 2.0) and also tested with users with disabilities. In particular, the new development tool is analyzed in an empirical study with 50 in- volved developers. In two test groups, the model-driven development approach using Accapto is compared with the standard development method. The results show a significant improvement in terms of accessibility for the model-driven development ap- proach. Therefore the thesis proves that model-driven approaches have a high potential to significantly improving app accessibility from the beginning and helps developers to raise their awareness for the needs of special user groups. Kurzfassung

Der Markt für Apps und mobile Software ist auf dem Vormarsch. Dies geht Hand in Hand mit der Anzahl verfügbarer Apps, welche zuletzt die drei Millionen Marke über- schritten hat (siehe https://www.statista.com/statistics/266210/). Auf- grund dieser Entwicklung spielt die Bedienung von Smartphones eine entscheidende Rolle. Menschen mit Behinderungen profitieren von der zunehmenden digitalen Tech- nologie im Allgemeinen, aber nur, wenn sie zugänglich ist. Allerdings sind Apps für Menschen mit Behinderungen oft nicht zugänglich, da Touchscreens und visuelle Darstellungen ihre Bedürfnisse oft übersehen. Nach der UN-Konvention über die Rechte von Menschen mit Behinderungen sind rund 650 Millionen Menschen der Weltbevölkerung behindert. Innerhalb der Europäischen Union (EU) sind etwa 80 Millionen Menschen von Behinderungen betroffen. Um auch diese große Gruppe europäischer BürgerInnen einzubeziehen, hat die Europäische Union die Richtlinie (EU) 2016/2102, in Kraft setzt, in der gefordert wird, dass Websites und mobile Anwendungen öffentlicher Stellen für alle zugänglich sind. Die Überprüfung der Top-Apps im Android Store zeigt, dass selbst sehr beliebte Apps wie WhatsApp, Messenger und Instagram Probleme mit der Barrierefreiheit haben, z.B. Text- und Bildkontraste, fehlende Objektbeschreibungen oder zu kleine Berühr- ungszielbereichsgrößen, sodass Benutzer mit Behinderungen nicht den gleichen Zu- griff auf diese Apps haben (siehe Kapitel 1). Die vorliegende Arbeit präsentiert einen innovativen Ansatz, der die Implementierung von Barrierefreiheit in den Entwurfs- und Entwicklungsprozess von mobilen Anwen- dungen von Anfang an unterstützt. Diese Arbeit stellt einen modellgetriebenen Ansatz für eine bessere Integration von Accessibility-Anforderungen im Entwurfs- und En- twicklungsprozess vor. Um dieses Konzept zu untermauern, erhalten EntwicklerInnen ein Prototyp-Tool na- mens Accapto (Accessible App Tool), um einen Interaktionsprototyp auf ein formales Modell zu übertragen. Die abstrakte Definition beschreibt Screens, Elemente der Be- nutzeroberfläche und Interaktionsworkflows in einer domänenspezifischen Beschrei- bungssprache. Das Modell wird in einen funktionierenden App-Prototyp für die Android- Plattform umgewandelt. Im Generierungsprozess wird die App mit der richtigen platt- formspezifischen Accessibility-Unterstützung erstellt und um zusätzliche unterstützen- de Funktionen erweitert. Im Zuge dieser Arbeit wird die Barrierefreiheit des generierten App-Prototyps mit plattformspezifischen Tools evaluiert, durch die Web Content Accessibility Guidelines (WCAG) überprüft und durch unterschiedliche Nutzern mit speziellen Bedürfnissen getestet. Insbesondere wird das neue Entwicklungswerkzeug in einer empirischen Studie mit 50 beteiligten Entwicklern analysiert. In zwei Testgruppen wird der modellgetriebene En- twicklungsansatz mit Accapto mit der Standardentwicklungsmethode verglichen. Die Ergebnisse zeigen eine signifikante Verbesserung der Zugänglichkeit für den modell- getriebenen Entwicklungsansatz. Daher zeigt die Arbeit, dass modellgetriebene An- sätze von Anfang an ein hohes Potenzial haben, die App-Barrierefreiheit signifikant zu verbessern und EntwicklerInnen dabei unterstützen, auf die Bedürfnisse spezieller Nutzergruppen aufmerksam zu machen. Acknowledgments

I am grateful to many people who were directly or indirectly involved in the preparation of this thesis. In particular, I want to thank • my supervisor a.Univ.-Prof. Dr. Klaus Miesenberger for his support and guidance during my thesis • Prof. Dr. Roberto Manduchi reading this thesis as the second examiner • my colleagues at FH JOANNEUM and Johannes Kepler University (JKU) helping me in my scientific work and their critical discussion when I needed fresh ideas • my students for testing prototypes, filling out questionaries and evaluating gen- erated apps • my family and friends for their motivating words and their support. And finally, my biggest thanks goes to Beate, Julian, and Niklas, who always gave me motivation and encouraged me to go on. Contents

1 Introduction1 1.1 Accessibility Problems in Mobile Apps ...... 1 1.2 Why Should Your App be Accessible? ...... 6 1.3 Aims of this Thesis ...... 7 1.4 Research Questions ...... 8 1.5 Proposed Solution: Accapto – Accessible App Tool ...... 8 1.6 Methodology and Structure of this Thesis ...... 9 1.7 Published Contributions ...... 10

2 Background and Related Work 11 2.1 Accessibility ...... 11 2.1.1 Disabilities ...... 12 2.1.2 Accessibility Legislation ...... 13 2.1.3 Accessibility Standards ...... 14 2.2 Mobile Accessibility ...... 17 2.2.1 Mobile Accessibility Mapping ...... 17 2.2.2 Accessibility Features of Popular Mobile Platforms ...... 18 2.2.3 Accessible Android Apps ...... 18 2.2.4 Related Work on Mobile Accessibility ...... 19 2.3 Model-Driven Development (MDD) ...... 22 2.3.1 Model and Meta-Model ...... 23 2.3.2 Modeling Languages ...... 23 2.3.3 Model Transformation and Code Generation ...... 25 2.4 Related Work ...... 26 2.4.1 Model-driven Development for User Interfaces ...... 26 2.4.2 Model-Driven Development for Mobile Applications ...... 28 2.4.3 Model-Driven Development supporting Accessibility ...... 29 2.5 Summary ...... 29

3 Model-Driven Development for Accessible Apps 31 3.1 Modeling with UML ...... 32

i CONTENTS ii

3.1.1 UML Diagrams for User Interaction ...... 33 3.1.2 Accessibility and UML ...... 35 3.2 A Model for Accessible Apps ...... 35 3.2.1 Elements of an Accessible Model ...... 36 3.2.2 Profile ...... 38 3.2.3 Meta Model ...... 38 3.3 Model Description (DSL) for Accessible Apps ...... 39 3.4 Summary ...... 42

4 Generation of Accessible Apps 43 4.1 Android Applications ...... 44 4.2 Parsing the Model ...... 45 4.3 App Generation Overview ...... 45 4.3.1 App Scaffolding ...... 46 4.3.2 Templating ...... 46 4.4 Accessibility Enrichment in Android Apps ...... 49 4.4.1 Implementation of Accessibility on Android ...... 49 4.4.2 Proper Implementation for Accessibility ...... 51 4.4.3 Runtime Accessibility Extension ...... 54 4.4.4 Runtime Theme Selection ...... 55 4.4.5 SpeechOutput Helper ...... 56 4.4.6 SpeechInput Helper ...... 56 4.5 Accapto - Accessible App Toolkit ...... 56 4.6 Summary ...... 58

5 Accessibility Evaluation of the Resulting App Prototype 59 5.1 From Mockup to Prototype ...... 60 5.2 Accessibility Evaluation of the Resulting App ...... 61 5.2.1 Accessibility Evaluation Android Apps ...... 61 5.2.2 Evaluation with W3C Mobile Accessibility Guidelines ...... 64 5.2.3 Evaluation with Web Content Accessibility Guidelines (WCAG) . 66 5.2.4 Evaluation with Test Users ...... 69 5.2.5 Quick Accessibility Check ...... 73 5.3 Summary ...... 75

6 Empirical Evaluation of the Model-Driven Development Process 76 6.1 Study Design ...... 77 6.2 Target Group ...... 77 6.3 Development Tasks ...... 78 6.3.1 Model-driven Development with Accapto ...... 79 6.3.2 Development with ...... 79 6.4 Accessibility Evaluation Task ...... 80 CONTENTS iii

6.5 Results of the Empirical Evaluation ...... 81 6.5.1 Accessibility ...... 81 6.5.2 Workload of Tasks ...... 86 6.5.3 Awareness and Learning Effect ...... 87 6.6 Summary ...... 92

7 Conclusion and Outlook 93 7.1 Findings ...... 93 7.2 Future Work ...... 95 7.3 Conclusion ...... 95

Appendix A Accapto Model 113 A.1 XSD Schema Definition of the Accapto Model ...... 113 A.2 Model of Routing app in XML ...... 115

Appendix B Data Usertesting 117

Appendix C Details from the Empiric Evaluation 121 C.1 Evaluation Instruction ...... 121 C.2 Questionary ...... 121 C.2.1 Pre-Questionary ...... 122 C.2.2 Accessibility Test ...... 123 C.2.3 Post - Questionary ...... 124 C.2.4 Data from Participants ...... 126 C.2.5 Data A11y Evaluation ...... 127 C.2.6 Data A11y awareness & learning effect ...... 129 C.2.7 Data A11y Interviews ...... 132

Appendix D CV Elmar Krainz 135 D.1 Personal ...... 135 D.2 Teaching and Working Experience ...... 135 D.3 Education ...... 136 D.4 Main Research Area ...... 136 D.4.1 Research Projects (Selection) ...... 136 D.4.2 Publications (Selection) ...... 137 D.5 Other scientific Activities ...... 138 D.6 Profiles on Science Platforms ...... 139 List of

1.1 Accessibility Metrics ...... 3 1.2 Statistical data of problems - Normalisation and ranking after the best accessibility ratings...... 5

2.1 Four-layer-metamodel hierarchy ...... 24

5.1 Evaluation with W3C Mobile Accessibility guidelines ...... 65 5.2 Evaluation with W3C WCAG 2.0 levels A and AA ...... 67 5.3 Evaluation with W3C WCAG 2.0 levels A and AA, part 2 ...... 68 5.4 Quick accessibility check - Assistive technologies ...... 74 5.5 Quick accessibility check - Errors from Accessibility Scanner ...... 74 5.6 Quick accessibility check - manual checks ...... 74 5.7 Association of QAC Rules to WCAG Success criterions and guidelines . 75

6.1 Single Accessibility evaluation ...... 81 6.2 Statistics of Accessibly Evaluation ...... 84 6.3 Usability in App Development ...... 88

iv List of Figures

1.1 The rise of available apps in Apple’s App Store and ’s Play Store from 2008 to 2016...... 2 1.2 Examples of accessibility problems detected by the Accessibility Scanner.3 1.3 Over 90% reported at least three major issues regarding the Store top 100 apps...... 4 1.4 Most of the top 10 apps actually have issues A4 and A5...... 5 1.5 The best 10 apps according to accessibility report problems for A1 and A2 only...... 6 1.6 Accapto overview [1]...... 9

2.1 The context of the standards WCAG, UAAG and ATAG (from https: //www.w3.org/WAI/guid-tech)...... 16 2.2 The basic idea of model-driven development...... 22 2.3 The relation between real objects, model and meta-model...... 23 2.4 The transformation process of model-driven development...... 25 2.5 Simplified version of the Cameleon Reference Framework [2]...... 26 2.6 The research focus is in the intersection of model-driven development, , and accessibility...... 30

3.1 Typical paper prototype for the interaction flow in a mobile app...... 32 3.2 Storyboard in Xcode ...... 33 3.3 Example of a UML use case diagram for a simple routing app...... 34 3.4 Example of a UML sequence diagram for geocoding in routing app. . . 34 3.5 Example of a UML activity diagram for a simple routing app...... 34 3.6 The UML class diagram of the model...... 38 3.7 Simple app model: (a) app mockup, (b) model...... 39

4.1 Building chain of Accapto...... 43 4.2 Android app development project...... 44 4.3 XML to Java binding...... 46 4.4 Overview of Accapto code generation...... 47 4.5 Template processing for code generation...... 48

v LIST OF FIGURES vi

4.6 Example of insufficient contrast and colour as only distinctive feature (left). Proper usage of contrast, colour and text (right)...... 51 4.7 Different styles of the Accapto Accessibility Pattern Library ...... 53 4.8 Generated input item with TextView and EditText...... 54 4.9 Checkbox without and with touch extension...... 55 4.10 Accapto overview [1]...... 57

5.1 Mockup of routing app...... 59 5.2 Generated app with (a) low vision and (b) standard theme...... 61 5.3 Setup of Lint for accessibility checks...... 63 5.4 Code inspection with Lint using accessibility rules...... 63 5.5 Results of the WCAG evaluation. Overall 20 rules passed, 2 rules failed in the evaluation and 15 rules were not applicable...... 68 5.6 Final app for usertest...... 69 5.7 User tests: left: test person with cognitive disability, right: blind test person ...... 71 5.8 Average TLX of the the task compared to the different user groups. . . . 72 5.9 Average SUS score by user groups...... 73

6.1 Work experience of participants...... 78 6.2 Programming skills of participants...... 79 6.3 UI design and accessibility skills ...... 80 6.4 Mockup of the app prototype...... 80 6.5 Boxplot of self-estimated accessibility rating...... 82 6.6 Barplot of accessibility rating...... 83 6.7 Boxplot of accessibility rating...... 85 6.8 TLX of the evaluation task...... 86 6.9 TLX of the development task...... 87 6.10 Q1- Before and after development task; model-driven vs. standard de- velopment...... 89 6.11 Q3- Before and after development task; model-driven vs. standard de- velopment...... 89

B.1 User tests with persons with motor and cognitive disabilities ...... 117 B.2 User tests with elderly people ...... 118 B.3 User tests with visually impaired people ...... 119 B.4 User tests with persons without restrictions ...... 120

C.1 Participants of the empiric evaluation...... 126 C.2 A11y evaluation test group Accapto...... 127 C.3 A11y evaluation test group Android Studio...... 128 C.4 A11y awareness & learning effect data...... 129 LIST OF FIGURES vii

C.5 A11y awareness & learning effect chart 1...... 130 C.6 A11y awareness & learning effect chart 2...... 131 Listings

3.1 XML of the ScreenType ...... 40 3.2 XSD of the ScreenType ...... 40 3.3 Model of WhereAmI App in XML...... 41 4.1 Template code fragment for a method stub in Java class...... 47 4.2 Template code fragment for a method stub in Java class...... 48 4.3 Template for the UI element in the XML layout file...... 48 4.4 Generated input item with TextView and EditText...... 54 5.1 XML model of routing app ...... 60 A.1 XSD of the Accapto model ...... 113 A.2 Model of the example routing app...... 115

viii Chapter 1

Introduction

In the information age, software is the foundation of the connected world of comput- ers. With the introduction of the first modern smartphone in the year 20071 human- computer interaction moved from personal computers and to tablets, phones and other smart devices.

In the year 2013 the number of mobile Internet devices reached 10 billion, which is about 1.4 device per person on the planet [3]. With the rise of smartphones the need for special software products is also increasing.

The market for apps and mobile software is growing. Mobile users spend about 90 per cent of their mobile time in apps [4]. People use various apps and most of these are easy to operate, because of their simple and intuitive user interfaces.

Since 2008 the available apps have increased from 800 (2008, Apple App Store2) to 3.500.000 (December 2017, Google Play3). Figure 1.1 shows the soaring progress in the number of available apps in the two most popular app publishing platforms.

Mobile applications, or apps, come with a simple, intuitive user interface. Touch screens and visual representation provide very natural user interaction, but unfortu- nately not for everyone. Not every app is accessible for people with disabilities.

1.1 Accessibility Problems in Mobile Apps

To use the features of a software product like a website or app, the first step is access to the technology. Accessibility is the ability to perceive, understand, navigate and

1Apple presented the first iPhone in January 2007 2https://www.statista.com/statistics/263795/number-of-available-apps-in-t he-apple-app-store/ 3http://www.statista.com/statistics/266210/number-of-available-application s-in-the-google-play-store Chapter 1

AVAILABLE APPS IN ANDROID AND APPLE STORE DATA FROM: HTTPS://WWW.STATISTA.COM/STATISTICS/266210/NUMBER- OF-AVAILABLE-APPLICATIONS-IN- THE-GOOGLE-PLAY-STORE/ HTTPS://WWW.STATISTA.COM/STATISTICS/263795/NUMBER- OF-AVAILABLE-APPS-IN- TH E-APPLE-APP-STORE/ 3,000,000 2,600,000 Apple 2,500,000 2,400,000

Android 2,200,000 2,000,000 2,000,000 2,000,000 1,800,000 1,600,000 1,500,000 1,500,000 1,400,000 1,400,000 1,300,000 1,300,000 1,200,000 1,000,000 1,000,000 1,000,000 900,000 850,000 850,000 800,000 700,000 700,000 675,000 650,000 600,000 585,000 500,000 500,000

450,000 500,000 425,000 400,000 350,000 300,000 300,000 250,000 225,000 200,000 150,000 100,000 100,000 70,000 65,000 38,000 35,000 30,000 16,000 3,000 800 0

Figure 1.1: The rise of available apps in Apple’s App Store and Google’s Play Store from 2008 to 2016. interact with a software product [5] unrestricted to the people’s abilities.

Smartphone apps tend to be intuitive and easy to use. People of all ages use apps to stay connected, consume media, use helpful tools or just play games. According to Kane et.al [6], mobile devices give people with disabilities new chances and opportu- nities for an independent lifestyle. But not all apps are implemented with accessibility in mind.

The following example of a shopping app explains the lack of awareness of accessibil- ity. Figure 1.2 shows a typical Android app including a representative dashboard with icons, textual descriptions and interactive elements. The app is also well designed to reflect the company’s visual corporate identity. However, typical accessibility errors can also be found. In this screenshot, we can see a missing object item label for text-to-speech, a contrast ratio lower than 3:0 in texts and images, and touch targets smaller than 48x48dp.

To get an overview of possible accessibility issues of an app, Google provides a useful tool called Accessibility Scanner [7]. In order to measure accessibility, it is vital to de- fine metrics first. The metrics used by Accessibility Scanner, as listed in Table 1.1, are content label, object description, editable content label, clickable items, touch target and text and image contrast. These criteria are explained and grouped on the website of the scanner into four main categories [8] content labelling, implementation, touch target size and low contrast.

2 Chapter 1

Figure 1.2: Examples of accessibility problems detected by the Accessibility Scanner.

Code Metric A1 Touch target size A2 Item label missing A3 Editable item label A4 Text contrast A5 Object description A6 Clickable links A7 Image contrast

Table 1.1: Accessibility Metrics

In Reip’s study [9], the overall goal is to show how many, if any, of the selected Google Play store top apps consider accessibility properly. To gain deeper insight into mobile apps, they were evaluated by means of this accessibility inspection tool.

In fact, applications have different amounts of screens and as a result, the compara- bility decreases. Consequently, three major screens are evaluated, namely the home screen, the logon screen and a preferences screen. Although some applications do not contain one of those screens, similar screens are taken. For instance, if an app does not include a logon screen, a contact screen is evaluated. Under those circum- stances, a meaningful result is provided.

Furthermore, the number of applications examined is equally important for a mean- ingful result. At first, about 200 of the first Google Play’s top apps were put on the

3 Chapter 1

1 91% 90%

0.9 87%

0.8

0.7

0.6 52% 52% 0.5

0.4

0.3

0.2 19%

0.1 4% 0 A1 A2 A3 A4 A5 A6 A7

Figure 1.3: Over 90% reported at least three major issues regarding the Google Play Store top 100 apps. long list, which was then reduced to a short list by filtering (for example, the main idea of games can already breach accessibility guidelines, 87 of the first 193 applications (45,08%) are games and were therefore eliminated).

Analysing the data of the study [9] accessibility issues are found in every one of the 100 top-rated apps. Even in simple ones like flash-lights problems were reported. Opon closer examination (see Figure 1.3) on to the different problem categories, one can see that more than 50% of apps fail in five out of seven criteria. Nearly 90% have problems in touch target size (A1), missing item label (A2) and insufficient text contrast (A4). Missing objects descriptions (A5) and image contrast (A7) are reported in every other app. Few problems were found according to clickable links (A6) and there were hardly any issues with editable item labels (A3).

Reported numbers of errors are sometimes very high because some iterative elements like list or icons set occur more than ones on an app screen. For further qualitative information about the accessibly issues, we normalised the error count to a dual repre- sentation. Errors A1 to A7 are transferred to a binary measurement. There are either errors in the selected section or no value. With this normalisation, multiple counting of the same categories is avoided.

Figure 1.4 shows the distribution of accessibility issues in the top 10, 20 and 100 apps. The number of different errors (A1 to A6) are consistent in all three ranking groups. This means the best ranked (top 10 and top 20) apps in the store have similar errors in quantity and category to the top 100.

4 Chapter 1

Top10 Top20 Top100 45% 41% 40% 40% 40% 35% 35% 31% 30% 30%

25% 20% 20% 15% 15% 15% 10% 10% 10% 8%

5% 3% 2% 0% 0% 0% 0% 0% 0% 0% 0% #1 #2 #3 #4 #5 #6 #7

Figure 1.4: Most of the top 10 apps actually have issues A4 and A5.

Top20 Top100 Diff min. 1 1 0 max. 3 6 3 median 2 4 2 average 2,3 3,95 1,65

Table 1.2: Statistical data of problems - Normalisation and ranking after the best ac- cessibility ratings.

To find out the top rated apps in ease of accessibility, we chose a different ranking. Sorting the apps in order of the number of reported accessibility errors, we got a different result. Comparing the top 20 best accessible apps to the top hundred, a significant difference can be seen. The median of the top 20 best-accessibility rated apps is only half and the average is 1.65 lower. In the top 20 we found a maximum of 3 different errors, which is half of the top 100 (see Table 1.2).

In contrast to the first chart regarding the distribution of accessibility issues, we can see a different distribution in Figure 1.5. In the alternative sorting with the best accessible apps first, we observe an offset to fewer reported accessibility issues. The top 10 best accessibility rated apps show only errors in one or two categories, the top 20 in only three categories. Here we can also visually show that there are differences in accessibility with fewer reported errors.

5 Chapter 1

Top10 Top20 Top100 80% 70% 70%

60%

50% 45% 41% 40% 40% 31% 30% 30%

20% 15% 15%

10% 8% 3% 2% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% #1 #2 #3 #4 #5 #6 #7

Figure 1.5: The best 10 apps according to accessibility report problems for A1 and A2 only.

This study provides insights about the current lack of accessibility support in mobile applications. Analysing the 100 top apps of the Google Play Store has shown that none of the aforementioned apps would fully pass the automated accessibility evalua- tion with Accessibility Checker. The findings revealed several lacking features as well as violations against the accessibility best practice guidelines.

1.2 Why Should Your App be Accessible?

Why should accessibility be respected? This can be answered in five ways.

A large part of humankind is excluded

According to the UN Convention on the Rights of Persons with Disabilities (CRUD) [10] around 10 per cent of the world’s population is handicapped. These 650 million people are a very large minority. Furthermore, the World report on disability [11] indicate that 15,3% of the world population has a prevalence of a moderate disability; even 2.9% have a severe impairment. Regarding the European Union, about 80 million people in the EU are affected by a disability [12].

6 Chapter 1

People with disabilities are an economically significant factor

About 10% of the world population is a significant economic factor. Due to the lack of accessibility, people are excluded from products and services. The proportion of older people is also on the rise and this group has to fight on the one hand with physical and cognitive restriction and on the other hand, this is an economically potent group.

Accessibility is politically accepted and more and more legally required

The European Commission agreed to an EU-wide rule to make public-sector websites and apps more accessible. 4,5. In 2016 the European Union enacted the Directive (EU) 2016/2102 which "..aims to ensure that the websites and mobile applications of public sector bodies are made more accessible on the basis of common accessibility requirements." [13].

Accessibility has socio-economic reasons

Everything, which lacks accessibility requires social support and care. Accessibility improves independence and reduces care and support costs considerably.

Because we have the technology and it is easy or justifiable

Assistive technologies are now part of many operating systems (e.g. VoiceOver6) and we have guidelines (e.g. Web Content Accessibility Guidelines [14]. To sum it up, the words of lkka Pirttimaa, inventor of BlindSquare7 are accurate. "..accessibility is not just an additional feature, but a best-practice" [15].

1.3 Aims of this Thesis

Software on mobile devices is on the rise, but this sector of software industry does not take every user group into consideration. People with disabilities, which is a large group of users, have more or less problems to use those apps.

The aims of this thesis are:

1. Research background of accessibility on mobile devices, considering standards, regulations and platform specifics; research the foundation of model-driven de- velopment with a focus on accessibility and mobile devices.

2. Research of state of the art Android app accessibility and exploring the poten- tial of model-driven development for pushing accessibility of app development forward. 4http://europa.eu/rapid/press-release_IP-16-1654_en.htm 5http://www.consilium.europa.eu/en/press/press-releases/2016/07/18-accessi ble-websites-apps-wide-rules/ 6https://www.apple.com/de/accessibility/ 7Blindsquare is an accessible GPS navigation app for blind people http://www.blindsquare.com.

7 Chapter 1

3. Find an intuitive model for designing accessible mobile applications.

4. Find a procedure to generate the prototype of an accessible app based on the model.

5. Validate and evaluate the accessibility of the app prototype created.

6. Validate the accessibly improvement of the model-driven development tool with developers

1.4 Research Questions

The objectives of this thesis lead to the following research questions

• RQ 1: How can model-driven development support the development of accessi- ble apps?

RQ 1.1: What kind of model is needed for the model-driven approach?

RQ 1.2: How can the model-transformation create an accessible app?

• RQ 2: Does model-driven development lead to better and more accessible apps?

• RQ 3: Do model-driven approaches increase awareness of and practice in ac- cessible app development?

1.5 Proposed Solution: Accapto – Accessible App Tool

"Programming an accessible Android app is not technically difficult, but is often skipped in the rush of a deadline", said Kelly Schuster [16].

The proposed solution gives developers a toolset to include accessibility in mobile app development from the beginning. Accapto - Accessible App Tool - consists of two components, the first being a model for accessible app interaction. The second one is a generator to transform models into accessible apps. The model describes the main component and interactions of an app which are important for an accessible user interface. The model components and the description language are explained in Chapter3. The generator transforms the model into an app project with the enrichment of proper implementation of accessibility and additional components to support different kinds of user restrictions. Fig 1.6 shows the overview of the proposed system.

8 Chapter 1

Accapto creates Accessibility generates Enrichment depends on

App Model Components Model XMLModel Parsing & XML App Project XML Validation

User Interfaces App

Native Code

Developer

Figure 1.6: Accapto overview [1]

1.6 Methodology and Structure of this Thesis

The scientific methodology of this work follows these procedures. The foundation of any research in the field of is solid background and related work. Budgen and Brereton [17] claim the basis for research in computer sciences and soft- ware engineering is to find the related work like standards, literature, and state of the art in development. Chapter2 presents the literature relevant to the main topics computer accessibility and model-driven development.

The key factors for good research in are according to Shaw [18], [19] the type of question, the type of result and the type of validation.

Type of Question: Method or means of development: How can model-driven development support the development of accessible apps?

Type of Result: (1) Qualitative or descriptive model: A domain model for accessible mobile apps – Chapter3 shows the design of the model for accessible mobile apps and the domain specific language (DSL) to describe it.

(2) Procedure or technique: Integration of accessibility in the development process with model-driven development – Chapter4 focuses on the transformation process, the app generation process and the extension of selected assistive components.

Type of Validation: (1) Example: Implementation of an accessible routing app - Chapter5 shows the

9 Chapter 1 implementation of an accessible routing app. Additionally, the accessibility of the re- sulting app is evaluated using common guidelines and with tested by users with dis- abilities. (c.f. Krainz et al. Accessible way finding on mobile devices for different user groups, 2016 [20])

(2) Experience: Evaluation of the Accapto tool with developers - Chapter6 points out how developers use the tool in a test scenario and the improved accessibility of the resulting apps is tested.

1.7 Published Contributions

The research results of this thesis were previously published in the following papers:

• Krainz et al. Can We Improve App Accessibility with Advanced Development Methods? will be published at ICCHP 2018

• Krainz and Miesenberger Accapto, a Generic Design and Development Toolkit for Accessible Mobile Apps. [1]

• Krainz et al. Accelerated Development for Accessible Apps - Model Driven De- velopment of Transportation Apps for Visually Impaired People [21]

• Krainz et al. Accessible way finding on mobile devices for different user groups [20]

• Krainz et al. Catching the Right Bus - Improvement of Vehicle Communication with Bluetooth Low Energy for Visually Impaired and Blind People [22]

Previous work related to mobile app accessibility:

• Krajnc et al. A touch-sensitive user interface approach on smartphones for visu- ally impaired and blind persons [23]

• Krajnc et al. User centered for mobile applications focused on visually impaired and blind peoples [24]

• Mattheis & Krajnc Route Descriptions in Advance and Turn-by-Turn Instructions- Usability Evaluation of a Navigational System for Visually Impaired and Blind People in Public Transport [25]

• Bischof, Krajnc, Dornhofer, & Ulm NAVCOM–WLAN Communication with Public Transport Vehicles to Support Visually Impaired and Blind People [26]

10 Chapter 2

Background and Related Work

According to RQ 1 – How can model-driven development support the development of accessible apps?, this chapter establishes the groundwork for this thesis. The first part of the literature review covers accessibility and the accessibility of mobile applications in detail. The second part considers the topic of model-driven development, with a focus on user interfaces, mobile applications and accessibility. Based on the literature review it can be argued that model-driven development enhances the development of accessible apps and is thus an original contribution to the field.

2.1 Accessibility

The usability of a software system is an important factor in order to give users a great experience. There are definitions and standards for the usability of a system (see Nielsen [27] and ISO 9241-11 [28]). For some people, however, is subordinate if they are not able to get access to the system at all, which leads to accessibility.

The ISO Standard ISO 9241-171:2008 [29] defines accessibility as:

usability of a product, service, environment or facility by people with the widest range of capabilities

The ISO definition addresses all user abilities, not only limited to people who are for- mally disabled or restricted. Accessibility is part of usability, but access to a product or service is rather a necessary condition for usability [30].

The Web Accessibility Initiative WAI [5] of the W3C defines (Web) accessibility more Chapter 2 accurately as the possibility for people with disabilities to use the Web. In other words, this means:

that people with disabilities can perceive, understand, navigate, and inter- act with the Web, and that they can contribute to the Web

2.1.1 Disabilities

The following section provides a summary of the most important groups of disabilities. The International Classification of Diseases (IDC) [31] defines all diseases, injuries and disabilities in a standardised hierarchical categorisation. This classification is used to give a clear distribution of these disabilities.

The W3C Web Accessibility Initiative (WAI) [32] gives an overview of the wide diversity of people and abilities. WAI also provides descriptions as well as some technical aspects for people with special needs [33]. These personas are helpful to present a typical user with his or her restrictions to use the Web, an app or a computer.

2.1.1.1 Blind people

Blind people have either very limited or no visual perception. The IDC-10 H54.01 defines blindness as a visual acuity below 1/50 (0.02), which means an item must be 50 times larger to be recognised compared to a person without visual restrictions.

For the usage of computers or smartphones blind people rely on screen reading sys- tems like Voiceover, Talkback or Jaws as well as special input/output-devices, such as a braille display. Interaction with a mouse is not possible and the use of touch screens is limited [33], [32].

2.1.1.2 Visually impaired people

Not everyone with a visual restriction is completely blind. Many people suffer from a vi- sual impairment like low vision (IDC-10 H54.1-9 2) or color blindness (IDC-10 H53.1-9). With these restrictions, one is not always handicapped in daily life but needs support while using, for instance, a smartphone.

Websites and apps have to provide sufficient text sizes and visual information or proper implementation to use zooming. Adequate contrast in the user interfaces is also im- portant.

1http://apps.who.int/classifications/icd10/browse/2016/en#/H53-H54 2http://apps.who.int/classifications/icd10/browse/2016/en#/H53-H54

12 Chapter 2

2.1.1.3 People with hearing disabilities

People with hearing disabilities (IDC10 H60-H953) are not able to recognise sounds or spoken texts. Sometimes sign language is the mother tongue of a deaf person and written texts are not always feasible. In this context, we have to distinguish between deaf people and people with hearing impairments. These different groups also need different assistive technologies.

User interfaces have to provide text alternatives to audio and video information. Al- ternatives to texts in sign language should be considered. Acoustic notifications or alarms are not reliable for this user group.

2.1.1.4 People with motor disabilities

Motor disabilities are unlike the ones described previously. People with a physical handicap can mostly retrieve information in a visual or audio form, but are limited in the active interaction with a system. There are various diseases like paralysis, tremors or temporary injuries which can cause a physical handicap.

People are reduced in their usage of standard input devices and touch gestures. Sim- plified interaction with less active input like selection rather than text entry helps to improve accessibility

2.1.1.5 People with cognitive disabilities

People with cognitive disabilities are a very heterogeneous group. Older people with dementia (IDC G30-G32 4) or humans with intellectual disability (IDC F70-795) have problems perceiving and understanding complex user interfaces on computers. More- over, the reduced ability to read complicated texts and comprehend abstract concepts which are part of many IT systems is challenging.

This user group needs simple interaction and easily readable texts. Providing alterna- tive ways of interactions like icons instead of complex texts is a possible aid.

2.1.2 Accessibility Legislation

Besides best practices and standards to support handicapped people, there are also legal regulations and international acts to enable digital technologies for all humans.

3http://apps.who.int/classifications/icd10/browse/2016/en#/H90.0 4http://apps.who.int/classifications/icd10/browse/2016/en#/G30-G32 5http://apps.who.int/classifications/icd10/browse/2016/en#/F70-F79

13 Chapter 2

First of all the UN Convention on the Rights of Persons with Disabilities (CRPD) [10] is meant to protect the rights and dignity of any person with a disability.

In the EU, the European Accessibility Act [34] aims to provide accessible products and services, this also includes accessible ICT. The European Council has enacted an EU- wide law for accessible websites and apps [35]. The Directive (EU) 2016/2102 of the European Parliament and of the Council of 26 October 2016 on the accessibility of the websites and mobile applications of public sector bodies (ext with EEA relevance) [13] ensures that websites and mobile applications of public sector bodies are accessible for anyone.

Austrian’s main platform for both legal and technical information is Digitales Österreich [36]. EU wide regulations, the Austrian Federal Constitution and the national Disability Discrimination act (Behindertengleichstellungsgesetz)citebehindertengesetz ensure the accessibility of digital systems.

§6 Absatz (Abs.) 5 Behindertengleichstellungsgesetz definiert, dass (...) technische Gebrauchsgegenstände, Systeme der Informationsverarbeitung sowie andere gestaltete Lebensbereiche barrierefrei sind, wenn sie für Menschen mit Behinderung in der allgemein üblichen Weise, ohne beson- dere Erschwernis und grundsätzlich ohne Hilfe nutzbar sind. Als Beurteilungs- maßstab werden für Angebote im Internet die WAI-Leitlinien herangezo- gen. [37]

It is also worth mentioning the Rehabilitation Act Amendments of 1998, Section 508 [38] and the Americans with Disabilities Act (ADA) [39], which are the main legal reg- ulations for accessibility in the United States. Currently, more than 40 countries have their own (Web) accessibility laws and policies and it is common to refer to the inter- national standards of the World Wide Web Consortium6.

2.1.3 Accessibility Standards

The World Wide Web Consortium (W3C)7, the main authority for standards on the Web, developed rules to grant access to the Web for anyone. In 1999 the Web Con- tent Accessibility Guidelines (WCAG) 1.0 [40] were published. This first standard ad- dressed the Web and the technical implementation of HTML. Nine years later, this standard was superseded by the WCAG 2.0 [14]. In 2012 the WCAG 2.0 became the standard ISO/IEC 40500:2012, Information technology - W3C Web Content Accessi- bility Guidelines (WCAG) 2.0 [41].

The significant difference was the change from a technological viewpoint to a more

6https://www.w3.org/WAI/Policy/ 7https://www.w3.org/

14 Chapter 2 general interpretation. The WCAG 2.0 included four general principles with a corre- sponding set of guidelines and success criteria.

Principles of the WCAG 2.0:

• Perceivable - All information or components of the user interface must be per- ceivable for any user; for example, information only presented in a graphical way must also have text alternatives.

• Operable - All components must be operable; for instance, keyboard access must be provided by the system.

• Understandable - All information within the user interface must be understand- able; texts should be not only readable, but users should also understand the meanings, interaction must be predictable and input assistance like instructions or help should be available.

• Robust - Contents must be able to be interpreted reliably by different user agents.

A draft of the new version of this standard, WCAG 2.1 [42], is now in the review pro- cess. This new version extends the existing standard and adds new success criteria.

The WCAG are primarily a rule set for Web applications, but the transformation from classic desktop browser to mobile devices and also the generalisation of the four prin- ciples allows these guidelines to also be adapted for other systems

There are some related W3C standards to build a bridge from the Web to other tech- nologies. Not only accessibility issues, but also the switch to mobile web browsing, are the focus of Mobile Web Best Practices (MWBP) [43]. Some adaptations for mobile web are also applicable to increase the accessibility which can be found in the Rela- tionship between Mobile Web Best Practices (MWBP) and Web Content Accessibility Guidelines (WCAG) [44].

The basic principles of the WCAG, which are not focused on technology but on the user’s needs, can also be used in other domains of ICT. The Guidance on Applying WCAG 2.0 to Non-Web Information and Communications Technologies (WCAG2ICT) [45] is the approach to use and adopt the principles of WCAG to other non-Web infor- mation and communications technologies (ICT).

The rise of mobile applications also demands the transfer of accessibility issues/needs to mobile platforms. Currently, there is no standard but the draft Mobile Accessibility: How WCAG 2.0 and Other W3C/WAI Guidelines Apply to Mobile [46] to adopt general accessibility guidelines to mobile platforms. The WCAG principles are transferred to smartphones, tablets and also smart wearables with specific interpretations for mobile devices. For example, the principle perceivable has to focus on smaller displays or even not existing visuals on smart wear. Easy data entry and support of platform

15 Chapter 2 specific characteristics is part of the principle robustness. More detailed information as well as more platforms related to accessibility can be found in Section 2.2. x

Not only contents are important for good accessibility, but also the programs to create and consume them. The User Agent Accessibility Guidelines (UAAG 2.0) [47] consider browsers, media players and other tools for users to consume (web) content. These guidelines cover accessibility of the tools along with the interfaces of other assistive technologies.

The Authoring Tool Accessibility Guidelines (ATAG 2.0) [48] considers the accessibility of the software and services to create web content and offers guidance to make the tools accessible. More importantly, it provides support for authors and editors to create their web content in an accessible form.

Fig 2.1 shows the context of the standards for content (WCAG), the authoring tools (ATAG) and the user tools (UAAG). For good accessibility all three parts are comple- mentary.

Figure 2.1: The context of the standards WCAG, UAAG and ATAG (from https: //www.w3.org/WAI/guid-tech).

16 Chapter 2

2.2 Mobile Accessibility

Mobile devices are universal companions for people with disabilities. Before the age of smartphones, people with special needs also had to use special devices as their personal digital assistants, such as the Pronto organizer from Baum8. These very special devices were also quite expensive.

Today most people own a smartphone, which supports them in their daily life. But actually, there is still a lot of improvement in the accessibility of smart mobile devices.

2.2.1 Mobile Accessibility Mapping

At the moment, iOS and Android are the two major platforms for smartphones. Both mobile operating systems have their own accessibility support, but there is no general standard. The W3C has released a working draft to apply the commonly accepted WCAG to mobile systems and applications. Mobile Accessibility: How WCAG 2.0 and Other W3C/WAI Guidelines Apply to Mobile [49] is based on the same principles as the WCAG 2.0, but they are more specific on mobile. In this context, mobile is generic for smartphones, tablets and smart wearables.

Principles for mobile:

• Perceivable: One common feature of mobile devices is the small screen size or even the absence of the screen. Users need the ability to zoom. Contents should be reduced; contrast and text size should be adaptive.

• Operable: Small devices also have challenges regarding user input. Touch tar- gets must have an adequate minimal size; touchscreen gestures must be avail- able to provide different operations like exploring, selecting or tabbing on the touchscreen. Interactive user interface controls like buttons must be reached easily. External keyboards are also an important factor to be able to operate a .

• Understandable: A consistent layout and a clear indication that elements provide interaction are important factors to understand a user interface. Accessibility problems can also occur with unpredicted changes in the screen orientation.

• Robust: Robustness is provided with easy data entry and preselection of input types. In custom solutions, the platform characteristics for accessibility support like changing the system text size have to be implemented, as well.

8http://www.baum.at/de/produkte/pronto.html

17 Chapter 2

2.2.2 Accessibility Features of Popular Mobile Platforms

According to the latest mobile OS market share statistics9 Android and iOS account for 99,8% of the market. Nevertheless, in a commercial context, Windows Mobile still has its users.

2.2.2.1 Accessibility on iOS

Apple, with its philosophy of providing a closed system, also has integrated accessibil- ity support directly in the mobile operating system. iOS has a system-wide integration of the built-in screenreader VoiceOver, which reads captions and audio descriptions. Display customisation with appropriate fonts and colours (e.g. colour schemes for the visually impaired) are part of the system. Apple’s iOS has a guided access for people with attention and sensory challenges[50].

More detailed information and specially issues for proper development are available on Accessibility Programming Guide for iOS [51]. Important points concerning the integrated accessibility support, and guiding for developers and tester are online.

2.2.2.2 Accessibility on Windows Mobile

Things have been quiet for Microsoft’s mobile operating system. Less than 0,1% of the mobile market share belong to Windows 10 Mobile. Nevertheless the accessi- bility support is given. Windows Mobile supports hearing aids, teletypewriters (TTY), speech input and output and screen readers on its platform [52].

The foundation for accessibility in Windows-based programs is the Universal App Plat- form10. The UWP app of windows allows the development of software on a wide range of devices including mobile ones like phones and tablets. In this universal approach of Microsofts platform accessibility is included from the beginning [53].

2.2.3 Accessible Android Apps

Due to it having the argest market share and the openness of its system11, the main focus of this thesis is the Android platform. In the rapid evolution of Android, acces- sibility wasn’t always a included. In the version previous (4.1), a screen reader was not integrated in the system, but was available as app. Custom

9https://www.statista.com/statistics/266136/global-market-share-held-by-s martphone-operating-systems/ 10https://docs.microsoft.com/en-us/windows/uwp/get-started/whats-a-uwp 11The source code of Android is open source see https://source.android.com/

18 Chapter 2 solutions like TalkingTouch from Krajnc et al. [23] created self-voicing apps instead of an system wide support.

In the latter versions of the mobile operating system Google provides guidelines and programming interfaces to implement accessible apps. The Guide- lines [54] provides three main principles for accessibility. The first one is clear. Sim- plified layout, visible elements and hierarchy of importance help users to navigate and use an app. Robust, the second principle, adapts an app for a broad range of differ- ent users. Users have to understand the apps major tasks of have access to the app. Lastly the app has to support the specific assistive technologies of the platform.

Furthermore, Material Design gives guidance for accessible development on Android [54].

1. Colour and contrast: According to the WCAG, the app design has to use a proper contrast ratio. A ratio with a least 4.5:1 for the app’s primary, secondary, and accent colours provides good usability and accessibility.

2. Sound and motion: Visual alternatives to sound should be available (see WCAG) and enable motion if it is just a decorative element. Like the WCAG, flashing components should be avoided and for any timed controls the user must have enough time for an accessible user experience.

3. Style: Touchable components must provide at least a minimum touch target size of 48x48dp. Smaller icons also have to expand the touch size. The spacing between elements has to be at least 8dp. The grouping of the belonging UI elements allows for simpler interaction.

4. Hierarchy and focus: Proper position of items in visual and also tabbing order is crucial for linear navigation, for example while using a screen reader. With the help of the focus the right order is made possible. Linear navigation also depends on adequate grouping of the elements.

5. Writing: Reasonable and understandable apps rely on succinct texts for labels and descriptions.

Android has different built-in assistive technologies to provide alternative use cases to handle an app. Via the system settings, supporting tools like magnification, switch access, screen reader and various display settings (e.g. color correction)[55].

2.2.4 Related Work on Mobile Accessibility

Portable and mobile devices are affordable and ubiquitous, but are not always acces- sible for everyone [56]. Bringing accessibility to mobile devices and applications is dis- cussed in literature. Mobile apps were already helpful devices in the pre-smartphone

19 Chapter 2 age. Kane et al. [3] shows different use-cases as to how people with disabilities select, adapt and use mobile devices to improve their daily lives. The project Blindsight [57] provides eyes-free interaction on mobile devices which had still been using physical keyboards. A more general approach of user centered design for accessible mobile programs is part of Krajnc et al. [24]. With personas, paper prototypes and a final implementation blind people receive a tailored user experience on their phone.

With the rise of modern touch-based smartphones, physical keyboards and buttons vanished. Especially, people with disabilities had to adapt to this new paradigm. Vi- sually impaired and blind people have new requirements regarding touchscreens [58]. Rodrigues et al. [59] attempt to comprehend the adoption of smart phone interaction for the blind, in a study on the different tasks of users. Not only touch input, but also motion input and gestures are new interactions methods on smartphones [60].

Smartphones are also transforming into digital assistants for people with disabilities, like the work of Narasimhan et al. [61] shows. Visually impaired and blind people are also the target group of Sierra et al. [62]. They design apps for the visually impaired and blind for touch devices with a focus on iOS.

The integration of assistive technologies on Android phones was not always obvious. A custom solution is the TalkingTouch library of Krajnc et al. [23]. TalkingTouch gives developers the aim of adding touch to speech within an Android app. Bonner et al. [63] support text input without eye sight on Android

What is notable is the eyes-free project12. The work of Raman et al. [64, 65] lead to supportive tools like Talking Dialer, SoundBack, KickBack and finally TalkBack which is now the foundation of Androids assistive technologies. One of the latest spin offs ist Just Speak [66] a way to control an Android smartphone mainly with voice input.

Visually impaired and blind people are an important user group dealing with touch- based user interfaces. Another physical restriction like motor disabilities also faces new challenges on smartphones. Naftali &Findlater [67] tried to understand this new need. Their study reveals issues in touch input systems like text entry in small input fields. The work of Zhong et al.[68] improves the the lives of people with hand tremors, enhancing the touch input for them. Smart Touch also improves the touch accuracy [69] using patterns and templates. Better input accuracy for people with tremors with the help of the motion sensor on the Android phones is part of Plaumann et al. [70].

Another large user group consists of people with hearing disabilities. Smartphones with apps function as portable listening devices [71] or hearing aids [72]. Apps are helpful to train children with hearing disabilities by means of voice recognition [73].

Text, however, is not always an alternative for the deaf. For communication in their mother tongue, deaf people depend on sign language. Different research aims to

12http://eyes-free.blogspot.co.at/

20 Chapter 2 introduce sign language on mobile devices [74, 75, 76], but there is still no integrated approach on mobile platforms. New challenges also arise with external content like media data. For example, video content has to be dubbed in sign language [77].

The last group in this literature review is older people. This is a very heterogeneous group as far as know-how and restrictions are concerned [78, 79]. Azuddin et al. [80] studied the motivation for the elderly to use smartphones. The most important factors are the wish to communicate with friends and family as well as safety in emergency situations. Older people also have problems with mobile devices and apps. Issues are too small font or touch sizes, new gestures (e.g. swipe) and also with the ability to learn new interaction models.

Still, smartphones are useful tools in healthcare for older people [81, 82]; new methods of user interactions like on mobile phones [83] also enhance the target groups of people with special needs on mobile applications.

The literature review shows that mobile devices are an assistive technology for both different situations and different disabilities. Diverse restrictions need specialised so- lutions to the problems. Many of these examples are focused on a special task or a special kind of restriction. A new challenge is the widespread support of different disabilities and the integration into the different systems.

It can be concluded that although accessibly is established in terms of ethical, econom- ical and legal constrains (i.e. WCAG, UAAG and others), developers and designers hardly put this guidelines and recommendations into practice. The lack of awareness and the missing support of developer-tools, which should guide and lead to better ac- cessibility in resulting software products, addresses the main research questions of this thesis.

21 Chapter 2

2.3 Model-Driven Development (MDD)

What is model-driven development? Software development is an elaborate proce- dure. Software engineering aims to increase the quality of SW products and reduce the complexity of the development process [84]. A model-based approach helps the stakeholders of a software project to reach these objectives [85], [86]. Models are helpful for the communication between software engineers and other involved parties, to share the knowledge of the domain and the documentation of the resulting software product[87].

Model-driven architecture (MDA), model-driven development (MDD) or model-driven software engineering (MDSE) are various terms for this development approach. The method of model-driven development creates software or source code automatically from a formal model [85]. In Figure 2.2, the core components and the basic idea are shown. The modeling language describes an application model; the transformation generates schematic repetitive code from an instance of the application model; gener- ated code and additional individual code finally build the resulting application

describes Application Model

Modeling Language transforms

Transformation defines Individual Code

Application transforms

Generated Code

Figure 2.2: The basic idea of model-driven development.

There are several reasons to use model-driven development (MDD).

• Abstraction: with a higher level of abstraction, developers can focus on the prob- lem and the complexity is better manageable[85]

• Improved architecture: generalised models improve the reusability of code and tools [85]

22 Chapter 2

• Improved development: with automatisation the development speed increases and the code quality improves [85]

For a deeper understanding we focus on models, domain specific languages and the transformation in the following sections.

2.3.1 Model and Meta-Model

Models help to understand complex problems [88], which is why they are a useful con- cept to reduce complexity. With generalisation, classification and aggregation people create simpler models to deal with complex contexts [86]. Model-driven development uses several kinds of models. Even a model is an abstraction of a meta-model, which is again an abstraction to a meta-meta-model. Figure 2.2 shows the relation in these different layers.

Domain Model Meta-Model

“Real World” Elements of the Elements of the Objects Model Meta-Model

describes describes

Figure 2.3: The relation between real objects, model and meta-model.

A common example is the four-layer-metamodel hierarchy [89]. Tab.2.1 presents the different layers in this system. Beginning from the bottom up, there is an instance (M0) for example the person object p="John" of the user model (M1) the class Person which describes generic persons. The definition of the user model is provided by the meta-model (M2) for example UML, which is defined as Meta Object Facility - MOF (M3).

2.3.2 Modeling Languages

A modeling language is used for the description of a model. It is a tool to formalise the models concept, which can be either textual or visual citebrambilla:2012aa. The main parts are the following:

• Abstract syntax - the structure of the language

23 Chapter 2

Table 2.1: Four-layer-metamodel hierarchy

language to define M3 Meta-Meta-Model e.g. MOF the meta-model Language to define M2 Meta-Model e.g. UML model describes a specific M1 Model e.g. class Person model in a domain running instance of M0 Instance e.g. Person p = "John" the model

• Concrete syntax - the notation of the modeling language

• Semantics - the meaning of the elements and possible combinations

There are general purpose languages (GPL) or more specific description within a do- main a so-called domain specific language (DSL) [86]. One example of GPL is the Unified Modelling Language (UML).

UML (Unified Modeling Language) is the standard modeling language for several parts of the software development process. UML is specified by the Object Management Group (UMG). The current version is UML 2.5 and is online available [90].

Beside the general approach, DSL addresses a specific application domain. They are designed for a particular domain [91]. This is not only a limitation but also a benefit for clear definitions and the abstraction of the domain. A DSL is limited in its expressiveness [91]. It is not possible to build a whole software system based on this type of modeling languages. Some typical examples of DSL are SQL, a language to describe database operations [92], VHDL, to describe hardware and electronics [93] or WebML, a modeling language for the user interface and navigation of a website [94].

According to Brambilla et at. [86] every DSL should follow some principles. The lan- guage must give the right abstraction of the underlying problem. It has to be open for extension and closed for modification. The DSL has to be intuitive and easy to handle. It should make the the work of the developer easier, not harder.

There are two categories of DSL. An internal DSL is written or embedded in a host language. Typical host languages are Ruby or XML [95]. External DSL is a new language built from scratch. This promises many possibilities because of its openness, but all additional tools like the parser needs implementations.

24 Chapter 2

2.3.3 Model Transformation and Code Generation

In the end, the main goal of model-driven development is to create software from the model. To reach this goal, the model is transformed to another abstraction layer. This is either a model-to-text or a model-to-model transformation [86]. The latter approach creates another model for special issues in the domain or for special needs of other projects members. For the process of automatic source code generation, the model is transformed into a textual form like program code or XML [87].

defind by

Meta Model leads to depends on

Transformation Individual Model Language Toolchain Code

Transformation Generated Model Application Process Code

Figure 2.4: The transformation process of model-driven development.

The typical process of software generation is described in Fig. 2.4. The model based on the meta-model is the input for the transformation process. With various methods of transformation the source code artefact is created. Developers can modify the resulting code and can also add their own indiviual program parts. This new codebase with generated and individual code creates the final application in the domain of the model.

Typical code generation patterns [96, 85] are:

• Templates + Filtering - the code is generated from the model and embedded in a template

• Templates + Meta-Model - this is an extension of the Templates + Filtering pat- tern. Templates are part of the meta-model, which is instantiated first.

• API-based Generators - the generator provides methods via an API

• Inline Code Generation - the generation is done directly in the compilation pro- cess

25 Chapter 2

2.4 Related Work

The aim of this thesis is a model-based approach creating accessible mobile appli- cations. This literature review presents existing work using MDD for user interfaces, mobile application and accessible software.

2.4.1 Model-driven Development for User Interfaces

The implementation of user interfaces is a demanding part of software development. In literature we can find examples of model-based techniques.

Model-Based User Interfaces (MDUI) has several benefits; faster development, alter- natives in design and adaptions to different devices or platforms [2],[97], [98],[99].

There are different levels in this model-based approach. An excellent example of this is the Cameleon Reference Framework [100]. The highest levels are tasks within the domain. Out of these emerges an Abstract UI which is independent from the imple- mentation and modality. Next is the Concrete UI, which depends on the modality but is still implementation-independent. At the end, we have the Final UI that represents the implementation in the final source code [2], [101]. Fig. 2.5 shows this concept with simplified version of the Cameleon Reference Framework.

Figure 2.5: Simplified version of the Cameleon Reference Framework [2]

An important part of MDUI is the definition of tasks. Task models provide the goals and aims in an interactive application [102]. One widely adopted task-modeling notation is ConcurTaskTrees (CTT) [103]. CTT distinguishes different kinds such as system, in- teraction, user or abstract tasks and a designer can model the interaction of a process in a graphical tool.

26 Chapter 2

Another aspect is the Abstract UI models. Beuvens et al.[104] give a generic definition of them for the definition of user interfaces corresponding to the Platform-Independent Model (PIM) in model-driven engineering.

User interface description languages

Model-based approaches for UI development are often described in a user interface description languages (UIDL). The UMIL is defined in a markup language and ren- dered to a final UI. User Interface Markup Language (UIML) from Abrams et al. [105] is an XML-based language. UIML uses abstract components like windows, menu, etc., which are platform-independent. WebML form Ceri et al. [94] is a UIDL for designing and creating a complete website.

Mozilla’s version of an UIDL is XUL (XML User Interface Language)[106]. This lan- guage provides input controls, menus, dialogs, etc. in a generic form. The UI for applications like Firefox are build fromut of this platform independent description.

IndieUI [107] from W3C is an approach to design the user interface of accessible web applications. With events [108] and user context [109] applications can be built for a wide range of different contexts and user needs.

UsiXML by Vanderdonckt et al.[110] follows the four stages of the Cameleon Ref- erence Framework and usees it for an multi-path development. A UI is defined by different levels of abstraction; the transformation is done in three steps abstraction, reification and translation. These steps generate multi-modal user interfaces for differ- ent platforms [111, 112, 113].

Another modeling language based on XML is TeresaML [114]. TERESA is a model- based method for designing multi-platform user interfaces. A successor is MARIA (Model based lAnguage foR Interactive Applications) [115]. It is an universal, declar- ative, multiple abstraction-level language for interactive applications created from a model.

The workflows are an important part of interactive software products. IFML (Interaction Flow Markup Language) by Brambilla & Fraternali [116] describes these flows in an abstract way. With view containers and their connection via events the interaction through an application is defined and is the basis for further development or code generation.

Finally. the work of Dittmar et al. [117] aims to answer the question of whether model- based UI design is helpful in end-user programming. With a case study, they show the practicality of their method.

27 Chapter 2

2.4.2 Model-Driven Development for Mobile Applications

Examples of model-driven development approaches and mobile apps can be found in literature. A starting point is the work of Umuhoza & Brambilla, which shows several techniques of MDD and defines criteria to classify these approaches [118]. Early examples were still focused on web applications optimised for mobile devices. Braun et al. share their experience of MDD for mobile web [119]. The combination of user- centred design with software development is part of Balagtas et al.’s research [120]. An iterative process creates a prototype of a mobile app with model based creation and evaluation.

MD2 (Heitkötter et al. [121]) creates cross-platform apps from a model. This work focuses on business apps where common source code is compiled into native iOS and Android apps.

Another instance of a model-based method is Le Goaer & Waltham’s [122]. Their custom DSL is used for mobile apps. Majchrzak et al. [123] engineer mobile business cross-platform apps with the aims of model-driven development. Another approach of a DSL for mobile apps is XIS [124]. The model is based on UML and the resulting apps are created for different platforms. The usage of this model-driven method has been evaluated with several participants [125].

Native Android apps are the result of Paranda et al.’s work [126]. Activities and ser- vices are designed with class and sequence diagrams. Da Silva & Brito e Abreu [127] are also focused on Android-based apps. Their user interfaces for business informa- tion system app are modelled, using class diagrams.

The adaption of the interaction flow modeling language IMFL for the user interface of mobile apps [128] as well as the usage for web and mobile applications [129] is part of the work of Brambilla et al.

Barrnet et al. [130] present a tool to generate data-driven apps based on a domain specific language. In the work of Bernaschina [131] a web-based tool generates mo- bile applications online.

Model-driven development for Android apps is part of Vaupel et al.’s research [132]. Different abstraction levels in the modeing process helps developers with the imple- mentation of mobile apps. The extension of this work to other platforms like iOS can be found in [133].

These examples used the model-driven approaches for the generation of mobile ap- plications, but none of them have an explicit focus on the inclusion of accessibility.

28 Chapter 2

2.4.3 Model-Driven Development supporting Accessibility

The model-driven approach is also used to improve the accessibility in software devel- opment.

Gajos et al. show automatically generated UIs for users with physicals disabilities. The SUPPLE system creates different appearances of the user interfaces, depending on the users restriction [134]. A framework for accessible applications is Johar by Andrews & Hussain. This approach covers a wide range of disabilities. The interface interpreter transforms the interaction model into a final Java application.

The AT lab app framework [135] allows the creation of games for people with physical disabilities. The work of Gonzales Garcia al. [136, 137] presents the design and implementation of an accessible media player based on model-driven development.

Minon et al. presents a model-based user interface for different types of users. It is an interface generator to transform XML models via XSL into an adapted accessible user interfaces [138].

Adaptive user interfaces based on a predefined model can be found in [139]. Integrat- ing adaptation rules for accessible digital service is part of [140].

Zouhaier et al. shows a context-aware techniques for automatic UI generation [141] and a UML model for accessible software [142]. The model-driven approach for an adaptive user interfaces and the context model includes accessibility [143].

Feld et al. [144] use the model-driven methods for adaptive user interfaces in automo- tive. The shift from tangible interface to digital apps in cars also requires adaption to the users. Accessible user interfaces for ubiquitous services are automatic generated in [145].

2.5 Summary

The literature review reveals that model-driven development is used in different areas of development. User interfaces or mobile applications based on MDD can be found in literature. Even the usage to improve accessibility in software products is part of current research.

The research fields accessibility, mobile applications and model-driven development are widely discussed in literature. In Figure 2.6, the overlapping of these different areas is shown. There has already been some exciting work done that deals with the outer intersections. For example, accessibility and mobile development or accessibility and model-driven development have been covered by previous papers, but all three fields of research are seldom discussed together in the scientific community (see [21]).

29 Chapter 2

Mobile Development

A11y + Mobile + Accessibility MDD

Model-driven Development

Figure 2.6: The research focus is in the intersection of model-driven development, mobile app development, and accessibility.

The combination of model-driven development to bring accessibility to mobile apps is an original contribution to the field. Hence it can be argued that model-driven devel- opment is a possibility to support developers and designer better and more efficiently in situations where they miss profound knowledge in terms of accessibility. The aim of this thesis is therefore to find an intuitive model for designing accessible mobile appli- cations and a procedure to generate the prototype of an accessible app based on the model.

30 Chapter 3

Model-Driven Development for Accessible Apps

This chapter presents the model-driven development approach for accessible apps. The starting point of most app development processes is an app idea. To find a model for accessible apps we have to identify the components of the app.

Following the WAI the foundation for accessibility is using simple interactions to create complex ones.

The key to accessibility in interaction is starting with the simplest interac- tions and using those as the building blocks of more complex interactions. [146]

The main idea for modeling accessible apps is to find useful components and easy interactions or workflows. Before designing an accessible app, however, one has to design an app at all.

The user interface and the interaction design are the most relevant parts of an app for accessibility. According to Banga and Weinhold [147] good mobile interaction design leads the user through an app. The key factors are clear and simple controls, but more importantly reducing the functionality of the app is essential. Banga and Weinhold [148] offer useful tools and techniques to design user interaction. Suitable tools to design mobile interaction are:

• wireframes

• storyboards

• (paper) prototypes

Fig 3.1 shows an example of an app interaction process in an early development Chapter 3 stage. Workflows and interaction can be sketched with pen and paper or with the help of design tools.

Figure 3.1: Typical paper prototype for the interaction flow in a mobile app.

These methods are informal and are not integrated into the development process. Apple’s Xcode IDE for iOS development provides an integrated storyboard tool [149], which allows designers or developers to sketch the interaction workflow within the development process. Fig 3.2 illustrates this intuitive method to design the flow within an app, but this tool is limited to iOS development. A similar tool to design interaction and navigation on the Android platform is the Navigation Editor (http://tools.and roid.com/navigation-editor). Unfortunately this tool was just experimental and is not available anymore [150].

3.1 Modeling with UML

For more general modeling of interaction, more generic modeling tools are necessary [151], [152]. UML is used in different aspects of software engineering. The next section presents the usage of UML for user interaction and accessibility.

For more general modelling of interaction one needs also more generic modelling tools UML is used in different within in software engineering. The next sections shows the usage of UML for user interaction and accessibility.

32 Chapter 3

Figure 3.2: Storyboard in Xcode

3.1.1 UML Diagrams for User Interaction

There are different diagrams in UML; possible diagram types to model user interac- tion related topics are use case diagram, sequence diagram, communication diagram, activity diagram or the interaction overview diagram.

UML Use Case Diagrams; this type of model explains requirements of the system mostly from the perspective of a person’s needs. The user as a role e.g. a customer and their use-cases in the system. Fig. 3.3 gives an example of the use case for a routing app.

Interaction diagrams like sequence or communication focus on the flow between el- ements. For modeling the time-based event in a system, a Sequence Diagram is used. This model type shows the exchange of between objects in a time- based context. In Fig. 3.4 the timing of the geocoding in a routing app is modelled in a sequence diagram [152].

A Collaboration/Communication Diagramm focuses on communication rather than the sequence of messages. An Activity Diagram describes behavioural flows in a system, like procedures or logical flows. The process is described using action states and activity edges. Fig. 3.5 shows the decision process of the address selection in

33 Chapter 3

<> Customize App A11y Settings

<> Routing Select Target User

Figure 3.3: Example of a UML use case diagram for a simple routing app.

Select Routing Target Routing Target Calculate Route

checkStoredLocations()

getAddressGPSPosition() enterAddress

getGPSfromAddress()

getGPSPosition()

Figure 3.4: Example of a UML sequence diagram for geocoding in routing app.

Select Routing Routing Target

Search Address

Stored Location

Figure 3.5: Example of a UML activity diagram for a simple routing app.

34 Chapter 3 the routing app. Finally, the Interaction Overview Diagrams is a combination of sequence and activity diagram. This kind of diagram expresses the overall flow in a system [152].

Ambler [153, 154] claims that UML does not support any diagrams related to flowcharts or storyboards. Nevertheless, Conallen [155] provides examples of employing UML in model Web applications. Communication (or collaboration) diagrams show the inter- action between components or parts in an interactive system.

Model-driven development, with the help of UML is also used in the process for app development. Kraemer [156] uses UML with statical and behavioural diagrams to modelling mobile apps. With the help of building blocks and libraries an Android app is created from models. Specific aspects of Android app like intents, data/service requests are part of the approach of Parada et al. [126]. Le Goaer et al. [157] combine modelling and code generation with standard coding for their method of model-driven development. User interfaces generation is the aim of Sabraoui et.al. [158] work. UML is used for graphic user interfaces. Based on a meta-model for basic UI components an Android specific UI is the result.

3.1.2 Accessibility and UML

UML as a standard to model software systems and also accessibility matters in UML. In literature there are various example that enhance and validate the accessibility of UML. King et al. [159] show how blind software engineers can use UML in the devel- opment process, while Müller [160] is works with blind students using UML diagrams. With AMWO, Grillo presents a tool for blind users to model web applications [161], [162] with UML. Providing guidelines as to how blind developers can use UML in tex- tual form is the work of Petrausch et al.[163].

There are few example of using UML to model accessibility. Gjøsæter et. al. give an example of defining accessibility constraints with UML [164] as well as testing the accessibility of generated XHMTL documents [165].

3.2 A Model for Accessible Apps

Proper interaction design is the first step to satisfying accessibility in a mobile applica- tion. For the definition of the model we should define the requirements of an accessible app.

As written in the last section there are some requirements for an accessible mobile app.

35 Chapter 3

• Simple interactions (components) to create complex ones [146]

• Clear interaction

• Reducing functionality [147]

What is relevant for users with disabilities? For simple interactions, building blocks are needed. These are basic input and output components with different manifestations. In order to start an action, an active element is used. To cluster these building blocks, a grouping item is necessary. For interactivity and workflows, a navigation component is used. These base elements for the accessible app model are described in detail in the next section.

3.2.1 Elements of an Accessible Mobile App Model

Going along with these requirements, the base types for a model are as follows:

Grouping Component: The first idea for an app user interface, sketched in a proto- type, shows several screen or grouping elements. This allows the designer to break down the overall interaction flow into smaller parts. As seen in the storyboards or wireframes, these define the interaction flow with the connection of several container elements.

This model uses the Screen as the grouping component. The screen element is one component in the interaction flow and contains sub-elements for direct user interaction like actions, transitions, inputs and outputs.

Screen: name: String [1] description: String [0..1] subscreen: Screen [0..*] action: Action [0..*] transition: Transition [0..*] input: Input [0..*] output: Output [0..*]

Navigation Component: In the proposed interaction flow, an element to navigate from one screen to another is required. The navigation component is Transition, which is part of a screen and lets the user navigate to another target screen element or outside of the app to the system (e.g. email).

Transition: name: String [1] description: String [0..1] target: Target [1]

36 Chapter 3

Action Component: In some parts of the interaction process, an action like retriev- ing sensor data, starting a background service, loading or saving data in the app is required. The Action element allows a method or procedure to be triggered, which is provided by either the system, a library or the developers. An action element is part of a screen element, but not obligatory for every screen.

Action: name: String [1] description: String [0..1] action: Action [1]

Output Component: Every app has content for the user’s information like texts, im- ages or sounds. To provide contents in various types the element Output is part of the model. Output is used to give the user context in the proper usage of the app.

Output: name: String [1] description: String [0..1] type: String [0..1]

Input Component: For interacting, entering data and selecting among different choices, the model provides the Input element. Similar to output there are different types like text, selection or choice as a mandatory attribute in the element.

Input: name: String [1] description: String [0..1] type: String [0..1]

Every element of the model has a mandatory name attribute. To create an accessible app it is important to provide a textual information for any element related to user interaction. Additionally, each element has an optional description attribute for more detailed information, which is provided on demand.

App Container: Last but not least all these elements are part of one complete mobile application. An app element has at least one screen element. Meta information about the app name and the package are also part of this element.

App: name: String [1] package: String [1] profile: Profile [1..4]

37 Chapter 3

3.2.2 Profile

For proper implementation of accessible apps, it is important to deal with the right user groups. In the context of accessibility, this model is focused on four different profiles. These profiles support different accessibility enhancements.

Profiles:

• No restrictions

• High contrast, possibility to read large fonts, problems with colour or contrast

• Blind, no visual abilities

• Easy touch, physical disabilities, problems with touch target sizes

3.2.3 Meta Model

The interaction elements and user profile define the meta model for accessible apps. Fig. 3.6 shows the overview of this meta model in a UML class diagram. A model of an app needs a name, package and at least one screen element. Screen items may have input, output, action or transition elements.

Based on this meta model developers and designers may start with a sketch of an app in a paper prototype or a mockup tool and are able to transfer the draft to a more formal model.

0..* 0..* App Screen Input

profil: String [1..5] 1..* name: String name: String Description: String [0..1] appname: String Description: String [0..1] package: String type: String

0..* 0..* 0..* Action Transition Output

name: String name: String name: String description: String [0..1] description: String [0..1] Description: String [0..1] target: String type: String

Figure 3.6: The UML class diagram of the model.

The app model based on the meta-model is shown in the following example - a simple

38 Chapter 3

Where am I? app. To get an impression of the app idea Fig. 3.7 illustrates (a) the basic sketch of the app idea. The app has a dashboard with one flow to the second interactive screen. The position screen has a button to trigger the current location which is shown in a text box. Both screens have a textual description on top.

The model in Fig. 3.7 (b) consists of an app with appname, package and the profile blind and two screen elements. Each screen has several sub items like textual output, transition (from start- screen to position) and action (to get the GPS position).

With the meta-model the design draft is transformed into a formal model, which is used in the automatic part of the development process.

appname: Where Am I Position Where Am I package: org.accapto.whereami getGPS-Position profile: blind Start

47.31, 9.64 Screen:Start Screen: Position Output: Where am I Output: Position Transition: Position Action: getPosition Input: gpsData

(a) (b)

Figure 3.7: Simple app model: (a) app mockup, (b) model.

This graphical representation is just a formalisation of the model. For developers, ab- stract descriptions of concepts in text form are state of the art. For further processing of the model, text-based formats are also a benefit. The next section goes deeper into the text form of the model.

3.3 Model Description (DSL) for Accessible Apps

For developers, textual descriptions of formal definitions are common. One possible way of describing a model within a special domain is a domain-specific language [91]. Before defining the model or meta-model one has to choose the base language or syntax for the DSL. An external DSL is based on a new syntax. This provides freedom in the definition but beside creating the modelling language also the processing tools are also new. For example, Barnet et al. [130] use a JSON-like syntax and they implemented a custom parser for their DSL.

When using an existing syntax (e.g. XML) as a hosting language, this is called an

39 Chapter 3 internal DSL. In the end, it is more or the less a personal of decision, which language you choose [166].

In this work an internal DSL based on XML is used. XML has many advantages. First of all XML all is a common standard by the W3C [167]. It has a strict ruleset to cre- ate well-formed documents and also provides also resources for grammar definitions for validation. XML is used in many different cases/parts in IT such as definitions, configurations and , to name a few.

Second, various tools are available to create and edit XML. Developers can choose their preferred editor to write new definitions in XML. Beside the creation of XML files, there are many tools available for processing this information. For reading, parsing and transforming XML-based data, developers can mostly choose from various programs on the selected platform.

The model definition in this works defines tags for each element. For example, the Screen element is represent with a screen-tag. Further information on the element is given in either in an attribute (e.g. name="Start Screen") or in a child element. The example below shows a typical screen element as an XML tag.

Listing 3.1: XML of the ScreenType

Not only the correct syntax (well-formed), but also the correct combination of all ele- ments of the XML file is essential. Only with the grammar definition can an XML file be valid. The XML Schema Definition (XSD) describes the structure and constrains of the contents of XML documents [168, 169].

The meta-model for accessible apps is defined in XSD. Every valid tag in the definition is defined as a complex type. This represents a composite tag with predefined child tags and attributes. The following example demonstrates the definition of the screen tag. This tag has a sequence of child tags like an input tag. Every child tag can occur more than once and is not mandatory. Every screen tag may have the attributes name and description. The name attribute is mandatory because for proper implementation for accessibility, each element needs at least one textual description.

40 Chapter 3

Listing 3.2: XSD of the ScreenType

The scheme definition includes alle possible elements of the DSL. The complete defi- nition can be found in Appendix A.1.

The following listing is the XML representation of the example model in Fig. 3.7. The app model contains a surrounding app element with appname and package. The required profile blind is also in the root tag. The model consists of two screen tags with a name attribute. Both screens include child elements (e.g. output or transition).

blind Listing 3.3: Model of WhereAmI App in XML.

41 Chapter 3

3.4 Summary

This chapter presents the model for the development of accessible apps. In many cases, the design process of mobile applications starts with a draft of user interac- tion. This sketch of the user interface and interaction is transferred to a model for app development..

To answer the research question, What kind of model is needed for the model-driven approach? compared to Shaw [18] a type of result is a new (qualitative) model.

The Accapto model is a way of creating the basis for an accessible app. This model consists of several basic building components to design interactive mobile user inter- faces. First, the meta-model is defined in XSD; then, a concrete model is described in XML.

This is the first step in the model-driven development approach. The focus of the next chapter (Chapter4) is the transformation from XML model to Android app prototype.

42 Chapter 4

Generation of Accessible Apps

This chapter focuses on the process from model to final Android application. Fig. 4.1 presents an overview of the app generation process. The first step is the model of the app in the XML file; next comes parsing of the XML file, which leads to an instance of the model in the generator. The app scaffolding and accessibility enhancing is part of the generator; the resulting output is an Android Studio project.

According to Völter [96], code generation is getting important for the development of a system in a similar domain. These are called software system families; in this case, the domain is a mobile application on the Android platform with automatic integration of accessibility (features). The Accapto generator uses the Templates + Metamodel pattern for code generation (see Völter [96]) The model is an instances of the meta- model, the resulting code is generated by applying the template to the instance

Accessibility Generated App Model XML Parsing App Scaffolding App XML Extension Project

Parsing XML File Add Accessibility Lib Unmarschal XML Adopt App Components Create Instance of model

Create Project Structure Add custom Code Generate App Components Build App

Figure 4.1: Building chain of Accapto. Chapter 4

4.1 Android Applications

This approach of model-driven development for accessible apps is generic, but the source code generation is different for distinct mobile operating systems. This thesis focuses on Android.

Android covers about 85% of the market; it is the most widely spread mobile operating system1. It has a layered architecture based on a multi user Linux kernel. The middle layer consists of native libraries, the virtual machine and the application framework. Android apps makes up the top layer of the system. All interactive parts visible to the user, like the app launcher, the phone application, various web browsers, etc., are apps. Every app runs in an own instance of the virtual machine [170, 171].

Android app development

Android app projects consists of several parts: Java classes, XML files for layout and other resources, image or media files and build configuration files (see Fig.4.2). Devel- opers design user interfaces with the help of a XML-based layout system and connect them to an Activity, which is an Android component that represents an active screen [172]. The navigation and flow through an Android app is implemented with an Intent, a component to navigate from one screen to another.

Figure 4.2: Android app development project.

The build process compiles source code and resources and packages them into an

1https://www.statista.com/statistics/266136/global-market-share-held-by-s martphone-operating-systems

44 Chapter 4

.apk file (Android Package File)[173]. This final .apk is installed on an Android device.

For the automatic generation of an app project the following topics are relevant:

• package name: unique application ID

• app name: name of the installed app

• screen(s): activity and layout for each user interface screen

• navigation: intent to start another activity

4.2 Parsing the Model

The description of the Accapto model is an XML file. For further processing the in- put file has to be parsed and validated. With the Java Architecture for XML Binding2 (JAXB)[174] comes a practical and fast way to link XML and Java. Fig. 4.3 gives an overview of the XML-to-Java relations for the parsing process. In the first step Java classes are created, which represent the XML based model from the XSD. From the schema description the corresponding java classes are generated, These classes match the elements in the XML model (see Appendix A.1 for the complete XSD). After reading and parsing an XML input file, the JAXB framework unmarshals Java objects from the XML content. The result is an instance of a complete Apptype-object includ- ing all screens and meta information of the designed app. This instance of the model at runtime is the input for the next part in the Accapto generator, the app scaffolding process.

4.3 App Generation Overview

Fig. 4.4 shows the Accapto generator classes. The ModelParser class is responsi- ble for the whole process of parsing. The input is an XML file and the output is an instance of an AppType object. The AppScaffolder creates the whole Android project structure. All ScreenType objects of an AppType are used in the ManifestBuilder and in the ScreenTemplating. ScreenTemplating creates an activity and the layout from each screen of the model. The ManifestBuilder adds the necessary entries in the Android Manifest file. 2https://docs.oracle.com/javase/tutorial/jaxb/intro/arch.html

45 Chapter 4

@XmlElement(required = true) profile; minOccurs="0"> protected List screen; protected String appname; bind = true) protected String _package; ... Classes Schema ...

follows Instances of

marshal

Document Objects normal app.getAppname()); .. ...

Figure 4.3: XML to Java binding.

4.3.1 App Scaffolding

The app scaffolding process is the first step in the app generation after parsing the XML input. The input to create the app project prototype is an instance of the model in the form of the Apptype-object. This object contains all meta information about the app, the structure of the user interface and the flow through the app. The necessary files and folders of an empty Android project are created based on the meta information app-name and package-name. Fig 4.2 shows the generated Android project structure.

The Apptype-object contains at least one Screentype. This object represents a single user interface screen including elements for user interaction (input and output widgets and interactive components). For each Screen, the templating process transforms the model into Java source-code for an activity and Java methods and the corresponding XML layout definition. The templating of the activity and layout files is described in the next section.

4.3.2 Templating

The transformation from model to source code follows the Templates + Metamodel pattern [96]. The input for this pattern is a concrete instance of the model, for example a Screen object. The template engine FreeMarker3 [175] uses this input to fill the template placeholders. The example in Fig 4.5 shows the templating components the

3http://freemarker.org/index.html

46 Chapter 4

Figure 4.4: Overview of Accapto code generation.

Java object ScreenType, the template for an Android Activity and the resulting source code after the templating process.

More details of this process reveals the following example of a transition from one screen to another (see Listing 4.1). The createTransition() method gets a Transition- Type-object. The template uses a map structure with a key-value pair for each input. The maps for the layout and the code template are filled with the transition values. The template, which is stored in a separate file, is loaded and processed in the template engine.

private void createTransition(TransitionType transition) {

layoutTemplate.put("name", transition.getName()); layoutTemplate.put("description", transition.getDescription());

47 Chapter 4

Java Object Template package ${package};

... public class ${activityname} extends BaseActivity{ ScreenType screen = new ScreenType(); public void onCreate(Bundle savedInstanceState){ screen.setName("Start"); setContentView(R.layout.${activity_layout}); ... } ...

Output package org.accapto.app;

public class Start extends BaseActivity{

Freemarker public void onCreate(Bundle savedInstanceState){ setContentView(R.layout.start_layout);

} ...

Figure 4.5: Template processing for code generation.

layoutTemplate.put("function", "goTo" + transition.getTarget());

codeTemplate.put("transition", transition.getTarget());

Template template = cfg.getTemplate("accapto_action_layout.ftl"); template.process(layoutTemplate, layoutWriter);

Template templateCode = cfg.getTemplate("accapto_transition_code.ftl"); templateCode.process(codeTemplate, codeWriter);

.. } Listing 4.1: Template code fragment for a method stub in Java class.

Listing 4.2 shows the template for the Java code generation. Each transition in the apps workflow starts a new user interface screen with an Android intent. The method gets a composite name including the name of the transition target.

public void goTo${transition}(View view) { Intent intent = new Intent(this, ${transition}.class); startActivity(intent); } Listing 4.2: Template code fragment for a method stub in Java class.

To launch the interaction flow, the app also needs an active UI element. In Listing 4.3, the template for a button in the layout of the app screen is presented. The name of the resulting button is created with the name of the transition target.

48 Chapter 4