Relative Content

Tag Archive for tdd

Do unit tests sometimes break encapsulation? [duplicate]

This question already has answers here: Should I avoid private methods if I perform TDD? (14 answers) Closed 10 years ago. I very often hear the following: “If you want to test private methods, you’d better put that in another class and expose it.” While sometimes that’s the case and we have a hiding concept […]

What to do when TDD tests reveal new functionality that is needed that also needs tests?

What do you do when you are writing a test and you get to the point where you need to make the test pass and you realize that you need an additional piece of functionality that should be separated into its own function? That new function needs to be tested as well, but the TDD cycle says to Make a test fail, make it pass then refactor. If I am on the step where I am trying to make my test pass I’m not supposed to go off and start another failing test to test the new functionality that I need to implement.

How can I test database access methods in Java? [closed]

It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago. I want to write a test for a […]