Learn Enough Python to Be Dangerous by Hartl Michael;

Learn Enough Python to Be Dangerous by Hartl Michael;

Author:Hartl, Michael;
Language: eng
Format: epub
Publisher: Pearson Education, Limited
Published: 2023-05-15T00:00:00+00:00


Tests allow code to be refactored (i.e., changing its form without changing its function) with greater confidence.

Tests act as a client for the application code, thereby helping determine its design and its interface with other parts of the system.

Although none of the above benefits require that tests be written first, there are many circumstances where test-driven development (TDD) is a valuable tool to have in your kit. Deciding when and how to test depends in part on how comfortable you are writing tests; many developers find that, as they get better at writing tests, they are more inclined to write them first. It also depends on how difficult the test is relative to the application code, how precisely the desired features are known, and how likely the feature is to break in the future.

In this context, it’s helpful to have a set of guidelines on when we should test first (or test at all). Here are some suggestions based on my own experience:

When a test is especially short or simple compared to the application code it tests, lean toward writing the test first.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.