Training kata to develop a remotely controlled Mars rover using TDD.
A training kata to develop an API that translates commands sent from Earth into instructions understood by a rover on Mars.
You're part of the team exploring Mars by sending remotely controlled vehicles to the planet's surface. Your task is to develop an API that allows controlling the rover via commands.
The rover has an initial position (x,y) and a direction (N,S,E,W)
It receives an array of commands: FORWARD, BACKWARD, LEFT, RIGHT
Implement forward and backward movement
Implement left and right turns
Implement wrapping at edges (the planet is a sphere)
Detect obstacles before each movement
If an obstacle is found, the rover stops and reports its position
Requirement: Java 21
Build Tool: Gradle
Includes: Implemented solution and Spring service
Hardcore TDD: No excuses
Switch roles (driver, navigator) after each TDD cycle
No red phases during refactoring
Careful with edge cases and exceptions
Java 21
Gradle
Spring Framework
JUnit 5
Practice Test-Driven Development
API design
Coordinate and direction handling
Collision detection
Pair programming