ECE444-F2020-Lab6

Available on heroku: https://mysterious-mesa-96511.herokuapp.com/

Test Driven Development (TDD) is the practice of writing tests before actually writing code to implement features.

Pros and Cons of TDD:

Pros:

  • Properly written tests can give you quick warning when a new piece of code has broken existing functionality. It helps catch bugs as they happen, rather than letting them be hidden and unexpectedly discovered down the line when context on what may have caused them is potentially lost.
  • Writing small tests forces your code to be modular, since you are writing to pass one test at a time usually. Modular code is good practice because it is easier to understand, change and refactor in the future.
  • Writing tests is also a good way to document your code. It can give others trying to understand a function a good idea of what it should be doing. Also, since tests are constantly being run, they can be looked at as documentation that never goes out of date.
  • Tests ensure that the developers really understand the code they are writing, and pushes them to really clarify requirements before getting into implementation. This will likely result in cleaner code, that requires less adjustments in the future as a result of misunderstandings.

Cons:

  • Writing tests can be time consuming, especially when there are tight deadlines. Some workplaces with few developers available simply may not be able to afford to write tests in the interest of time.
  • Tests can be difficult or tedious to write, and developers may be discouraged from doing so if they have not done it in the past. There is a learning curve that must be overcome.
  • Writing and maintaining tests is a team effort. If everyone on the team does not actively participate, many of the benefits can be lost.