Developers are responsible for unit testing their code as they develop it and pr
ID: 3590173 • Letter: D
Question
Developers are responsible for unit testing their code as they develop it and prove to the project management that they have tested all the possible paths of execution of their code prior to promoting their code to QA testing environment.
Let’s assume that your system takes a file that contains 5,000 courses offered at a university and the number of enrolled students in these courses. The file also contains what days and what times these courses meet and what department they belong to. Also your system takes two more files, one that contains a list of 400 lecture rooms with their capacity and another that contains a list of 1,000 instructor and the types of courses they can teach. The main function of your system is to assign the courses to rooms and instructors. The assignment must ensure that no two courses that overlap in meeting time are scheduled in the same room, no instructor is teaching two courses that overlap in time, and no course is assigned to a room with a capacity less than the number of enrolled students.
Describe how you can prepare test cases to cover these situations. Obviously testing with the large files may be complicated.
Explanation / Answer
Assume that the assignments out of three files are stored in a fourth file,
having all the details as such:
Name of the Instructor
Name of the Course Offering
Lecture room
Capacity of the Lecture Room
Time of the lecture
Number of Students Enrolled for the course
Now, we have the following scenarios to be tested:
Testcase 1:
Check to see if 'Lecture Room' is occupied by more than one instructor at a time,
If there exists more than one line where 'Lecture Room' and 'Time of the Lecture' are the same,
then the testcase fails.
Testcase 2:
Check to see if an 'Instructor' is teaching more than one course at a time,
If there exists more than one line where 'Name of the Instructor' and 'Time of the lecture' are the same,
then the testcase fails.
Testcase 3:
Check to see if any row in the file has 'Number of Students Enrolled for the Course' value greater than the
'Capacity of the Lecture Room' value, if so, then the testcase fails.
Testing the above 3 scenarios validates the assignment file in assigning Instrcutors to Lecture Rooms and Courses without any overlap.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.