Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 3
    +1 "I don't think you can separate interface design from test design" should be in bold, IMHO :) Commented Oct 28, 2014 at 12:30
  • It's even easier to show, if you want to tests more than one implementation of a functionnality, says an XML Import and a CSV Import, you can tests them with exactly the same method from the same interface though the implementation will change. Furthermore, tests involve often some mocking, and for this interface are necessaries. Commented Mar 21, 2016 at 15:46
  • You say the test doesn't need to change, but new Calculator() is the implementation right ? If there's a new implementation needed, maybe you'd do a MultiplicationCalculator then, and you'd need to change the test to use new AdditionCalculator() for it to still pass ? Or am I missing something ? Commented Sep 19, 2016 at 11:33
  • 3
    @SteveChamaillard Sure, if your design has you change the class name from Calculator to AdditionCalculator the test would have to change to match. Of course, by doing TDD what would actually happen is you would change the test first, and the class change would follow in order to make the test pass. Commented Sep 19, 2016 at 14:56