Lab Three: Adding Testing

You've implemented a game, and it works. But what confidence do you have in it? Does your game recover gracefully from bogus/unexpected input?

This week, you'll revisit a classmate's code, do some refactoring, and add some testing. 

Obtaining the Code

I'll assign you code to work with. You'll check it out and work from a repository as normal.

Grading

Grading will continue to be on a criterion-referenced basis. Last week, you were striving to be Completely Awesome. This week, you are striving for Samadhi, or complete focus and singleness of mind.

Checkpoint: Vitarka

The first level of meditation is vitarka, or focus on the object. You are the bee, hovering above the flower.

To achieve this state, you have done at least the following with your peer's code:

  • Comments. You have brought all of the comments up to JavaDoc spec. If they are already JavaDoc, you will work to improve/correct them if necessary. This implies that you understand what their code does.

  • Basic Tests. You provide at least one test for each method in the code. All tests are generated through the BlueJ IDE.

  • Exceptions. You catch all exceptions that can be thrown in the code, but do not provide unit tests for exceptional circumstances. 

  • Formating. The code should be consistently formatted when you are done with it if it was not so to begin with.

Checkpoint: Priti

Ecstasy that transcends words. The joy of old friends reacquainted after years apart.

To achieve this state, you have achieved vitarka as well as the following:

  • Improved Decomposition. You have broken down your colleague's code into a maximally testable state. This means pulling code out of their play() loop and other methods to maximize the ease with which you can test all of their code.

  • Coverage. You can argue successfully that every line of code is tested.

Checkpoint: Samadhi

Singleness of mind. You are one with yourself.

To achieve this state, you have achieved priti as well as the following:

  • Exceptional Testing. All code that might generate exceptions is unit tested.

  • Reflection. You and your partner each write a 1-2 page essay reflecting on the process of working with, revising, and testing other people's code. Was it challenging? Easy? Moreso than writing your own code? How? Why? 

Submission

Check your code in on time, and send me an email letting me know it is done.

Please include in the subject line of your email 

[DS 112] LAB SUBMISSION

That would make my life a bit easier. If you have questions, ask them in a separate email; your lab submission should just tell me it is done and the name of your lab, not tell me a story. If you tell me a story in your submission message, you will make Domo Kun cry.

When you are done with your lab, you practice your meditation.

Creative Commons License Creative Commons BY-NC-SA 3.0 Licensed where possible.