Skip to content

Test Plan for Sensor Component

Caleb Murphy edited this page Aug 28, 2024 · 4 revisions

Test Environment

  • Framework: JUnit 4
  • Objects Used: SensorComponent, InteractionComponent, Entity (mocked), Interactable Target (mocked), non-Interactable Target (mocked)

Test Cases - Testing SensorComponent Methods

  1. Sensor Component Initialisation: To verify that the SensorComponent is properly initialized and its interaction component is correctly set up. Purpose: To ensure that the sensor component handles its creation and sets the correct target layer. Expected Results: Sensor Component, it's Interaction Components, and its fixture is not null after creation The fixture should be the same as the entity created fixture

  2. Entity Initialisation: To verify that the entity is correctly initialized with the InteractionComponent and that its fixture is properly configured. Purpose: To ensure that testing of other components are not affected by incorrect initialisation.layer. Expected Results: It's fixture for the interaction component should not be null The fixture should be a part of the INTERACTABLE physics layer

  3. Target Initialisation: To verify that the entity is correctly initialised with the InteractionComponent and that its fixture is properly configured. Purpose: To ensure that testing of other components are not affected by incorrect initialisation. Expected Results: It's fixture for the interaction component should not be null The fixture should be a part of the INTERACTABLE physics layer

  4. Adding Features to a List: To verify that when an interactable component is collided with, it is added to a list. Purpose: To ensure that interactable objects are being handled correctly when collided with. This involves adding it to a list of colliding objects Expected Results: Before colliding with an interactable object, the closest interactable object should be null After colliding with an interactable object within range, there should be 1 value inside the colliding fixtures variable

  5. Detecting closest object: To verify that the closest interactable object is returned when calling getClosestFixture(). Purpose: To ensure that the closest interactable object is always returned regardless of the number of interactable objects close by Expected Results: After colliding with an interactable object, the closest interactable object should not null After colliding with an interactable object, the closest interactable object should be the collided interactable object

  6. Not detecting far objects: To verify that objects out of range are not able to be interacted with. Purpose: To ensure that if an interactable object is out of range of the sensor component, it is not added to the list of interactable objects and thus cannot be interacted with. Expected Results: After colliding with an object out of range, the closest interactable object should be null

  7. Not detecting a bad target: To verify that only interactable objects are detected by the sensor. Purpose: To ensure that the player can not call interactable functions on an object that is unable to be interacted with. Expected Results: After colliding with an non-interactable object, the closest interactable object should be null

  8. Remove a target after the collision has ended: To verify that after the player is out of range of an object and has thus called to end the collision, it can no longer be interacted with. Purpose, if the player is out of range of a previously interactable object, they should not be able to interact with it. Expected Outcome: After calling collision ended on the only interactable object within range, the closest interactable object should be null

Table of Contents

Home

Team Design Document

Game Features

Inventory System
Scoring System
Food Recipes
Level System
Player Actions
Ordering System
Stations
Items
Map Design
Customers
Pause Menu
Upgrades
End of Day Display
Day Night Cycle
Moral System
Debug Terminal
Game Interactions Tutorial
Backstory Cutscenes

Game

Getting Started

Entities and Components

World Backstory

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Map Design

Test Plans

Sensor Component

Customer Sensor Component

Interaction Component

Inventory Component

Inventory Display

Station Meal Component

Station Progress Display

Keyboard Input Component

Fire Extinguisher Handler Component

Score System

HoverBox Component

MainGameActions Create Docket Triggers

End Day Display Component

Cutscene Area

Docket

Docket Line Display

Docket Meal Display

Main Game Order Button Display

Order Actions

Recipe

Ticket Details Component

BackstoryCutscene Test Plan

BackstoryCutsceneDisplay Test Plan

Test Plan for Tutorial

Keybinds

Keybinds Test Plan

Test Plan for MainGameOrderTicketDisplay

Test Plan for MainGameOrderBtnDisplay

Test Plan for Docket

Test Plan for DocketLineDisplay

Test Plan for OrderActions

Ticket Details

Test plan for RandomComboService

Test plan for LoanUpgrade

Test plan for UpgradesDisplay

Test plan for RageUpgrade

Test plan for SpeedBoostUpgrade

Test plan for DancePartyUpgrade

Test plan for ExtortionUpgrade

Troubleshooting

MacOS Setup Guide

Clone this wiki locally