Code Testing - UQdeco2800/2022-studio-1 GitHub Wiki
Based off of feedback received from sprint 1 the following changes were made:
- Moving functionality to remove buildings to a separate keybind
- Creation of multiple new building types
- Added support to upgrade buildings
- Added support to sell buildings
In accordance with the [Test Plan] (./Software-Test-Plam) tests were written for the ResourceCostComponent and the TrapComponent. Furthermore, greater emphasis was placed upon user testing which was undertaken to gain feedback in relation to the upgradeStructure, and handleBuildingDestruction methods.
Requirement | Test case addressed by |
---|---|
Test entities are damaged by trap | ShouldTrap |
Test entities with the wrong hitbox layer are not damaged by trap | shouldNotTrapOtherLayer |
Test entities without a combat component are not trapped | shouldNotTrapWithoutCombatComponent |
Requirement | Test case addressed by |
---|---|
Test the cost of buildings is returned correctly | shouldGetResources |
To fairly conduct user testing, the following assumptions were made:
- The player would be provided with a control scheme outlining all game controls (the assumption being this is a UI element which has not yet been included in the game)
- The player would be given an outline of the game, and its win conditions
- The user would be provided a goal to achieve within the game
Players were given the following goals to complete within the game, and feedback was collected during and after observation:
- Create one of each of the buildable structures
- Destroy buildings
- Upgrade buildings
- When presented with a building of an unknown level, ask the player what level the building was
Observations:
- Players were easily able to understand and construct new structures
- Players were frustrated with the functionality of switching between buildings
Suggested improvement: Integrate ability to purchase buildings through the shop when the functionality is present - Players were frustrated when there is no indication of what building they are currently constructing
Suggested improvement: Create a icon of what building is currently selected as a UI element - Players were easily able to tell what level buildings were when familiar with Roman numerals
- Players were easily able to destroy buildings
- Players were frustrated that the UI did not update to show their refunded resources
Given that the team had many dependencies (UI element not updating to show refunded resources, waiting on UI / Shop team to complete their features to allow integration) the code test coverage suffered. To ensure our features were able to be used however, appropriate key binds were chosen to allow players to use the features.
In the future, the team will need to complete tests for all the new components / methods and ensure the features are integrated correctly with both the Building UI, and also the Shop UI.