Skip to content

Pathfinding Test Plan

kk4w4i edited this page Oct 6, 2023 · 5 revisions

Overview

The goal of this test plan is to consider scenarios for the pathfinder, and check whether it outputs the correct path. The key tests will be whether the pathfinder correctly finds the "best" path, and whether the pathfinder reads the grid layout correctly.

Setup

Load in a dummy map with obstacles placed on the map.

Test 1: copiesCorrectGrid

  • Objective: Test if the nodes correctly mirror the "red" tiles (tiles that have an obstacle on it).
  • Methodology: Test through a JUnit script.
    • Establish a starting the target grid.
    • Make the pathfinder calculate the path.
    • Use a getter method to get the “closed” path which are the grids that the pathfinder avoided when calculating the path.
    • Check if the number of grids match with the number of grids in the pathfindergrids in the gameArea class.

Test 2: findPathTest

  • Objective: Test to see if the pathfinder returns the correct list of grids.
  • Methodology: Test through a JUnit script.
    • Establish a starting and target grid.
    • Make the pathfinder calculate the path.
    • Create the hypothesized list of grids.
    • Check if the list of grids match the hypothesized list of grids.
Clone this wiki locally