There has been a lot of information shared over the past few years about Test Driven Development. Initially it might seem complicated and counter to logical thinking but it actually makes a lot of sense. Test Driven Development is defined as: a software development process that relies on the repetition of a very short development cycle. Requirements are turned into very specific test cases and the software is modified in order to get those tests to pass. In the normal process of software development, code is written first and then tested to make sure that it works.
What is the origin of Test Driven Development?
The origin of TDD traces back to the late 1990’s when extreme programming started. It because more mainstream when Agile came around. By 2006 it had matured and resulted in additional innovations to the process with ATDD or BDD.
What are the steps for Test Driven Development?
Here are the basis steps for TDD:
- Write a new test
- Check and make sure the test fails
- Write code to pass the test
- Verify the test passes
- Refactor code to make it more efficient
- Repeat steps again
What is the purpose of Test Driven Development?
TDD is a process of modifying code in order to pass a test which was designed prior to code being written. There is more emphasis on writing production code than designing test cases. This includes refactoring and helps to have cleaner and simpler code. It helps to find defects much sooner and eliminates the need of rework.
What is Agile Test Driven Development?
All the teams today that use Test Driven Development follow Agile or some form of it like Scrum.
Who is responsible for Test Driven Development?
Typically the person who is writing the code will be the person to write the test cases. I have seen some situations where there is a slight variation and a test engineer writes them but that is not a common practice.
What are the benefits of Test Driven Development?
- The primary benefit of TDD is that it helps to eliminate writing duplication of code
- Allows developers to capture defects much sooner in the lifecycle
- Software is better designed and results in more maintainable code
- Helps with teamwork. More people can work on code together.
- Less time is spending on debugging code
- Helps with code refactoring
- Eliminates a significant number of defects
- Often results in projects getting completed faster than original timelines
What are the pitfalls of Test Driven Development?
Here are some common pitfalls of TDD:
- Forgetting to run the tests
- Writing too many tests
- Writing tests that are too large
- Writing tests that are too simple
- Writing tests that are too complicated
Test Driven Development Skill Levels
There are different skill levels for TDD which include:
- Someone who can write a unit test prior to code creation
- Someone who can get a failing test to pass by writing code
- Someone who can write a test case for a defect that has been found
- Someone who can take a previous test driven development test and further break it down to simpler tests
- Someone who can factor reusable elements
- someone who can create a test driven development roadmap
- someone who can provide additional guidance and direction to beginner or intermediate levels
I hope this information has been helpful. You might want to also learn more about Behavior Driven Development.