ubsuny / CP1-24-HW3

Homework 3 template for CP1-24
1 stars 16 forks source link

Test Driven Development: Failures First #11

Closed avgagliardo closed 1 week ago

avgagliardo commented 2 weeks ago

Since we were talking about unit testing today, I thought I would bring up the topic of Test-Driven Development (TDD).

The basics of TDD are as follows: -Write your unit test first -Make sure that whatever it tests, fails (very important!) -Write the minimal amount of code needed to make it pass -Repeat

The general idea is that by writing your tests first (and making sure that they fail), you are giving yourself some guiderails when it comes to actually writing the code. You no long need to draft out the problem in your head, because you have a tangible goal-- making the unit test pass!

There is a ton of literature on the topic (especially if you are interested in web development) but for now I'll just link these: -Simple Intro to TDD -TDD in Python: A Beginner's Guide

If there's questions regarding how/why it works, feel free to comment or reach out to me directly.

goat

Obey the Goat

laserlab commented 1 week ago

Do you want to convert this little write up into a markdown so we can push it into the repository?

avgagliardo commented 1 week ago

Sure thing, I'll take care of that tonight. I'll close this thread in a day or two, or whenever I push the markdown version.

avgagliardo commented 1 week ago

Added this to the documentation directory in the main project root. Closing issue.