I work in TDD environments and basically I'm confronted with a dilemma which I think is TDD in the environment is very important. As a programmer, you want your methods to be possibly readable. To achieve this, we divide our methods into many personal ways. While carrying out all the code taken to do personal work, it loses the ability to test.
Rhino test class can not see all those personal methods and I should be able to run tests against those methods too.
Any thoughts?
If I make a part of your question:
[. ..] We divide our methods into several methods [...]
This is incorrect if you follow a good OOP design, your methods are very free and simple Will be If you think that you want to remove another private method to reduce your public , then it may be given an idea first, you might call it a different class Can you restart in?
You do not test private methods, because you test the public contracts and not the details of the implementation. If you want to do some different ways to test the private methods, then create them internal and set the attribute.
Another method (Directed by R. Harvey) is to write a cover class that wraps you into private methods public The advantage is that you do not have to make your personal methods internal the downside is that you have a cover for each private method Public method, therefore the amount of methods can be repeated.
Comments
Post a Comment