Disadvantages of Test Driven Development? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for … Read more

Unit testing Anti-patterns catalogue

Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. anti-pattern : there must be at least two key elements present to formally distinguish an actual anti-pattern from a simple bad habit, bad practice, or bad idea: Some repeated … Read more

JavaScript unit test tools for TDD

This question’s answers are a community effort. Edit existing answers to improve this post. It is not currently accepting new answers or interactions. I’ve looked into and considered many JavaScript unit tests and testing tools, but have been unable to find a suitable option to remain fully TDD compliant. So, is there a JavaScript unit … Read more

How to verify that a specific method was not called using Mockito?

How to verify that a method is not called on an object’s dependency? For example: public interface Dependency { void someMethod(); } public class Foo { public bar(final Dependency d) { … } } With the Foo test: public class FooTest { @Test public void dependencyIsNotCalled() { final Foo foo = new Foo(…); final Dependency … Read more

How do I test a class that has private methods, fields or inner classes?

Update: Some 10 years later perhaps the best way to test a private method, or any inaccessible member, is via @Jailbreak from the Manifold framework. @Jailbreak Foo foo = new Foo(); // Direct, *type-safe* access to *all* foo’s members foo.privateMethod(x, y, z); foo.privateField = value; This way your code remains type-safe and readable. No design compromises, no overexposing methods … Read more