TGDG - Test-Driven Game Development

Chiara Emanuela Zarrella
(2025) , 62 pages

Files

2025-TDGD-Test-DrivenGameDevelopment.pdf
  • Open Access
  • Adobe PDF
  • 1.57 MB

Details

Authors
  • Chiara Emanuela ZarrellaUCLouvain
    Author
Abstract
Since the earliest days of human civilization, games have played a fundamental role in culture and society. They combine reasoning, strategy, and enjoyment: attributes deeply intrinsic to human nature. With the advent of computing and the rapid evolution of programming languages, games have also become a significant subject in various research domains. One of the most prominent areas is General Game AI. This field focuses on the analysis, generation, and design of games through artificial agents. These agents, referred to as General Game Playing (GGP) agents, are designed to play multiple games by understanding their rules rather than being hardcoded for specific ones. Over time, these agents have been incorporated into broader frameworks known as General Game Systems (GGS), platforms capable not only of playing but also of supporting game design, teaching, and experimentation with new games. Among the most notable of these systems is Ludii, the platform that forms the basis of this thesis. At present, Ludii includes 1,409 games, including reconstructions of ancient and traditional games, modern games, and experimental games. This rich library makes Ludii particularly appealing to historians and scholars of cultural heritage interested in understanding or preserving historical gameplay. Ludii is distinguished by its unique Game Description Language (GDL), built upon the concept of ludemes: atomic, human-readable units of game-related information. By combining ludemes hierarchically, users can describe a wide variety of games concisely and in a manner close to natural language. Such ludeme-based approach makes Ludii accessible not only to computer scientists, but also to game designers, historians, and researchers in the humanities, many of whom may not possess a background in computer programming but are still able to meaningfully contribute by encoding games. To support this accessibility, Ludii offers a Graphical User Interface (GUI) that includes an integrated game editor and a visual game board, along with a collection of AI agents. These features allow users to develop, play, and evaluate games directly within the platform, either against artificial opponents or by observing automated matches between different agents. Despite the accessibility offered by Ludii’s ludeme-based language, developing games within the platform remains a non-trivial task, especially for users with no formal background in computer science. While ludemes simplify the writing of game descriptions, users still face challenges: Ludii’s GDL has its own syntactic and semantic rules, which must be learned and respected. Errors in rule encoding, misinterpretation of game mechanics, or subtle inconsistencies in ludeme usage can easily result in flawed implementations. Although the system includes a syntax validator, semantic errors frequently go unnoticed. A game may compile without errors but fail to play correctly. This places a considerable burden on the developer, who must engage in time-consuming manual debugging. In traditional software development, this problem is mitigated by testing frameworks, which allow developers to verify system behavior through automated tests. Unfortunately, Ludii currently lacks such a framework for its GDL, leaving developers without structured tools to validate their implementations during development. This thesis explores whether the established methodology of TDD can be adapted to the domain of general game development. We refer to this adaptation as Test-Driven Game Development (TDGD). TDD is based on writing a test before implementing the corresponding feature or functionality. The process follows a simple cycle: 1. Write a failing test that captures the intended behavior. 2. Write the minimum code necessary to pass the test. 3. Refactor the implementation and the test to improve clarity and maintainability. This methodology aligns naturally with the incremental and modular nature of game development. In Ludii, a game is generally structured in terms of major components such as Players, Equipment, and Rules, each of which is represented by specific ludemes. A Ludii developer typically starts by defining the players, then proceeds to the equipment, and finally encodes the rules. A testing tool that supports and encourages this iterative process (validating each component as it is introduced) would represent a significant improvement in Ludii’s development ecosystem. Such a tool could not only reduce implementation errors but also serve as a learning companion, helping new users understand Ludii’s GDL through well-defined and testable examples. The goal of this work is to provide a dashboard extension to the existing Ludii GUI, along with an integrated database of tests, to support Ludii developers in adopting a TDGD approach. The dashboard is designed to allow developers to run tests multiple times across different stages of development, enabling early validation and iterative refinement of their work. Additionally, the system will provide meaningful feedback when tests fail, helping users identify and resolve errors in their game definitions effectively. The supported tests span different categories, including those verifying semantic rules and game-specific behaviors. The ultimate objective is to offer a user-friendly tool that enables both the reuse of predefined tests and the creation of custom tests. Given that many Ludii users may lack a background in computer science, particular attention is devoted to ensuring the accessibility of the system. For instance, test names and failure messages must be clear and self-explanatory
Affiliations

Citations

Chiara Emanuela Zarrella. (2025). TGDG - Test-Driven Game Development. https://hdl.handle.net/2078.5/275185