![]() ![]() Not all code is created equal and worth the same. Maintainability: “How hard is to read a test” and “how hard is to run a test.”.Fast feedback: “The faster the tests, the more of them you can have in the suite and the more often you can run them.”.Resistance to refactoring: “The more the test is coupled to the implementation details of the system under test (SUT), the more false alarms it generates.”.Protection against regressions: “Code that represents complex business logic is more important than boilerplate code.”.“A test-whether a unit test or an integration test-should be a simple sequence of steps with no branching”Ī good unit test has these four attributes: It’s ok to test more than one class at a time if the tests don’t affect others by sharing state. They should run in isolation from each other. On the other hand, for the Classical school, it’s not the code that needs to be tested in isolation, but the tests. If a class has collaborators, we should test it using test doubles for every collaborator. There are two groups of developers with different views about “isolation”: the London school and the Classical school.įor the London school, isolation means writing separate tests for separate classes. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |