# Maximizing Test Coverage for Security Threats Using Optimal Test Data Generation
## 4 Experiment Design
\begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt}} \hline ID\({}^{*}\) & SMC-SA-001 \\ \hline Goal\({}^{*}\) & Security \\ \hline Sub Goal\({}^{*}\) & Authentication \\ \hline Misuse Case Name\({}^{*}\) & Steal Login Details \\ IMPLEMENTS steal sensitive data \\ \hline Associated Misusers\({}^{*}\) & Information Thief \\ \hline Author Name & ABC \\ \hline Date & dd/mm/yy \\ \hline Description\({}^{*}\) & Misuser gets access through automated attacks such as credential stuffing and brute force technique to Login into the system to perform illegal activities with the user data. \\ \hline Preconditions\({}^{*}\) & The login page is accessible to the Information Thief. \\ \hline Trigger\({}^{*}\) & Information Thief clicks the login button \\ \hline  & Information Thief uses an automated attack tool to generate many combinations of usernames and passwords. Login Details, i.e., username, Password, and Captcha matched with the login details of the system. \\ Basic Flow\({}^{*}\) & On Successful Login, a verification code will be sent on the user email id/SMS for multifactor authentication. If a user receives a verification code and verifies the login attempt, then the Information thief will be redirected to the User’s personal and sensitive data pages. \\ \hline  & **BF-2**. In case of non-authentic/invalid login details, i.e., username, Password, and Captcha, or the number of login attempts are greater than three against the same IP, it will be blocked. \\  & **BF-4**. If the multifactor authentication verification code is not received through Email/SMS, repeat the Bf3. \\ \hline Assumption & The system has login forms feeding input into database queries. \\ \hline Threatens Use Case\({}^{*}\) & User Login \\ \hline Business Rules & The Hospital system shall be available to its end-users over the internet. \\ \hline  & Hospital O/I Maintenance Department, O/I User \\ Stakeholder \& Threats & Department, Store Keeper, Dispenser. \\  & If deleted, data loss reveals sensitive information to damage the business and reputation of the hospital. \\ \hline Threatens Use case Mitigation & If a user from the same IP address attempt three logins failed attempts, block the IP. Also, apply Captcha and multifactor authentication to avoid attacks. \\ Note: & All fields with \({}^{*}\) are mandatory for Structured Misuse Case Description. \\ \hline \end{tabular}
\end{table} 
Table 2: Structured Misuse Case Description. **Step 4:**: Specify constraints in Mal Activity Diagram using OCL  
Following are the specification of constraints in OCL that will be used for transformation into boolean expression. self. Username = 'valid' and self. Password = 'valid' and self.captcha = 'valid' and self.attempts < 3  
**Step 5:**: Transformation of Constraints into Boolean Expression  
self. Username = 'valid' \(\wedge\) self. Password = 'valid') \(\wedge\) (self.captcha = 'valid' \(\wedge\) self.attempts < 3))  
After converting into a logical operation, we applied the MC/DC and decision coverage to each constraint. **Step 6:**: Transform Boolean expression into truth table expression  
We will specify and label each constraint separately, i.e., Table 3, before transforming them into Boolean expression. \begin{table}
\begin{tabular}{l l} \hline a & self. Username = ’valid’ \\ \hline b & self. Password = ’valid’ \\ \hline c & self.captcha = ’valid’ \\ \hline d & self.attempts < 3 \\ \hline \end{tabular}
\end{table} 
Table 3: Explanation of constraints transformation. Figure 2: Mal-activity diagram for SMC-SA-001. Constraints specified using Table 3 become ((a \(\wedge\) b) \(\wedge\) (c \(\wedge\) d)). In the following Table 4, the Boolean expression, which is first transformed from a constraint, is now transformed into truth Table form. **Step 7:** Generating Possible Test  
We will use the decision coverage approach mentioned in [32,33] and MC/DC described in [16]. To obtain MC/DC and decision coverage, we need to solve the combinations of true and false values required to achieve the MC/DC criterion.