A simple rule that I use when doing TDD is to always write down tests that don't run.
If the test fails first, this is a good test for TDD. This means that something has not yet been implemented or not implemented as it should be. Then you can change the code to make it pass. A test that passes successfully first is a bad test. You don’t even know if it succeeded because you made a mistake by writing a test, or because what you are testing already works.
If you can fail a test using properties, then write tests for these properties. Usually, you should start by testing the test setter or getter before implementing it. A not implemented setter or getter may look trivial, but makes the test fail. And why would you write a line of code even by the installer or the receiver, if it is not controlled by a test?
Other types of tests, such as tests, such as documentation showing how to use the API, are also very useful, and good flexible practice, but this is not TDD. TDD is trying to actively try to break the code until you can no longer use it. Then you run the functional tests, and if you push the unit tests quite hard, and if there isn’t any kind of integration or system problem along the way, everything should be fine.
kriss source share