Test-Driven Development: Best Practices You NEED to Know

preview_player
Показать описание
In this video, we dive into the intricacies of Test-Driven Development (TDD) and tackle common challenges developers face. Join me as I recount a recent client visit where we tackled slow test run times and the misconceptions about TDD. Discover how dependency injection and mock objects can revolutionize your testing approach, making it faster and more efficient. We also explore the critical distinction between TDD and QA, emphasizing the value of expressing system intentions through assertions rather than merely ensuring functionality.

Learn how to categorize tests into "red" and "green" folders for better organization and efficiency. Uncover why maintaining high-quality test code is just as important as production code, and how focusing on behavior validation can reduce redundant tests and improve overall system reliability. Whether you're building enterprise-level software or tackling smaller projects, these insights will enhance your development process.
Software Developer Training and Resources:

For AI Enthusiasts:

Next Video in the Series:
- Check out my channel, @ThePassionateProgrammer for more videos -

Your Thoughts Matter:
- Have questions, suggestions, or ideas? Share your thoughts in the comments below. I'm excited to hear from you!

#ThePassionateProgrammer #DavidScottBernstein #SoftwareDevelopment #AIPromptEngineering
Рекомендации по теме
Комментарии
Автор

I really liked the approach to TDD expressed in the TDD with Python book. He starts out with user stories and the tests become a fairly literal expression of the user story. It also tends to lead to a code structure where the code itself naturally aligns with the functionality you want to express. I find that when I take the time to come up with some user stories and map them to tests in this manner it really helps with creating good tests. When I don't I tend to have a lot of little tests checking some small part of the functionality which tends to become an illegible mess.

With regard to mocks, I like to have an option for the mock to go either to the live API or to the mocked result. Too many times I've found a bug because a third party API has changed, or because I made an incorrect assumption about how it behaved when I was implementing the mock and the tests all pass but it breaks when exposed to real world data. Maybe there's a better approach but I find that tends to be a minimal effort for maximum reward version.

skulver
Автор

Hi Billy Bob. Would love to hear your insight on unit testing vs integration testing vs E2E testing. Do you agree with the testing pyramid? I appreciate your knowledge. Please do a video on this ❤

Nojo
Автор

I am happy to be the thousandth subscriber of this channel 🎉

Shoharnaaze