On Sep 13, 10:20 pm, Joshua Marinacci <[email protected]> wrote: > * inline unit tests. Why are your unit tests in a separate class. It > should be easy to put the test for a method right next to the method, > and hide it when you don't want to look at it. the test is stripped > when you compile for deployment.
1) Most unit tests are there to confirm that the response of non- private methods in a class to external stimulus is as specified. If the test is internal to the class, you cannot be sure that will always elicit the same response as the same test located externally to the class. 2) For the tests to be valid, the shipped code should be the same at the tested code. If the code (in a class) is altered between testing and shipping (i.e. by stripping internal tests (and presumably test related class variables, set up/tear down structures, etc.) then it should be tested again. Except... ..we've just thrown out the test code. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---
