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
Watch video TDD & Refactoring as a Rust Newbie online without registration, duration hours minute second in high quality. This video was added by user Brett Codes 09 November 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 62 once and liked it 1 people.