One embodiment of the present invention provides a system that facilitates
testing object-oriented programming (OOP) methods. During operation, the
system receives a request from a client at a test-automation framework to
execute a test case for the OOP methods. In response to the request, the
system executes the test case in the test-automation framework. (Note
that in this system, a class that includes the OOP methods inherits from
an originally intended parent class, and calls to a test class are made
via reflection.) The system then determines an outcome of executing the
test case. Finally, the system reports the outcome of executing the test
case.