-
Notifications
You must be signed in to change notification settings - Fork 2
Software Quality Assurance Plan
Methods we are using for quality assurance:
- Each member will implement their methods on their own branch
- Once each member has completed his or her own business methods, they will create a PR request and set the rest of the members as the reviewers.
- Each member will then review the code written by the requesting member and requests changes where necessary.
- Once all the changes have been made and all reviewers have approved the changes, the last reviewer will merge the branch into the master branch.
- The author will then delete the branch that was just merged and close any related issues.
- Note: when we work as a group, these reviews are sometimes done in person rather than on GitHub.
- We will be frequently merging code between branches to minimize discrepancy between working directories and therefore reduce merge conflicts later on.
- To test our database, we decided to develop Unit Tests with mockito framework provided. As such, we decided to mock the output of all the other Repositories, save for the service class. These outputs will allow us to create stubs to tests the overarching service methods. As such, we are going to ignore the functioning of the repositories and abstract to simply the function of the service class. Furthermore, we are only testing the service methods that are called by our RESTful Controller, as these are the methods required for the proper functioning of the back end. We also decided to specifically evaluate branch coverage, and ensure that all possible branches are covered in the code.
- We used the method of equivalence partitioning to reduce the number of tests needed by only having 1 positive test and one negative test in each category of failure.
- We decided to test the business methods that are directly called from the restful service class as well as the service methods which are called inside these methods to ensure full functionality of the business methods.
We decided to document both statement coverage and branch coverage for this report. We decided to aim for at least 80%, and preferably greater than 90%, coverage for both types of coverage. This is due to the behaviour of certain branches internally, untestable code, to test for errors that may occur from other perspectives, and the impossibility to test for everything.
There are two methods to test for this endpoint: getStudent and getTutor
getStudent(String username)
- Return "Please insert a username..." if username is null
- Return "Please insert a username..." if username is empty
- Returns null if user with that username doesn't exist
- Works if given the correct username
getTutor(String username)
- Return "Please insert a username..." if username is null
- Return "Please insert a username..." if username is empty
- Returns null if user with that username doesn't exist
- Works if given the correct username
This is done in three steps, first all the universities are listed. Then, a student can select a university to view available courses. Thirdly, the student can select a course to view all available course offerings.
getAllUniversities()
- All universities returned properly.
- No universities created to return.
getAllCourses()
- All courses returned properly.
- No courses created to return.
- Null returned.
getAllCoursesByUniversity(String universityName)
- All courses from specified university returned.
- Create valid university. Create valid course and link to university.
- Created course returned by method.
- University with that name is not found.
- Give a university name that hasn't been created.
- Expected output: "No courses offered for this university"
- No courses
- Return an empty list from getAllCourses
- Expected output: "No courses offered for this university"
- No university linked to course
- Create a course but do not link a university.
- Expected output: "No courses offered for this university"
- Null
- getAllCourses returns null.
- Expected output: "No courses offered for this university"
getAllCourseOfferings()
- All course offerings returned properly.
- No course offerings created to return.
- Null returned.
getAllCoursesOfferingsByCourse(String courseName, String universityName)
- Positive case
- Create valid university. Create valid course and link to university.
- Create a valid course offering linked to both.
- Created course offering returned by method.
- Invalid university name
- Give a university name that hasn't been created.
- Expected output: "No courses offerings offered for this course"
- Invalid course name
- Give a course name that hasn't been created.
- Expected output: "No courses offerings offered for this course"
This is done in two steps. Once the student has chosen a course offering(see above), they can view the available tutors for that course offering. Then they can select a tutor to view their information such as hourly rate, experience, education level, availability and reviews.
getAllTutorsByCourseOffering(int id)
- Positive Case
- Create valid course offering.
- Create a valid tutor and link to course offering.
- Created tutor returned by method.
- Invalid course offering id
- Give a course offering id that hasn't been created.
- Expected output: "This course offering does not exist"
- No linked tutors
- Do not link any tutors to the created course offering.
- Expected output: "No tutors for this course offering"
- No course offerings created
- Set returned course offerings by id to null
- Expected output: "No tutors for this course offering"
findTutorByUsername(String username)
- Positive Case
- Create valid tutor with given username
- Created tutor returned by method.
- Negative 1
- Give a tutor name that hasn't been created.
- Mock repository returns null.
- Expected output: "No tutor by that username"
isRoomAvailable(Date date, Time startTime)
- Conflict with date and time
- Create a session at the same time and date as the one being checked
- Expected output: False
- No conflict with date
- Create a session at the same time but a different date.
- Expected output: True
- No conflict with time
- Create a session on the same date but a different time.
- Expected output: True
- Multiple rooms
- Create 2 rooms, one of which has a conflict.
- Expected output: True
- Multiple rooms with conflict
- Create 2 rooms, both of which has a conflict.
- Expected output: False
- No rooms
- No rooms created.
- Expected output: "No rooms to check"
- No sessions
- No sessions created.
- Expected output: True
createSession(int courseOfferingID, Date date, Time time, Double amountPaid, String studentName, String tutorName)
- Tutor name is Null
- Attempt to create a session when the tutor name is unspecified
- Expected output: Error - with message: "Invalid tutor name..."
- Student name is Null
- Attempt to create a session when the student name is unspecified
- Expected output: Error - with message: "Invalid student name..."
- Date/Time is Null
- Attempt to create a session when the Date or Time is null
- Expected output: Error - with message: "Invalid time parameters..."
- Negative amount paid
- Attempt to create a session when the amount paid is negative
- Expected output: Error - with message: "So your student is paying you?? Please provide positive amount paid..."
- No Rooms Available
- Attempt to create a session when there are no rooms available
- Expected output: Error - with message: "There is no room available at this time"
- Session date is the same day or in the past
- Attempt to create a session with a time after 8pm (as no session can end after 9pm)
- Expected output: Error - with message: "Can not book a session on the same day, or in the past!"
- Tutor is null
- Attempt to create a session with a valid tutor name, but no such tutor exists in the system
- Expected output: Error - with message: "Please input a valid tutor"
- Tutor is unavailable at the session time
- Attempt to create a session with a valid tutor, but the tutor does not have an availability at that time.
- Expected output: Error - with message: "The Tutor is busy during this time."
- Course Offering is Null
- Attempt to create a session without a course offering to tie to it.
- Expected output: Error - with message: "Please input a valid course offering"
- Session is valid
- Create a valid session or booking
- Expected output: Session that is created
- Booking is too far ahead
- Attempt to create a session that is more than two weeks from today
- Expected output: Error - with message: "Can not book a session more than 14 days in advance"
- Student is Null
- Attempt to create a session with a valid student name, but no such student exists in the system
- Expected output: Error - with message: "Please input a valid student"
- Tutor Availabilities are Null
- Attempt to create a session when the tutor has a no availabilities
- Expected output: Error - with message: "The Tutor you picked has no Availabilities"
getAllSessions()
- Get all the sessions
- Check that all sessions can be retrieved
- Expected output: List of all sessions in the system
getSession(int id)
- Get a session based on an ID
- Check that the session retrieved exists in all sessions
- Expected output: the session that you retrieved by ID
getSessionByStudent(String studentName)
- Session List Returned
- Get all the sessions for a particular student
- Expected output: a list of sessions
- Student name is Null
- Get all the sessions for a particular student, whose name is null
- Expected output: Error - with message: "Invalid student name..."
- Student is Null
- Get all the sessions for a particular student, whose name is not null, but the student is
- Expected output: Error - with message: "Please input a valid student"
addStudentToSession(int sessionId, String studentName)
- Student is already added to this session
- Attempt to add a student to the session that is already added. Throw error to avoid duplicates
- Expected output: Error - with message: "Student is already added to this session."
- Student is Null
- Attempt to add a student to the session, but the student is null
- Expected output: Error - with message: "Student is null!"
- Session
- Attempt to add a student to the session, but the session is null
- Expected output: Error - with message: "Session is null!"
- Officially add a Student to a Session
- Attempt to add a student to the session, satisfying all conditions. Check that the student is added to the session.
- Expected output: the student added
Logout uses the exact same tests as R1 (Login)
deleteSession(int sessionId)
- Cancel a session
- Cancel a session by deleting it, respecting all the time constraints, and value constraints
- Expected output: true
- Session within One Day
- Check that the session is at least 24 hours away, but is the day before, and delete it
- Expected output: true
- Cancel a session on the same day
- Attempt to cancel a session on the same day
- Expected output: Error - with message: "It is too late to cancel a session! Please do it at least the day before!"
- Cancel a session on the day before, but less than 24 hours before
- Attempt to cancel a session
- Expected output: Error - with message: "It is too late to cancel a session!"
- Session is Null
- Attempt to cancel a session for an invalid Id, resulting in a Null session
- Expected output: Error - with message: "Invalid Session ID"
- Room has been Assigned
- Cancel a session when a Room has already been assigned
- Expected output: True, with the session being successfully deleted
- Tutor Already has an Availability
- Cancel a session when the Tutor already has an availability
- Expected output: Error - with message: "Availability already exists"
createSession(int courseOfferingID, Date date, Time time, Double amountPaid, String studentName, String tutorName)
- Session time is too early
- Attempt to create a session with a time before 9am
- Expected output: Error - with message: "This is not a valid time"
- Session time is too late
- Attempt to create a session with a time after 8pm (as no session can end after 9pm)
- Expected output: Error - with message: "This is not a valid time"
This requirement has no tests associated to it.
This requirement has no tests associated to it.
createUser(String name, String userEmail, int age, String phoneNumber)
- Name is null
- Attempt to create a user when the user name is unspecified
- Expected output: Error - with message: "Invalid user name..."
- Name is empty
- Attempt to create a user when the user name is empty
- Expected output: Error - with message: "Invalid user name..."
- Age is Invalid
- Attempt to create a user when the user is underage(younger than 12)
- Expected output: Error - with message: "Must be above the age of 12 for this tutoring service..."
- Phone Number is null
- Attempt to create a user when the phone number is null
- Expected output: Error - with message: "Invalid phone number..."
- Phone Number is Invalid
- Attempt to create a user when the phone number is invalid
- Expected output: Error - with message: "Invalid phone number..."
- Email is null
- Attempt to create a user when the Email is null
- Expected output: Error - with message: "Invalid user email..."
- Email is invalid
- Attempt to create a user when the Email is invalid
- Expected output: Error - with message: "Invalid user email..."
getAllUsers()
- Get all the users
- Check that all users can be retrieved
- Expected output: List of all users in the system
createStudent(String username, String password, String email)
- Name is null
- Attempt to create a student when the student name is unspecified
- Expected output: Error - with message: "Invalid user name..."
- Name is empty
- Attempt to create a student when the student name is empty
- Expected output: Error - with message: "Invalid user name..."
- Password is null
- Attempt to create a student when the password is null
- Expected output: Error - with message: "Invalid password..”
- Password is empty
- Attempt to create a student when the password is empty
- Expected output: Error - with message: "Invalid password..”
- Email is null
- Attempt to create a student when the email is null
- Expected output: Error - with message: "Invalid email..."
- Email is invalid
- Attempt to create a user when the Email is invalid
- Expected output: Error - with message: "Invalid user email..."
- Email is Incorrect
- Attempt to create a student with an email, where there is no user with that email
- Expected output: Error - with message: "Invalid user email..."
getAllStudents()
- Get all the students
- Check that all students can be retrieved
- Expected output: List of all students in the system
This requirement begins when there is an active session. This PUT query will update one of the available rooms, if any in the session.
public SessionDTO updateRoom(@PathVariable("sessionid") int sId, @RequestParam(name = "date") Date aD,@RequestParam(name = "startTime") Time aT) throws IllegalArgumentException
.
The tests for this methods are covered in:
- R4 : Check Room Availability
- R5 : Book Session
- R13 : Cancel Session if Room is Unavailable Upon Tutor Response
This requirement begins with a response from the tutor. This will be a POST query into one of our restful apis
public void sessionCreationUponTutorResponse(@PathVariable("response") boolean response, @RequestParam("sessionId")int sessionId) throws IllegalArgumentException
.
There are multiple method calls for this process.
public boolean isRoomAvailable(Date date, Time startTime)
- Session does not exist
- Return error message: "No session with that id exists".
- Check room availability
- Upon confirmation of the tutor to host the session, a check is made if a room is still open.
- Expected output: Error - with message: "There is no room available at this moment".
- The session will then be deleted using deleteSession method.
- User is notified of the room issue.
- If there is a room available, the update session process continues.
- Room has no sessions attached.
- Loop through each room and compare timing of sessions from the room with the date of current session.
- No sessions are found for given room - room has no assigned sessions.
- Assign any room to the current session.
- Room has sessions, none at current time.
- Loop through each room and compare timing of sessions with the date of current session.
- Compare all sessions and loop through each.
- Assign the current session the empty room.
- All rooms are booked at the required time.
- Loop through each room and compare timing of sessions with the date of current session.
- Return null value for room when looping ends. Checked and responded with "No room available".
- Message sent to user about no room availability.
public Session updateSessionWithRoomFromTutorSuccessAndRoomAvailable(int sessionid, int roomNumber)
- Session does not exist
- Attempt to find the session
- Return error message: "No session with that id exists".
- Room does not exist
- Attempt to find the room
- Return error message: "No room with that number exists".
Upon session completion - when the session is complete, an email / notification will be sent to the user to review the tutor. The notification is based off the email class we have created - email is manually tested for all requirements of a notification.
The tests for this component will focus on the creation of the text and rating class upon user review. These tests can be found in the service tests + backend tests.
public Rating createRating(int ratingValue, String revieweeUsername, int coID)
- Reviewee linked is null / empty
- Attempt to find the user that was attached to the rating creation.
- Return error message: "No such tutor exists."
- No rating will be created.
- Course Id has no associated course offering
- Attempt to find the course offering.
- Return error message: "No course offering with that id exists".
- No rating will be created.
- Rating given is above 5 (highest possible rating)
- Attempt to create the review with this associated rating.
- Return error message: "Rating has to be between [1..5].".
- No rating will be created.
- Rating given is below the minimum threshold of 1
- Attempt to create the review with this associated rating.
- Return error message: "Rating has to be between [1..5.]".
- No rating will be created.
public Text createText(String description, boolean isAllowed, String revieweeUsername, int coID)
- Reviewee linked is null / empty
- Attempt to find the user that was attached to the text creation.
- Return error message: "No such tutor exists."
- No rating will be created.
- Course Id has no associated course offering
- Attempt to find the course offering for the text creation.
- Return error message: "No course offering with that id exists".
- No rating will be created.
- Text is given null / empty description.
- Attempt to create the review with this associated text.
- Return error message: "Description is missing".
- No text will be created.
- Text is given a description greater than the 250 words (restriction added for query based issues - too large of a string)
- Attempt to create the text with this associated description.
- Return error message: "Description has to be less than 250 words.".
- No text will be created.
- Text is given a 'false' for is allowed (meaning that it is not allowed to be posted)
- Attempt to create the text with this boolean of false.
- The text will still be created - as it can be edited later.
- Text will be 'blacklisted' and stored in the database.
Helper Method
public Set<Review> getAllReviewsByTutor(String tutorUsername)
- Successfully return the list of all reviews
- Attempt to find all the reviews with the tutor username.
- Successfully find the tutor in the database.
- Return all reviews written about the tutor.
- Tutor does not exist with given username
- Attempt to find all the reviews with the tutor username.
- Tutor does not exist in database.
- Return error message - "Tutor does not exist".
Helper Method
public Set<Review> getAllReviewsByCO(int courseOId)
- Successfully return the list of all Reviews
- Attempt to find all the reviews with the course offering id.
- Successfully find the course offering in the database.
- Return all reviews written about the course offering.
- Course offering ID does not exist
- Attempt to find all the reviews with the course offering id.
- Course offering does not exist in the database.
- Return error message - "Course offering does not exist".
The creation of a text and rating for a given review does not have an attribute to store the author of the review. As such, there is no history maintained of who wrote the review thus maintaining the anonymity.
The one test is related to attempting to ask for it.
- Author of a review is called
- Attempt to find the author of a review
- Error message - "You are not allowed to access this information."
Meeting Minutes
24/09/2019
27/09/2019
3/10/2019
8/10/2019
19/10/2019
24/10/2019
26/10/2019
07/11/2019
14/11/2019
19/11/2019
21/11/2019
26/11/2019
Sprint 1
Requirements
Use Case Diagram
UML Diagram
Detailed Specifications
Sprint 2
SQA Plan
SQA Report
Endpoints
Queries & Integration
RESTful API Tests
Sprint 3
System Architecture
UI Mockup
Sprint 4
Web Documentation
Android Documentation