Thesis
Thesis
This thesis document was typeset using the UiT Thesis LaTEX Template.
© 2024 – http://github.com/egraff/uit-thesis
Abstract
With the emergence of powerful generative AI models comes the possibility
of creating knowledgeable and engaging chatbots, which have the potential
to significantly enhance several areas of the user’s life. This thesis focuses on
the design and implementation of FysBot, an application with an integrated
chatbot that aims to increase the user’s physical activity levels. In collaboration
with a PhD project, FysBot’s design is guided by scientific evidence on user
preferences in physical activity chatbots, with a strong emphasis on the security
and privacy of the users’ data.
FysBot’s design has undergone testing via a usability study conducted using
the think-aloud method. From this study, the overall impression of FysBot has
been positive. However, several areas require improvement to enhance the user
experience and intuitiveness. Addressing these areas will, in turn, increase
engagement and promote healthier lifestyles among users.
Acknowledgements
I would like to thank my main supervisor, André Henriksen, and co-supervisors
Eirik Årsand, Elia Gabarron and Kerstin Denecke for their support and guidance
not only in the supervision meetings but also for taking the time to answer
my spontaneous questions and checking in on me to see how I was doing.
They have shown genuine interest in the success of the thesis and have always
motivated me to do better.
Many thanks to my co-supervisor and the PhD student referred to in this thesis,
Dillys Larbi, whom I have worked closely with and who has helped me with
the usability tests, application design, and much more. I am extremely grateful
for all you have done and wish you all the best for the future.
Thank you to Assoc. Prof. Elisavet Kozri, thank you for taking the time to answer
my questions about security design.
To the participants of the usability test, thank you for your participation and
honest feedback.
To my friends at the university, thank you for all our discussions. Your dedication
to the field of computer science is an inspiration.
To my family, thank you for your limitless support and to my brother, who has
always been my role model.
And lastly, Benedikte, thank you so much for moving with me, believing in me,
and pretending to be interested in my incoherent ramblings over the last five
years.
Contents
Abstract iii
Acknowledgements v
List of Figures xi
List of Listings xv
1 Introduction 1
1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Previous Work . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Research Question . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Technical Background 5
2.1 Physical Activity . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Chatbots . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.2 Physical Activity Chatbots . . . . . . . . . . . . . . . 7
2.3 Large Language Models . . . . . . . . . . . . . . . . . . . . 7
2.4 ChatGPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4.2 Function Calling . . . . . . . . . . . . . . . . . . . . 9
2.5 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5.1 Data Protection . . . . . . . . . . . . . . . . . . . . 10
2.5.2 Data Security . . . . . . . . . . . . . . . . . . . . . . 10
2.5.3 JSON Web Token . . . . . . . . . . . . . . . . . . . . 12
2.6 Android App Development . . . . . . . . . . . . . . . . . . 12
2.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . 12
vii
viii co n t e n t s
3 Method 17
3.1 Collaboration . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 Software Development . . . . . . . . . . . . . . . . . . . . 18
3.2.1 Agile Methodologies . . . . . . . . . . . . . . . . . . 18
3.2.2 Personas . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2.3 User Stories . . . . . . . . . . . . . . . . . . . . . . 19
3.3 Usability Study . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.4 Ethics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.4.1 Test Approval . . . . . . . . . . . . . . . . . . . . . 21
3.4.2 Data Privacy and Protection . . . . . . . . . . . . . . 22
6 Implementation 51
6.1 Backend Server . . . . . . . . . . . . . . . . . . . . . . . . 51
6.1.1 Azure VM Deployment . . . . . . . . . . . . . . . . . 52
6.2 Database Setup . . . . . . . . . . . . . . . . . . . . . . . . 52
6.3 Securing API Endpoints . . . . . . . . . . . . . . . . . . . . 55
6.3.1 Authentication . . . . . . . . . . . . . . . . . . . . . 55
6.3.2 NGINX and TLS . . . . . . . . . . . . . . . . . . . . 57
6.4 Azure ChatGPT Deployment . . . . . . . . . . . . . . . . . . 58
co n t e n t s ix
8 Discussion 81
8.1 Software Development Process . . . . . . . . . . . . . . . . 81
8.1.1 Solving a Problem . . . . . . . . . . . . . . . . . . . 81
8.1.2 Usability test . . . . . . . . . . . . . . . . . . . . . . 82
8.2 Avoiding Misuse of FysBot . . . . . . . . . . . . . . . . . . . 84
8.3 Complexities with Step Collection . . . . . . . . . . . . . . . 85
8.4 Lacking IOS Implementation . . . . . . . . . . . . . . . . . 85
8.5 Steps for Releasing FysBot to Production . . . . . . . . . . . 86
8.6 Gaining Insight into App Use . . . . . . . . . . . . . . . . . 86
8.7 Standalone App vs. Social Media Deployment . . . . . . . . 87
8.8 Design Revision After Usability Study . . . . . . . . . . . . . 88
8.9 Facilitating Future Continuation of FysBot . . . . . . . . . . 91
8.10 Research questions . . . . . . . . . . . . . . . . . . . . . . . 91
9 Future Work 93
9.1 Improving User Experience . . . . . . . . . . . . . . . . . . 94
9.1.1 Voice Communication . . . . . . . . . . . . . . . . . 94
9.1.2 Social Aspects . . . . . . . . . . . . . . . . . . . . . 94
9.1.3 Gamification . . . . . . . . . . . . . . . . . . . . . . 94
x co n t e n t s
10 Conclusion 97
Bibliography 102
xi
xii list of figures
xiii
List of Listings
2.1 Custom button component . . . . . . . . . . . . . . . . . . 14
xv
List of Abbreviations
AAB Android App Bundle
OS Operating System
PA Physical Activity
RN React Native
xvii
xviii l i s t o f a b b r e v i at i o n s
RP Routing Persona
UI User Interface
VM Virtual Machine
With the widespread use of smartphones and other smart devices, designing and
developing software applications specifically to help individuals become more
physically active is now possible. Most smartphone manufacturers produce
phones that come pre-equipped with health applications that use the phone’s
internal sensors to monitor the user’s steps, heart rate and metabolism. Third-
party apps like Strava1 also use the geopositioning of the smartphone or
smartwatch to track the user’s activity and have a feature to share the activity
in a social network that exists within the app.
The field of Natural Language Processing (nlp) has seen a lot of improvements
in recent years, and research on chatbot applications used for promoting phys-
ical activity has become a hot topic[6, 7]. The prominent features of chatbots
1. https://www.strava.com/
1
2 chapter 1 introduction
are that they can simulate human-to-human interactions and contain a vast
knowledge base. A chatbot is also a very effective tool for packing many differ-
ent functionalities into a single user interface. This is an innovative solution
for keeping the user engaged and can have positive effects on individuals
who otherwise struggle to reach out to other people for social interactions. A
chatbot is always available when the user needs it and can be designed as a
companion with a personality that is tuned to the user’s liking. With this, a
chatbot could be the source of motivation that the individual needs to become
more physically active.
Maher et al.[8] used a chatbot that allowed users to set goals and monitor
progress. An accompanying website was used to show videos that educated
the users on physical activity. The chatbot was powered by the NLP software
Watson from IBM and was deployed on the messaging platform Slack. The
study found that participants, on average, had a 109.8-minute increase in time
spent being physically active compared to their baseline[8].
In their 2023 study, Vandelanotte et al[6]. explored the use of a chatbot system
to educate users about physical activity, nudge them at opportune moments
using machine learning, and answer PA questions using generative AI. A set
of predefined conversations was used to help users become more motivated
and could be initiated by the nudge engine or triggered when the user asked
a question that closely related to one of the conversation. The nudge engine
also used weather data and the users’ locations to suggest suitable activities.
The NLP behind the chatbot was implemented using Google DialogFlow, and
the chatbot was released as a standalone app[6].
1.3 objective 3
1.3 Objective
It is possible to integrate chatbots into popular chat applications like Messenger,
Telegram, or Slack, which already have large user bases, thus making it easier
for people to use them. Using these chat applications also removes the need
to implement a standalone app, which usually takes considerable time. The
downside is that the privacy of users’ data cannot be fully guaranteed, and any
unforeseen regulation changes could render the chatbot unusable. Furthermore,
the chatbot’s functionalities are limited to what already exists within the chat
application. Therefore, the aim is to implement a chatbot in a standalone
application that preserves the privacy of the user’s data and provides a rich set
of features to help the user achieve their physical activity goals.
1.5 Outline
The thesis contains the following chapters:
Chapter 3 - Method details the methodologies used for designing and testing
4 chapter 1 introduction
FysBot.
Chapter 4 - Design presents the design of the FysBot application and the
architecture supporting it.
Chapter 7 - Evaluation presents the findings from the usability study and the
results from running FysBot.
Chapter 9 - Future Work goes into detail about potential features in FysBot
and priorities for future work.
5
6 chapter 2 t e c h n i c a l b ac kg r o u n d
The Norwegian Institute of Public Health found that as of 2022, about one in four
Norwegians are not sufficiently active based on the who recommendations of at
least 150 minutes of moderate-intensity activity per week[5][2]. It is important
to encourage individuals living with obesity, cancer, or diabetes to become
more physically active as the health benefits of pa can have a significant impact
on their quality of life[2]. For these individuals, insufficient pa can even be
life-threatening, so attempts must be made to make exercising more accessible
and engaging.
2.2 Chatbots
2.2.1 Overview
Physical activity chatbots are chatbots that are applied to motivate the user to
be more physically active. Not everyone can afford to hire professional help;
some might feel uncomfortable doing so even if they could. It is assumed that
most people would also like to get assistance quickly, at any time of the day,
so there is also the problem of availability. pa chatbots attempt to fill this gap
by always being available, allowing the users to freely interact, receive advice,
and be motivated by them.
Behavior
You are a positive physical activity instructor who tries to motivate the user to be more active
Use the documents below when answering the user's question. If you are not able to find the
answer in these documents, reply with "Sorry I don't know".
<<DOCUMENTS>>
Knowledge source
User question Instructions
2.4 ChatGPT
2.4.1 Overview
The system message has another use, which is in a feature OpenAI calls
"function calling". This feature lets the model decide whether or not a function
could be called based on the user message. One could then say in the API
call to OpenAI that there exists a function that, given the name of a location,
fetches the weather conditions for that location. The model will then evaluate
the user message and determine if the user wants to know the weather and if
the message includes a location. If so, the model will automatically parse out
the location from the message and reply with a JSON object that contains the
location. The JSON object could then be passed to weather function to fetch
the weather conditions. The steps for completing this query are all described
in the system message, which OpenAI handles automatically. Function calling
also allows for setting enums for each parameter that defines which values the
parameter can take. In the weather example, one could define legal locations as
just Tromsø or Oslo. This is useful for handling typos in the user message. The
model will be able to detect the typo and output the correctly spelled location,
which can later be used in API requests or database queries. In addition, if the
enums are written in English, the user could still write the equivalent word
in a different language, and the model will automatically output the English
equivalent if it exists among the enum values.
10 chapter 2 t e c h n i c a l b ac kg r o u n d
2.5 Security
2.5.1 Data Protection
being detected[24].
The JSON Web Token (jwt) is an internet standard (RFC7519) used to encode
a set of claims (information about a subject formatted as key/value pairs)[25].
The integrity and authenticity of the jwt can be secured by digitally signing
the jwt with a private key. In addition, the jwt can also be encrypted to
achieve confidentiality.
There are solutions that enable the periodic waking of terminated apps to run
background tasks. Still, these solutions can be unreliable and cannot be run
too often as they will be throttled by the os.
Within an app, there are usually multiple tabs, which are screens with different
2.6 a n d r o i d a p p d e v e lo p m e n t 13
content that the user can navigate. The content and corresponding logic within
the tab can be written in the native language of the Software Development Kit
(sdk) (Java or Kotlin for Android) and/or using other ui frameworks like React
Native (rn). Often, a combination of the native language and other frameworks
are used, as using a separate ui framework can speed up development and
enable cross-platform functionalities. The native language is used to access
platform-specific functionalities that are not available in the framework (e.g.,
device sensors).
Components
A core part of RN is the use of components which are units that contain the
logic and the markup for the ui, both of which are written in the same file[26].
Components drive the reusability of UI elements and are implemented as
JavaScript/TypeScript functions that take in a set of arguments called props
and return what should be rendered on the screen[26]. A simple example is
the implementation of a custom button that has a specific color, shape and size
and takes in the text that should be rendered inside the button as a prop. The
custom button component and how it can be used is shown in listing 2.1
14 chapter 2 t e c h n i c a l b ac kg r o u n d
// App.tsx
function App {
return (
<CustomButton title="Press me"/>
)
}
State
Variables that are defined in React components can be used as part of the ui
and even updated by, for example, defining a button that increments a counter
each time it is pressed. If the counter variable value is shown in the ui, one
would, however, not see the updated value as the button is pressed; only its
initial value will be shown. The counter value would also be reset whenever
the component re-renders. React offers state hooks whenever data values has
to persist across re-renders and triggers a re-render whenever the state value
is updated to show the new value in the ui.
Sharing the same state among several components is often required in React,
and passing them as props can lead to "prop drilling", where a state is passed
down multiple layers of components, which makes it harder to maintain the
code base. For example, an application needs to render a welcome message
to a user if the user is logged in and display a login screen if not. For this, it
creates a state value isLoggedIn and a setter for updating the state setIsLoggedIn.
If the user is not logged in, the setter is passed to the login component. The
login component itself can consist of a ’create new user’ component and a ’log
in existing user’ component for which the setter has to be passed a second time.
2.6 a n d r o i d a p p d e v e lo p m e n t 15
3.1 Collaboration
The system created in this master project is intended to be used in a PhD project,
and as such, the PhD student could be considered a customer of the system.
She has knowledge about the users and what they desire in a physical activity
chatbot application based on her ongoing research. Her findings about potential
users’ preferences, as well as the findings in the literature review performed in
the capstone[9], have motivated the implementation of the features that now
exist in the application. Since this master project has a "customer", frequent
meetings are important to give updates on the implementation progress in
order to get feedback on what works and what does not. To facilitate this, we
set up an entire day each week to work together, in addition to the regular
supervision meetings.
17
18 chapter 3 method
3.2.2 Personas
• Age
• Gender
• Occupation
• Location
• Education level
• Technology usage
• Personality
User stories are short and informal descriptions of what a user would like to
achieve while using a product. They are implemented using the following
steps:
1. Role. The user of the functionality states the specific position they find
themselves in. Roles always start with "As a".
2. Action. The action that the user wants to execute is the piece of func-
tionality that must be implemented. Actions always start with "I want".
3. Value. What is the value the user gains from executing an action? Values
always start with "So that".
User stories help in all stages of the development process, from designing the
product, implementing the features, and finally, validating that the product
matches the user’s expectations. It is a tool used to guide the development
into creating something that the user actually wants and avoids features that
are "cool" but do not benefit the user. Since the target population is mostly
individuals living with obesity as well as other related health condition, the
roles were centered around this.
Friends and colleagues at UiT The Arctic University of Norway, and the Norwe-
gian Centre for E-health Research were invited to participate in the think-aloud
test. Participation was voluntary. Before the test, participants had to sign an
information letter (appendix A) explaining the reason for the test and their
rights relating to data privacy. Furthermore, participants were informed that
the think-aloud test would be recorded. The set of tasks given to the partici-
pants is shown in table 3.1. The tasks were used in a schema by the observers of
the think-aloud test where the following key points are noted: Time: the time
to complete the task in minutes, Completed: whether or not the participant
was able to complete the task (Y-Yes; N-No), and Errors: the severity of any
identified errors were noted (C-critical; NC-Non-Critical). The tasks were exe-
cuted with minimal intervention, but the participant could freely ask questions
or ask for assistance. For participants who had never participated in this type
of test, a demonstration using a different app was given to help them better
understand what was expected of them.
Task
Download and install the FysBot app
The app was released in test mode for the usability test, requiring adding
participants’ Gmail accounts to a list of test users. These were collected orally.
All tests were audio recorded on an offline device. Voice recordings were given
anonymous identifiers, transcribed verbatim and then deleted. The data were
then analyzed and used to improve the application’s usability.
3.4 Ethics
3.4.1 Test Approval
Approval for executing the user testing was granted by Sikt - Norwegian Agency
for Shared Services in Education and Research. This is required as the appli-
cation could potentially collect and process personal information. To get the
approval, a notification form is filled that explains the following:
• Usage of application
In addition, an information letter explaining the goal of the test, the partic-
ipation requirements, and the participants’ data privacy rights was written
for each user sample. The notification form, information letter and the Sikt
22 chapter 3 method
An emphasis has been placed on protecting the privacy of the user data collected
through app usage and user tests. This data includes, for example, location,
message history and voice recordings.
The second part presents the design of FysBot, beginning with choosing the
right llm in section 4.2.1. The following section, 4.2.2, introduces the chatbot
personas, which are entities implemented to handle different topics of conver-
sation and are used to provide personalized responses. The different personas
are further described in section 4.2.3. Sections 4.2.4, 4.2.5 and 4.2.6 present
the design of the goal setting, badges, and daily schedule features, respectively.
Section 4.2.7 presents the design and design obstacles related to collecting user
steps. Section 4.2.8 presents FysBot’s architecture with a graphical explanation
of the backend server and database schema. Finally, section 4.2.9 presents a
revised architecture that is not used in the current implementation of FysBot
but could be used to increase FysBot’s scalability.
23
24 chapter 4 r e q u i r e m e n t s p e c i f i c at i o n a n d d e s i g n
4.1 Requirements
The functional requirements were developed using personas and user stories,
with priority given to those that provide value to the user and were feasible
to implement in the given time frame. The non-functional requirements were
based on the need to protect users’ data during the usability test and ensure
the reliability of the server throughout the test.
Personas
The following describes two fictional personas undergoing treatment for obesity
at a health clinic. These personas are representative subjects for the user base
that will use the FysBot application and are based on interviews performed by
the PhD student with patients at a rehabilitation clinic.
Persona 1 - John
John is a 33-year-old male living in southern Norway who struggles with obesity.
He has a high school education and is currently receiving health benefits as he
is unable to work because of his health problems. John is single and likes to
talk to friends, primarily through gaming. He also enjoys watching movies and
listening to music. Currently, John is a patient at a rehabilitation clinic for his
obesity.
John does not enjoy physical activity and sits mostly at his computer. He lacks
motivation and finds walking just for the sake of moving boring and pointless.
He would like to be productive while getting his exercise. John does little
physical activity at home, but he would like to be more motivated to lose
weight and is addressing this by going to the rehabilitation clinic.
Persona 2 - Mary
Mary is a 61-year-old Norwegian who struggles with obesity and depression.
She has a bachelor-level education and used to work as an advisor, but she
is now out of work and receives disability benefits because of obesity-related
problems. Mary is a single mother who lives alone, and her favorite activities
are swimming, gardening and hiking.
4.1 requirements 25
Mary would like to be more physically active but lacks the motivation to start,
especially in the winter months. She has bought resistance bands for working
out and has hung them up in a place that makes her notice them every day in
an attempt to remind herself to train. She also goes to a rehabilitation clinic
to help manage the weight gain.
Mary is not proficient with technology and is hesitant to use new technology.
She would like a chatbot that could be a companion and remind her to be
physically active. However, it would need to be intuitive and should understand
what she is saying. She would like to try the chatbot first to determine if it can
help her be more active.
User Stories
In a published paper about the user base[30], a set of desired features were
gathered from individual interviews and focus groups using a semi-structured
interview guide. Using this information, along with the personas, several user
stories have been defined and are presented in table 4.1 (US: User Story). These
will be used to guide the design of FysBot.
NO User Story
US1 As an individual living with obesity, I want to get recommendations for
exercises so that I can have more variety.
US5 As an individual living with obesity, I want to create a structured plan for
my day so that I can keep promises to myself to exercise and eat.
US9 As an individual trying to live healthier, I want to be able to work out with
other people so that physical activity becomes more social and thus easier
to accomplish.
US12 As a chatbot user, I would like information about how to use the chatbot
so that I can have productive conversations.
Based on the user stories listed in 4.1, the following set of features have been
decided as key focus areas for the application and are the functional require-
ments for FysBot. The decisions are based on their value to the user base and
on what is realistically feasible.
• Scheduling. The user should be able to set a daily plan and have the
option to be reminded of selected events (US3, US4, US5).
• Reward system. The user should be able to set goals and be rewarded
for their efforts (US7).
• Guide for using chatbot. The user should be able to receive information
on how to use the chatbot (US12).
The remaining user stories, 8, 9, 11, 13 and 14, are not scheduled for this master
thesis. Stories 8 and 9 relate to a feature incorporating a social platform into
the application. With the given time frame, this feature is not prioritized as
other features are thought to add more value. In user story 11, there is a desire
to communicate with a health professional if the chatbot is not able to satisfy
the user. This could be a great feature, but its value is thought to be first
realized in a production setting, so it is not a priority in the prototype. User
stories 13 and 14 express a desire to converse with the chatbot using voice.
Speech-to-text and text-to-speech synthesis is, unfortunately, too expensive for
this project.
User Interface
The previous sections have identified the features that could be included in
FysBot, and from this, a mockup of FysBot’s user interface is presented in figure
4.1. This mockup is used to help visualize the functional requirements.
28 chapter 4 r e q u i r e m e n t s p e c i f i c at i o n a n d d e s i g n
For the prototype of FysBot that will be tested in the usability study, there are
three main non-functional requirements: security, reliability, and performance.
Since the application could probably process sensitive data, a set of security
mechanisms has to be in place to protect the users’ data and privacy. For the us-
ability study, the backend server hosting the AI model must be available during
the study. This leads to the following non-functional requirements:
• Secure traffic. The traffic between the client and server, as well as
between the server and other APIs must be secure (security).
4.2 Design
4.2.1 Choosing the Right LLM
The chatbot will be powered by an llm as it will give the user the most human-
like experience and make extracting information from free-text conversations
easier. There are different design options to evaluate when choosing an llm,
and the most suitable solution will depend on the severity of inaccurate out-
puts, response time, response quality, time to implement and possibly most
importantly, the cost of using the llm.
With the dedicated hardware, a good option could be to host the llm on-
premise. There are several available open-sourced models in different sizes.
Smaller-sized models are not considered an option for this application’s pur-
poses, as the chatbot responses will not be of high enough quality to be perceived
as human-like. Larger models are also not an option as the dedicated hardware
is not available to us on-premise, and renting cloud hardware is too expensive.
Not considering the cost, the time and effort spent setting up a larger model
like Metas’ LLaMA[31] model will be extensive.
30 chapter 4 r e q u i r e m e n t s p e c i f i c at i o n a n d d e s i g n
Since running the llm locally is not an option, the best solution appears to be
the ChatGPT models, accessed via the OpenAI API. This will provide a powerful
model at an affordable price and several out-of-the-box features. The model
chosen is the ChatGPT-3.5-1106 version, which will be referred to as just "the
model" from here on.
To create a chatbot that works well for different topics, splitting the respon-
sibilities of the chatbot into several entities, each specialized for a specific
topic, could be one approach. These specialized entities have been given the
name personas and are inspired by LangChain’s chain[32] structure used to
simplify the development of apps using llms. The topic could, for example,
be exercise recommendation, for which the persona responsible for exercise
recommendation will have the task of analyzing which exercise(s) the user is
most likely interested in and providing the appropriate response. There could
also be scenarios where one persona ’talks to’ another persona in order to
complete the user query.
The reasoning for this approach is that the context size of the model is limited,
but also, the model would most likely become confused if given too many
instructions at once. The instructions often include how to respond and/or
parse a specific message. One can imagine that placing all the instructions for
every topic in a single message, like the example message of figure 2.1, would
make it difficult for the model to perform. Instead, one persona called the
router persona, acts as a mediator between the user queries and specialized
personas.
Router Persona
The Routing Persona (rp) is the persona that first receives a query and is
responsible for routing the query to one of the other personas. As shown in
figure 4.2, the rp is given a description of the capabilities of each persona and
must evaluate the incoming query to find which description best matches the
query. The rp will then forward the query to the selected persona.
4.2 design 31
{query}
Router persona
Persona descriptions
Select persona
query
The erp is designed such that when the user has a specific exercise in mind,
it will return the instructions as well as images for that exercise. Otherwise,
it will list a set of suggestions based on the parameters the user has included.
Any combination of parameters can be used.
{exerciseMessage}
Parse message
Exercise
images
Exercises
The intention of the Progress Review Persona (prp) is to give the users an
overview of their step history by comparing their daily steps to their weekly,
monthly and yearly step averages.
When reviewing the steps, it is, of course, necessary to know the user’s step
history. With this system, the topic of the user query cannot be known until it
is reviewed by the rp. Therefore, it is difficult to ascertain whether the steps
should be included in the client’s request. A solution is then needed to fetch
the steps when the user query is directed to the prp. This could be done using
the periodically sent steps explained in section 4.2.7. However, more up-to-date
steps are needed to get the most accurate response. A better approach for
progress review is to do conditional fetching where the step records are only
provided when needed.
When the user query is sent to rp, and it is determined that the query should
be forwarded to the prp, the prp initially verifies if the necessary step records
are included in the request. If they are absent, the server responds with a
request to include this data. This is illustrated in figure 4.4. Subsequently, the
client, awaiting the response, will conditionally send a new request with the
step records if necessary.
Whenever a user request is forwarded to the lap by the Routing Persona, the
same conditional fetching strategy used in the prp is applied to resend the user
message, but now also including the user’s location. A mathematical function
is then applied to determine the distance between the user and the activities,
and the ones within a set radius are recommended to the user. This radius
is currently set to five kilometers, but the feature could easily be extended to
allow the user to specify the maximum distance in the request.
Another feature of the lap is that it is programmed to give the user personalized
34 chapter 4 r e q u i r e m e n t s p e c i f i c at i o n a n d d e s i g n
{progressReviewMessage}
Parse message
{requiresSteps}
Steps included
No
in message?
Yes
Generate response
Memory
Each persona has its own memory for storing conversations with the user.
This is done to more efficiently manage the context in the conversations and
attempt to give the user a more accurate response by providing continuity. The
design challenge this presents is managing the conversation messages linked
to a particular user and persona. One approach is to let the client manage
the messages that should be sent to the server, which would require sending
large message blocks to the server for each chat request. Instead, the approach
used is to store the messages in the server database, where messages can be
36 chapter 4 r e q u i r e m e n t s p e c i f i c at i o n a n d d e s i g n
In the initial design of the goal-setting feature, the user was supposed to be able
to set goals in free text by stating the goal directly to the chatbot. The chat model
would then parse out the goal type, which could be, for example, a step goal
or a weight-loss goal, and then parse the associated value (number of steps or
number of kilos). The motivation for this approach is to enhance user experience
and human-like interaction with the chatbot. Although feasible, getting it right
requires a good amount of testing. Furthermore, it would be harmful to the
user experience if the chat model could not parse a more unconventional goal
setting. A solution would be to limit the user to a predefined set of goal types.
However, it was concluded that the most suitable approach would be to give
the user a menu of goals to choose from. This solution might make it easier for
the user to set goals and, in addition, make it possible to include and obtain
data on the goal types stated as outcomes in the PhD project.
4.2.5 Badges
Badges are earned by completing specific step goals, and the progress towards a
goal is constantly monitored by the app, but only while the app is running. The
badges earned by the user are stored locally on the user’s phone. Whenever the
application is opened after being closed, synchronization of the badge progress
is required by reviewing the user’s step history from previous days. The time of
the last sync is also stored on the user’s phone and will be used as the starting
point. If, however, there has been no previous sync, as will occur the first time
the user opens the app, the time of the app installation is used instead. The
sync will run every 5 seconds.
The synchronization process found in figure 4.6 starts by retrieving the last
sync date, as shown. Then, for each day up to the current day, the badges
the user should have earned are found and matched against the badges the
user has been rewarded. If they match, the last sync date is set to the current
day, and the iteration jumps to the next day. If not, the user is first awarded
the previously unrewarded badges. The badges are stored in a minimal SQL
database on the user’s phone.
4.2 design 37
Start loop
End loop
Current date
Yes
evaluated?
Async
No
Calculate badges
which should have
been earned on this
date
SQLite
User received
Increment to next day Yes
all badges?
No
From section 4.1.1, it was identified that potential users might want to set
a structured plan and get reminders for events like workouts. A scheduling
feature is implemented for this purpose, where the user can create events
38 chapter 4 r e q u i r e m e n t s p e c i f i c at i o n a n d d e s i g n
and have the option to get reminders for specific events that are sent as push
notifications.
A notification on an event is sent 30 minutes before the time of the event. For
this to be feasible, each user’s scheduled events must be stored in the backend
server. At a frequent interval, the server then checks for any scheduled events
in the next 30 minutes. A possible solution to this is to store the entire schedule
of each user separately, then iterate over each user and their schedules. This
is highly inefficient, so instead, each singular event of every user is stored
in the same table. Sorting this table by event time makes it easy to check
whether any events occur in the next 30 minutes. If events are identified,
the notifications are sent, and the corresponding row is deleted. Figure 4.7
illustrates the process.
User
The FysBot application can fetch steps through Health Connect and Google Fit.
To use Google Fit, the user must have it installed and log into their Google
account when using FysBot. Google requires the login to authorize the user and
give consent. Step data from Google Fit can be used without further verification
while FysBot is released in the testing stage. For an open release of FysBot,
the app must be verified by Google, which involves demonstrating the app and
how the health data is being used.
Steps can also be accessed via Google’s Health Connect application, which is
a hub for different health apps to share data. The Health Connect application
is installed by default starting from Android 14. This is currently the latest
version of Android, and the usage of Android 14 is currently around 16% at
the time of writing[36]. For users with versions below Android 14, the Health
Connect application has to be manually installed, or the user could use Google
Fit instead. Using the data from Health Connect requires a complete Google
verification process that involves demonstrating the app and how the data is
used. This applies to both test releases and open releases of FysBot.
Backend Server
The backend server is designed using a proxy at the front, which terminates
the TLS communication and forwards the request to the API controller after it
has been authenticated. A TLS-certificate system is attached to the proxy for
generating and renewing the TLS-certificates that enable secure communica-
tion. The API controller reads the request and uses one or several services to
handle the processing of the request, which again might require accessing the
database or external APIs. The AI chat service is responsible for forwarding
the user query to the chatbot personas to process the query and generate a
response.
Database Schema
The system design that has been implemented is for a prototype. This sec-
tion explores a design that is scalable, has a higher fault tolerance, is more
resilient and has a stronger security. Only the most critical components are
discussed.
In the revised architecture shown in figure 4.10, the API server and the different
services are split into self-contained microservices. To provide a higher degree
of availability and fault tolerance, these microservices are replicated and can
be scaled either vertically or horizontally. Each service includes health check
endpoints to verify the availability of the service. A load balancer sitting in
front of the API server then uses health probes to route traffic to replicas that
are operational. This ensures that users can still access the system through
another replica should one of the replicas crash or overload.
Database Personas
Progress Location
Exercsises Router
review activity
Services
User profile User goal Notification Schedules User steps Hiking trips Exercises AI chat
Certbot
API controller
Nginx
notification system in this manner makes it easier to develop and maintain, and
the producers and consumers can scale independently. Using a message queue
like RabbitMQ makes it easier to guarantee that messages reach the user suc-
cessfully. It can also dynamically balance the load across the consumers.
The majority of the processing takes place in the ChatGPT service, which can
42 chapter 4 r e q u i r e m e n t s p e c i f i c at i o n a n d d e s i g n
Figure 4.9: Database schema. Diagram is taken from pgAdmin using ERD tool.
Load balancer
Users
Message queue
Figure 4.10: Scalable architecture that splits the backend concerns into separate mi-
croservices.
5
Security and Privacy
Securing the user’s data is a large focus area in this project. The data processed
by FysBot is potentially sensitive information and includes messages between
chatbot and user, location, steps and goals, and the prospect of using voice. This
data must be protected against unauthorized access and should not be shared
with others. Section 5.1 provides information learned from consulting a security
expert. Section 5.2 explains how the API endpoints are secured. Section 5.3
explains how the users’ credentials are secured. Section 5.4 explains how the
communication between the client and the FysBot server is secured. Finally,
section 5.5 explains how the users’ privacy is protected when writing messages
to the chatbot.
In addition to the token, username and password are essential parts of au-
thentication. Without the ability to refresh a token using the username and
password, access to it cannot be revoked should the user’s phone be compro-
45
46 chapter 5 s e c u r i t y a n d p r i vac y
mised. Without the username, there is no way to know which token is owned
by which user, and without the username and password, there is no way to
give the user a new token should the user reinstall the app.
The user needs to be informed that their data is being used in queries to OpenAI.
Being aware of this, the user must decide whether or not to share sensitive data.
Of course, much of the responsibility also falls on the server, which makes the
actual request to OpenAI. Instead of providing the complete message history
in the requests, a sliding window could be used to only take, for example, the
last 20 messages. The size of the window could be tuned by the user, letting
the user create a balance between privacy and quality with which the user is
comfortable. The requests should not include the user’s username unless the
user explicitly states it in one of the messages.
The API server exposes endpoints to, for example, fetch the user’s message
log. It is crucial that the request to such an endpoint is authenticated, making
sure a user is not able to fetch another user’s data. A solution to this is to give
each user an authentication token when the user starts using the app. This
token is then stored locally on the user’s phone and included in the request
when the user wants to access a protected route. A common approach to this
is to create a JSON Web Token (jwt). The jwt defines an access token
and a refresh token, where the access token is a short-lived token used to
authenticate routes while the refresh token has a longer lifetime and is used
to re-authenticate the access token. By using the JWT, the server does not
have to be concerned about a user’s session, as the required information can
be found in the user’s token. The trade-off with this approach is that the user
must create a username and password, which is required to create new tokens
when the refresh token expires. Encrypting the token residing in the user’s
phone could also be considered for extra security. The trade-off for security is
5.3 securing credentials 47
Figure 5.1 illustrates the process of protecting the API routes. The security of
this depends on the user never sharing their token or password with anyone.
Users Credentials
API
(username) (username, hash(password), token)
Password Token
HTTPS
{username: Kate, password: 1234} /api/user/createUser generateSignedToken(username)
/api/user/loginUser HTTPS
200 OK {signedToken}
/api/user/getUser
HTTPS
200 OK {data}
/api/messages/**
/api/badges/**
No No
HTTPS
401 Unauthorized
metadata is required for some functionality within the client. This strategy
becomes a safety measure against a developer who could otherwise accidentally
send the user credentials, too. In the latter case, although data transfer is
encrypted and authenticated, passing on user credentials unnecessarily should
be avoided.
The passwords within the credentials table are hashed, followed by salting. In
this case, an attacker would be unable to retrieve meaningful information from
the stored credentials easily. Even so, an extra security step could be ensuring
users occasionally update their passwords. It should also be noted that this
security measure is only efficient if the password is strong and, therefore,
difficult to guess to begin with.
The solution of using the Application Gateway resource was tested and worked
as intended, securing the communication to the Azure vm gateway and pro-
viding the backend server with decrypted requests. However, the offloading
feature provided by Azure comes at a price, and while testing, it was found that
it is far more expensive than first anticipated. With limited funding, another
solution is needed.
A different approach tested was to fetch the certificate from the Azure key
vault and use it in the backend API server to decrypt the messages. The only
problem with this is that no solution was found to effectively set and update
the certificate used by the vm. Again, it was found that Azure provides pricey
mechanisms for handling such cases, which is not an option in this project.
This led to exploring options outside the confined spaces of the Azure Portal
box and evaluating what could be done manually on the vm. It was then found
that the open-source system NGINX has the ability to do tls offloading at no
cost. NGINX acts as a proxy that intercepts all traffic and collaborates well with
the free-to-use certificate system Certbot, which provides automatic renewal
5.5 p r ot e c t i n g p r i vac y i n c h at b ot m e s s ag e s 49
of valid certificates.
Using NGINX, requests sent by the client will be picked up by the NGINX
proxy that uses its configured certificates instead of those configured by Azure.
With just a couple of lines in the configuration, tls offloading is enabled,
and the backend is served decrypted requests. Though several solutions were
attempted, this ended up being the best solution. In the implemented system,
NGINX interacts with the certificate generation system Certbot1 that generates
and automatically renews valid certificates used to enable TLS-enabled com-
munication. Figure 5.2 illustrates how an API request is decrypted by NGINX
and authenticated before accessing a resource.
HTTPS POST
/api/newSchedule
HTTP POST
/api/newSchedule
User authenticated
/api/newSchedule
Handle storing
schedule
Save(schedule)
Schedule saved
Store successful
1. https://certbot.eff.org/
50 chapter 5 s e c u r i t y a n d p r i vac y
• Location: Exact coordinates are never added to the user query. Location
is used to fetch names of hiking trips in a large radius around the user
and weather conditions, which could be added to the user query.
• Steps: Steps for the current day, as well as aggregates of steps in the
current week/month/year could be added to the user query.
To reduce the risk of personally identifying a user based on the hiking trip
recommendations, hiking trips in a large radius around the user is used. It
should be noted that the risk increases for individuals living in a sparsely
populated area.
6
Implementation
This chapter gives a description of how FysBot’s design has been implemented,
the tools used, and how FysBot is published to the Google Play Store. Section 6.1
explains the implementation of the backend server and how it is deployed to the
Azure cloud. Section 6.2 explains how the database is set up and the injection
of the exercise and hiking trip data. Section 6.3 explains the implementation
for securing API endpoints and securing communication. Section 6.4 explains
how the ChatGPT model is deployed in the Azure cloud. Section 6.5 explains
the implementation of the features in the user interface. Finally, section 6.6
describes how the app is published to the Google Play Store.
51
52 chapter 6 i m p l e m e n tat i o n
A virtual machine hosted in Azure was used to implement the backend server.
The entire deployment process was done via the Azure portal, which includes
selecting the specifications for the VM, deployment region, storage type, virtual
networks, reliability options and security. The specification is given in table 6.1.
For the prototype, the amount of compute needed is very small; thus, one of the
cheapest options was selected. The VM is deployed in Norway and uses Spot,
which is a solution provided by Azure where the VM utilizes spare capacity
in Azure’s VM pool. This gives us a VM at a cheaper cost but at the risk of
being evicted if the capacity in the VM pool is full. The latter is not desired in
a production system but is not an issue for the prototype.
Specification Value
Operating system Linux
vCPUs 1
RAM 3.5GiB
were performed directly in the backend code. The tables in the database were
created by annotating Kotlin classes as an "entity", for which Spring Boot scans
through all the entities and constructs the tables when the server is run.
The exercise and hiking trip tables contain static data and require copying
data from JSON and CSV sources. This is easiest to accomplish when initially
building the docker image and involves injecting the SQL script shown in listing
6.1 into the docker image. The exercises are available in JSON format. To be
able to copy this data to Postgres, it has to be converted to Newline Delimited
JSON (NDJSON), which is done beforehand using jq[40]. Note that in the
insert statement of "primaryMuscles", which is originally an array, only the first
element is chosen as it is found that this array always contains a single element.
By removing the array, future processing becomes easier. The hiking trips were
manually written down in a CSV file and copied using this script.
54 chapter 6 i m p l e m e n tat i o n
JSON Web Token (jwt) are used for authenticating API routes, and the backend
server handles the generation of jwts. This is done through a jwt class found
in Java’s IO package. When a user of the FysBot app creates a new profile or
signs into an existing one, a new jwt is generated based on the user’s username,
known as the "subject" of the token. In addition, the token is annotated with an
issue date and an expiration date. Using a public/private key pair generated for
the server using OpenSSL[41], the last step of the token generation is signing
it with the private key.
Table 6.2 shows every available API endpoint through the backend server. The
endpoints that are Authenticated always require a jwt and the username. In
Spring Boot, the implemented jwt filter class extends the native OncePerRe-
questFilter class, effectively intercepting all requests so that authentication
can be performed before the request is passed to the API controller. When the
server receives a request on an authenticated endpoint, the filter class checks
that the token’s signature is authentic using the server’s public key and then
extracts the subject from the token. The server can then authorize the request
by verifying that the subject matches the username within the request.
56 chapter 6 i m p l e m e n tat i o n
GET /api/user/getUser No
POST /api/user/createUser No
POST /api/user/loginUser No
Since the request has to be read by both the jwt filter class (to extract the
username) and by the destination endpoint (if the token validation process
succeeds), caching the request is required as illustrated in figure 6.1. Typically,
the request body can only be read once, as caching the body for each request
can be expensive and introduce scalability issues. However, for the moment,
this is the only identified solution to the problem. To read the request body
multiple times, Java’s HttpServletRequest and ServletInputStream classes
are extended, and the input stream reader methods are overridden to cache
each request.
6.3 securing api endpoints 57
As explained in the security chapter, the backend server has enabled Transport
Layer Security by using Certbot and NGINX. For this, the configuration shown
in listing 6.2 is added to the NGINX configuration file. The location block
specifies that incoming requests shall be proxied to the local Spring Boot server
running on port 8080 using HTTP (thereby, TLS is terminated by the NGINX
proxy).
The certificate is created using Certbot with the command shown in listing
6.3.
6.5.1 Contexts
• BadgeContext: Holds the state for earned badges. This context runs the
badge synchronization process by repeatedly checking the user’s step
count, adding new badges to the state, and storing them in the user’s
6.5 u s e r i n t e r f ac e 59
local storage when earned. On launch of FysBot, the context will load
the earned badges from the user’s local storage.
• GoalContext: Holds the state of the user’s current daily step goal. Set
goals are stored in local storage and retrieved on launch.
• StepContext: Holds the state of the user’s current steps and includes
methods for retrieving steps. It also holds the state of whether the user
has granted FysBot access to their Google Fit data. This context will
continually request the current step count and update the step context if
needed.
• ScheduleContext: Holds the state of the scheduled events set by the user.
Updates to the schedule state are stored in the user’s local storage and
loaded on launch.
• UserContext: Holds the state of the user’s username, avatar and logged
in status, as well as the state for whether it is the first time the user has
launched the app. If the user has previously created a profile, the user-
name, avatar and first-time user states are retrieved from local storage.
6.5.2 Login
The login screen is the first content displayed to the user on the initial launch
of FysBot. This screen is shown depending on whether the user owns a valid
authentication token. If the user does not have a valid token, the user is able
to either create a new account, as seen in figure 6.2a, or log in to an existing
account, as seen in figure 6.2b, in order to gain a token. Since the token will
be used most frequently for automatic authentication, the create user text
input fields are shown first, while the log-in option requires an extra button
press.
60 chapter 6 i m p l e m e n tat i o n
When the user creates a new user, the server checks whether a user already
exists with the same username; if it does, the user receives a descriptive error
message. If not, the user profile is created. The creation process involves
sending a request to the server to store the username, creation date, and hash
+ salt of the password in the backend database. In return, the user receives an
authentication token, which is stored in the local storage of the user’s phone.
This token is then used for future authentication requests.
The user is then taken to the next part of the user creation process, which
involves setting up their avatar, customizing the chatbot with a name and
avatar and finally setting a daily step goal as shown in figures 6.3a, 6.3b and
6.3c, respectively. After a valid step goal is set, the user is taken to the main
content of FysBot.
6.5 u s e r i n t e r f ac e 61
Figure 6.3: The next three steps required to complete the user profile creation after
setting a username and password.
62 chapter 6 i m p l e m e n tat i o n
An issue with the navigation bar is that it will sit on top of the keyboard
whenever the keyboard comes into view, cluttering the screen. Because of this,
the navigation bar is conditionally rendered and only shown if the keyboard
is not active. This is achieved by consuming the keyboard state from the
KeyboardContext.
The chatbot messaging component is the core part of FysBot. It displays all
messages between the user and the chatbot, as well as a text input field for
writing a new message that can be sent by pressing the arrow button. Pressing
the text input field will bring the keyboard into view, and the navigation bar will
be hidden. When the user sends a new message, an API request is sent to the
server to get the chatbot response. Based on the topic of the message, additional
information like steps or location could be required. The client will then await
the server’s response and conditionally send the required information if needed.
By consuming the ChatbotContext, the new user message and its response are
6.5 u s e r i n t e r f ac e 63
added to the message state. Since this state is used in the JSX returned by
the messaging component, any new additions to the message state cause the
component to re-render, instantly showing the new messages.
The ChatbotContext is also used to display the name and avatar of the chatbot
at the top of the tab, with the option of changing the name of the chatbot. In
combination with the UserContext, each message is accompanied by the avatar
of the user and chatbot to enhance the user experience.
Figure 6.4: Requesting exercise recommendations. erp found the following parame-
ters in the first query: level=beginner, category=cardio.
Figure 6.5 shows the user asking for progress review within the app. The
64 chapter 6 i m p l e m e n tat i o n
Progress Review Persona will request the user’s steps and craft a response
based on the steps.
Figure 6.6 shows the user asking for hiking trips. The Location Activity Persona
will request the user’s location, fetch nearby hiking trips and the current weather
conditions at that location, and use it in its recommendation.
The daily schedule feature allows the user to create events for the current day
and have the option to get notifications on specific events. As shown in figure
6.7b, the user is able to add new events by pressing the plus icon, which brings
up the event customization modal shown in figure 6.7a. Here, the user is able
to set the hour and minute of the event and optionally press the notification
symbol to receive a notification before the event takes place.
6.5 u s e r i n t e r f ac e 65
To display the existing events in the schedule, the component consumes the
ScheduleContext and retrieves the schedule state. Creating a new scheduled
event will add the event to the state, which re-renders the list of scheduled items
shown in figure 6.7b. Each item is sorted by time before rendering. Adding an
item with notification enabled will issue an API request with username, time
and event title to the server.
66 chapter 6 i m p l e m e n tat i o n
6.5.8 Badges
The badges, shown in figure 6.8, are based on the user’s daily step progress
and can be earned by walking a certain amount of steps. It consumes the
BadgeContext and aggregates the number of times each badge has been earned.
This number is then displayed in the corner of each badge. Pressing a badge
will display the requirements for how the user can earn it.
The profile tab allows the user to set a new daily step goal and review their
step count. The step count is fetched from the StepContext and displayed both
in a circle that shows the step count for the current day and in a bar chart for
the current week, as seen in figure 6.9. The circle can also display the step
progress directly against the current goal, shown in the same figure.
6.5 u s e r i n t e r f ac e 67
Push notifications are provided through the Google service Firebase Messag-
ing[42]. The user may get notifications on goals reached or for upcoming
scheduled events. To enable Firebase Messaging, the FysBot application is
registered in the Firebase console through their web portal. From the web
portal, a JSON file is downloaded containing the API key for the messaging
service along with other metadata such as project identifiers. This JSON file
must be placed under /app within the /android root folder to enable Firebase
Messaging on the client. The Firebase React Native API can then be used to
handle incoming notifications and fetch the Firebase token associated with the
user’s mobile device. This token is sent to the server when the user logs in or
creates a new profile in the FysBot app.
In the backend server, a different JSON file is required. This file is downloaded
68 chapter 6 i m p l e m e n tat i o n
Figure 6.9: The user profile which displays step counts and the step goal, which can
be updated by pressing the "Set goal" button.
from the Google Cloud Console and contains metadata such as the ID of the
client sending the push notifications. It is used to retrieve the server’s Firebase
token, which is necessary for authenticating the server against the Firebase API.
The backend server can then send notifications to registered users by including
the user’s Firebase token in the API request.
published by uploading the signed aab. Google will then perform a verification
process to check the validity of the signature and make sure that the application
does not request unauthorized permissions. The permissions are, for example,
reading Google Fit steps, which is allowed in the internal testing stage. If the
verification process is successful, the application can then be published. For
users to be able to download FysBot, their Gmail accounts must be added to a
list of test users within the Google Play Console.
An important thing to note is that Google will have its own certificate for
signing the published build. This certificate has to be used to authenticate
FysBot against other Google and third-party APIs like Google Fit. To fix this,
the SHA-1 fingerprint of the publishing certificate is added to the credentials
of the Google account used to publish the application.
7
Evaluation and Result
In this chapter, an evaluation, and the results, of the usability study is provided
in section 7.1. This includes the time used for the different tasks as well as the
most notable comments from the participants. In the following section, 7.2, an
evaluation of the system performance and cost is given.
NO Task
1 Download and install the FysBot app
71
72 chapter 7 e va l u at i o n a n d r e s u lt
Participants were selected from among friends and colleagues. Five participants
aged 20-60 were included in this test. All participants are considered highly
proficient with technology. Participants were sent a link via their Gmail to
download the app. Those who did not own Android devices could borrow one
for the sake of the test.
Since FysBot was released on an internal test stage, participants might not have
necessarily found it in their Google Play store. In most cases, the participants
7.1 u s a b i l i t y s t u dy 73
had to be given the download link directly. This caused some complications
with the time measurements, so they were not calculated for this task. In
any case, none of the participants experienced any issues downloading and
installing the app after receiving the link.
The first four tasks involved downloading and installing the FysBot app, creating
a user account, customizing the chatbot, and setting a step goal.
After opening FysBot for the first time, the participants are presented with a
Google account login pop-up to enable Google Fit data collection. No problems
were encountered in this step, although one participant stated that it would
be nice to know why this login was necessary. After logging into their Google
account, the next step was to create a new user profile. Here, the user first sets
their username, selects their avatar, and customizes the chatbot with its own
name and avatar.
Two participants did not find the chatbot customization intuitive, as they did
not realize why they had to select an avatar a second time (not knowing it was
for the chatbot). This can be seen by looking at the times for participants 2 and
3 to complete Task 3 in figure 7.1. It was also mentioned that the selected avatar
could be made more clear, as people with vision problems might have difficulty
seeing it. The last step of the ’create user’ process was to set a step goal, where
one of the participants noted that it would be nice to know what a good step
goal for them would be. For tasks 2 and 4 in figure 7.1, some participants spent
more time thinking about their username and step goal.
7.1.4 Chatbot
There are seven tasks that revolve around interactions with the chatbot (5, 7, 10,
11, 12, 13 and 16 in table 7.1). The time to complete these tasks is not included, as
participants had no issues navigating to the chatbot tab and asking the chatbot
the appropriate questions to get the information they wanted. However, it is
also in these tasks that the most critical user experience issues were discovered
and are discussed further in section 8.1.2.
Overall, users were satisfied with the chatbot’s responses to hiking trip sug-
gestions, step reviews and exercise recommendations. However, they were not
74 chapter 7 e va l u at i o n a n d r e s u lt
Figure 7.1: Time taken to complete task 2: Sign in to FysBot, task 3: Give the chatbot
a name, and 4: Set a step goal.
entirely satisfied with the responses to the follow-up questions. Two partici-
pants tried to ask for hiking trips near a specified location, unaware that the
chatbot only uses the user’s current position. One of the participants tried to
ask for more information about a particular hiking trip using the trip name.
The chatbot did not understand the query since it’s not programmed to give
additional details on specific hiking trips.
Exercise Recommendations
Steps Review
All participants successfully got a step review response on their first try, although
the response content was not satisfactory due to a bug in the code which
recorded the wrong step count. This is a critical error which must be fixed.
One participant did not have Google Fit installed but still tried to complete
the step review task, although the chatbot responded by stating that it did
not have access to the steps. Another participant did have Google Fit installed,
but FysBot was unable to collect the step data. Additionally, one participant
felt that the chatbot’s response lacked sufficient focus on the number of steps,
desiring more concrete statistics.
Task 8 involved going to the user’s profile tab and changing the step goal
the user initially set when creating their profile. In figure 7.2, it can be seen
that Participant 5, in particular, took a long time to complete this task. Like
Participant 4, they tried asking the chatbot to change the step goal before
realizing it had to be done manually in the profile tab. Participant 2 was
initially prevented from setting the step goal because they mistyped it and
tried to set a goal over 100 000 steps, which the app did not allow.
All participants successfully found the step overview of task 14 in the user
profile tab. As seen in figure 7.2, there were no issues related to this task.
Task 6 involved finding and reading information about FysBot, for which most
participants had no problems, as seen in figure 7.3. However, Participant 4
tried to ask the chatbot first before identifying the information tab in the top
right corner of the application. The information button and the information tab
within the app is shown in figure 7.4. They then suggested that the information
tab should have been presented right after logging into FysBot.
76 chapter 7 e va l u at i o n a n d r e s u lt
Figure 7.2: Time taken to complete task 8: Change step goal and task 14: Check the
overview of steps.
(a) The information button (b) The information displayed after pressing the
(indicated by the arrow). information button.
Figure 7.3: Time taken to complete task 6: Find and read information about FysBot.
In task 9, participants were asked to set a physical activity plan for the day
in the schedule tab. Three of the participants assumed that they were to set
up an exercise routine, creating schedule entries with exercise names and the
duration of that exercise. Because of this, they were unsure of the purpose of
the notification option.
The time to complete task 9 is shown in figure 7.5 and was measured from
when the user read or was given the task until the first scheduled event was
created. Participant 1 spent a little time looking for the correct tab to create
the events but had no problems after that. Participant 2 initially did not set
the hour of the event as it was assumed the scheduled events were exercises
in a workout plan (and thus did not need the hour component). Participant 3
initially asked the chatbot to create the plan but had no problems after finding
the correct tab. Participant 5 used the longest time and thought the schedule
was for creating a workout routine for the day. In addition, this participant did
not set the hour component for the same reason as Participant 2 and created a
title that was too long. Some participants preferred longer titles in the event
as this was limited to 20 characters.
78 chapter 7 e va l u at i o n a n d r e s u lt
Task 15, checking how many badges the user has received in the badges tab,
was done with no problems, as evident in figure 7.5. Four of the five participants
did, however, have some comments about the design of the badge tab. They
found it unintuitive to know whether or not a badge had been earned because
of the color options used. Two of them also thought they should already have
received some of the badges based on their current step count (in the current
version, badge progress is only recorded after installation of FysBot).
Figure 7.5: Time taken to complete task 9: Make a physical activity plan for the day
and task 15: Check how many badges you have have received.
Each test ended with asking the participants to give general feedback about
FysBot, and they were encouraged to comment on the design, too. The following
lists some of their suggestions for improvement that have not been stated
previously:
• Edit font size. It should be possible to increase the size of the font.
• Chatbot name editor. The chatbot name edit feature was not intuitive.
• Emphasise chatbot tab. Since the chatbot is the app’s main feature, it
would be nice if the tab option in the tab navigation bar was somehow
more dominant than the other options.
• Information. When using the app for the first time, some information
about the usage of the app and the abilities of the chatbot should be
presented immediately.
• Wearable sensors. The total step count could take into account the steps
registered on wearable devices.
• Hiking trip difficulty. The difficulty level of the hiking trip could be
stated to get more appropriate suggestions.
• Hiking trip location. Could have a map to show the location of the
hiking trip.
FysBot aims to motivate people to become more physically active. Each design
and implementation decision strives to solve the challenge of motivating and
guiding individuals towards improved physical activity. Therefore, the features
of the system are influenced by this objective. By contemplating the problem
that FysBot seeks to address, each decision is made to align with the user’s
needs.
In section 3.2, two fictive users and several user stories were presented. This is
used to concretize the problem that needs to be addressed and from which a
set of features can be outlined. The features are then realized in the prototype
of FysBot. The prototype includes all the features that were scheduled for this
project.
To ensure that there is value in the design decisions and that the implemented
81
82 chapter 8 discussion
system works as intended, it is ideal that new prototypes are pushed out and
tested constantly. Unfortunately, only one prototype of FysBot was created
during this project. To some extent, this was because FysBot has a single
developer, but even so, delivering multiple prototypes could have still been
possible. This could have been done by accepting that parts of the application
need not be finished or even functional for it to be evaluated. One concern is
finding participants to test the prototypes, as having multiple usability tests
with multiple users is time-consuming. For this project, if multiple prototypes
were created, having the PhD student test each prototype would have been a
great option.
Section 7.2 provided an evaluation of the performance and cost of the system
as a whole. With such a small group of users over a short period, the reliability
of these results most likely does not transfer to a scenario with more users.
However, one could use the cost from the usability study to project costs for
many users.
Findings
Most users thought the daily schedule feature was a method for setting up a
workout plan and inputting the exercise name and the duration of the exercise.
This could partly be due to how the task was formulated: "Make a physical
activity plan for the day". The title of the schedule tab could be updated to avoid
future misunderstandings. In addition, a date should be displayed, possibly
under the title. There was also some dissatisfaction about the legal length
of the title on a scheduled event. This is set to a maximum of 20 characters
and should be increased. Some users expressed a desire to set a weekly plan
instead, which is a good idea and should be implemented in the future. Perhaps,
users can have the option to choose the kind of plan they would like to set.
There was also a desire to update scheduled events after creation. This can
easily be fixed by implementing an on press listener for each event, enabling an
8.1 s o f t wa r e d e v e lo p m e n t pr o c e s s 83
editorial mode. Lastly, in the daily schedule feature, some users wondered what
enabling notification on an event did for them (most likely due to thinking the
daily schedule was a workout routine planner). The text beside the notification
button could be more descriptive to prevent future confusion. Another option
could be to enable an informational pop-up text box to appear and explain it
when the user first enters the schedule tab.
For the tasks relating to the chatbot, the participants were able to ask for exercise
recommendations, hiking trips and step progress reviews easily. However, they
received unexpected responses to some of the follow-up questions. For the
hiking trip recommendation task, users successfully got recommendations on
the first try, but some users wanted more information about specific trips, like
route information. The first issue to address with this is to inform the user
that this type of information is not available at the moment, possibly through
a response from the chatbot. Attempts have been made to make this sort of
functionality available by using an open database provided by Kartverket that
contains detailed information on hiking trips (route information, difficulty,
etc.). However, due to several problems in using the database, implementing
this functionality proved harder than anticipated. Kartverket was contacted to
resolve the issues, but they could not help. The second issue is that the chatbot
mistakenly recognized the request for additional information as a request for
general hiking trip recommendations, for which it simply repeated the initial
recommendation. This sort of problem also occurs with the Progress Review
Persona as any follow-up questions, like "how many steps should I be walking?"
caused the prp to repeat the user’s step progress.
Limitations
For the usability test, all participants were quite proficient with technology and
had previously used chatbots like ChatGPT. This is a limitation of the study,
which could have included a more diverse group.
The study had no strict rules about the order in which participants completed
the tasks, which also made time measurements difficult. It is thought that
being more strict about following the exact order could give more accurate
results. The time measurements were also taken by listening to the recordings
of each participant, but ideally, this should have been done while observing
the participant’s actions within the application. The trade-off is that this could
be disturbing to the participant if it is not done in a subtle manner. Optionally,
accurate timings after the fact could be achieved using analytics tools, like the
ones described in section 8.6.
unclear how long this will take, but finishing a working version on Android
with the backend server, security, and AI takes a substantial amount of time. It
was, therefore, decided that improving the quality of the application is more
valuable at this time.
One of the reasons for choosing a social media platform, like Messenger or
Telegram, is that they already have large user ases, making it easier to reach a
larger population. In this case, one can avoid having the user install another
app to use the chatbot as they are most likely already using a popular social
media messaging platform. It could also cause the chatbot to be thought of as
another friend, which could have positive psychological effects.
Another big reason for using existing social media platforms is that implemen-
tation is much quicker and requires less software development knowledge. The
social media messaging platform already has a messaging interface, it secures
data in traffic, and runs on the social media providers servers. To host the
chatbot itself, an independent server is still needed to run the backend Natural
Language Processing system, which makes the necessary API calls to chat with
the user. There could also be a need for installing an independent app even if a
social media platform approach is used. This could be to, for example, collect
the user’s steps and send them to the chatbot server.
The limitation of using existing social media messaging platforms is that there
are few opportunities to implement features outside the messaging interface.
Most often, one is restricted to the existing features of the messaging platform.
One is also heavily restricted to the messaging platform’s policies and the
belief that the user’s data is secure and not misused for political agendas[46]
or otherwise.
Selecting the right messaging platform can be a problem. Among the youth
in Norway, in terms of usage, the top-ranking platforms where messaging is
a core component are: Snapchat (95%), Instagram (90%), Messenger (62%)
and Discord (25%)[47]. Other platforms like WhatsApp and Telegram see less
than 10% of usage[47]. Of these, Snapchat and Instagram are not suitable
for implementing chatbots, and it is unlikely that the user already uses What-
sApp or Telegram. Norway also prohibits Norwegian ministers and officials
from using Telegram along with TikTok, so these are also not considered safe
options[48].
and it was found that Messenger offers an easy-to-use API for conversing with
users. The problem with the Messenger chat API is that its design is focused on
marketing and has a few restrictions that make it hard to implement Behaviour
Change Techniques. One of these policies implements a restriction on when
the chatbot is allowed to send the user a message. Specifically, the chatbot
is only allowed to send the user a message within 24 hours of receiving a
message from the user. When the user sends a new message to the chatbot,
this 24-hour timer resets. This restriction was explored in the capstone project
[9] and heavily affected the study by To, Quyen G and Green, Chelsea and
Vandelanotte, Corneel[49], as the policy was implemented during the test trial
of the chatbot. This is evident that sudden policy changes in a social media
platform can significantly affect chatbot use. The authors of [49] later decided
to implement a standalone application.
At the time of writing, Meta has released a new policy allowing them to use
the users’ data to improve their AI models, including messages sent between
the user and professional accounts[50]. If FysBot were to be released on the
Messenger platform, it would be considered a professional account, and thus,
there would be some concerns about the privacy of the users’ data.
For the first point, a new design for routing queries has been implemented.
8.8 d e s i g n r e v i s i o n a f t e r u sa b i l i t y s t u dy 89
Previously, a message annotated with user was injected with the descriptions of
all the other chatbot personas (figure 4.2), and the model was asked which of
these descriptions best fit the given user query. In the new design, the Routing
Persona instead utilizes OpenAIs function calling API (see function calling in
section 2.4.2), where each of the other personas is given dummy functions that
could be called. The query is then routed based on which function the model
has decided to use. It is found that the rp now selects the correct persona
much more frequently.
For the second point, the chatbot personas are now given much more freedom
in their responses. Previously, their recommendations and suggestions were
almost static, like the Exercise Recommender Persona who tries to find suitable
exercises but then only gives the user a simple list (figure 6.4). In retrospect, this
is not a good use of a powerful llm like ChatGPT. In the newly implemented
design, the personas are given the external data, but it is up to them to decide,
based on the user’s query, how to use this data in their response. This opens
up the possibility for a much wider range of conversations. An example of
this is shown in figure 8.1, where the erp has to fetch the exercises from the
database matching the user’s specification and use them to satisfy the user’s
request.
90 chapter 8 discussion
Figure 8.1: Asking more complex questions using the new design.
After implementing these three changes, the chatbot seems to have improved
significantly, but ideally, a new usability study should be conducted to verify
this.
After the completion of the usability study, some less critical issues were also
fixed. Since many of the participants found the chatbot customization step in
the create a user process unintuitive, the app’s design has been altered with a
new and more descriptive title. In addition, the daily schedule entries are now
deleted after the event time has expired.
8.9 f ac i l i tat i n g f u t u r e co n t i n u at i o n o f f y s b ot 91
The Azure resources are currently located under the author’s Azure subscription
and has to be moved to the research group’s subscription to avoid redoing the
creation process. The necessary steps for this transfer has been researched,
and the author will be available to assist once specific details about where
the resources should be moved have been finalized. The author will also be
available to assist in extracting data that is stored on the Azure vm after the
transfer has been completed.
RQ1: How can a chatbot be developed using ChatGPT to help users become
more physically active?
Through the use of the implemented chatbot personas, ChatGPT is instructed
to provide information on different topics related to physical activity. Further,
the use of OpenAIs function calling API makes it easy to extract relevant
information from the user query. This information is then used to call other
APIs or make database queries to give personalized responses. Whenever the
topic of the user query does not match any of the persona descriptions, the
chatbot still attempts to help the user by utilizing the vast knowledge already
found in ChatGPT.
The chatbot personas are able to give exercise recommendations, hiking trip
suggestions and review the users’ step progress. They have been implemented
with modularity in mind, allowing new personas to be added easily. The
information they provide will help the user discover different options to be
physically active and hopefully motivate them to maintain a more active
lifestyle. Additionally, the chatbot is designed to avoid repetitive responses and,
to a large degree, feel like a human. This helps retain user engagement and is
92 chapter 8 discussion
Using the OpenAI API to use ChatGPT, assuring that the privacy of the users’
data is maintained becomes an obstacle. FysBot handles this by using an Azure
deployment of ChatGPT, located in Sweden, ensuring compliance with GDPR
legislation and that the users’ data is not used to improve future OpenAI models.
It is also found that the data will not be moved from the location where the
model is deployed. Even so, steps have been taken to ensure no personally
identifiable data is included in the queries sent to ChatGPT.
The following discusses future work that can be done to further improve
FysBot’s user experience and system design. Section 9.1 gives a discussion of
functionality that can be added to FysBot to improve user experience. Section
9.2 discusses adding a feature that allows health professionals to help users
through FysBot. Section 9.3 discusses some of the system design changes that
can be made to improve FysBot’s backend system.
93
94 chapter 9 future work
The users of FysBot could benefit from social interactions within the app to help
them stay motivated in their goal of becoming more active. This could include
chatting with friends and posting achievements on a timeline shared with all
of the user’s friends. By also having the means for creating workout plans,
users could share these plans as well as coordinate group workouts so they can
help each other be active. There could also be global events like challenges or
competitions that are posted in which the user could compete with friends and
have a leaderboard ranking. Implementing these social aspects will cover user
stories 8 and 9 of table 4.1.
9.1.3 Gamification
Together with badges, avatars were first intended as another method of adding
gamification to FysBot to increase the user’s motivation to be active and have
ties to the social aspects in section 9.1.2. The user’s avatar was supposed to be
customizable by applying customization options gained from reaching different
step goals. Furthermore, the user could be rewarded with different avatars or
receive other visual rewards to show their progress. Due to the lack of large sets
of available open-use avatars of high quality and limited graphic design skills,
this reward system has not been implemented. Attempts were made to use AI
solutions like OpenAI’s Dall-e image generator to create the avatars. However,
this result did not align with the vision for the avatars, and no more time was
spent on this topic due to not being a high-priority feature. This feature would
be a great addition to FysBot for future work, especially in combination with
the social aspects discussed in section 9.1.2.
9.2 p r o f e s s i o n a l i n t e g r at i o n 95
Through the usability study, it was found that the chatbot could, in some
cases, give undesired responses. In most cases, these are related to mistakenly
identifying a message as a request for step review or hiking trip suggestions,
as discussed in section 8.1.2. A solution to this is explained in section 8.8 but
should be further tested. Another solution that could be explored is using
OpenAI’s new Assistants API, which is currently in beta[52].
97
Bibliography
[1]Darren E.R. Warburton, Crystal Whitney Nicol, and Shannon S.D. Bredin.
“Health benefits of physical activity: the evidence.” In: CMAJ 174.6
(2006), pp. 801–809. i s sn: 0820-3946. d oi: 10 . 1503 / cmaj . 051351.
eprint: https : / / www . cmaj . ca / content / 174 / 6 / 801 . full . pdf. u r l:
https://www.cmaj.ca/content/174/6/801.
[2] World Health Organization. “More Active People for a Healthier World.”
In: Global action plan on physical activity 2018–2030: more active people
for a healthier world (2018).
[3] WHO. "Age-standardized prevalence of obesity among adults". Last ac-
cessed 15 April 2024. 2022. u r l: https://data.who.int/indicators/i/
BEFA58B.
[4] WHO. Prevalence of overweight among adults. Last accessed 15 April
2024. 2022. u r l: https://www.who.int/data/gho/data/indicators/
indicator- details/GHO/prevalence- of- overweight- among- adults-
bmi-greaterequal-25-(crude-estimate)-(-).
[5] FHI. Fysisk inaktivitet - voksne (indikator 7). Last accessed 2 April 2024.
2023. u r l: https://www.fhi.no/is/ncd/fysisk- aktivitet/voksne/
?term=.
[6] Corneel Vandelanotte et al. “Increasing physical activity using an just-
in-time adaptive digital assistant supported by machine learning: A
novel approach for hyper-personalised mHealth interventions.” en. In:
J. Biomed. Inform. 144.104435 (Aug. 2023), p. 104435.
[7] Wendy Wlasak, Sander Paul Zwanenburg, and Chris Paton. “Supporting
autonomous motivation for physical activity with chatbots during the
COVID-19 pandemic: Factorial experiment.” en. In: JMIR Form. Res. 7
(Jan. 2023), e38500.
[8] Carol Ann Maher et al. “A physical activity and diet program delivered
by artificially intelligent virtual health coach: Proof-of-concept study.”
en. In: JMIR MHealth UHealth 8.7 (July 2020), e17558.
[9] Sondre Elvebakken Løvås. Exploring Chatbot Design and the Feasibility
of securely implementing a chatbot using ChatGPT. Unpublished work.
[10] C J Caspersen, K E Powell, and G M Christenson. “Physical activity,
exercise, and physical fitness: definitions and distinctions for health-
99
100 BIBLIOGRAPHY
related research.” en. In: Public Health Rep. 100.2 (Mar. 1985), pp. 126–
131.
[11] James O Hill, Holly R Wyatt, and John C Peters. “Energy balance and
obesity.” en. In: Circulation 126.1 (July 2012), pp. 126–132.
[12] Kevin D. Tipton and Robert R. Wolfe. “Exercise, Protein Metabolism, and
Muscle Growth.” In: International Journal of Sport Nutrition and Exercise
Metabolism 11.1 (2001), pp. 109 –132. d oi: 10.1123/ijsnem.11.1.109.
u r l: https://journals.humankinetics.com/view/journals/ijsnem/
11/1/article-p109.xml.
[13] Pedro A. Villablanca et al. “Nonexercise Activity Thermogenesis in Obe-
sity Management.” In: Mayo Clinic Proceedings 90.4 (2015), pp. 509–519.
i s sn: 0025-6196. d oi: https://doi.org/10.1016/j.mayocp.2015.02.
001. u r l: https://www.sciencedirect.com/science/article/pii/
S0025619615001238.
[14] Eleni Adamopoulou and Lefteris Moussiades. “Chatbots: History, tech-
nology, and applications.” In: Machine Learning with applications 2 (2020),
p. 100006.
[15] Ashish Vaswani et al. “Attention is All you Need.” In: Advances in Neural
Information Processing Systems. Ed. by I. Guyon et al. Vol. 30. Curran
Associates, Inc., 2017. u r l: https://proceedings.neurips.cc/paper_
files / paper / 2017 / file / 3f5ee243547dee91fbd053c1c4a845aa - Paper .
pdf.
[16] Vipula Rawte, Amit Sheth, and Amitava Das. “A survey of hallucination
in large foundation models.” In: arXiv preprint arXiv:2309.05922 (2023).
[17] Angie K Reyes, Juan C Caicedo, and Jorge E Camargo. “Fine-tuning
Deep Convolutional Networks for Plant Recognition.” In: CLEF (Working
Notes) 1391 (2015), pp. 467–475.
[18] Inc Meta Platforms. Retrieval Augmented Generation (RAG) for LLMs. Last
accessed 09 June 2024. 2024. u r l: https://www.promptingguide.ai/
research/rag.
[19] OpenAI. Chat Completions API. Last accessed 6 April 2024. 2024. u r l:
https://platform.openai.com/docs/guides/text- generation/chat-
completions-api.
[20] GDPR EU Ben Wolford. What is GDPR, the EU’s new data protection law?
Last accessed 8 April 2024. 2024. url: https://gdpr.eu/what-is-gdpr/.
[21] GDPR-info.eu. Art. 5 GDPR: Principles relating to processing of personal
data. Last accessed 8 April 2024. 2024. url: https://gdpr-info.eu/art-
5-gdpr/.
[22] M. Goodrich and R. Tamassia. Introduction to Computer Security. Pearson,
2014.
[23] Eric Rescorla and Nagendra Modadugu. Datagram transport layer secu-
rity. Tech. rep. 2006.
[24] Eric Rescorla. The transport layer security (TLS) protocol version 1.3. Tech.
rep. 2018.
BIBLIOGRAPHY 101
[25] Michael B. Jones, John Bradley, and Nat Sakimura. JSON Web Token
(JWT). RFC 7519. May 2015. d oi: 10 . 17487 / RFC7519. u r l: https :
//www.rfc-editor.org/info/rfc7519.
[26] Inc Meta Platforms. Introducing JSX. Last accessed 21 May 2024. 2024.
url: https://legacy.reactjs.org/docs/introducing-jsx.html.
[27] Pekka Abrahamsson et al. “Agile software development methods: Review
and analysis.” In: arXiv preprint arXiv:1709.08439 (2017).
[28] Maarten Van Someren, Yvonne F Barnard, and J Sandberg. “The think
aloud method: a practical approach to modelling cognitive.” In: London:
AcademicPress 11.6 (1994).
[29] Microsoft. Data, privacy, and security for Azure OpenAI Service. Last
accessed 10 May 2024. 2024. u r l: https://learn.microsoft.com/en-
us/legal/cognitive-services/openai/data-privacy.
[30] Dillys Larbi et al. “What do adults living with obesity want from a chatbot
for physical activity? – a qualitative study.” In: BMC Digital Health 2.1
(2024), p. 15. i s sn: 2731-684X. d oi: 10 . 1186 / s44247 - 024 - 00070 - 3.
url: https://doi.org/10.1186/s44247-024-00070-3.
[31] Inc Meta Platforms. Discover the possibilities with Meta Llama. Last
accessed 09 June 2024. 2024. u r l: https://llama.meta.com/.
[32] Inc. LangChain. langchain 0.2.3. Last accessed 13 June 2024. 2024. url:
https : / / api . python . langchain . com / en / latest / langchain _ api _
reference.html#module-langchain.chains.
[33] yuhonas. free-exercise-db. Last accessed 13 June 2024. 2024. url: https:
//github.com/yuhonas/free-exercise-db.
[34] Den Norske Turistforening. Finn din tur blant tusenvis av turforslag
og hytter i hele Norge. Last accessed 13 June 2024. 2024. u r l: https:
//ut.no/.
[35] Norwegian Meteorological Institute (met.no) and the Norwegian Broad-
casting Corporation (NRK). Make something useful with data from the
Meteorological Institute. Last accessed 13 June 2024. 2024. u r l: https:
//developer.yr.no/.
[36] Eugene et al. Android API Levels. Last accessed 13 June 2024. 2024. url:
https://apilevels.com/.
[37] Google. Improve your app’s security. Last accessed 13 June 2024. 2024.
u r l: https : / / developer . android . com / privacy - and - security /
security-best-practices#internal-storage.
[38] Microsoft. What is Azure Application Gateway? Last accessed 09 June 2024.
2024. u r l: https://learn.microsoft.com/en-us/azure/application-
gateway/overview.
[39] Microsoft. What is Azure Application Gateway? Last accessed 20 April 2024.
2023. u r l: https://learn.microsoft.com/en-us/azure/application-
gateway/ssl-overview.
[40] jq. jq. Last accessed 13 June 2024. 2024. u r l: https://jqlang.github.
io/jq/.
102 BIBLIOGRAPHY
[41] OpenSSL Project Authors. OpenSSL. Last accessed 13 June 2024. 2024.
url: https://www.openssl.org/.
[42] Google. Firebase. Last accessed 13 June 2024. 2024. u r l: https : / /
firebase.google.com/.
[43] Google. Google Play Console. Last accessed 13 June 2024. 2024. u r l:
https://play.google.com/console/.
[44] Google. Google Marketing Platform. Last accessed 13 June 2024. 2024.
url: https://marketingplatform.google.com/about/analytics/.
[45] Matomo. Matomo. Last accessed 13 June 2024. 2024. u r l: https : / /
matomo.org/.
[46] Joanne Hinds, Emma J Williams, and Adam N Joinson. ““It wouldn’t
happen to me”: Privacy concerns and perspectives following the Cam-
bridge Analytica scandal.” In: International Journal of Human-Computer
Studies 143 (2020), p. 102498.
[47] Turi Reiten Finserås et al. “Reexploring problematic social media use
and its relationship with adolescent mental health. Findings from the
“LifeOnSoMe”-study.” en. In: Psychol. Res. Behav. Manag. 16 (Dec. 2023),
pp. 5101–5111.
[48] The Local. Norwegian government bans ministers and officials from using
TikTok. Last accessed 1 June 2024. 2023. u r l: https://www.thelocal.
no/20230321/norwegian-government-bans-ministers-and-officials-
from-using-tiktok.
[49] Quyen G To, Chelsea Green, and Corneel Vandelanotte. “Feasibility,
Usability, and Effectiveness of a Machine Learning–Based Physical Ac-
tivity Chatbot: Quasi-Experimental Study.” In: JMIR Mhealth Uhealth
9.11 (2021), e28577. i s sn: 2291-5222. d oi: 10.2196/28577. u r l: https:
//mhealth.jmir.org/2021/11/e28577.
[50] DAIR.AI. Guidelines for privacy. Last accessed 09 June 2024. 2024. u r l:
https://www.facebook.com/privacy/policy/version/25238980265745528.
[51] Docker Inc. Docker. Last accessed 13 June 2024. 2024. u r l: https :
//www.docker.com/.
[52] OpenAI. Assistants API. Last accessed 13 June 2024. 2024. u r l: https:
//platform.openai.com/docs/assistants/overview.
A
User Testing Procedures
103
104 appendix a user testing procedures
Kort om personvern
Vi vil bare bruke opplysningene om deg til formålene vi har fortalt om i dette skrivet. Vi
behandler personopplysningene konfidensielt og i samsvar med personvernregelverket. Du
kan lese mer om personvern på neste side.
Etter prosjektslutt vil alle opplysningene om deg bli slettet. Du vil ikke bli gjenkjent i
eventuelle publikasjoner.
Dine rettigheter
Så lenge du kan identifiseres i datamaterialet, har du rett til:
• å be om innsyn i hvilke opplysninger vi behandler om deg, og få utlevert en kopi av
opplysningene,
• å få rettet opplysninger om deg som er feil eller misvisende,
• å få slettet personopplysninger om deg,
• å sende klage til Datatilsynet om behandlingen av dine personopplysninger.
Vi vil gi deg en begrunnelse hvis vi mener at du ikke kan identifiseres, eller at rettighetene
ikke kan utøves.
Spørsmål
Hvis du har spørsmål eller vil utøve dine rettigheter, ta kontakt med:
• André Henriksen
[email protected]
+47 77 64 52 14
• Vårt personvernombud: [email protected].
Hvis du har spørsmål knyttet til Sikts vurdering av prosjektet, kan du ta kontakt på e-post:
[email protected], eller på telefon: 73 98 40 40.
Jeg har mottatt og forstått informasjon om prosjektet FysBot: En Chatbot-drevet App for Økt
Fysisk Aktivitet, og har fått anledning til å stille spørsmål. Jeg samtykker til:
å delta i applikasjons-testing
Jeg samtykker til at mine opplysninger behandles frem til prosjektet er avsluttet
a.3 sikt assessment 111
FysBot Project
Think-aloud protocol – max 60 minutes
Description:
Concurrent think-aloud method – participants complete specific tasks and think aloud
simultaneously. That is, participants voice out everything they see, do or think related to the
assigned tasks.
Metrics:
Procedure:
• Welcome participant
• Explain the reason the participant is there. Show example of think aloud.
• Ask if the participant has read, understood and signed the informed consent
• Take the informed consent from the participant and check if it has been signed
• Ask if they have any questions about the testing
• Explain the process:
You will be asked to perform certain tasks related to the app/chatbot. In the process of
performing these tasks, you are required to think out loud. You do not need to think about
what you are going to say first. Just say whatever comes to mind when you look at the screen
and perform the tasks, including saying the things you are doing to perform the task. You can
also comment on the appearance of the app, chatbot, buttons, etc. There is no wrong way to
do this, so just feel free to say anything that comes to mind.
Preparation – print informed consent, find room for testing, recruit participants by
invitation
Scheduling – find out when participants, observers and a room are available
Location – convenient for participants
Prototype – FysBot app/chatbot
Observers - 2 people observe and write down what participants say. Compare notes at
the end of testing