Minecraft Modding For Kids For Dummies
Book image
Explore Book Buy On Amazon

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.

About This Article

This article is from the book:

About the book authors:

Sarah Guthals, Ph.D. is the CTO of ThoughtSTEM and has dedicated her life to coding education.

Stephen Foster, Ph.D. is the CEO of ThoughtSTEM, a company that teaches computer science to kids across America.

Lindsey Handley, Ph.D. is the COO of ThoughtSTEM and has hundreds of hours of experience as a classroom instructor for Minecraft based science and computer science classes.

This article can be found in the category: