How to Plan and Execute Test Cases for Your Minecraft Mod - For Dummies

Before playing your Minecraft mod, identify the different test cases to make sure that your game is working properly. Test cases are the different ways to test your mod to check whether it’s behaving correctly.

Before you write a test case, make two lists that spell out

  • What you will test: For example: Break the melon block.

  • What you expect to happen: For example, the gamemode switches to Survival, and blocks below you disappear after one second.

If your test cases pass, you know that the mod is correct.

The following list shows five sample test cases for the Spleef mod:

  • The scene sets up properly. When you run the mod, two arenas appear: a brick arena with lava and a diamond arena with a tall fence.

  • The player is put into Survival mode when the melon block breaks. When you break the melon block, the player is set to Survival mode.

  • Blocks disappear. One second after you touch a block, it disappears.

  • Lava causes the player to lose health. When the player falls into the lava, they lose all their health.

  • Respawn back to arena. Two seconds after the player respawns, she automatically returns to the arena again.

Come up with at least one more test case, and then test all of them on your game. If something doesn’t match your expectation, such as blocks don’t disappear when you walk over them, begin debugging the code.