©2011 Viera K. Proulx

6  Understanding Mutation

Our lives just got to be more difficult. Many Java programmers cannot imagine living without void methods and the corresponding mutation. However, this makes the job of designing test for the methods much harder.

Do the work for the lab we have used with our students in the Spring 2011. (Do only the first part of the lab. The second one deals with equality, the topic we have covered in our Lab 3.

Look for the lessons learned:

Typically, our design for the tests in the presence of mutation starts by defining one or more reset methods that return the value of the test data to the original state. Each test case then can start with invoking the needed reset methods, the method invocation, the test evaluation, and often with another invocation of the reset methods.

Practice

Rewrite the game you have designed earlier using the mutation style. Instead of importing the draw library import the isdraw library and the tunes library. We may use the tunes library to add sounds and music to our games (and explore how to design tests in this context.)

Last modified: Friday, June 10th, 2011 2:19:49pm