Chapter 5: Unit Testing the Logger and Client

The Purpose of Unit Testing

Creating tests for your code creates a methodology of proving your code works. Tests define precisely the intent of a routine. Even more important, testing code offers a safety net for both development and maintenance.

Testing forms the modern way to create solid code. An entire corpus of work supports the benefits of test driven development.

As you write code, you test it. By “test” I mean write code in the form of unit tests. When someone asks if you can prove your code works, you can run the tests and prove it. More importantly, you use the test code to prove it to yourself.

An old saying is “No test? Then, by definition, the code is broken.”

Continue reading
Posted in 0MQ, arduino, IoT, linux, messaging, networking, RaspberryPi, testing, unittest, zeromq, zmq | Tagged , , , , , , | Leave a comment