Description
The purpose of this lab is to explore some subtle aspects of encapsulation. In particular, a program is given which appears (for the most part) to be properly encapsulated. However, there remain certain ways in which code can break encapsulation. Your job is to harden the code base against such attacks.
1 RobotWar
A small software program, called Robot War, is provided which implements a battle arena in which robot with artificial intelligence can compete against each other.
You can download the robotwar.jar from the lecture schedule on the course home page. You should begin by running the software and getting a feel for how it works. Figure 1 shows a screenshot from RobotWar.
2 What to do
You should find that a number of the invalid tests are failing. Your job is to harden the robot war code base against the attempts to break encapsulation embodied in the invalid tests. Please note that just changing the test code is insufficient for this lab. Rather, you instead need to ensure certain objects do not give away as much information as they currently are.



