TDD, SOLID, Functional Programming, Declarative programming and more…

Thursday, December 19, 2013

TDD and the Single Responsibility Principle Amongst the 5 SOLID principles, I found that the one which is the least tangible is the “Single Responsibility Principle” (SRP). Even though this is the most well-known and intuitively easy to understand, the questions “What exactly is ‘Responsibility’?” or “How do you determine whether a class has exactly one Responsibility?” is not trivial whatsoever. Obviously there are many cases that the violation of this principle is evident, but there are many more which fall in the grey area. It’s often being claimed that TDD helps guide you to develop classes which adhere to the...