One of the most important aspect of TDD is writing unit tests that are more readable and maintainable. Lot of people fail with TDD because when they add more unit tests to the code, they don’t put the effort to make them more readable and maintainable. I have seen cases where adding an extra dependency to a class would mean that the developers needs to modify 100 tests where they were creating an instance of that class. This is a result […]
Resharper is perhaps one of my most frequently used tools, I use it every day and It is one tool that I have gotten so addicted to over the years that I find it very hard to work on a machine where Resharper is not installed. Today I will share with you some of the Resharper features that I use every day and I find very useful. I am using Resharper’s IntelliJ key bindings and NUnit project, so […]
Over the past decade I have worked for several companies, from small startups to large enterprises and even in Govt. sector. I have worked with people of various cultures, religion and believes. I have seen people who have been extremely successful in relatively short careers and people who have not grown as professionals like they wished. I have worked under people, I have lead teams and I have given consultation to various companies.
If I sum up all of my experience […]
Writing clean code is an art, it takes lot of discipline to write code that can be read by other developers. The most comprehensive book on this topic is by Robert C. Martin (Uncle Bob) and if you have not read his Clean Code book, then that is definitely the next book you should read!
Initially I thought of writing a single post and cover some of the things that Robert Martin mentioned in his legendary book, but then I felt […]
How to increase productivity? This is a question that every professional person has. Over the years I have seen people that are able to do ridiculous amount of work in the same 24 hrs. time frame that we have. Chances are that if you are a Software Developer, you will know about some developers that are writing books, articles, creating training and also working 8 hours a day. Somehow these people have been able to do it for […]
Abstraction vs Encapsulation is one of the most confusing concept for new developers. I have seen even experienced developers getting confused over the question, that what is the difference between abstraction and encapsulation? Both these concepts seem related to data hiding and many people use them interchangeably which results in increasing this confusion even more. Let’s try to understand the difference between abstraction and encapsulation in this article.
If you search for Abstraction on Wikipedia, you will […]
In the previous post I discussed the Open Close Principle, today I will talk about Liskov Substitution Principle. Liskov Substitution Principle is the third principle in SOLID principles. Original definition of Liskov Substitution Principle states that
Let q(x) be a property provable about objects x of type T. Then q(y) should be provable for objects y of type S, where S is a subtype of T.
This definition is not very clear to understand, later Robert C. Martin […]
In the previous article we discussed about the Single Responsibility Principle. Today we are going to discuss about the second SOLID Principle that is the Open Close Principle. Open Close Principle states that
Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.
In first look it might seem like a contradictory statement, how can a class be closed for modification but at the same time open for extension? To answer this question […]
Provider pattern is an extremely useful pattern that allows you to write loosely coupled components in .Net framework that can be injected at run time. The concept of provider model is very simple, yet extremely powerful. We create abstraction for our components and define which concrete implementation we want to use in the configuration file. When the code executes, we can create instance of the concrete component mentioned in the configuration file and use that instance to do work.
Using a Provider For Logging
In the previous post, I gave an overview of how to get started with TDD. I tried to highlight the thought process and steps that I take when doing TDD. In this article I will continue building further on the shopping cart from the previous post and show how I can add further functionality to it using TDD. The tests that I want to focus in this article are the following:
Adding an item multiple times
Removing an item