Skip to content

TCR kata repository for the Software Craft Luxembourg Community Autumn Camp 2022

Notifications You must be signed in to change notification settings

les-tontons-crafters/submarine-tcr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disclaimer

The puzzle used for this kata is taken from Advent Of Code 2021 (Day 2 - Part 2). All credits goes to AOC's team for their incredible work.

The TCR Utility Tool in this repository is Murex's one that can be found here.

Autumn camp

Kata

The goal of this kata is to allow people to get familiar with TCR (Test && Commit || Revert), and experience it in a safe context as a pair or mob.

Prerequisites

  • Your favorite IDE
  • SpecFlow plugin
  • Cucumber plugin available here

Story

You need to figure how to pilot this submarine.

It seems like the submarine can take a series of commands like forward 1, down 2, or up 3:

  • down X increases your aim by X units.
  • up X decreases your aim by X units.
  • forward X does two things:
    • It increases your horizontal position by X units.
    • It increases your depth by your aim multiplied by X.

Note that since you're on a submarine, down and up affect your aim and do the opposite of what you might think.

The submarine seems to already have a planned course. You should probably figure out where it's going. For example:

  • forward 5
  • down 5
  • forward 8
  • up 3
  • down 8
  • forward 2

Your horizontal position, depth and aim all start at 0. The steps above would then modify them as follows:

  • forward 5 adds 5 to your horizontal position, a total of 5.
    • Because your aim is 0, your depth does not change.
  • down 5 adds 5 to your aim, resulting in a value of 5.
  • forward 8 adds 8 to your horizontal position, a total of 13.
    • Because your aim is 5, your depth increases by 8*5=40.
  • up 3 decreases your aim by 3, resulting in a value of 2.
  • down 8 adds 8 to your aim, resulting in a value of 10.
  • forward 2 adds 2 to your horizontal position, a total of 15.
    • Because your aim is 10, your depth increases by 2*10=20 to a total of 60.

After following these instructions, you would have a horizontal position of 15 and a depth of 60.

Goal

The goal of the kata is to make all acceptance tests pass following Test-Driven Development and using the TCR Utility Tool.

(SUPER) Important

Create a branch of your own so you don't push all your commits on the main branch!

Tool

Without going too much in detail, here's a little explanation on how the TCR Utility Tool works.

The command must follow the following format, and be executed from the root directory:

  • .\tcr\OS\tcr.exe -b .\language\ -w .\language\ -l language
// For Java
./tcr/MacOs/tcr -b java/ -w java/ -t maven
.\tcr\Windows\tcr.exe -b .\java\ -w .\java\ -l java -t maven

// For C#
./tcr/MacOs/tcr -b csharp/ -w csharp/ -l csharp
.\tcr\Windows\tcr.exe -b .\csharp\ -w .\csharp\ -l csharp

From there, the tool will provide a set of options:

[TCR] Available Options:
[TCR]   D -> Driver role
[TCR]   N -> Navigator role
[TCR]   P -> Turn on/off git auto-push
[TCR]   Q -> Quit
[TCR]   ? -> List available options

It's pretty simple:

  • When it's your turn to drive, pick the Driver role or press D. You will be the driver for the next 5 minutes.
  • Otherwise, pick the Navigator role or press N. You will constantly pull commits and have an up-to-date codebase.

Please, make sure to follow your rotation and have only one driver at a time.

Have fun!

Rules

  • Follow the Test-Driven Development approach.
  • ISubmarine interface cannot be changed.
  • Submarine component should have an empty constructor.
  • Handle empty/wrong input so they don't affect the state of the submarine without stopping the process.
  • When an acceptance test pass, change its tag to 'Acceptance'.
  • Apply SOLID principles whenever possible
  • Think about design like it's production code.
  • Refactor the code like it's production code.
  • It is production code, remember?

Advices

  • Baby-steps. If you think you're going small, think smaller.
  • You should have TCR generating commits often, like every few minutes.
  • If you spend more too much time on an implementation, discard your changes and start with another approach.
  • The submarine's behavior is detailed in the summary.
  • Try to implement pure functions for better predictability.
  • Use acceptance tests to follow your progress.

About

TCR kata repository for the Software Craft Luxembourg Community Autumn Camp 2022

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published