Game Engine Tests #38
Code-Over-Time
announced in
Tasks: Mid Level
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Category: General Development
Level: Mid
Description
Many of the projects within Code Over Time have a test suite that can be executed to verify that the product is functional, but there is one significant gap in the test coverage.
The Rock, Paper, Scissors Apocalypse game engine has no tests at all, despite being quite testable.
If you open
game_rps/game_engine
you will find a folder calledtests
... but sadly it is empty. This is an all too common occurrence. We start out with the best of intentions - planning to implement a whole bunch of tests, but it's kind of boring so we put if off, and never get back to it.For this task you need to write some functional tests (end to end functionality) and unit tests (testing small units of work).
For example, you should test that you can play an entire game using this engine. That the game ends successfully and only one person wins. That is your functional test.
Then you should test individual bits of logic, like:
Here it should be pretty simple to verify the behavior of the Rock in our Rock, Paper, Scissors game.
You don't need to get 100% coverage here, just use your judgement to make sure you are testing the most important parts of the game (like the above weapon test - it's critical that this works as expected).
Deliverable
Acceptance Criteria
Task Tips!
happy path
where everything just works. What happens if you use invalid arguments to functions, like a string instead of a number? What if you try to start a game with only one player added? You need to verify that things fail gracefullysrc/game_models.js
as it should be easy to write tests forBeta Was this translation helpful? Give feedback.
All reactions