[General boards] [Winter 2019 courses] [Fall 2018 courses] [Summer 2018 courses] [Older or newer terms]

Several questions regarding A2


#1

1: I remember seeing that we can set the bubble created at the original position of the fish before moving, or above the new position of the fish. Will the AutoTest take up both cases?
2: Can we assume that the boundaries of the FishTank is fixed at 106, 48? If not, do we need getter methods for the height and width of FishTank?
3: Will FollowFish eat seaweed just like Fish and HungryFish?
4: Do we need to write test cases for all scenarios of a single behaviour? For example, the sample test “testFishBubbles” mocks a Fish going to the left and blow a bubble one tile left. Do we need to write another test case that mocks a Fish going to the right and blow a bubble right tile right? If so, do we put all those scenarios under one single method with multiple assert statements?

Many thanks!


#2

1: Yes, both are fine
2: You can assume the boundaries are constant (though you should access them through a public static final int in FishTank, probably)
3: It can, it’s up to you if you want to implement it this way
4: This it totally up to you, but you should always err on the side of making more tests than less (e.g., 1-3 asserts per @Test, 1-2 tests per point in the Behavior section, a few more for “sanity” (e.g., fish shouldn’t move backwards…)