Introduction to TDD as an Absolute Beginner: 🧵👇
1. Definition
- It stands for Test Driven Development.
- It's an Iterative Software Development approach.
- It focuses on writing test cases before starting the actual development work.
- It stands for Test Driven Development.
- It's an Iterative Software Development approach.
- It focuses on writing test cases before starting the actual development work.
2. How does it work?
- Before starting the actual feature development, tests are written which will get failed.
- Then, in order to make it work, we write code and make the test pass.
- Over time, we refactor and perfect the code if required.
- Before starting the actual feature development, tests are written which will get failed.
- Then, in order to make it work, we write code and make the test pass.
- Over time, we refactor and perfect the code if required.
3. Red, Green & Refactor Approach in TDD
🔴Red
- Initially, we write the test cases which should get failed.
🟢Green
- Then write code to make those test gets passed.
🔄Refactor
- Then Improve the solution and make it perfect.
🔴Red
- Initially, we write the test cases which should get failed.
🟢Green
- Then write code to make those test gets passed.
🔄Refactor
- Then Improve the solution and make it perfect.
4. Benefits
- Almost 100% test coverage, which means fewer bugs.
- Better ROI (especially for long-term projects).
- Discovers bugs in the initial stages, less back & forth and the quality product gets delivered.
- Code is more modular and maintainable.
- Almost 100% test coverage, which means fewer bugs.
- Better ROI (especially for long-term projects).
- Discovers bugs in the initial stages, less back & forth and the quality product gets delivered.
- Code is more modular and maintainable.
5. Drawbacks
- Team writes more code hence initial development phase is slower & initial cost is a bit high.
- Initially, the learning curve is high in TDD for new developers.
- Support & Maintenance is a bit challenging.
- Team writes more code hence initial development phase is slower & initial cost is a bit high.
- Initially, the learning curve is high in TDD for new developers.
- Support & Maintenance is a bit challenging.
6. Conclusion
- TDD is not meant to be used for all types of projects, read about it thoroughly before implementing it.
- If chosen wisely, it can turn out to be a great differentiator in the longer run.
- TDD is not meant to be used for all types of projects, read about it thoroughly before implementing it.
- If chosen wisely, it can turn out to be a great differentiator in the longer run.
That's it for now!
Hope you learned something new.
If you liked this then you might also enjoy reading my previous thread on DevOps:
Hope you learned something new.
If you liked this then you might also enjoy reading my previous thread on DevOps:
Namaste, I'm Vikas!
Trying to diversify Tech Twitter with content on Backend Development.
Every Mon, Wed & Fri - I write a thread,
follow @vikasrajputin to read all my future threads.
Trying to diversify Tech Twitter with content on Backend Development.
Every Mon, Wed & Fri - I write a thread,
follow @vikasrajputin to read all my future threads.
جاري تحميل الاقتراحات...