Home/TDD / BDD

Test Driven Development (TDD) is a technique of software development which asks the developer to write production code by writing small tests for that production code first. Writing tests first ensures excellent code coverage, easy refactoring of the production code; as it is backed by a lot of tests which tell immediately if something breaks and incremental and lean software development. TDD is the insurance policy that allows developers to write code and ship it to the customer with confidence.

9 09, 2016

Readable, maintainable tests using the builder pattern

By |2019-04-13T10:22:19+08:00September 9th, 2016|C#, Design Principles & Patterns, TDD / BDD|0 Comments

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

13 09, 2014

Writing Your First Unit Test – Part 2

By |2019-04-13T19:48:08+08:00September 13th, 2014|C#, TDD / BDD|0 Comments

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 Adding [...]

7 09, 2014

Writing your first unit test – Part 1

By |2019-04-17T15:58:31+08:00September 7th, 2014|C#, TDD / BDD|2 Comments

In this post, I am going to show you the thought process and steps that I take while doing TDD. I am going to focus on a simple scenario. This will show you the baby steps that I take while writing my unit tests. This is going to be a two-part tutorial. In this first part, I am going to show you how to follow the 3 step process of TDD i.e. Red, Green & Refactor. I am going to [...]

18 05, 2014

Introduction to Mocking

By |2019-04-18T18:05:37+08:00May 18th, 2014|TDD / BDD|0 Comments

If you have been reading about Unit Testing than you might have heard some of the words like Mocking, Fakes and Stubs. You might wonder what do all these terms mean, what is the difference between a mock and a fake object or why do we need to use mocking when we are doing unit testing? Today I will try to clarify some of these concepts and try to eliminate the confusion that arises in peoples mind when they [...]

25 04, 2014

Introduction to Behavior Driven Development

By |2019-04-18T18:28:50+08:00April 25th, 2014|TDD / BDD|0 Comments

If you know about Unit Testing and Test Driven Development, you might have heard about Behavior Driven Development or BDD. BDD was first described by Dan North in an article that was published in 2006. The exact definition of BDD given by him can be translated into any language and still won’t make much sense :). Personally when I am learning about new technologies, I try to understand their use and the reason for their existence. Remember the old [...]

24 04, 2014

Different types of tests and which ones to use

By |2019-04-18T18:33:37+08:00April 24th, 2014|TDD / BDD|0 Comments

In the previous article, I gave an introduction of unit testing and test driven development (TDD). I also discussed why for a modern day software developer, TDD is mandatory! In this article I will go into a little bit of more detail about unit tests and tell you the various types of unit tests. Types of Tests Although if you search online, you will find that there are a lot of different types of tests and each one of [...]

24 04, 2014

Introduction to Unit Testing and Test Driven Development

By |2019-04-18T18:37:03+08:00April 24th, 2014|TDD / BDD|1 Comment

Over the past few decades computer programming industry has been going through a complete revolution. The history of computer programming is not very old as compared to some of the other fields such as Architectural engineering, Astronomy, Chemistry etc. Unfortunately while we have observed an extremely fast growth rate in the hardware side; software development has not been as profound. If you are a software developer who has been in this industry for over 3 years, chances are that [...]

Go to Top