Github Classroom Autograding - How to test Junit tests?

121 views Asked by At

How can we test if a JUnit test is well implemented in Github classroom? Suppose the student is required to write the function int triple(int n) (using java) and also to implement a test to check if the implementation is correct. How can we check if the student's unit test void tripleFunctionIsOK() method is doing its job correctly?

1

There are 1 answers

0
Timothy Truckle On

How can we test if a JUnit test is well implemented in Github classroom?

short answer

You can't.

long answer

A unit test expresses a single expectation about the units behavior. An expectation in turn is a human thing. Given that we currently have no possibility for computers to read human brains there is no technical way to check that the code of a unittest really matches the coders expectation.

So the only way to ensure that JUnit test is well implemented is good naming when implementing this test and the four eyes principle (pair programming).