Snakes exploring Pipelines – A “System Engineering and Management” Project

Part 0: Introduction

This series of blog entries describes a student project focused on developing an application by using methods like pair programming, test driven development and deployment pipelines.

Once upon a time, which was about one and a half months ago, an illustrious group of three students found together, united by the shared interest to learn more about systems engineering and software development in the aptly named course “System Engineering and Management”.

As we had to choose a project to work on for the course, we decided to explore modern, professional development methodologies as employed in software development companies.
In particular, we wanted to focus on pair programming and test driven development with unit tests for the actual coding, as well as using a build and deployment pipeline for continuous integration, supported by tools and a version control system.

So, having decided that, the only remaining part we needed for our project was a concrete application to program.

After a long, emotional discussion (which lasted for at least ten minutes), we agreed on implementing a timeless classic, uniquely suitable for working with pipelines: Snake! (Actually, there was another application we considered beforehand, but we don’t talk about that anymore.)

A python. (Because snakes. Not the language.) Source:
A python. (Because snakes. Not the language.)

Snake promised an easy-to-code, basic system with the possibility of future additions, since the main focus was the process of development and deployment, as mentioned before.

Finding common ground in our experience with Java as programming language for the application itself, we chose fitting tools and frameworks. JUnit was an obvious choice for test driven development, as was Git(hub) for code versioning. For setting up our tool pipeline, we wanted to try out Gradle for build automation and the wide-spread Jenkins server for continuous integration. Regarding pair programming, we had to settle with ourselves, naturally.

Starting off with what we had most experience in, we designed the architecture for our Snake game with the help of time-tested tools such as: Bidirectional face-to-face communication, a whiteboard, and associated markers with varying output colours. The result of this task (which might be supplemented with a proper UML-diagram in future entries):

Take note of the highly accurate anatomical approximation of a snake.
Take note of the highly accurate anatomical approximation of a snake.

The rules of Snake are probably common knowledge, as such we will only provide a concise overview of the architecture for now: All entities off the game will be objects controlled by the game loop and visualized in a user interface. The Gameobject will be the parent class for the Bodypart-objects which form the snake, including the head. The Food-object will extend the Gameobject class as well. The snake will move in an Arena object (probably a JFrame).

The game loop executes Gamecontroller “ticks”. For each tick, the user input is checked, a new position for the snake is calculated, and the result is be rendered in the user interface.
While calculating the new position, the first action is to grow the snake body, if it has eaten the tick before, checking the game over conditions (the snake touching itself or the border ☹️), checking if the snake head reached food, checking the win condition (the snake covers the entire Arena ?) and finally creating a new food object, if the old one was eaten.

Having completed this first architecture draft, next on was setting up and configuring the development environment (Eclipse) and our tool pipeline. The exact workflow for this will be covered in the next blog entries.

Until then, happy slithering.