Brian

44%
Flag icon
For example, suppose you want to support a category of test that succeeds only if it throws a particular exception. The exception type is essentially a parameter of the test. You could encode the exception type name into the test method name using some elaborate naming pattern, but this would be ugly and fragile
Brian
Have used this pattern to make it clear to humans what the test is up to, but absolutely agree not to use naming introspectively to affect runtime behavior. the "test" prefix rule in some test frameworks has made me feel uneasy.
Effective Java
Rate this book
Clear rating
Open Preview