6. xUnit test patterns Naming Have a descriptive name. Tests-names should read like specifications. If your names get too long you're probably testing too much. Structure Use AAA structure. Arrange your context Act , do the things that need to be tested Assert , assert what you want to check Mocks vs. Stubs The term 'Mock Objects' has become a popular one to describe special case objects that mimic real objects for testing. Mock objects are but one form of special case test object http://martinfowler.com/articles/mocksArentStubs.html
7.
8. Red – Green - Refactor Red — Write a test that expresses how you’ll use the code and what you need it to do. This test will fail, producing a red bar on many UI’s. Green — Write enough code to get the test to pass, but no more. If you need more code, for example, to check for errors, first write another test to demonstrate that feature. For now, just write enough code to get the test to pass. Refactor — Clean up the code to remove redundancy and improve the design. Then re-run the tests to make sure you didn’t break anything.
9. The Giants Martin Fowler is an author and international speaker on software development, specializing in object-oriented analysis and design, UML , patterns , and agile software development methodologies, including extreme programming . Fowler is a member of the Agile Alliance and helped create the Manifesto for Agile Software Development in 2001. He popularized the term Dependency Injection [2] as a form of Inversion of Control . Kent Beck is an American software engineer and the creator of Extreme Programming [1] and Test Driven Development . Beck was one of the 17 original signatories of the Agile Manifesto in 2001. He has pioneered software design patterns , the rediscovery of Test-driven development , along with Erich Gamma created the JUnit unit testing framework.