Test-Driven Development (TDD) is a methodology where you write tests first and then implement the functionality. TDD is great because it helps you design your program before you write it and better ensure when you make changes that you don't break existing functionality.
In this video, I add some new functionality to a simple command line program that counts the number of lines a file. I start with writing integration tests and then eventually write unit tests.
Rust has been really fantastic for TDD. The tooling is mature, the docs are great, and tests run fast.
Now remember! I'm new to Rust. I've only been writing it for about a week. So there's likely some bad code and stuff I don't understand. This over-the-shoulder coding video is sharing for fun. Let me know if I'm doing anything heinous in Rust or that could be improved. Thanks!
View the commit with the diff: https://github.com/brettchalupa/werds...
GitHub repo for the project: https://github.com/brettchalupa/werds
Chapters:
00:00 - Intro
06:41 - Writing an integration test
08:53 - Writing the program code
17:55 - Writing more integration tests
20:12 - Refactoring
25:38 - Unit testing
31:21 - Outro
Смотрите видео TDD & Refactoring as a Rust Newbie онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Brett Codes 09 Ноябрь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 62 раз и оно понравилось 1 людям.