On 7/13/2011 11:13 PM, Adam Heath wrote:
On 07/13/2011 04:57 PM, Adrian Crum wrote:
One of the things I don't like about Adam's approach is how all of the
test classes are in a different package than the classes being tested -
so imports are needed. In the proposed folder structure, test classes
can be in the same package - eliminating the need to import the classes
being tested.

Having test classes in the same package is also bad for ensuring api leakage. A method marked 'protected' or 'nothing' is accessible to any other class in the same package. With the test code in a separate package directory(./test), then the test code can only really test the exposed api methods, and doesn't get tied to the internals of the class(thereby allowed the class to change how it is implemented without breaking random tests).


Good point - I hadn't thought of that.

-Adrian

Reply via email to