/incubyte-assessment

This repository contains my solution for the Incubyte assessment problem statement. The problem required the development of a spacecraft control system with a focus on implementing a robust class structure and thorough testing.

Primary LanguageJavaScript

Chandrayaan 3 Lunar Craft: Galactic Space Craft Control

Project Explanation: -

  • Primary Language: Javascript
  • Test framework: Jest
  • IDE: VS Code

Commits Explanation: -

In this initial commit, I've set up the foundational structure for the project. I've added the essential files "spacecraft.js" and "spacecraft.test.js" which will contain the implementation of the spacecraft class and its corresponding tests.

In this commit, I've introduced the fundamental Spacecraft class. The class includes a constructor that initializes the spacecraft's position and direction. Moreover, I've set up the necessary module import and export structure in "spacecraft.test.js" to ensure proper integration with the test suite.

In this commit, I've written a series of tests to thoroughly assess the functionality of the 'moveForward' method within the Spacecraft class.

This commit signifies the successful implementation of the 'moveForward' function within the Spacecraft class. The function now accurately updates the spacecraft's position based on its current direction, allowing it to move forward in the intended manner

In this commit, I've written a comprehensive set of tests to validate the correctness of the 'moveBackward' method in the Spacecraft class.

This commit indicates the successful implementation of the 'moveBackward' function within the Spacecraft class. The function now effectively adjusts the spacecraft's position based on its current direction, enabling backward movement.

In this commit, I've created a comprehensive set of tests to rigorously examine the behavior of the 'turnLeft' method in the XY plane of the Spacecraft class.

This commit marks the successful implementation of the 'turnLeft' function within the XY plane of the Spacecraft class. The function now correctly alters the spacecraft's direction while considering the XY plane constraints.

In this commit, I've developed a comprehensive suite of tests to thoroughly validate the functionality of the 'turnRight' method in the XY plane of the Spacecraft class.

This commit signifies the successful implementation of the 'turnRight' function within the XY plane of the Spacecraft class. The function now accurately adjusts the spacecraft's direction, adhering to the rules of the XY plane.

In this commit, I've crafted an exhaustive set of tests to rigorously evaluate the behavior of the 'turnUp' method in the Spacecraft class.

This commit confirms the successful implementation of the 'turnUp' function within the Spacecraft class. The function now appropriately changes the spacecraft's direction to "Up" while considering relevant conditions.

In this commit, I've designed a comprehensive set of tests to thoroughly examine the behavior of the 'turnDown' method in the Spacecraft class.

This commit indicates the successful implementation of the 'turnDown' function within the Spacecraft class. The function now effectively alters the spacecraft's direction to "Down" while considering relevant constraints.

In this commit, I've created a series of edge test cases to rigorously examine the behavior of the 'turnRight' method when the initial direction is 'Up' or 'Down.'

In this commit, I've devised edge test scenarios to thoroughly validate the behavior of the 'turnLeft' method when the initial direction is 'Up' or 'Down.'

This commit addresses an issue discovered during edge testing of the spacecraft functions. The necessary fixes have been applied to ensure accurate behavior under edge conditions.

In this commit, I've created an example test case to validate the functionality of the 'executeCommands' method in the Spacecraft class.

This commit confirms the successful implementation of the 'executeCommands' function within the Spacecraft class. The function accurately executes a series of commands, resulting in the expected spacecraft position and direction.

In this commit, I've developed a set of tests to thoroughly assess the functionality and correctness of the 'executeCommands' method in the Spacecraft class.

In this commit, I've updated the README file to provide comprehensive explanations for all commits made throughout the project's development. Each commit's purpose, changes, and outcomes are clearly documented, enhancing the understanding of the project's progression and codebase.

Added test cases to check the behavior of the spacecraft when it encounters invalid commands during execution.

Addressed the failing invalid command tests by implementing command validation to ensure that only valid commands are executed.

Introduced test cases to validate the spacecraft's functionality for performing complex 3D movements involving turns and rotations through different directions and planes.

Defined constants that represent complex movements involving changes in 3D planes and directions, providing a foundation for implementing the corresponding logic.

Improved the 'turnLeft' and 'turnRight' functions to handle complex plane transitions and direction changes based on the current plane.

Enhanced the 'turnUp' and 'turnDown' functions to ensure proper plane transitions and direction adjustments according to the established constants.

Provided an update to the README to reflect the newly added support for complex 3D commands in the spacecraft code, along with brief explanations of the commits made.

Conclusion: -

  • The Chandrayaan 3 spacecraft now executes diverse commands, showcasing effective TDD and systematic design.

  • Through the application of Test-Driven Development (TDD) principles, we have successfully designed and implemented a comprehensive spacecraft control system capable of navigating and maneuvering in 3D space.

  • My approach ensures reliable performance and adaptation to complex 3D space challenges.