This repository is a clone of https://github.com/mjhea0/flaskr-tdd
The example has been replicated
For part 2, I created the test_invalid_login, test_register, test_valid_login tests to test the ability of our backend api to sucessfully process login/register requests.
The advantages of using TDD are that the testing of features is implemented before the development of the feature. This ensures that testing is not implemented as an afterthought, potentially at a much later time than the feature was originally created. TDD also helps to promote good software practices such as keeping the codebase as modular as possible so that many unit tests can test small pieces of a feature. TDD can also be helpful for debugging as other developers can quickly figure out which parts of the program are failing by looking at the code coresponding to the feature that is failing. In a non TDD testing framework, it might be more difficult to locate the source of the problem as the implementation of the relevant feature was not designed based on its ability to be tested.
The disadvantages of TDD are that it can slow down the development process. Since tests are designed before the relevant feature is, potentially valuable time is lost by creating many test cases which can be problematic if the project timeline is small. Another issue with TDD is that the developer might realize that some of their tests will not be helpful during the development of the relevant feature. It can be difficult to come up with a testing harness for a complicated feature for which the developer has not given much thought about its implementation. TDD also has the risk of programmers creating too many test cases. The developer might think an aspect of the feature must be tested in insolation during the creation of the testing suite and then realize during the implementation that it is not necessary to test that aspect in isolation.