TDA Principle

While reading materials about how to improve my OO code / design, I run into "Tell, Don't Ask" principle. Interestingly, I also have read this article and realized that I am still thinking as a procedural developer. But then I got confused by the idea - you can test the interactions, but how do you test the state if you trying to eliminate any trace of state from the object? Does that mean that state base testing causes to violate TDA principle?

This is a question to community - ideas are appreciated.

PS: I was trying to pretend a situation where needed to report a subject without accessing subject's properties - using what I thought would be a TDA principle. Same question remains.

No Comments