Code Monkey home page Code Monkey logo

coding-exercise-ioet's Introduction

Coding Exercise ioet

Overview of the solution

I developed the solution using the TDD methodology together with a pragmatic approach.

ETC, DRY, SOLID principles and orthogonality were the fundamental concepts on which I based the development of the system.

I decided to create abstractions that represents the interval of time (Timeslot) and the time of the day (DayTime). These are the fundamental abstractions, so I take advantage of the Python data model to allow higher abstractions to operate with these easily.

As well I put the data of the company table of pay rates in an external format and used an abstraction in code to represent it.

The program has the following single responsabilities:

  • Present/Emit the total that the company has to pay an employee (Handler)
  • Parse the schedule of the employees (TimeslotParser)
  • Format the message to send (Formatter)
  • Read the text file containing the employees' schedule (read_txt_employee_data)
  • The domain model (abstractions within model, daytime and timeslot modules)
  • CLI (parse_args and main)

In general terms I divided in a modular way the business logic, the interface, the presentation and the data.

The program interface is a CLI (main.py).

Instructions to run locally

Requirements: python 3.7+

To run the program just run from the console:

python main.py

Run the tests

If you are using Linux or macOS, run with the following command:

make test

For Windows users run:

python -m unittest discover -s tests

# If you want to run the doctests, then run
python -m doctest docs/daytime.doctest;
python -m doctest docs/timeslot.doctest

coding-exercise-ioet's People

Contributors

jordandjp avatar

Watchers

 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.