Friday, May 8, 2020

Test and Code: 112: Six Principles of Readable Tests - David Seddon

"Code is read much more often than it is written." - Guido van Rossum
This is true for both production code and test code.

When you are trying to understand why a test is failing, you'll be very grateful to the test author if they've taken the care to make it readable.

David Seddon came up with 6 principles to help us write more readable tests.
We discuss these, as well as more benefits of readable tests.

David's 6 Principles of Readable Tests:

  1. Profit from the work of others
  2. Put naming to work
  3. Show only what matters
  4. Don’t repeat yourself
  5. Arrange, act, assert
  6. Aim high

Special Guest: David Seddon.

Sponsored By:

Support Test & Code : Python Testing for Software Engineers

Links:

<p>&quot;Code is read much more often than it is written.&quot; - Guido van Rossum<br> This is true for both production code and test code.</p> <p>When you are trying to understand why a test is failing, you&#39;ll be very grateful to the test author if they&#39;ve taken the care to make it readable.</p> <p>David Seddon came up with 6 principles to help us write more readable tests.<br> We discuss these, as well as more benefits of readable tests.</p> <p>David&#39;s 6 Principles of Readable Tests:</p> <ol> <li>Profit from the work of others</li> <li>Put naming to work</li> <li>Show only what matters</li> <li>Don’t repeat yourself</li> <li>Arrange, act, assert</li> <li>Aim high</li> </ol><p>Special Guest: David Seddon.</p><p>Sponsored By:</p><ul><li><a href="https://ift.tt/2JDHRTz" rel="nofollow">PyCharm Professional</a>: <a href="https://ift.tt/2JDHRTz" rel="nofollow">Try PyCharm Pro for 4 months and learn how PyCharm will save you time.</a> Promo Code: TESTNCODE2020</li></ul><p><a href="https://ift.tt/2tzXV5e" rel="payment">Support Test & Code : Python Testing for Software Engineers</a></p><p>Links:</p><ul><li><a href="https://ift.tt/2LdBYzO" title="How to write readable tests (presentation) · David Seddon" rel="nofollow">How to write readable tests (presentation) · David Seddon</a></li><li><a href="https://ift.tt/2LdH5je" title="How to write readable tests (slides)" rel="nofollow">How to write readable tests (slides)</a></li><li><a href="https://ift.tt/2oxKKPL" title="pytest" rel="nofollow">pytest</a></li><li><a href="https://ift.tt/2Le2Wao" title="WebTest " rel="nofollow">WebTest </a></li><li><a href="https://ift.tt/2aJSnuc" title="factory_boy" rel="nofollow">factory_boy</a></li><li><a href="https://ift.tt/3bmIb7a" title="django-webtest" rel="nofollow">django-webtest</a></li></ul>

from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...