Você está na página 1de 4

Project 1 Readme

Names:
Denise Szeto (cs61bl-hb)
Clark Chen (cs61bl-hc)

Descriptions of Each Tests Purpose

testDotConstructor1:
This dot constructor takes in two int arguments which represents the Dots
coordinates on the board. It gives the created dot a randomly selected color.
Test that the constructor successfully creates a dot.

testDotConstructor2:
This dot constructor takes in three int arguments, two of which represent the
location (coordinates) of the dot on the board and one of which represents a
user designated color. Test that the constructor successfully creates such a
dot.

testDotGetColor:
Confirms that the color of the dot on which this method is called successfully
returns its color.

testDotIsSameColor:
Returns a boolean that this dot has the same color as the other Dot it
takes in as a parameter.
Confirms that this method works.

testDotIsColor:
Returns a boolean that states whether or not this Dot has the color that the
method takes in as a parameter. Confirms that this method works.






testConstructor1: tests the Board constructor which takes in no parameters.

testConstructor2: tests the Board constructor which takes in as a parameter a preset
array of (color) values.

testMovesAllowed: test getMovesAllowed() method.

testCanMakeMoves:

False Case - creates preset array which is created in a way that disallows any
move to be made. Tests to see if canMakeMove returns false.

True Case - creates another preset array which statistically should allow a
move to be made. Tests to see if canMakeMove returns true.

testIsGameOver:
No Possible Moves Case preset array made to guarantee that no moves are
available. Tests that IsGameOver must return true.

Moves is 0 Case Tests that when allowed moves is set to 0, IsGameOver
must return true

Game is Not Over Case - assert that when Game is Not Over, the method
must return false

testCanSelect:
Can Select Anything Case with the construction of a new board, test that
CanSelect returns true when attempting to select dots.

No Moves Allowed Case CanSelect must return false when moves-allowed is
set to 0.

Cannot Select Non-Adjacent Dot Case CanSelect must return false when an
attempt to select a non-adjacent dot is made.

Cannot Select Different Dot Color Case CanSelect must return false when
attempting to select a dot that is different in color to the previous dot.

testSelectDot:

CanSelect/CanDeselect a Selected Dot Case testing if CanSelect/CanDeselet
functions correctly on a dot that has already been selected.

Edge-Case test Testing the selection of dots that exist on the boundaries of
the board.

testNumberSelected:

Tests to see if method correctly returns the value of dots that have been
selected.

testIsClosedShape:
Preset arrays created. Dots selected that should obtain a boolean value that
correctly states whether or not the selected dots form a closed shape.

-Top Right Corner Case
-Bottom Left Corner Case
-Bottom Right Corner Case
-Top Left Corner Case

testRemoveSelectedDots:
Preset array of colors created. Dots selected, and RemoveSelectedDots is
called.


testRemoveSingleDot:
Left Column case checks if removing a single dot in the left side boundary of
the board works correctly.

Right Column case checks if removing a single dot on the right side
boundary of the board works correctly.

testRemoveSameColor:
RemoveSameColor method increments an instance variable named counter
each time it removes a dot. The helper method getCounter was created in
order to access the counter in the JUnit file. Checks to see if counter is truly
the number of dots that was removed by the method RemoveSameColor.


testDropRemainingDots:
Bottom Left Test Case checks to see that DropRemainingDots functions
correctly on a board that has had a dot removed in the bottom left.

Bottom Right Test Case checks that DropRemainingDots method functions
when a dot in the bottom right of the board has been removed.

Center Test Case checks that DropRemainingDots functions when a dot in
the center of the board has been removed.

testFindBestSquare:
* in these different test cases, other squares (besides the boundary test
squares) are also present in the boards; the invariant that the best square
that will yield the most points will be chosen should never be violated. This
is an inherent quality in these tests.

No Best Squares Case preset board made with no squares. Asserts that a
call to FindBestSquare will be unable to find a square.

Bottom Left Case preset board made with a valid square in the bottom left
of the board. Confirms that FindBestSquare is capable of finding this square.

Bottom Right Case preset board created with valid square in bottom right
of board. Tests if FindBestSquare finds it.

Top Left Case same as stated above, but for upper left of board.

Top Right Case same as above, but for upper right of board.




testFillRemovedDots:
Removes dots in the board, and checks to see if a call to FillRemovedDots
places dots functions correctly.




Summary of Members Contribution to Project

Implementation and project ideas were created together upon discussing and
planning. Much of the code was written together (in the same format as labs where
one member plans it out while the other types). The following allocation of project
parts illustrates situations where one member did most of the work on said project
part.

Denise:
-BestSquares
-1/2 JUnit Tests
-RemoveSelectedDots
-RemoveSingleDot
-RemoveSameColor
-DropRemainingDots
-fillRemovedDots


Clark:
-Dot
-1/2 JUnit Tests
-CanMakeMove
-FindBestSquares
-CanSelect / CanDeSelect
-SelectDot
-isClosedShape

Você também pode gostar