Test Driven Development The importance of writing tests They force the developer to think of the class design They provide a safety harness while refactoring They ensure that the state of code is always stable New developers can make changes comfortable with the knowledge that if they break something that was working, the tests will inform them Test after development is not the same as test first development. Test after development does not reap all the benefits of test first development Writing the tests Think about the class it’s responsibilities and it’s API Write the tests to test every method and various conditions in the methods Whenever you think of writing a print statement or generate a log, it might be a scenario to include a test Write enough production code to ensure that the tests compile and fail Write production code to pass all tests one by one, while also ensuring that previous tests do not fail What not to test Database entities need not be tested Do not go...
Write Awesome User Manuals and Tutorials for Software Products