Test-driven development overview

The sequence of TDD is loosely based on the following six steps:

  1. Write a test with the result in mind
  2. Run all tests and see whether the new test fails
  3. Write the code
  4. Run the test again
  5. Make necessary changes if the test fails
  6. Repeat

I just follow the guidelines loosely. The TDD process calls for writing the test cases before writing any code, or in our instance, before any components of the network are built. As a matter of personal preference, I always like to see a working version of the working network or code before writing test cases. It gives me a higher level of confidence. I also jump around the levels of testing; sometimes I test a small portion of the network; other times I conduct a system-level ...

Get Mastering Python Networking - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.