Different mindset

As an application is being developed with a view towards TDD, you should take the same approach to small deliverables. Write a little test, write just enough code to make it pass, then refactor. If you're constantly running your test suite, or better yet, you are using a continuous test runner such as NCrunch, your feedback cycles should be quite quick indeed.

Never leave an ignored test, or ignore more than one test at a time.

If a test begins to fail during the development cycle it should be easy to recover. The code just written must be at fault. Pause the current effort and evaluate. Is the change necessary? Does the failing test need to change? Skip (xUnit) or Ignore (MSTest) your current test, if needed. Fix the code and resume by un-ignoring your test. Never leave an ignored test, or ignore more than one test at a time. Doing so will only risk the test (or worse, tests) never being completed, fixed, or recovered. An ignored test has no value. If a test is un-ignored at a later date by you or someone else and is now (or still) failing, it may be difficult to determine if the test is valid and indicates a true failure, or invalid and possibly sending you on a wild goose chase. Make sure your tests are valid, accurate, and provide value.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.154.190