-
Notifications
You must be signed in to change notification settings - Fork 1
Testing
Unfortunately, there was not a whole lot of unit testing we could do with our project as a result of the large amount of impure functions, heavy usage of ui and occasional use of random number generation throughout the codebase, however we did manage to find a function that could unit test well.
The next turn function on the TurnTracker Queue was fully pure and deterministic, unfortunately the function is very simple so testing it did not yield any interesting or notable results.
Instantiate a TurnTracker object with players and call next turn until a cycle is completed.
Current player should cycle through the queue and wraparound back to the start.
As expected.
Pass.
There were a lot of other functions that were still tested however, even if less vigorously than a unit test. For example:
We pitted 5 AI players against one another and watched the gameplay to ensure the AI was behaving as expected.
All functionality is roughly as expected (with some element of randomness due to the nature of the AI)
Barely ever making a reasonable move at all, seemingly picking moves entirely at random.
Fail
After looking into this deeper, it turns out the wrong function was being used to decide whether to randomly do a bad move or not and instead of getting the normal X% chance that a bad move occurs, it was always picking a bad move. We rectified this by replacing the random number generating function with the correct one.
We pitted 5 AI players against one another AGAIN and watched the gameplay to ensure the AI was behaving as expected with the altered code
All functionality is roughly as expected (with some element of randomness due to the nature of the AI)
Moves seem mostly reasonable, however troops being placed badly is much more common than expected.
Fail
Make the AIs have no chance of picking a bad move temporarily to investigate further.
We pitted 5 AI players against one another AGAIN and watched the gameplay to ensure the AI was behaving as expected with the altered code and no chance of a bad move
The placement of troops should be improved
Placement of troops still remained erratic and poor
Fail
Will need further investigation, however when testing the AIs at varying difficulty levels, stronger AIs are still notably winning more so this will become low priority for now.
Retested the last test WITH the occasional awarded troops to territories from cards turned off to see if it's just that
The placement of troops should be improved
Placement of troops was improved immediately
Pass
Selecting territories
The arrow drawn as a visual aid should be from the first territory selected to the cursor, or when a second territory is selected to that territory instead.
The arrow will occasionally come from the territory selected before the correct one instead
Fail
Warrants further investigation, hoping this is due to some cached state being updated later than intended
Saving a malformed board in the board editor
Should not be possible
In most cases, the board is blocked from being saved, however if the user attempts to save, is declined, makes one change so that it is valid, saves, reopens the editor, undoes that change and saves, it can save a malformed board.
Fail
Absolutely no idea how to even begin to approach this one, we don't have time to research this issue unfortunately but if we get time, I would definitely start with looking into the location of the validity check first.