Integration Testing - Computer Science | University of ...
Sexual Assault Reporting App (SARA)PersonnelDakota Amiot, David Carson, Anthony Snow CS 499 (University of Kentucky)Spring 2017DisclaimerThis project has been designed and implemented as a part of the requirements for CS-499 Senior Design Project for Spring 2017 semester. While the authors make every effort to deliver a high quality product, we do not guarantee that our products are free from defects. Our software is provided "as is," and you use the software at your own risk.We make no warranties as to performance, merchantability, fitness for a particular purpose, or any other warranties whether expressed or implied. No oral or written communication from or information provided by the authors or the University of Kentucky shall create a warranty. Under no circumstances shall the authors or the University of Kentucky be liable for direct, indirect, special, incidental, or consequential damages resulting from the use, misuse, or inability to use this software, even if the authors or the University of Kentucky have been advised of the possibility of such damages.AbstractSARA is a sexual assault reporting application. SARA aims to make self reporting of sexual assaults more accessible by giving the victim the ability to notify police through the use of their phone. The goal is to make it easier to anonymously report sexual assaults, thus minimizing the hesitation and lack of reporting. SARA also consists of a research component. Users of the Luna app can use their credentials to log in before making a report, and if they do so, the date and location of their assault will be recorded. The intention of this data collection is to look for a connection between sexual assault and fertility. No personally identifiable information will ever be collected during this process.IntroductionEvery 98 seconds, an American is sexually assaulted. Every 8 minutes, that victim is a child. Meanwhile, only 6 out of every 1000 perpetrators will end up in prison. When asked why people do not report these assaults, many cite fears of retaliation, fears that nobody will believe them, fears that nothing will be done to help them, and so on. With this in mind, SARA is designed to make it easier for victims to report sexual assaults without having to face the intimidation and doubt they fear might come with reporting in person. The application provides a simple form which victims can use to make a report, anonymously or not, from their phone. Victims can use the app to notify police, medical centers, and women’s shelters of their assault, depending on the selections they choose in the form. Our hope is that the simplicity of SARA will encourage more victims to report their assaults.Our client is Kaylynne Glover, a biology PhD candidate at the University of Kentucky. Kaylynne specializes in studying human reproductive behavior. In addition to SARA, she is leading another CS 499 group in developing an app called Luna, which monitors users’ menstrual cycles.In addition to its primary goal, Kaylynne plans to use SARA as a research tool. To that end, SARA interfaces with Luna, and Luna users will be able to log into SARA using their credentials before reporting an assault. If they choose to do so, the location and date of their assault will be recorded in Luna’s database. Kaylynne hopes to use this data to look for a connection between sexual assaults and victims’ fertility status. As of this writing, our target user base consists of iPhone users who are UK students and other residents of Lexington. We currently have a contact at the Lexington police department, as well as a medical contact and a contact at a local women’s shelter. However, Kaylynne has hopes of expanding the application to more locations in the state and even other locations across the country. So far, we have reached out to potential contacts in Louisville, Kentucky, and are waiting to hear back from them. In addition to this, we hope to expand our user base to include more than just iPhone users.Product RequirementsKaylynne had very specific requirements of the SARA application, which are outlined below:A form for users to input information about their assaults:First name of victim (optional)Last name of victim (optional)Date of assaultLocation of assault (city, state)Optional yes/no questions*:Would you like to press charges?Would you like to have evidence collected?Do you require medical attention?Would you like to speak to a counselor?Do you need to be relocated?If ANY of the above are selected, user must enter one or both of:Email addressPhone number* If any of the optional questions are answered YES, emails will be sent to police, medical center, and/or women’s shelterUsers of the Luna application must be able to login to SARA with their Luna credentials before making a report, if they choose to do soIf a user logs in before making a report, the date and location of their assault will be saved to Luna’s database for research purposesThe app must be able to run on iPhones with iOS 10+Product PlanningEffort and Size EstimationWe estimated roughly 600 lines of code.In reality, it took: 474 lines of code for the front-end development 76 lines of code for the back-end developmentTotal: 550 lines of codeHaving experience developing applications similar to this, I would say we made a very good estimation. What possibly through us off by less than 100 lines of code is that we overestimated how much work it would actually take.Schedule and MilestonesIn order to stay on track and complete this project, we relied on a schedule of events. Some of these dates were set by the instructor, and others, like group and client meetings, were decided by us as a group.MilestonesFebruary 1: First meeting with clientMarch 1: pre-midterm meeting with instructorMarch 3: Practice presentation with Presentation U!March 8: Midterm presentationApril 5: Test plan review with instructorApril 12: Additional client meetingApril 17:Practice presentation at Marksbury buildingApril 24:Final presentation at Marksbury buildingGroup meetingsFebruary 21February 25March 24April 10In addition to the in-person meetings above, our group maintained regular contact via email and group text messages, as well as occasional meetings via Google Hangouts. We also kept our client informed of project status via email and Slack.Platforms, Tools, LanguagesPlatformsIonic 2 - Framework written in TypeScript (a superset of JavaScript) that allows us to create applications and build natively iOS, Android, and WindowsToolsHeaders - Ionic 2 module used to add headers to a GET requestMd5 - Ionic 2 module that allows us to hash usernames and passwordsHttp - Ionic 2 module that allows us to make POST requestsHTTP - Ionic 2 module that allows us to make GET requestsnodemailer - nodeJS module that allows us to send emailsLanguagesHTML, CSS, JavaScript, TypeScriptDesignOur architecture diagram, found below this paragraph, shows the basic flow of our application. The user interface that the user interacts with is an iOS application that will send HTTP requests to both the Luna PHP servers and our nodeJS server. Luna’s servers handle user logins and database entries, respectively. The SARA Server will be reached on the submission of the user form. RESTful endpoints are setup to receive the sexual assault data on the SARA server. This data is used to generate emails that will be sent to authorities based on flags set by the user on the app interface. Using the NodeMailer library we can leverage emails to be sent to the authorities personalized for every user and to make sure only relevant data is sent to the appropriate authorities. If the user has the login boolean entered as ‘true’ then we send their hashed username and date of the assault to the Luna PHP server from the NodeJS server via HTTP requests. Luna’s server then handles adding this information to a table in their database specifically created for SARA. If the emails are sent properly the user will receive a 200 OK response from the SARA server and the user will be notified of their successful request.Above is a snippet of the code for the front-end application. Located in src/pages/login.html. This is pretty straightforward html to set up a simple to use UI. The custom ion-* tags are native to the Ionic framework. This screenshot above shows the back-end logic for connecting to the Luna database. returns a success message, if not gives you an error status and code. Located in src/pages/login.tsAbove is a snippet of the actual report front-end form located at src/pages/report.html. The form asks the user a series of questions and keeps track of what they enter using typescript for the back-end. This is the final function of the application written in typescript. Once everything checks out successfully, the application will post to the url given Note, unless you host the node server on bloodroot.cs.uky.edu:3030 , you MUST change the url to wherever you host the nodeJS app!Above is a sample valid JSON Object: This object would send the hashed username and date to the Luna database because the login boolean is entered as ‘true’. This would also cause an email to be generated for the police since the user has the toggleCharged boolean entered as ‘true’.User scenarios-1142999525Upon opening the app, users will be presented with this screen. Users with existing Luna credentials can use those credentials to login, which will trigger the app to record their assault information. If they choose to do so, they will be alerted by a popup reassuring them of the anonymity of their data.They can, however, choose to bypass the login screen and submit an anonymous report instead.-1142990The tab in the top left corner of the previous screen (shown on the previous page) opens this side menu, which has more options for going to or bypassing the login screen. -95249114300After logging in or bypassing the login screen, the app will automatically redirect you to the form, which is composed of three screens. The first screen, as shown to the left, requests the user’s first and last name, as well as the date and location of their assault. Users can swipe to continue to the next screen.3905250190501905019050196215019050The three screenshots above represent the second slide. This screen asks you a series of questions, and if you answer “yes” to ANY of them (by ticking the slider), then you will be prompted to enter an email address and phone number. The options you choose here determine which emails get sent by the application. A popup will also encourage the user to call 911 if they are in immediate danger.-95249114300If the required information is supplied, then the user will receive another popup informing them that their report has been successfully submitted. At this point, it is safe to close the app.ImplementationMost of the problems our team had with implementation involved waiting on the Luna team to get their servers up and running and ready to receive SARA login data and information to be saved in the Luna database. Once they got their servers working, we had to make a small change to our design. Originally we had thought that our server would make a direct connection to the Luna MySQL database and add the information to a table ourselves using a driver from Node Package Manager. However, the way we ended up implementing this was to send an HTTP request asynchronously from the SARA server to have the sexual assault data logged in Luna’s database. It should be noted that the server does not wait for a response from the Luna server to make sure the information was successfully added to the database. This was an intentional design decision we discussed with Kaylynne, because the only thing that constitutes a successful request to SARA is that the emails are sent successfully. Since simplicity of reporting was our number one goal with this application, we did not want to force the user to have to resubmit in the event that data was not successfully sent to the database. TestingUnit TestingOur application consists of four primary components: the login server, the form, the email server, and the database. Each of these components will need to be tested individually to ensure proper functionality. Note, the login and database components depend on functionality built into Luna!LoginLogin functionality will be tested using the SARAtest account that the Luna team created for us to test with.Test whether or not a user can successfully log in with a valid Luna username/password combination.Test whether a user receives a relevant error message when attempting to log in with invalid credentials.User enters invalid username.User enters the wrong password for an existing username.FormForm submissions will be tested under a handful of different scenarios:Test whether user receives a confirmation when a report is successfully submitted.Confirmation when user chooses any of the special options listed in the project requirements, requiring contact information.Confirmation when user does NOT choose any of the special options, which requires no contact info.Test whether user receives an error message upon a failed submission due to any of the following conditions:User chooses one or more of the special options, but they fail to provide either form of contact (phone number or email address).User fails to fill out any one or more of the required fields in the form.Email ServerUpon successful form submission, our application may need to send an email to the police, medical center, and/or a women's shelter, depending on options chosen in the form. As we should not be sending 'testing' emails to either of these locations, we will need to test that we can send an email containing the form results to any arbitrary email address.DatabaseWhen a logged in Luna user successfully submits a form, an entry must be added to our table in Luna's database. Table entries will be handled via HTTP post requests, which can easily be tested in-browser with any valid username as well as a location and date. Note, entries will only be created for logged in users. Records will not be kept in the database for anonymous form submissions.Integration TestingProper functioning of the application requires that all of these components work simultaneously. There are three primary cases to test, along with the expected output:Logged in user successfully submits form:User receives a confirmation message.Email(s) sent to the appropriate contact(s), depending on form selections.A table entry consisting of a hashed username, location and date of assault is created in the database.Anonymous user successfully submits form:User receives a confirmation message.Email(s) sent to the appropriate contact(s), depending on form selections.A new table entry in the database is NOT created.Logged in or anonymous user fails to submit form:User receives an appropriate error message.No emails will be sent.No table entry is created in the database.These can be further broken down into separate test cases for different types of error messages, different combinations of email recipients, etc.System TestingWe will test our application on an iPhone running iOS 10, as this is the environment for which the app is being developed.Customer TestingWe had college students, the primary intended audience, test our app for:elegant, functional UIclarity in information, form presentation, etc.ease of useTest CasesOur test cases can be found here. A hardcopy version will also be provided at the end of this document.Future Enhancements/MaintenanceThe main future enhancement for this project would be to expand the locations that can be reached by this app. The way the server is currently setup to expand this concept is to add three new emails to the ‘emailInfo.txt’ and to map that to a specific string received from the location parameter in the JSON. See mailer.js line 109 for example. Another future enhancement Kaylynne has expressed interest in was to have a SARA database that logs every event just for record keeping purposes, even if the users are not logged in to Luna. Obviously the information would be hashed in some way for security but this is just again to further research. For maintenance purposes you need to make sure the app is pointing to wherever you decide to host the server. We had the server hosted on the ‘bloodroot’ multilab machine so in the mobile application code every instance of “*” needs to be changed to URL the server is hosted on. In addition to this, it is important to make sure that if Luna’s login or database servers are hosted elsewhere, this change must be reflected in SARA’s code to maintain proper functionality. Currently, Luna’s servers are hosted at: login: entry: learned a lot over the course of the semester while working on this project. We learned about various technologies, including the Ionic framework and how to use it to achieve portability, nodeJS and how it can be used to send emails, and so on. We had to keep in mind that we would be handling sensitive information, and we had to learn how to deal with this in a secure matter. We accomplished this by refraining from storing personally identifiable information, hashing usernames and passwords, etc. Finally, we learned about the importance of being able to work not only with your own team, but also being able to work with other teams who are responsible for different projects. Our biggest hurdle with this project was working with the Luna team to incorporate functionality from their app into our own. If we had to do this project again, we would have been more adamant about communicating with both Luna and each other from the start. Another issue we faced involved explaining to potential users why they would want to sign in to an app to report a sexual assault. To make it easier to understand, we added an alert at the beginning of the application to explain that we collect anonymous information for research purposes. With all of this in mind, our client is happy with the progress we have made, and she plans to continue working where we left off.References: and User’s ManualInstall Ionic 2 following this guide: you have nodeJS installed, skip step 3Install nodeJS: into the SARA folder, look for src/pages/report.ts and go to line 251change the url to into the folder labeled CS499Server with terminal and run “npm install”Go into the folder labeled CS499Server with terminal and run “node server.js” go into the root folder of the application and run: “sudo ionic serve”. The application should load inside of your browser with no problems. ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- university of houston testing center
- list of computer science topics
- university of houston testing services
- university of hawaii testing centers
- benefits of computer science degree
- history of computer science pdf
- fundamentals of computer science pdf
- benefits of computer science career
- benefits of computer science education
- doctor of computer science salary
- stanford university computer science ms
- examples of computer science math