Back to the basics: Tests, part 6 (The last one!)
After a long journey about tests, the tools available, strategies and what to avoid, let's see good practices! How to write and maintain a good tests code base. - Clear and Concise: The test must be simple and easily to understand that the goal of the test and what it is testing. - Repeatable: I can run the same test a hundred time, and it must always return the same assertions for the same input. - Comprehensive: Must be simple to see all the things that the test uses, the AAA pattern is a good example to make clear the steps. - Independent: You must be capable of running any test individually, cannot have coupling between tests. - Validated: Well, it must validate something. - Traceable: If you are testing a method that fail, the return must be traceable to point to the original implementation, for you found the code easily. - Maintainable: Again, tests are code, so remember, if you create test for all your code, you will have two code bases at the end, so treat them equally...