Test Driven Development is the process in which test cases are written before the code that validates those cases. It depends on repetition of a very short development cycle. Test driven Development is a technique in which automated Unit test are used to drive the design and free decoupling of dependencies.
The following sequence of steps is generally followed:
- Add a test – Write a test case that describe the function completely. In order to make the test cases the developer must understand the features and requirements using user stories and use cases.
- Run all the test cases and make sure that the new test case fails.
- Write the code that passes the test case
- Run the test cases
- Refactor code – This is done to remove duplication of code.
- Repeat the above mentioned steps again and again
Motto of TDD:
- Red – Create a test case and make it fail
- Green – Make the test case pass by any means.
- Refactor – Change the code to remove duplicate/redundancy.
- Unit test provides constant feedback about the functions.
- Quality of design increases which further helps in proper maintenance.
- Test driven development act as a safety net against the bugs.
- TDD ensures that your application actually meets requirements defined for it.
- TDD have very short development lifecycle.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Difference between Generic Software Development and Custom Software Development
- Domain-Driven Design (DDD)
- Software Development Engineer in Test (SDET)
- Difference between Test Plan and Test Strategy
- Boundary Value Test Cases, Robust Cases and Worst Case Test Cases
- Difference between Test Scenario and Test Condition in Software Engineering
- Difference between Test Case and Test Script
- Steps in Rapid Application Development (RAD) model
- Modern Principles Of Software Development
- Software Engineering | Rapid application development model (RAD)
- Software Engineering | Agile Development Models
- Software Engineering | Agile Software Development
- Software Engineering | Program Development Life Cycle (PDLC)
- Software Engineering | Software Business and Development
- Scrum (software development)
- Software Engineering | Identifying Software Development Metrics
- Software Engineering | Jackson System Development (JSD)
- Adaptive Software Development (ASD)
- Client-Server Software Development | Introduction to Common Object Request Broker Architecture (CORBA)
- Software Development Organizational Structure