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...

Main Pitfall of TDD–Refactoring

Monday, May 27, 2013

Many people have bad experience with TDD. Their main complaints are: They spend too much time maintaining tests. For example, to fix a small bug or a small change in the production code they need to fix many tests Even though they follow the TDD practice and always write tests before production code, the production code doesn’t become so “clean” and SOLID. It’s difficult to write tests that cover all lines of code and all cases Tests need very long and complicated setups of mock objects...

Online materials from my Expert Days sessions

Saturday, December 29, 2012

Thanks for those who participated in my sessions in Expert Days! I hope you enjoyed it. For your benefit and also for everyone else that didn’t participated, I uploaded all the materials online so you can browse whenever you want. You can find all the materials here. In the above link you’ll find the following files: For the “C# in Depth” session you’ll find: The presentation All the demos (except for the Roslyn project demo) The Roslyn project demo For the “Software Quality –...

Test driving interactions using Async and Await

Saturday, September 15, 2012

From time to time I encounter a problem that seems pretty straight-forward to implement without TDD, but very cumbersome to do with TDD. Most of these cases have something in common: they describe interactions between the tested component and external parties. These external parties can be either the user, external system, or any kind of communication protocol. Here’s the simplest example I could think of: This is a simple console application that asks the user for his name, and then greets him with “Hello, “, followed by his name. Writing this application takes exactly 3...

Avoiding Conway’s Law using TDD and ATDD

Wednesday, July 11, 2012

Back in 1968, Melvin Conway stated that "organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations". This statement is still relevant today and is well known as the Conway’s Law. There’s a lot of truth in this observation, and many organizations take this law seriously and structure their development organization to best reflect their desired architecture. The desired outcome of such organizational structure, which is mostly achieved, is that each component is cohesive, loosely-coupled from the other components, and also pretty well maintained by the team –...

Open House about TDD–The presentation!

Friday, December 16, 2011

UPDATE: I updated the link to the presentation  As I mentioned in my previous post, this Thursday (Dec. 22nd), I’ll be giving an Open House about TDD and ATDD. If you still haven’t registered, do it now! (it’s free, of course) And now you can already peep into the presentation here! See you all there!
one comment

TDD and the SOLID principles (Part 7 – Conclusion)

Sunday, November 20, 2011

Table of contents: Pat 1 – introduction Part 2 – SRP Part 3 – OCP Part 4 – LSP Part 5 - ISP Part 6 – DIP Part 7 – Conclusion (This post) Often when talking about TDD it is said that despite of its name, TDD is not a testing methodology, but rather it’s a design methodology. As you’ve seen in this series of articles, the SOLID principles goes hand-in-hand with TDD, and indeed TDD drives the design of your code in a way that adheres to the SOLID principles....

TDD and the SOLID principles (Part 6 – DIP)

Tuesday, November 1, 2011

This is the 6th post in the series about TDD and its relationships with the SOLID principles. Here’s the table of content for the series: Pat 1 – introduction Part 2 – SRP Part 3 – OCP Part 4 – LSP Part 5 - ISP Part 6 – DIP (this post) Part 7 – Conclusion DIP – Dependency Inversion Principle Depend on abstractions, not on concretions. This principle states that: A. HIGH LEVEL MODULES SHOULD NOT DEPEND UPON LOW LEVEL MODULES. BOTH SHOULD DEPEND UPON ABSTRACTIONS. ...

TDD and the SOLID principles (Part 5 – ISP)

Saturday, October 1, 2011

This is the 5th post in the series about TDD and its relationships with the SOLID principles. Here are the links to the previous parts: Pat 1 – introduction Part 2 – SRP Part 3 – OCP Part 4 – LSP Part 5 - ISP (this post) Part 6 – DIP Part 7 – Conclusion ISP – Interface Segregation Principle “Make fine grained interfaces that are client specific” This principle speaks for itself… but anyway I’ll “translate” it… : It is better to create many small interfaces than...

TDD and the SOLID principles (Part 4 – LSP)

Thursday, September 22, 2011

This is the 4th post in the series about TDD and its relationships with the SOLID principles. Here are the links to the other parts: Pat 1 – introduction Part 2 – SRP Part 3 – OCP Part 4 – LSP (this post) Part 5 – ISP Part 6 – DIP Part 7 – Conclusion The LSP (Liskov Substitution Principle) The principle (originally stated by Barbara Liskov in a more academic fashion), states that: FUNCTIONS THAT USE REFERENCES TO BASE CLASSES MUST BE ABLE TO USE OBJECTS OF DERIVED...