Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 2.44 KB

test-documentation.md

File metadata and controls

33 lines (22 loc) · 2.44 KB

Test documentation

The game has unit tests as well as integration tests. The testing is focused on the applicatiopn logic, and the code related to the UI is left untested.

Unit and integration tests

The game logic

The game logic is found in the Player, Level and GameLoop classes. The Player class is tested with the TestPlayer test class, testing the player's methods one by one. Testing player controls is done by feeding the desired pygame event objects into the player controls.

The GameLoop tests focus on the integration between the game component classes. Testing the GameLoop "as is" would be quite difficult, so the TestGameLoop test class is implemented by injecting Stub versions of some dependencies that would make testing tricky.

Storing and querying data

The DataBase class is responsible for all data storing and querying. It is tested with the TestDataBase class. The database tests use a separate database set in the .env.test file in order to not interfere with the users actual game data.

Loading files

The loaders package is responsible for loading all the files the game needs (images, fonts). The package is tested with the TestLoaders test class.

Test coverage

The branch coverage of the automated tests is 84% excluding the UI.

coverage

All the classes with the most important application logic have good test coverage. The Clock, EventQueue and Renderer classes have no coverage, as these have been implemented as stub classes in the tests. The maps file has no coverage because the tests implement different maps designed for testing, not gameplay.

System testing

The complete program "as the user would use it" has been tested manually and should comply with the requirements specifications.

Installation and configuration

Installation has been tested manually using the instructions found in the user manual. Configuring the program with the .env file has been tested as well.

Features

The game has been tested to fulfill all features specified in requirements specification.

Operating systems

The game has been tested on both Linux and macOS.