Python Advanced (2021-12-01 - 2021-12-03)

Day 1

Basics Recap

Group Project Preparation

  • At the basis: pytest Introduction, By Example

  • Talking about IoT sensors posting crap into cloud

    ../../../../_images/big-picture.png
  • Which kind of crap will sensors post into cloud?

    ../../../../_images/sensors.png
  • Sensor hardware (irrelevant to us). We write software to deal with it

    ../../../../_images/sensor-hardware-vs-software.png
  • We do not want to have

    • … a real sensor where we need a Diesel engine to make it send out vibrations. We just want a sensor that send out vibrations when we tell it to.

    • … a big fat OPC/UA broker in the middle. Not even a lighter MQTT broker. Nor do we want to depend on an internet cloud provider for testing.

    ../../../../_images/mock.png
  • We sure can do something with multithreading. Let the sensor threads hammer their data into a thread-safe queue (as an in-process replacement for a fat broker).

    ../../../../_images/mt.png

Day 2

Plan: write a number of sensor classes

  • SensorRandom

  • SensorSine

  • SensorConstant

All these sensors should be decoupled from wall clock time - testing time series data is hard when you must deal with time. We don’t.

../../../../_images/timeaxis-vibrcheck-yes.png ../../../../_images/timeaxis-vibrcheck-no.png

Wild hacking expected.

TODO

  • jjj refer to test cases

  • jjj refer to thread series

  • jjj refer to tests for tomorrow

Day 3

Hmmm?