Abstract

This paper presents a scheme for automatic grading of the member functions of a C++ list class. Developing an automatic grading program for C++ classes is non-trivial because a test case to verify one member function of the class may depend upon the correctness of one or more other class member functions. In addition, performing multiple test cases in the same driver program may produce invalid grading outcomes because an erroneous result from one test case could violate the preconditions for a later test case. The method described here uses a weakness of C++ data encapsulation that allows access to private data members of an object. Two instances of a list object are constructed, tested, and compared using student designed and instructor designed classes. If a test case produces incorrect results using the student's class, the instructor written class may be used (via a type cast) to access the private data members of the student's list object to correct the errors. The grading program automatically reports and tallies errors for each member function and for the class total.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.