Warning: Class __PHP_Incomplete_Class has no unserializer in /home/content/a2pewpnas01_data01/57/3877557/html/wp-content/object-cache.php on line 894
TDD / BDD Archives - Code Cooked

TDD / BDD

/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 | September 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 result [...]

13 09, 2014

Writing Your First Unit Test – Part 2

By | September 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 | September 7th, 2014|C#, TDD / BDD|1 Comment

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 to 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 | May 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 start [...]

25 04, 2014

Introduction to Behavior Driven Development

By | April 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 saying [...]

24 04, 2014

Different types of tests and which ones to use

By | April 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 them [...]

24 04, 2014

Introduction to Unit Testing and Test Driven Development

By | April 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 you [...]