Test Driven Development
- Setting the expectations
- What is TDD?
- Why is TDD important?
- The Red Green Refactor Cycle
- How to implement TDD
- Invoice Tax Computation Scenarios
- Implementing TDD using Javascipt
- Exercise
- Implementing TDD using Rails
Training duration: 3 hours
https://www.codecademy.com/articles/tdd-red-green-refactor https://medium.com/javascript-scene/tdd-the-rite-way-53c9b46f45e3
Unit tests check blocks of code to ensure that they all run as expected.
-
Setting the expectations Hello, what programming language are you using? What project are you currently using? How do you test your code?
This lecture is about the concept of TDD and not how to use a specific library or TDD for a specific programming language.
-
What is Test Driven Development an approach to software development where you write tests first, then use those tests to drive the design and development of your software application.
-
Snapshot of TDD Why is TDD important? Where is it used? Continuous integration - routinely push/commit into the main branch of a repository, and testing the changes, as early and often as possible.
Automated tests show a sample of running a test suite
How to compute tax of invoice line
- Compute discount
- Is the customer tax exempt? Is the product tax exempt?
- Compute Tax Single Tax Multiple Tax Store wide taxes Product specific taxes
- Compute line subtotal and subtotal without tax
- Update invoice
- Update totals view