CARE4CF: Daily Logging App A Progressive Web App to Log ACT Activities for People with Cystic Fibrosis Jordan Smith MSc Computer Science 1 Supervisor: Rae Harbird Clients: Prof. Eleanor Main, Great Ormond Street Institute of Child Health Lee Stott, Microsoft Submission date: 13th September 2021 1 Disclaimer: This report is submitted as part requirement for the MSc Computer Science degree at UCL. It is substantially the result of my own work except where explicitly indicated in the text. The report may be freely copied and distributed provided the source is explicitly acknowledged Abstract “ [People with CF understand] how we should be appreciative of anything that’s in our control since our health is not. ” - Salt In My Soul: An Unfinished Life , Mallory Smith Cystic fibrosis is an inherited life-limiting condition that causes recurring chest infections, dif- ficulty breathing and damage to the airways. There is no cure, but a wide range of treatments can be used to control the symptoms and reduce complications. For many people with CF, staying healthy means spending an average of two hours every day on their treatments. Airway clearance treatments, a form of chest physiotherapy used to clear sticky mucus from the lungs, are commonly regarded as the worst and most time-consuming of these treatments, and one of the most pressing questions in the field is whether people with CF can replace these airway clearance treatments with exercise without sacrificing their health. This report describes the development of an app to be used by people with CF to track the extent to which they keep to their daily airway clearance plan. It encourages users to log each day whether they have completed their normal airway clearance routine, something different (and if so, what), or no activities. The app is built as a progressive web app, making use of recent technological developments to increase accessibility and reliability. The data gathered from this app will be analysed alongside other data collected in the CARE4CF medical trial, and will paint a picture of the impact of exercise compared to airway clearance treat- ments on patient health. This app is a tool to gather the information necessary to answer one of the most important questions for people with CF, on the understanding that making more informed decisions on how to approach the burden of treatment can improve the quality of life for many. “ ...that crucial term ’choice’. It’s that guilt-free choice of knowing that they are equivalent, or knowing how much exercise intensity is equivalent; having that assurance that if I do ’this’, it will be the same as doing ’that’ and that’s okay. Having that choice. ” - CARE4CF interviewee with CF, 24 years old Acknowledgements Thanks go to the project’s clients, Prof. Eleanor Main of Great Ormond Street Institute for Child Health and Lee Stott of Microsoft, for their engagement, insight and clarity of vision throughout the project. Thanks also to Rae Harbird, the project’s supervisor, for ongoing guidance, support and practical feedback. Also to Nitya Narasimhan and Yohan Lasorsa of Microsoft for their time and enthusiasm in sharing their expertise. All have helped make this project a rewarding, impactful and enjoyable journey. Check It Out Use the below links to visit the CARE4CF app and supporting products. A .zip file containing source code is submitted alongside this report, but the repository locations have also been included below. Please contact the report author if there are any access issues (for example, Forest Admin or private repositories). Product URL Logging App care4cf.azurebwebsites.net Registration care4cf-register.azurewebsites.net Admin CMS app.forestadmin.com/care4cf-admin/ Figure 1: CARE4CF App URLs Product URL Logging App github.com/JordanJWSmith/care4cf_ejs Registration github.com/JordanJWSmith/care4cf_reg Admin CMS github.com/JordanJWSmith/care4cf-forest-admin Figure 2: CARE4CF App Code Repositories Contents 1 Introduction 2 1.1 The CARE4CF App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Challenges, Aims and Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 Project Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 Context and Research 6 2.1 Cystic Fibrosis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.2 CARE4CF Trial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.3 Mobile Health Apps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.4 Non-Medical Logging Apps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.5 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3 Requirements & Analysis 16 3.1 Requirements Engineering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.2 Use Case List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.3 Data Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4 Design and Implementation 22 4.1 CARE4CF Registration App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.2 CARE4CF ACT-Logging App . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.2.1 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.2.2 Logging Activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.2.3 Visualising Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.2.4 Implementing PWA Features . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.2.5 Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4.3 Content Management System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5 Testing and Results Evaluation 35 5.1 Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.2 SQL Injection Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 5.3 Black Box Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.4 Lighthouse Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.5 Compatibility and Load Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 6 Conclusions & Results Summary 41 6.1 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 6.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 1 6.2.1 Confirmed Plans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 6.2.2 Potential Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 6.3 Final Thoughts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 A System Manual 54 B User Manual 56 B.1 For Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 B.2 For Admins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 C Supporting Documentation and Diagrams 63 C.1 Kanban Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 C.2 Domain Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 C.3 Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 C.4 Requirement Traceability Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 C.5 Document Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 C.6 Prototype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 C.7 Focus Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 C.8 General Database Entity-Relationship . . . . . . . . . . . . . . . . . . . . . . . . . 76 C.9 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 C.10 Activity & Sequence Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 D Test Results 84 D.1 Unit Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 D.1.1 Sample Unit Test Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 D.1.2 Unit Test Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 D.2 SQL Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 D.3 Load Time Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 D.4 LightHouse Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 D.5 Load Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 E Code References 93 F Glossary 95 2 List of Figures 1 CARE4CF App URLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 2 CARE4CF App Code Repositories . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Project Lifecycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1 ERD for Private Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.2 Users Log Activities Describing Schedules . . . . . . . . . . . . . . . . . . . . . . . 21 3.3 Schedules Comprise Many Elements . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.1 Registration App Sitemap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.2 Registration App Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.3 ACT-Logging App Sitemap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.4 ACT-Logging App Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.5 newSchedule Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.6 Main Logging Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.7 Logging from Saved Schedules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.8 MyHistory Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.9 Service Worker Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.10 Caching Key Pages Upon Install ( pwabuilder-sw.js ) . . . . . . . . . . . . . . . . 29 4.11 Caching as Network Response [10] . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.12 Caching Upon SW Install [10] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 4.13 Assigning Different Caching Strategies ( pwabuilder-sw.js ) . . . . . . . . . . . . . 30 4.14 Push Notification Sent From Server . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.15 Return Subscriptions for Users Who Have Not Logged Today ( getNotLoggedToday. js ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.16 Content Management System Architecture . . . . . . . . . . . . . . . . . . . . . . . 33 4.17 Mapping techniques Model to Table ( /models/accesstokens.js ) . . . . . . . . 33 4.18 Section of Middleware File for New Table (2/8 pictured) ( /routes/accesstokens.js ) 34 5.1 Unit Testing the abbreviate.js Function . . . . . . . . . . . . . . . . . . . . . . . 36 5.2 Secure SQL Query When Logging An Activity ( logDifferent.js ) . . . . . . . . . 37 5.3 Comparison of Average Loading Times for Main Logging Page . . . . . . . . . . . 38 5.4 Display Loading Modal Depending On Operating System ( loadingModal.js ) . . . 38 5.5 Initial Lighthouse Testing Results ( care4cf.azurewebsites.net ) . . . . . . . . . 39 5.6 Lighthouse Results After Refining Performance ( care4cf.azurewebsites.net ) . . 40 5.7 Compatability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 5.8 Accessibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3 A.1 Update Credentials in database.js . . . . . . . . . . . . . . . . . . . . . . . . . . 54 A.2 Update VAPID and GCM API keys in app.js . . . . . . . . . . . . . . . . . . . . 55 A.3 Update pwa-auth Microsoft Key from Azure Active Directory . . . . . . . . . . . . 55 B.1 Installing the App (iPad) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 B.2 Opening the local app (iPad) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 B.3 Sign In with Microsoft (iPad) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 B.4 Redirect to Registration Site (iPad) . . . . . . . . . . . . . . . . . . . . . . . . . . 57 B.5 Registration Form (iPad) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 B.6 Registration Form Validation (iPad) . . . . . . . . . . . . . . . . . . . . . . . . . . 57 B.7 Registration Confirmation (iPad) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 B.8 Saving Our First Schedule (iPad) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 B.9 Accepting Notifications (MacBook Pro) . . . . . . . . . . . . . . . . . . . . . . . . 58 B.10 Main Logging Page (Google Pixel 3) . . . . . . . . . . . . . . . . . . . . . . . . . . 58 B.11 Logged Activity (iPad) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 B.12 My Normal Routine (iPad) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 B.13 Saved Routines (Pixel 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 B.14 Saving a New Routine (Pixel 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 B.15 Updated Saved Routines (Pixel 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 B.16 Logging Something Different (iPad) . . . . . . . . . . . . . . . . . . . . . . . . . . 60 B.17 Logging No Activities (Pixel 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 B.18 My History (Pixel 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 B.19 Activity Description (Pixel 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 B.20 Disable Gamification (Pixel 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 B.21 Prompt to Update Normal (MacBook Pro) . . . . . . . . . . . . . . . . . . . . . . 61 B.22 Reminder Notification (Google Pixel 3) . . . . . . . . . . . . . . . . . . . . . . . . 61 B.23 Admin Page (MacBook Pro) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 B.24 Admin Page (MacBook Pro) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 B.25 CMS Adjuncts Table (MacBook Pro) . . . . . . . . . . . . . . . . . . . . . . . . . . 62 B.26 Creating New Adjunct (MacBook Pro) . . . . . . . . . . . . . . . . . . . . . . . . . 62 B.27 New Adjunct Available (Google Pixel 3) . . . . . . . . . . . . . . . . . . . . . . . . 62 B.28 Admin Insights (MacBook Pro) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 C.1 Kanban Board (Trello) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 C.2 Requirement Traceability Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 C.3 Main Logging Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 C.4 Activity Detail Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 C.5 My Routines Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 C.6 My Routines Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 C.7 My Routines Page - Detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 C.8 Normal Routine Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 C.9 My History Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 C.10 General Database ERD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 C.11 System Architecture Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 C.12 Activity Diagram: Login process . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 C.13 Sequence Diagram: Authenticating User . . . . . . . . . . . . . . . . . . . . . . . . 80 4 C.14 Activity Diagram: Subscribing to Notifications . . . . . . . . . . . . . . . . . . . . 81 C.15 Activity Diagram: Serving and Updating Content . . . . . . . . . . . . . . . . . . . 82 C.16 Relationship Between Registration App and ACT-Logging App . . . . . . . . . . . 83 D.1 Testing the dateDifference.js Function . . . . . . . . . . . . . . . . . . . . . . . 85 D.2 Unit Test Results for ACT-Logging App (part 1) . . . . . . . . . . . . . . . . . . . 86 D.3 Unit Test Results for ACT-Logging App (part 2) . . . . . . . . . . . . . . . . . . . 87 D.4 Coverage Results for ACT-Logging App . . . . . . . . . . . . . . . . . . . . . . . . 88 D.5 Coverage Results for Registration App . . . . . . . . . . . . . . . . . . . . . . . . . 88 D.6 OWASP SQL Injection Test Results . . . . . . . . . . . . . . . . . . . . . . . . . . 89 D.7 Comparing Strategies for Loading Main Page . . . . . . . . . . . . . . . . . . . . . 90 D.8 Comparing Strategies for Loading Main Page . . . . . . . . . . . . . . . . . . . . . 90 D.9 Page-By-Page Ratings from LightHouse . . . . . . . . . . . . . . . . . . . . . . . . 91 D.10 LightHouse PWA Checklist Compliance . . . . . . . . . . . . . . . . . . . . . . . . 91 D.11 Load Testing 20,000 Requests from 1,000 Virtual Users . . . . . . . . . . . . . . . 92 D.12 Load Testing GET Requests from 3,000 Virtual Users . . . . . . . . . . . . . . . . 92 1 Chapter 1 Introduction This report details the creation of the CARE4CF App, a daily logging app to gather data from people with cystic fibrosis to describe their adherence to prescribed physiotherapy treatments. This app forms a key data-gathering part of the CARE4CF trial, a research trial comprising of three studies to investigate how people with CF approach their treatment plan and whether parts of it can be replaced by exercise. This document provides an introduction to the project and how it was managed, before describ- ing the context and research informing its creation. It then provides a detailed problem statement and an overview of the project requirements with subsequent analysis. It continues by describ- ing the project’s design decisions and how they were implemented, before giving examples of the project’s testing strategy, how it was carried out and what the results were. The report culminates with a conclusion to describe what the project has achieved, a critical evaluation of how goals were met and an overview of potential future work. Additional relevant information is provided in the Appendix. 1.1 The CARE4CF App People with CF carry out many treatments each day to maintain their health, but these treatments are often time-consuming and form a heavy burden. Patients often compromise by choosing to replace these airway clearance techniques with exercise, which may seem more natural, social and easy to integrate into a ‘normal’ life. People with CF and associated healthcare professionals are keen to understand whether airway clearance treatments can be replaced by exercise without the patient’s health deteriorating as a result. The CARE4CF trial aims to provide evidence to support those who wish to exercise instead of performing airway clearance [82]. To do this, researchers must gather data from a wide range of people with CF to measure how much exercise they do and what airway clearance they have done. For a period of 12 months participants will be asked to wear a Fitbit to log their exercise, and to use the CARE4CF App to log their daily airway clearance routines. The app must record this data such that it can be linked to the participant’s clinical data, which can in turn be used to determine how healthy the participant is given their recorded levels of exercise and airway clearance. This app seeks to contribute to solving one of the top priorities in research regarding CF. Its 2 creation proposes a number of interesting challenges, including capturing regular and unbiased data, encouraging users to engage truthfully without influencing their activity, appealing to a broad range of demographics and allowing maintenance from a non-technical team. It also presents an opportunity to navigate these challenges through research, design and the implementation of modern technologies. The information gleaned from the use of this app offers a real chance to better inform healthcare professionals, reduce the treatment burden for patients and improve the lives of people living with CF. 1.2 Challenges, Aims and Goals The app’s main purpose is to provide a convenient means for users to log daily activities, thus forming the backbone of the trial’s longitudinal observational study. While its deployment poses a meaningful opportunity to contribute to the field, its development poses a series of challenges. These challenges help to define a set of aims for development, which in turn give rise to deliverable goals. One challenged faced by the app’s development is its need to capture a relatively wide and varying set of user data every day without placing a burden on the user’s time [69]. The app should strike a balance between gathering the required level of detail and providing a streamlined user experience with minimal complexity. Similarly, the year-long duration of the study raises the challenge of maintaining user engagement over an extended period of time. A simple and concise user flow alone does not necessarily encourage users to form the daily habit of logging, nor does it help users to avoid simply forgetting to use the app. The app should employ techniques to motivate users to engage with the app each day. However, the use of these techniques can be in danger of reaching a point of diminishing returns [148]; users should be encouraged regularly but not to an extent that the app is perceived as annoying or intrusive. Given that the study will involve 800-1000 participants of all ages, development must meet the challenge of appealing to a wide spectrum of users from differing demographics. Users will have different preferences for how they interact with the app [134], and consequently the development process should not favour any one operating system or type of device. The app should offer a simple, intuitive user experience that remains unambiguous and practical for users of varying tech- nological confidence. The techniques used to create an enjoyable and habitual user experience should not alter users’ initial attitudes towards their treatment. For example, care must be taken not to associate logging a ‘normal routine’ with good behaviour, and logging ‘no activities’ with bad behaviour. This raises a challenge for the app to encourage users to truthfully log their activities (or lack thereof) each day, without associating reward or punishment with the data they enter. Doing so would place a bias on the information captured by the app. The app is to be maintained by a non-technical team, however its content is likely to need periodic updates. For example, specifications of airway clearance routines may need editing to include additional popular techniques or medications. This raises a challenge for the system to include a user-friendly platform for administrators to update the app without assuming any spe- cialist technical knowledge. 3 These challenges clarify a series of aims to be achieved during the development process. The first of these is to investigate different technical means of creating and delivering the project in order to make an informed decision on which to use as the app’s foundation. The second develop- ment aim will then be to learn the chosen language, runtime environment and/or framework and to apply them to deliver the project. Another aim is to investigate recent developments in web/app capabilities and to research how new technologies could contribute to building a more widely accessible product. Development ap- proaches have continued to evolve and offer a greater range of options to improve experiences for both users and developers. The current landscape of capabilities should be understood to better inform the app’s creation. Many of the challenges posed by this project revolve around employing effective UX and UI techniques. As such, another development aim is to study how to use these techniques to motivate users and to provide an enjoyable habitual user experience. Similar apps should be used as case studies to illuminate strengths and pitfalls of design, and to inform the decisions made during development. The app must balance collecting a comprehensive set of data with a smooth and efficient user flow. The development process should aim to elucidate a clear list of data features to collect, while streamlining the number of attributes to reduce unnecessary interaction. Development should aim to store this data in an efficient and structured format to enable future analysis. The goal of the CARE4CF App project is to deliver a robust application that achieves the development aims and meets the challenges it faces. It should use an appropriate development framework and relevant modern technologies to present a widely-accessible product with a smooth, succinct and widely-accessible user flow. It should be used to collect a practical number of data features from users for use in future analysis, and should maintain engagement without influenc- ing users’ attitudes. It should also contain a user-friendly administration page for non-technical researchers to maintain and update the user-facing app. 1.3 Project Management This project has been managed using a version of the USDP framework which has been adapted to suit the project’s timescale and resources with Agile methodologies. This framework places an emphasis on frequent inspection and adaption to navigate inevitably changing requirements. It encourages self-organisation and accountability, suiting a project with a single developer. It also allows for rapid delivery of high quality software and aligns development with customer goals. Appropriate emphasis was placed on communication with the client; short weekly meetings were held to deliver updates, gain feedback and match expectations. Each meeting revealed useful information which was fed back into subsequent iterations, developing incremental gains to reach a finished product. These iterations were used to encompass the five key workflows: requirements, analysis, design, implementation and testing. Each iteration spanned multiple workflows with varying emphases; early iterations tended to focus on requirements, analysis and design whereas 4 later iterations placed a greater focus on implementation and testing. As such, the development timeline can be broadly split into four sections, each encompassing a number of week-long iterations [142]. Figure 1.1: Project Lifecycle The inception stage was used to define the scope and objectives of the app. Meetings were used to discuss the project at a top-level and to develop broad understanding. This stage culmi- nated in the creation of use cases to define specific functional objectives. The elaboration phase focused on refining the requirements and using them to develop system architecture. Visual aids such as use case diagrams, architecture diagrams and database entity-relationship diagrams were produced and used as platforms to gather feedback. These requirements were analysed and a prototype design was created. This stage concluded when an executable architecture baseline was agreed upon, forming a blueprint for construction. The construction phase was used to develop and test software. These iterations focused on consolidating design decisions, learning and im- plementing the chosen programming language, framework and runtime environment, and gaining feedback on implementation. This phase culminated with a minimally functioning product. The transition phase focused on moving the project to deployment. These iterations were used to refine the implementation based on technical feedback and testing, polish the design according to user acceptance, and review the accompanying documentation. It is common within this framework to adopt a Scrum approach to manage workflow [126]. Scrum, however, relies on inflexible sprints in which requirements cannot be changed, whereas this project lends itself to continuous and variable iterations without strict limits on refining requirements. Instead, a Kanban approach was adopted. This methodology is less prescriptive with an emphasis on rapid execution[130], flexibility and short-term iterations [74]. Kanban advises that the workflow should be visualised, and the current work in progress should be limited [70]. To this end, a Kanban board was used to manage tasks, with separate swimlanes for backlog, tasks to-do, work in progress, bug fixing, work awaiting approval, and completed tasks (figure C.1). 5 Chapter 2 Context and Research The CARE4CF App forms part of the CARE4CF trial, and aims to collect data to study the extent to which people with CF adhere to their ACT schedules. This chapter details the context around the app’s creation; it gives an overview of cystic fibrosis and the associated treatments before describing the CARE4CF trial, why its aims are important and where it fits in the wider research landscape. It also describes research relevant to the app’s development. 2.1 Cystic Fibrosis Cystic fibrosis (CF) is a progressive genetic disease that causes sticky mucus to build up in the lungs and digestive system, leading to persistent lung infections, difficulty breathing and numerous comorbidities [39] [93]. It is the most common lethal genetic disease in Caucasian populations, appearing in 1 in 3,000 births of northern European descent [97]. Treatment of CF is multi- faceted, commonly comprising of a series of prophylactic medications, daily physiotherapy and a healthy lifestyle with consideration for nutrition and exercise [79]. As treatments and care for CF patients has improved over recent years, life expectancy has increased. This increased life ex- pectancy has brought with it the challenges of maintaining a treatment regimen which is complex, time-intensive and lasts throughout the lifetime of the patient, affecting every aspect of daily life including recreation time, family interactions and peer relationships [111]. This leads to common lapses in compliance which may cause accelerated disease [1]. In general, multiple studies have revealed that therapeutic adherence in CF patients lies be- tween 30-70% [111][21][2]. Of the different types of treatment, the highest level of compliance is seen with medications. Conversely, physiotherapy sees the lowest level of compliance [79][111][119]. Chest physiotherapy involves a range of airway clearance techniques (ACTs) to clear mucus from airways, and have been singled out as carrying the largest burden by people with CF, people close to people with CF and healthcare professionals alike [22]. Studies have highlighted a number of reasons for this, the three most significant being patients claiming not to have enough time, seeing no need for treatment and substituting physiotherapy for other exercises [79][119]. This relationship between general exercise and prescribed physiotherapy, henceforth referred to as airway clearance techniques (ACTs), has become a popular research topic. Given that 96% of people with CF exercise, levels of exercise are generally higher in people with CF compared to the non-CF population [121]. Exercise seems to be beneficial and is shown to improve the ease of expec- 6 toration in patients[29], but often comes at the expense of adhering to physiotherapy; nearly half of people with CF omit ACT when exercising [22]. This tendency towards general exercise, which may seem more natural, social and easy to integrate into a ‘normal’ life, and away from ACTs, which are time consuming and are perceived to be high-effort [138], has encouraged researchers to study to what extent exercise can replace ACTs. Through the James Lind Alliance research priority-setting partnership in CF, it was determined that the question of whether exercise can replace chest physiotherapy is one of the top 10 priorities for research [5] [122]. A 2020 study from N. J. Rowbotham et al [121] indicated that nearly three quarters of healthcare professionals would support a trial around replacing some or all ACT with exercise, showing that there is significant support within the scientific community for efforts to answer this question. The creation of this app represents one of these efforts, and sits within part of a NIHR trial to inform new guidance for people with CF regarding exercise and ACTs. 2.2 CARE4CF Trial CARE4CF : C an A irway clearance be R eplaced by E xercise for people with CF ? This project forms part of the the CARE4CF Trial, which aims to answer the question of whether exercise can replace chest physiotherapy for people with CF without compromising their health, and what happens to people’s health when they make different choices about the amount of exercise and ACTs they carry out. Should exercise prove to be an effective alternative, patients may be offered more flexibility in their treatment routines, they may be granted access to a less burdensome regimen, and the NHS will be charged less money. This will be the first study to compare clinical outcomes between those who prefer ACTs to those who prefer exercise, and will take important steps towards investigating ways of simplifying the treatment burden of people with CF [82]. The study is arranged into six work packages spread over six years, employing a UK-wide survey, a longitudinal observational study, and a substantive qualitative study to determine the extent to which exercise can replace ACTs or vice versa. The study will also involve numerous PPI focus groups to aid with research design, development and to optimise the progress of the trial, planned as and when they become necessary. The general outcomes of the trial include iden- tifying physiotherapy behaviours associated with the best outcomes, using evidence to inform and tailor physiotherapy advice and prescriptions for optimal disease management and prevention of ill health, and simplifying treatment and reducing burden for people with CF for direct patient and carer benefit. By analysing the adherence behaviour of people with CF, habits can be arranged into distinct observable characteristics to describe patients’ compliance to treatment. The first work package aims to determine these exercise and ACT phenotypes and associated clinical outcomes from existing data regarding young people with CF, and to develop a data processing pipeline for the subsequent work packages. In this regard, a large paediatric study has shown that the habits of people with CF tend to lie within three bands of adherence. There are those who have a high adherence to exercise or ACTs, those who have a moderate adherence to exercise or ACTs and those who have low or non-adherence to exercise or ACTs. These activities are broadly organised 7 into nine phenotypes to represent the comparative adherence to both exercise and ACTs, within which there are four phenotypes which represent the outer limits of adherence behaviours [114]: • High ACT and exercise adherence • Predominant exercise adherence with occasional, little or no ACTs • Predominant ACT adherence with occasional, little or no exercise Poor ACT and exercise adherence In the study, over half of people with CF fell into these four outer phenotypes. The first work package aims to determine the demographic and clinical characteristics associated with these four phenotypes; they will be the focus of subsequent work packages and of the app to which this report pertains. The second work package involves a national online survey of 2,000 people with CF to un- derstand engagement with ACT and exercise throughout life. The personal choices regarding compliance varies throughout different stages of life, and the study therefore aims to compare how ACTs and exercise have been managed through childhood, adolescence, young adulthood and older adulthood, as well as through significant trigger points for change in life. The results from the survey will be used to assign each participant to an ACT and exercise profile as detailed above. This report, and the creation of the CARE4CF app, form the base of the third work package. The aim of this project is to develop an easy-use, low burden secure smartphone-accessible app associated with CARE4CF, which can be used as the backbone of the subsequent longitudinal observational study. It is to provide a means for users to log daily and habitual ACT activities over 12 months, with linkage to UK CF Registry data for later quantitative study. Specific features described for the app include the ability for people with CF to log their standard ACT routines, a daily popup asking participants to enter their ACT or log a new prescription, and automatic synchronising to the CARE4CF cloud. These three features formed the starting point for discus- sions around software requirements and for wider research into the app’s development, the details of which are expanded upon below. The fourth work package will utilise this app as part of a 12-month UK-wide observational study of daily exercise and ACT activities in 800 people with CF. This app will be used to de- termine whether the exercise group do not have worse lung function compared to the ACT group, whether the ACT or exercise groups do not have worse lung function compared with those who do both, and whether the ACT or exercise groups have better lung function compared with those who do neither. A User Manual contained in Appendix B may be distributed to users and/or administrators to aid uptake, and will contribute to explanations and walk throughs being carried out via zoom video-calls to minimise cross-infection. Participants will also wear a Fitbit for the duration of the study to evaluate their exercise patterns. The fifth work package involves conducting a UK-wide qualitative study via online focus groups and semi-structured interviews to understand why people with CF and parents/carers choose spe- cific or predominant exercise or ACT healthcare behaviours, how long choices have been enacted for, the types of life stages, events and drug therapies that have contributed to changes in treatment behaviour choices, and the beliefs people with CF have about the health impact of their treatment 8 behaviours. This work package also aims to compare participants’ monitored behaviours to their self-identified classifications. Understanding these issues will help to develop the correct forms of support for behaviour changes in those who would benefit. The sixth work package seeks to disseminate the results of the study to the CF community. These results will be communicated through social media, webinars, podcasts, clinician scientists, by presenting at national and international CF conferences and by publishing in peer-reviewed journals. The CARE4CF study comes at a time when many people’s physical activity levels, including those with CF, have been severely restricted due to the ongoing COVID-19 pandemic. A 2020 study into the effects of COVID-19 shielding on physical activity levels in adults with CF found that almost half of participants reported conducting less physical activity during lockdown periods, while 79% and 91% reported no change in ACTs and inhalation therapies, respectively [112]. For those with CF who naturally gravitate towards replacing ACTs with exercise, periods of shielding and social restrictions would have a significant effect on the way they approach compliance to treatments. A 2020 University of Kansas study into physical activity level and perception of ex- ercise in people with C