BackstoryCutsceneDisplay Test Plan - UQcsse3200/2024-studio-3 GitHub Wiki
Test Environment
- Framework: JUnit 4
- Dependencies:
BackstoryCutsceneDisplay
: The main class under test.ServiceLocator
: Manages the services used in the game.RenderService
: Registered service to support rendering functionality.Entity
: A game entity to whichBackstoryCutsceneDisplay
is attached.EventHandler
: Mocked event handlers for verifying event triggers.Skin
,Stage
: Mocked UI components for managing LibGDX UI elements.
Error Handling
- Purpose: Due to the tight coupling between
BackstoryCutsceneDisplay
and the LibGDX framework, some aspects of testing, particularly around UI rendering and interactions, required visual testing. - Setup:
- Simulate UI failures such as missing stage or texture resources.
- Expected Outcome:
- The UI should handle errors gracefully without crashing.
- Logs should provide appropriate warnings or errors in case of missing or failed components.
Logging Verification
- Ensure that all key actions (e.g., button presses, stage setup, resource disposal) are logged appropriately.
- Log messages should be verified through mock loggers, ensuring that event-based logging provides sufficient information for debugging.
Visual Testing
https://github.com/user-attachments/assets/c9e23889-f03a-4355-8069-665394b87e2f
Conclusion
Due to the tight coupling of UI components with the LibGDX framework, full automated testing of the BackstoryCutsceneDisplay
class was not feasible. Instead, visual testing was primarily employed to ensure proper UI rendering and interaction, while the associated BackstoryCutscene
class underwent complete automated testing to verify core logic and event handling. Visual tests confirmed the proper functioning of UI elements, including buttons and text displays, and ensured that resources were properly disposed of. Additionally, due to time constraints and the nature of how the CutsceneTextDisplay class was implemented, the text display for the backstory renders at the bottom of the screen instead of the top. It also is quite large and covers some of the visual elements, which will be refined in the upcoming sprint.