In my opinion, yes, we should. We should even have standardized tests for the common design patterns in order to make sure the implementation is correct.

However, some have argued that this should actually be in the realm of code reviews. Since design patterns are already “standardized” algorithms, doing TDD on them would be bloating the tests. Some have also mentioned that TDD should be concerned with the behavior of the code, which I would disagree because that seems like the responsibility of a higher level test harness, like ATDD or BDD, to me.

If you think they should be tested, please point me out resources where I could find examples of Design Pattern standardized tests.

submitted by /u/Fanaro009
[link] [comments]