Coder Social home page Coder Social logo

rea_robot's Introduction

REA Robot Solution

Setup

Clone the repo and run setup:

git clone https://github.com/theminted/rea_robot
cd rea_robot
./bin/setup

Usage

./bin/robot filename

Solution Notes

I have refactored Robot fairly heavily in order to show knowledge of oo design patterns and architecture. I normally would be inclined to leave more of the logic in the Robot class if there is a low chance of it being touched by other developers.

Other possible improvements

raise CommandIgnoredError if ignore_commands? is repeated heavily in Robot. By either implementing a before_filter or moving each command method to its own implementation of a Command baseclass, this can be avoided. Moving commands to their own classes seems useful if there is a high likelihood of new commands being created with logic unique to that command.

While there is enough error handling to meet the problem specification, the application won't fail gracefully for incorrect input. If the application was known to have some chance of receiving incorrect input, I would implement this.

If the test suite grew large and slow, integration tests could be moved to be called directly on CommandsInterpreter, and the executable robot could be tested to ensure that it calls CommandsInterpreter correctly for all input. I did not do this as there is a higher risk of failure if an integration spec isn't exactly simulating the environment it is testing.

The test suite is really fast. The integration tests the application well, though it would not hurt the test speed nor the quality of the application to add in more tests of long obscure walks.

rea_robot's People

Contributors

frediy avatar fredwu avatar mdub avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.