Relationship Between Test and Production Code
Learn the relationship between test and production code and how you should manage them.
Exposing private behavior The JUnit tests we write will live in the same project as the production code that they verify. However, we’ll keep the tests separate from the production code within a given project. We’ll be shipping the production code (the target of the tests, sometimes known as the system under test or SUT), but the tests will typically stay behind.
Unit testing is solely a programmer activity. No customers, end-users, or non-programmers will typically see or run our tests.
Uni-directional testing
Unit testing is a one-way street. Tests depend on the production-system code, but the dependency goes only in that direction. The production system has no knowledge of the tests.
That is not to say that the act of writing tests can’t influence the design of our production system. The more we write unit tests, the more we’ll encounter cases where a different design would make it easier to write tests.
...
Tip: Build with testing ...