In the interest of full disclosure: I am not an expert in TDD (I actually do not use it and never have), but I think I can argue out of my ignorance for TDD lawyers in this case.
Imagine a situation where you have a simple / zero logic function, for example, Example 2. Suppose you have implemented your own version of GetProcessById , which functions very slightly differently, but interchangeably with the Process object. You decided not to write a test for this function and say: "Ah, I just delegate it to a trusted library, I can not ruin it." There is your first mistake. βI can't mess it upβ is the worst lie programmers ever regularly tell themselves.
Suppose that after six months you realize that you need to expand the Process with some additional materials. You delegate all the correct methods and override GetProcessById . Now you officially need to test this "zero logic" method. And this is a disaster. Polymorphism and many other features of programming languages ββ(even those that are not strictly object-oriented) lead to code that does not do what you imagine.
So, if you adhere to a strict TDD methodology, and you strive for 100% testing coverage, you will need to test the methods of "zero logic", as well as those that are in two versions.
The only exception that I can imagine is specific to .NET, and these are automatically implemented properties when it makes no sense to test that Getter and Setter are working correctly, because even if they didnβt do anything you could do it. Check the object wrapped in the property, not its property.
TDD people, does this describe him very well?
Crisfole
source share