Modeling and Analysis of Emotion-Oriented Goal Models: Virtual Clinics Case Study Mashail N. Alkhomsan1,2, Malak Baslyman1,3 and Mohammad Alshayeb1,4 1 Information and Computer Science Department, King Fahd University of Petroleum and Minerals, Dhahran 31261, Saudi Arabia 2 Computer and Information Sciences Department, Jouf University, Sakaka 72388, Saudi Arabia 3 Interdisciplinary Research Center for Intelligent Secure Systems, Dhahran 31261, Saudi Arabia 4 Interdisciplinary Research Center for Finance and Digital Economy, Dhahran 31261, Saudi Arabia Abstract [Context & Motivation] Understanding and capturing user emotional requirements are important to increase user acceptance and provide an enhanced user experience. This is essential to ensure continuity of using software systems and have successful adoption of technology. [Question/problem] Incorporating emotional requirements into Requirements Engineering (RE) activities is relatively new. In addition, there is a lack of analysis methods that enable reasoning on design alternatives while considering user emotions. [Principal ideas/results] We propose an Emotion-Oriented Requirements Engineering (EmORE) approach that supports the elicitation, modeling, and analysis of user emotions in relation to other requirements. The effectiveness of EmORE was illustrated by conducting a case study on a Virtual Clinic application, which showed an increase in overall positive emotions and a decrease in negative emotions. [Contribution] The main contributions of the EmORE are providing means for more accurate user emotions elicitation, enabling the analysis of user emotions in relation to the design elements, and quantifying user emotions. Keywords 1 Emotional Goal, Modeling, Analysis, GRL. 1. Introduction Nowadays, software technology is widely adopted in all sectors where humans are intensively interacting with those solutions on a daily basis. However, incorporating human-related aspects, such as emotions and values, into the software design process to provide a better user experience [1] is not a straightforward task. Several studies attempted to address users' emotions in software development; however, the way emotions were addressed was ad-hoc and lacked a comprehensive view [1]–[4]. In this research, Emotional Requirements refer to a state required to be fulfilled for users to have a better experience. Alkhomsan et al. proposed an approach to elicit user emotional requirements using interviews and think-aloud sessions and model user emotions using Goal-oriented Modeling Language (GRL) [5]. However, the approach tends to be subjective, and it lacks detailed and quantitative analyses that can be used to model emotions and analyze emotion-oriented goals. This paper extends the Emotion- Oriented Requirements Engineering approach by enhancing the elicitation method and proposing new relationships to enable emotions analysis in relation to the system and other stakeholders’ requirements and goals. The proposed elicitation method uses SAM (Self-Assessment Manikin) tool [6] to mitigate REFrame’23 – First International Workshop on Requirements Engineering Frameworks at REFSQ 2023, April 17–20, 2023, Barcelona, Spain EMAIL: g201901710@kfupm.edu.sa; malak.baslyman@kfupm.edu.sa; alshayeb@kfupm.edu.sa ORCID: 0000-0002-1634-6140; 0000-0003-4002-4480; 0000-0001-7950-0099 A. Ferrari, B. Penzenstadler, I. Hadar, S. Oyedeji, S. Abualhaija, A. Vogelsang, G. Deshpande, A. Rachmann, J. Gulden, A. Wohlgemuth, A. Hess, S. Fricker, R. Guizzardi, J. Horkoff, A. Perini, A. Susi, O. Karras, A. Moreira, F. Dalpiaz, P. Spoletini, D. Amyot. Joint Proceedings of REFSQ-2023 Workshops, Doctoral Symposium, Posters \& Tools Track, and Journal Early Feedback Track. Co-located with REFSQ 2023. Barcelona, Catalunya, Spain, April 17, 2023. ©️ 2023 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings (CEUR-WS.org) the risk of subjective expression and identification of user emotions. In addition, it uses PAD model [7] to map and classify the elicited emotions into more representative ones to be used in the modeling. The extended approach referred to as EmORE enables the analysis of emotions by introducing two relationships that trigger and mitigate the link between user emotions and stimuli (requirements and goals). In addition, it provides a means to quantify the emotional response to stimuli to identify the overall satisfaction level of positive or negative user emotions. EmORE approach is explained in detail and implemented in a case study, where it supported the elicitation of new emotional requirements that led to an increase in users’ positive emotions and a decrease in negative ones. The main contributions of this work are providing means for more accurate users’ emotions elicitation, enabling the analysis of user emotions in relation to the design elements and system/stakeholder requirements, and quantifying user emotions. The remainder of the paper is organized as follows: Section 2 provides related work, and Sections 3 and 4 are devoted to presenting the research approach (EmORE) and a case study to evaluate the proposed approach, respectively. Section 5 discusses the results, and Section 6 concludes the paper. 2. Related Work Over the past few years, several studies have demonstrated the importance of emotions in incorporating users' emotions when designing a software product [8]. Ramos et al. [9], discussed how requirements engineers can add the search for emotional issues to their traditional methods. Even adding a psychology expert to a RE team may even be helpful to identify and address emotional issues. Thew et al.[10], proposed a method for improving the elicitation process for soft issues, including emotions. The method involves using data collected from interviews and ethnographic to uncover values and emotions. Additionally, it uses scenarios, prototypes, and storyboards to get feedback from users on how the system aligns with their values. In an early effort to model emotional goals, Yu [11] developed the i* framework to represent soft goals that represent non-functional requirements or emotional requirements. Miller et al. presented the People-Oriented Software Engineering (POSE) model based on agent-oriented modeling [2]. They distinguished between personal emotional goals and context-specific emotional goals according to the impact a system should have on its users. Curumsing et al. [3] examined the feasibility of incorporating the emotional goals of their stakeholders into the development of smart home solutions. They applied agent-oriented models that are extended to represent three types of goals, namely, functional, quality, and emotional. Zulkifli et al. [4] proposed a systematic approach to creating emotional applications. They extended Agent-Oriented Modeling with three distinct layers involved: the motivation layer, system design layer, and platform-specific design layer. However, the proposed modeling approaches do not provide an analysis method that incorporates these emotional goals into the decision-making process. This study focuses on modeling and analyzing users' emotional goals using GRL in relation to system/stakeholder requirements. 3. Research Approach: Modeling and Analysis of Emotional Goals Using GRL This research extends the Emotions-Oriented Requirements Engineering (EmORE) approach proposed in [12] by proposing three main steps to elicit, model, and analyze emotional requirements. EmORE approach is depicted in Figure 1. 3.1. Phase1. Users’ Emotions Elicitation For emotions elicitation, we propose the use of the Self-Assessment Manikin (SAM) assessment method to elicit user emotions [6]. As seen in Figure 2, SAM is a language-free emotion assessment method that uses graphic scales depicting cartoon characters expressing three emotion elements: valence, arousal, and dominance (VAD) [7]. SAM was built to identify emotions based on Mehrabian's Elicitation Modeling Think Aloud Protocol Modeling Users’ Emotions Design Mapping Collected Values Identify Trigger/ Mitigate to Emotions Relationships Design New Alternatives Clustering Emotions Analysis Claculate Emotional Response Evaluate the Users Emotions View Figure 1: EmORE Approach PAD model, which suggests that emotions could be identified by at least three dimensions, commonly pleasure, control, and arousal [7]. These dimensions were developed based on emotions being the result of estimation processes during which individuals evaluate external stimuli based on their current needs and ability to cope with consequences. This provides a more realistic way of capturing human emotions compared to other models [13], [14]. The elicitation phase consists of three steps that are 1) conducting think-aloud sessions using the SAM tool, 2) mapping the elicited VAD vectors to emotions, and 3) clustering the elicited emotions using VAD model. These steps are illustrated in detail in the case study. 3.2. Phase 2. Modeling and Analysis of Emotional Goals Using GRL In the previous study [12], the Goal-oriented Requirements Language (GRL) was used to model the emotional requirements. The user emotions were modeled using a soft goal in a separate actor that is called the actor’s emotions, which include the emotions of an actor only [12]. In this study, we model user emotions as a soft goal that can be triggered or mitigated via stimuli. An emotional stimulus can be defined as any intentional element of an action that triggers or mitigates a specific emotional response. Hence, we propose two types of relationships between user emotions and stimuli that trigger and mitigate. Those links are represented by contribution links, and their types are captured in the contribution link metadata. The contribution weight of those links is either 100 (active) or 0 (inactive). Active means a certain emotion is triggered by a stimulus, while inactive means that an emotion is no longer triggered by a stimulus. Mitigate relationship is meant to illustrate how the negative impact of the existing stimulus is mitigated by introducing a new stimulus (tasks, functional or non-functional requirement). Emotional response refers to the ability to express emotion in response to an affective stimulus. For the model analysis, the initial evaluation values of emotional goals were assigned using the emotional response. It is used to quantify the impact of stimuli on certain emotional goals. In other words, the emotional response reflects the extent to which these emotions are triggered by stimuli. The emotion response value is computed by calculating scalar products for the normalized VAD vectors using equation (1). (𝑉, 𝐴, 𝐷)𝑅 = ∑𝑛𝑖=1 𝑉𝑖 𝐴𝑖 𝐷𝑖 (1) In addition, we define two emotional goals that capture the negative and positive emotional states of the user. All modeled emotions contribute to those two general emotional goals to have an overview of the impact of design alternatives on user emotions in general, regardless of the specific emotion type. Figure 2: SAM Tool [7] This also enables comparing the overall positive emotion to the negative emotion to design alternatives that maximize the positive emotion and minimize the negative one. The positive and negative emotional goals are assigned a threshold that can be determined by stakeholders, including users, developers, and requirements engineers considering several factors such as solution context and target users. 3.3. Phase 3. Design and Evaluation of Alternatives From goal modeling analysis, further design alternatives can be elicited to mitigate negative emotions and enhance positive emotions. This is done by meeting and interviewing users to obtain more stimuli alternatives that are likely to have a positive effect on their feelings. Next, a prototype is developed that reflects the proposed design alternatives and think-aloud sessions are conducted to elicit users' emotions. Finally, we calculate the emotional responses and update the evaluation values of positive and negative emotional goals, as described in Section 3.2. Updates to the evaluation values of positive and negative states on the goal model are indicators that can be used to select the alternatives or to elicit and evaluate different alternatives that meet the assigned threshold for each state. Table 1 Elicited Emotions with corresponding Stimuli. Think A loud Sessions Mapping Emotions Clustering Stimuli (V, A, D) Access to cameras, (2,6,7), (2,5,5), (3,4,3), (6,4,5), Terrible, Mellow, Hate, Hate, Sad, voice, and files (5,2,3), (5,5,5), (4,7,5), (4,6,5) Sad, Shock, Sentimental, Depressing, Love Depressing Agree to long-term (3,4,1), (2,5,5), (5,5,5), (3,3,5), Melancholy, Terrible, Hate, Depressing, conditions that are (6,6,6), (3,3,3), (7,7,5), (6,7,5), Depressing, Mellow, Hate, Melancholy, Sad, unclear (4,6,5) Shock, Sentimental Love, 4. Case Study: Virtual Clinic This case study illustrates the use of the proposed approach to enhance the virtual clinic services provided by the Sehhaty application by considering the emotional requirements [15]. Sehhaty is a national health platform provided by the Ministry of Health in Saudi Arabia. It is an end-to-end telehealth solution that enables patients to connect with physicians anytime and anywhere. Healthcare practitioners can conduct virtual examinations with remote patients through text, voice, or video calls. To elicit the emotional requirements, 20 participants were recruited who had already used the instant consultation service using convenience sampling. Those participants were involved in evaluating the new prototype as well. The sample comprised 55% males and 45% females, ranging in age from 21 to 54. According to their experience level in using smartphones, 60% are experts, 35% are intermediate, and 5% are novice users. Our approach is presented along with the case study implementation in detail in the following sections, which begins with eliciting users' emotions, modeling, and analysis using GRL, followed by design alternatives and evaluation. 4.1. Users’ Emotions Elicitation We conducted 20 think-aloud sessions, where participants were encouraged to express their feelings and discuss the stimulus using the virtual clinic app to conduct immediate consultation. They were then asked to rate their emotions using the SAM scale (see Figure 2 ). Table 1 summarizes some of the sessions' results. The first column presents the stimulus, and the second illustrates the VAD vectors identified by the participants. Then, VAD vectors were mapped to emotions using the VAD model [16] to understand what emotions were triggered by each stimulus. Participants' emotions are presented in the third column in Table 1. It is worth mentioning that several VAD vectors can refer to the same emotion, such as (2,7,7), (2,8,7), and (3,7,7) representing Terrible emotion. As emotions are subjective, these stimuli may evoke a wide range of emotions depending on the characteristics and experiences of the target user. To cluster emotions, we used an emotion wheel to group emotions into six main clusters using K-means clustering [16]. These six clusters are: Happy, Depressed, Love, Melancholy, Hate, and Sad cluster. Hence, if more than six emotions are associated with a stimulus, we group them into higher- level representations. This is to facilitate the modeling and analysis of emotions. Hence, we clustered emotions elicited by two stimuli, which are: Access to cameras, voice, and files, and accepting long- term conditions as depicted in Table 1. 4.2. Modeling and Analysis of Virtual Clinics Using GRL The GRL model with the patient emotion view is depicted in Figure 3. The user emotions were modeled using soft goals in a separate actor that can be triggered or mitigated via stimuli. An emotional stimulus can be defined as any intentional element (tasks, functional or non-functional requirements) that triggers or mitigates a specific emotional response. Those links are contribution links, and their types (triggers or mitigators) are captured in the contribution link metadata. As shown in Figure 3 Required access to camera and photos task triggered three negative emotions. However, these emotions were mitigated by providing the patient with a selection of communication options in the refined GRL. Figure 3: Virtual Clinic GRL Model with Patient Emotion View In this case study, the threshold for negative emotions should be under 50, and positive emotions should be over 75. The evaluation values of positive and negative emotional goals are accumulated by calculating the emotional response for each emotion contributing to the state of positive or negative emotion. As seen in Figure 3, with current stimuli and design alternatives, the positive emotion is above the threshold. However, the negative emotion is 90, which is above the threshold; hence, we need to design alternatives (stimuli) to mitigate negative emotions. For example, improving the readability of terms and conditions may be achieved by rewriting the terms and emphasizing patients' rights, such as if the user has the right to cancel the consultation without affecting his right to receive other healthcare services. 4.3. Designing and Evaluating Alternatives Based on the analysis results, several interviews were conducted after think-aloud sessions with the participants to elicit stimuli. Interviews focused on how to mitigate their negative emotions through a variety of design alternatives. Then, a new prototype was designed that reflects the user's emotional requirements and required features. New features have been added to mitigate negative emotions, such as allowing the patient to select a doctor before participating in the session and making the terms and conditions easy to read. Furthermore, we designed a more interactive chat user interface to display the status of the doctor in the chat. We conducted think-aloud sessions following the same procedure mentioned in section 3.1 to evaluate the new design alternatives. Moreover, we elicited, clustered, and modeled the new emotions. The analysis showed that the general positive emotions were enhanced to 100, and the general negative emotions were decreased to 35. The refined GRL model with the new alternatives and emotions, and screenshots of the application prototype are available online1. 5. Discussion Although the work is still in progress, the initial results are promising. Compared to previous work [12], using SAM to elicit exact participants' emotions was easy and effective, and it eliminated the problem of participants having difficulty articulating their emotions. However, during the think-aloud session, it was difficult for the participants to comprehend the dominance scale. By eliciting emotion over three dimensions, the subjectivity of identifying emotions by participants or requirements engineering was partially mitigated compared to the previous study. The analysis mechanism we proposed in this study was based on a trigger or mitigating certain emotions by some stimuli. The impact of those relationships was either active (100) or inactive (0). Currently, we are working on investigating different ways of assigning weights to those relationships and validating the proposals empirically. Furthermore, we used the generally negative and positive emotional goals to provide the overall emotional state the user is in when implementing a certain design alternative. However, the fine- grained level of emotions, such as disappointment or excitement, is still important to design alternatives that take the user from a specific state of emotion to another based on the context and user needs. Despite the potential benefits of the EmORE approach, some limitations remain. Eliciting emotions on a three-dimensional scale and determining their evaluation values can be challenging tasks for requirements engineers. Therefore, we plan to develop a tool that will aid the requirements engineer in this matter. We also plan to extend GRL with notations specific to users' emotions to support modeling and analyzing emotional goals. 6. Conclusion This paper proposes an Emotion-oriented Requirements Engineering (EmORE) approach that can be utilized to elicit, model, and analyze users' emotions using GRL. An evaluation of EmORE was conducted using a case study of virtual clinics. By applying the proposed approach, we were able to elicit users’ emotional requirements, model the emotional goals with respect to the system and user requirements, and analyze the emotional goals in relation to other goals effectively. The case study results are promising and encouraging to further develop and validate EmORE. Our future work includes providing a verification method to verify the elicited and the mapped emotions by PAD model. Moreover, we plan to enhance the relationship types between goals and emotions to enable more realistic analysis and provide appropriate modeling and tool support by extending the GRL metamodel. 1 https://figshare.com/s/157d3248c8b1c5b27e1f 7. Acknowledgements The authors acknowledge the support of King Fahd University of Petroleum and Minerals support in developing this work. 8. References [1] A. Dirin, T. H. Laine, and A. Alamäki, “Managing Emotional Requirements in a Context-Aware Mobile Application for Tourists,” Int. J. Interact. Mob. Technol. IJIM, vol. 12, no. 2, Art. no. 2, Mar. 2018, doi: 10.3991/ijim.v12i2.7933. [2] T. Miller, S. Pedell, A. A. Lopez-Lorca, A. Mendoza, L. Sterling, and A. Keirnan, “Emotion-led modelling for people-oriented requirements engineering: the case study of emergency systems,” J. Syst. Softw., vol. 105, pp. 54–71, 2015. [3] M. K. Curumsing, A. Lopez-Lorca, T. Miller, L. Sterling, and R. Vasa, “Viewpoint modelling with emotions: a case study,” Int. J. People-Oriented Program. IJPOP, vol. 4, no. 2, pp. 25–53, 2015. [4] S. F. B. Zulkifli, C. Waishiang, M. A. B. Khairuddin, N. B. Jali, and Y. R. B. Bujang, “How to Model an Engaging Online Quiz? The Emotion Modeling Approach,” J. Telecommun. Inf. Technol., no. 1, pp. 54–63, 2022. [5] D. Amyot, G. Mussbacher, S. Ghanavati, and J. Kealey, “GRL Modeling and Analysis with jUCMNav.,” iStar, vol. 766, pp. 160–162, 2011. [6] M. M. Bradley and P. J. Lang, “Measuring emotion: the self-assessment manikin and the semantic differential,” J. Behav. Ther. Exp. Psychiatry, vol. 25, no. 1, pp. 49–59, 1994. [7] A. Mehrabian, “Framework for a comprehensive description and measurement of emotional states.,” Genet. Soc. Gen. Psychol. Monogr., 1995. [8] C. Thompson, N. Maiden, M. Nouri, and K. Zachos, “Evoking emotion through stories in creative dementia care,” in Looking into the Future of Creativity and Decision Support Systems: Proceedings of the 8th International Conference on Knowledge, Information and Creativity Support Systems, 2013. [9] I. Ramos, D. M. Berry, and J. Á. Carvalho, “Requirements engineering for organizational transformation,” Inf. Softw. Technol., vol. 47, no. 7, pp. 479–495, May 2005, doi: 10.1016/j.infsof.2004.09.014. [10] S. Thew and A. Sutcliffe, “Investigating the Role of’Soft issues’ in the RE Process,” in 2008 16th IEEE International Requirements Engineering Conference, 2008, pp. 63–66. [11] E. S. Yu, “Social Modeling and i,” Concept. Model. Found. Appl., pp. 99–121, 2009. [12] M. N. Alkhomsan, M. Baslyman, and M. Alshayeb, “Toward Emotion-Oriented Requirements Engineering: A Case Study of a Virtual Clinics Application,” in 2022 IEEE 30th International Requirements Engineering Conference Workshops (REW), Aug. 2022, pp. 48–56. doi: 10.1109/REW56159.2022.00017. [13] J. A. Russell, “A circumplex model of affect.,” J. Pers. Soc. Psychol., vol. 39, no. 6, p. 1161, 1980. [14] P. Ekman, “Basic emotions,” Handb. Cogn. Emot., vol. 98, no. 45–60, p. 16, 1999. [15] MOH, “Ministry Of Health Saudi Arabia,” Ministry Of Health Saudi Arabia. URL: https://www.moh.gov.sa/en/Pages/Default.aspx (accessed Jun. 26, 2022). [16] D. Garg, G. K. Verma, and A. K. Singh, “Modelling and statistical analysis of emotions in 3D space,” Eng. Res. Express, vol. 4, no. 3, p. 035062, 2022.