I want to finish out this iteration and lock down the code. Whatever else I do next – well, I decide that over the next few days.
I went back to April 18's post to see what goals I set for finishing out this cycle.
GOAL: Revise tests for all the public constructors and methods, including DropStickRecurse and the value passed to the Board constructor that limits the number of sticks that can be added to a board.
STATUS: According to my spreadsheet, each of the constructors and methods has tests written.
GOAL: Evaluate whether all the public methods are necessary, including test_ methods.
STATUS: I ripped out all the overrides, except for ToString (below). I thought that I needed some of those, but the tests still run. If I trust the tests, then they weren't doing anything.
GOAL: Create a different test script for each method and constructor.
STATUS: Here's my list of tests:
- board_addStick.ps1
- board_constructorInt.ps1
- board_dropStickRecurse.ps1
- board_getPositionValue.ps1
- board_getStick.ps1
- board_moveStick.ps1
- board_removeStick.ps1
- board_test_isValid.ps1
- board_toString.ps1
- board_value.ps1
- node_constructorIntBoard.ps1
- node_currentNode.ps1
- node_doMove.ps1
- node_equals.ps1
- node_test_fall.ps1
- node_test_nodePosition.ps1
- node_test_offset90.ps1
- stick_constructorBool.ps1
- stick_constructorInt.ps1
- stick_location.ps1
- stick_value.ps1
This covers it.
GOAL: Create a toString method that returns a human-readable display of the grid (like the display function).
STATUS: Done.
GOAL: Use preprocessor directives to compile without testing code.
STATUS: Done.
GOAL: Write a test_ method to wrap each private method for testing. Previously, I've used the test_ methods on an ad hoc basis.
STATUS: Sufficient. I wrote wrappers for private methods in the node class. This did improve the quality of the code, but it would be hard for any of those methods to cause a problem because they are only called under controlled circumstances.
I'll include the C# code in a separate post today.
No comments:
Post a Comment