Search⌘ K
AI Features

Initiating a New Wordz Game Instance

Explore how to begin coding a new Wordz game instance by applying test-driven development and hexagonal architecture. Understand creating tests for starting a game, handling user stories, and designing domain model ports to ensure clean and maintainable code.

In this lesson, we’ll start by coding our game. Like every project, starting is usually quite difficult, with the first decision being simply where to begin. A reasonable approach is to find a user story that will begin to develop the structure of the code. Once we have a reasonable structure for an application, it becomes much easier to figure out where new code should be added.

Finding application structure through user stories
Finding application structure through user stories

This way, we can have a good start by considering what needs to happen when we start a new game. This must set things up ready to play and so will force some critical decisions to be made.

User story

The first user story to work on is starting a new game. As players, we want to start a new game so that we have a new word to guess.

When we start a new game, we must do the ...