If it's hard to write a test, it's a signal that you have a design problem, not a testing problem. Loosely coupled, highly cohesive code is easy to test. --Kent BeckFirst time I used JUnit, I had trouble because my components where tightly coupled and then couldn't be tested easly.
At first I thought I'll extend JUnit framework by subclassing TestCase and then I realized I should use IoC to get easy to test and therefore easy to use components.
No comments:
Post a Comment