9
votes
4answers
722 views

How to unit test a function that is refactored to strategy pattern?

If I have a function in my code that goes like: class Employee{ public string calculateTax(string name, int salary) { switch (name) { case "Chris": ...
1
vote
4answers
915 views

Moving from mock to real objects?

I'm like doing TDD so I started everything mocking objects, creating interface, stubbing, great. The design seems to work, now I'll implement the stuff, a lot of the code used in the stubs are going ...
5
votes
4answers
269 views

Type mocking frameworks does not change coding practices from testability point?

Many people recommend that we should code against interfaces and avoid statics for testability. Interfaces are not just for testability, they are sometimes a requirement. But sometimes we introduce ...
3
votes
2answers
622 views

Which GOF design patterns work well with TDD, and which do not?

The GOF Design Patterns book rarely mentions the test-ability of each pattern. I'm aware that there are patterns such as Singleton that would lead to code for which it is difficult to write unit ...
5
votes
1answer
367 views

The use of Test-Driven Development in Non-Greenfield Projects?

So here is a question for you, having read some great answers to questions such as "Test-Driven Development - Convince Me". So my question is: "Can Test-Driven Development be used effectively on ...