Thanks for your advice Robert. http://dannorth.net/**introducing-bdd/ > <http://dannorth.net/introducing-bdd/>http://martinfowler.com/** > articles/mocksArentStubs.html > <http://martinfowler.com/articles/mocksArentStubs.html> > http://www.refactoring.com/**catalog/index.html<http://www.refactoring.com/catalog/index.html>
I saved this webPage in my bookmarks. Now I´m more interesting: Introducing-BDD because The names of the test of apache-rat-core aren´t good names.(for example I only see that name of the method is testing but what things are testing). Manuel. 2013/7/8 Robert Burrell Donkin <[email protected]> > DefaultAnalyserFactory is a good example of why static methods introduce > unnecessary coupling and make systems hard to test: > > https://gist.github.com/**RobertBurrellDonkin/5952112<https://gist.github.com/RobertBurrellDonkin/5952112> > > Both guessers have (immutable) state, which could have been injected > through constructors. Then instances could have been injected into > DefaultAnalyser. By factoring out an interface for guessers, would have > allowed the interface (rather than the implementation) to be injected. Then > DefaultAnalyser could have been tested using mocking and stubbing > techniques as well as being easier to understand and extend. > > This might be a good opportunity to try out some BDD as well as other > refactoring techniques. Potentially challenging (especially as it's more > difficult for me to explain than to do) but sometimes that's a good way to > learn ;-) > > See, for example, > > http://dannorth.net/**introducing-bdd/<http://dannorth.net/introducing-bdd/> > http://martinfowler.com/**articles/mocksArentStubs.html<http://martinfowler.com/articles/mocksArentStubs.html> > http://www.refactoring.com/**catalog/index.html<http://www.refactoring.com/catalog/index.html> > > Hopefully people will jump in with other ideas, help and suggestions > > Robert > >
