To write expected and well-designed software, we tend to clarify the requirements before starting the development process. With agile practices in place, we translate our requirements to what we call user/functional stories. Transforming these stories into a simple specification of what we're going to implement adds an advantage. That's where writing test cases comes in handy. We specify our program's behavior in the form of test cases and then implement those behaviors.
There are some advantages to this approach. Writing test cases first and then providing the implementation drives the design of our program. It means that as we approach toward implementing the behavior, we can think of our design and code for that. If one of your classes, A, is dependent on another class, B, we can make sure that B is injected into...