TDD is an acronym for Test Driven Development.
As the name implies,
this concept revolves around the idea that your software development's flow,
will be guided by tests.
It started getting a lot of traction in the early 2000
when Kent Beck published a book
entitled Test Driven Development by Example.
You might recognize Kent Beck,
he is also known for his contributions to Extreme Programming
and the Agile Manifesto.
The fundamental process of Test Driven Development
is to write our code by looping over three main application stages,
red, green, and refactor.
For the red stage,
we start by writing a test that describes a requirement
we want our application to fulfill.
While writing the test,
we pretend that all the functionality is already there.
This test will most likely fail.
We will then focus on doing the least amount of work
necessary to get this new test to pass.
While at the same time keeping all the other tests
we already have in place, still passing.
As soon as all the tests are passing,
we have officially reached the green stage.
Don't worry if your most recent work looks a bit messy and hard to read.
Now we're ready to make our code better.
It's critical that we perform incremental improvements and commit often.
Each improvement can only be accepted if we keep all tests still passing.
The refactor phase can last as long as we want.
We will stop once we think our code is looking good enough.
As soon as we're happy with the state of the code,
we can write another test for another goal we want our application to fulfill.
This will bring us right back to the red stage.
This is the red-green refactor loop
that is the driving force behind test-driven development.
Why don't we put these concepts to the test?
In this course, we will be creating a clone
of the popular game Wordle, using test-driven development.
As we are creating this application,
we will focus on how test-driven development
not only allows you to write software with robust and clear requirements,
but also helps you and your team write very clean and maintainable code.
Besides learning test-driven development,
this course will also make use of Vue 3 and its composition API.
We will run our tests with Vitest
and make ample use of Vue test Utils to help us perform assertions.
Last but not least, this course is also a good opportunity
for us to explore a little bit of TypeScript.
I would recommend some basic experience with Vue before watching this course.
Don't worry if you've never written any TypeScript before,
you'll still be able to follow along with the content.
Also, we won't be focusing on fundamentals and syntax
of testing tools in this course,
but rather on the process of test-driven development itself.
Therefore, if you are brand new to testing,
it might be worth browsing the Vue Test Utils docs
or checking out our course on how to test Vue components first.
I've left links for both of these resources in the description below.