Sunday, March 29, 2015

Impression of week 9 - Test Cases

After completing the second assignment, our professor started the week off with some unittest exercises that tested the minimax strategy from the assignment, which we all struggled with at some point. In CSC108, we have done some unittest which checks if the actual function gave the desired output, and these unittests are definitely more descriptive than the doctests that we would usually import. The unittests we learned in this class have the same general idea. We carefully chose test cases that will give us more information on whether the minimax strategy worked with the subtract square game, such as whether the computer chooses a guaranteed winning move, or a random move if there are no winning moves. I found this lecture quite interesting because we were able to review some tree concepts and look at the condition of each move in the games to see if it's a winning move or not, and if there are no winning moves for the current value, how does that really tell us whether minimax is working or not. And the answer is, it doesn't tell us precisely if minimax is working or not because perhaps a random strategy would produce the same move as minimax. In this case, it is critical to learn to choose proper test cases.

No comments:

Post a Comment