Coder Social home page Coder Social logo

sviatoslav-zapolskyi / reusable-testable-arduino-tutorial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from platisd/reusable-testable-arduino-tutorial

0.0 0.0 0.0 1.01 MB

License: MIT License

Shell 0.96% C++ 83.37% Python 13.10% C 0.89% CMake 1.07% Starlark 0.60%

reusable-testable-arduino-tutorial's Introduction

How to write testable C++ for Arduino Arduino CI

How to write testable and reusable C++ for Arduino, following the Inversion of Control principle.

What?

This is the repository for the material included in the How to write testable C++ for Arduino video tutorial.

The tutorial demonstrates how to design and refactor C++ according to the Inversion of Control principle (IoC), using Arduino compatible code as an example. To follow along, it is advised you clone the repository and open it in an code editor.

Contents of interest

Homework

During the tutorial, you are tasked to complete the following tasks so to get hands-on practice with unit testing for Arduino:

  1. Finish the tests for the Calculator sketch.
  2. Finish the tests for the MagicCarControllerTestable sketch.

Once you are done, you can try evolving the code further and experimenting with the following stretch tasks:

  1. Write more unit tests to cover more edge cases.
  2. Inject the lightsPin instead of hard-coding it.
  3. Decouple the RestServer interface further from the ESP32 WebServer implementation and refactor the code as well as the tests accordingly.
  4. Think of a better way to return an Arduino String in a platform-agnostic way.

Solutions

The solutions can be found in the solutions branch.

Shared solutions

Do you have a solution that you want to share with us? Then fork this repository, push your solution to it and then let me know by opening an issue. I will add a link to your repo in this README file.

reusable-testable-arduino-tutorial's People

Contributors

pascalguenther avatar platisd 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.