creadur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Burrell Donkin <>
Subject [GSOC] DefaultAnalyser
Date Mon, 08 Jul 2013 20:35:33 GMT
DefaultAnalyserFactory is a good example of why static methods introduce 
unnecessary coupling and make systems hard to test:

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,

Hopefully people will jump in with other ideas, help and suggestions


View raw message