Examine the class diagram for class Tutoring System that creates Array Lists of tutors and students. What approach would you take to test this class?

Question

Examine the class diagram for the class Tutoring System that creates Array Lists of tutors and students. What approach would you take to test this class?

Tutoring System

–      tutors : Array List <Tutor>

–      students : Array List<Student>

–      any other necessary data

+ Tutoring System( )

+ addTutor ( Tutor ) : void

+ addStudent ( Student ) : void

+ removeTutor ( Tutor ) : void

+ removeStudent ( Student ) : void

+ noOfTutors ( ) : int

+ nonstudents ( ) : int

+ toString ( ) : String

* other methods as needed

 

Summary

A class diagram for the class TutoringSystem is provided, along with a list of the class’s components. It has members with private data, such as tutors and pupils.
It has a function Object() { [native code] }, methods for adding and removing tutors and students, methods for returning the number of students and tutors, and a tostring method.

Explanation

We used a divide-and-conquer strategy to test this module. We break down the entire module into smaller components and test each one separately. We undertake unit testing first to ensure that all of the units are working well, and then we perform integrated testing to ensure that the entire module is working properly.

The following units can be found in the above class:

TestAddTutor()

TestAddStudent()

TestRemoveStudent()

TestRemoveTutor()

TestNoOfStudent()

TestNoOfTutor()

TesttoString()

We test each of these functions separately because they conduct all of the important operations.
We undertake integrated testing if all of them pass the exam. We debug the code if any of these fails.

The diagram above depicts our strategy for testing the module.

Debugging becomes difficult when we test the entire module. It’s difficult to pinpoint the issue or the code part that caused it.

To tackle this problem, we separate the entire class Tutoring System into various components and then test and debug each unit to see if it is causing any errors. If this is not the case, we conduct integrated testing.
Debugging becomes easier as a result of this reduction in the risks of error.

 

Also, read check the python code below that doesn’t work properly, adjust it, and explain?

 

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *