Testing Plan for MazeUnderwater Mini‐Game - UQcsse3200/2024-studio-2 GitHub Wiki
Testing Plan for the MazeUnderwater Mini-Game
This wiki outlines the testing plan for the MazeUnderwater mini-game, covering the testing approach, key testing files, and components that require visual checks instead of JUnit tests.
Testing Approach:
-
Unit Testing
Objective: To test that the individual game components behave correctly and interact as expected.
Scope: Focus on testing the primary entities (Angler Fish, Electric Eel, Jellyfish, Fish Eggs) and ensuring their functionality during gameplay. Key features, such as movement, collisions, and maze-related mechanics, are also covered. -
UI/Visual Checks
Objective: Ensuring that all visual elements are displayed correctly and interact smoothly in the game.
Scope: This includes verifying animations, rendering of the maze, enemy behaviour, lighting effects (such as limited sight radius), and responsiveness to user inputs. Visual checks are required for aspects where unit testing is insufficient, such as the maze visibility effects.
Testing Files:
The following files were included for unit testing to ensure proper functionality of the MazeUnderwater game components:
-
AnglerFishTest.java
Tests the Angler Fish's behaviour in chasing the player, ensuring the collision detection works properly and the damage mechanism (20 damage per hit) is applied. -
ElectricEelTest.java
Ensures the Electric Eel appears at regular intervals, stuns the player on contact, and provides a brief light effect to illuminate parts of the maze. Confirms the eel deals 5 damage upon collision. -
JellyFishTest.java
Verifies that Jellyfish move randomly within the maze and apply 10 damage when they collide with the player. -
FishEggTest.java
Tests the interaction between Nemo (player) and the fish eggs. Confirms that eggs are collectible, increase the player’s score, and contribute to the medal tally at the end. -
MazeNPCFactoryTest.java
Validates the creation of Non-Playable Characters (NPCs) like the Angler Fish, Eels, and Jellyfish, ensuring they are correctly instantiated in the maze. -
MazeObstacleFactoryTest.java
Tests the correct generation and placement of obstacles within the maze, including walls and hazards, to ensure the player cannot pass through them. -
MazePlayerFactoryTest.java
Checks the instantiation and movement of the player (Nemo), ensuring correct controls and interactions within the maze environment. -
MazeCombatStatsComponentTest.java
Verifies that the player and enemies (like Angler Fish and Jellyfish) have correct health points and deal/receive damage appropriately during combat interactions. -
MazePathFindingTaskComponentTest.java
Tests the pathfinding algorithm used by the Angler Fish to chase Nemo. Ensures the fish navigates the maze properly without getting stuck. -
MazeTouchAttackComponentTest.java
Validates that enemies can correctly attack the player upon contact and apply the proper effects, such as damage or stun.
Classes Unable to Be Tested:
Some components of the MazeUnderwater mini-game could not be unit tested due to their complex interactions that require visual confirmation:
- MazeGameAreaTest.java
This class manages the overall game area and requires visual verification. It works as expected if the maze renders correctly, enemies and obstacles are placed in the correct positions, and the player’s view (limited sight radius) functions as intended.
Visual Checks:
To confirm that visual elements work correctly, manual visual testing is required for the following components:
-
Maze Rendering:
The maze should display with clear boundaries, and the fish should only see within a limited radius, enhancing the gameplay challenge. -
Angler Fish, Eel, and Jellyfish Animations:
All enemies (angler fish, electric eel and the jelly fish) must animate smoothly. The Angler Fish should visibly chase the player, the Eel should appear at intervals from the sides, and the Jellyfish should float through the maze. -
MazeNPCFactory and MazeObstacleFactory:
Ensure that NPCs and obstacles are generated and rendered correctly in the game world. Walls should block the player’s movement, and enemies (angler fish, electric eel and the jelly fish) should appear in their designated areas. -
MazeGameArea and MazeTouchAttack:
Ensure that the game area responds correctly to player input and that interactions between the player and enemies (angler fish, electric eel and the jelly fish) triggers the appropriate visual effects. -
End Game Screen and Medal Display:
The end game screen should display correctly, showing the player's score, the number of fish eggs collected by the player, and the medal awarded based on the score. The screen should be interactive, allowing players to retry or exit the game and go to the main menu screen.