Skip to content

ZihangH/ECE444-F2020-Lab6

Repository files navigation

ECE444-F2020-Lab6

Part 1: Replay the example

Done practice the example in https://github.com/mjhea0/flaskr-tdd

alt text

Part 2: Add test cases to your group project

The link to the test cases: https://github.com/ECE444-2020Fall/project1-webapp-group14-nullpointers/blob/master/test/app_test.py

Part 3: What are the pros and cons of TDD?

Pros of Test Driven Development:

  • Better architecture: In TDD, your code need to have a good architecture. If we want our code to be unit-testable, it must be properlu modularized.
  • Easier code refactoring: In TDD, you need to write the unit tests before writing implementation code. Thus, the refactoring of code becomes easier and faster.
  • Prevents defects: Since every new feature will be tested before it is used for future development, we will be able to detect bugs beforehand.
  • Help programmer better understanding the project: By writing the unit tests, the programmars are force to think about the corner cases. They may realize something they never thought about before.

Cons of Test Driven Development:

  • Hard to apply to existing legacy code
  • Take more time to adjust to new requirments: If the project/feature requirements have changed at the start, protentially, you will need to rewrite some of the unit test or even abandon some existing unit tests.
  • Consume more team effort: In order to make TDD works well, everyone on the team needs to correctly maintains their tests. Otherwise, the whole system can quickly degrade.
  • Sometimes it is hard to mock the exact scenario: In order to mock things in a complex code enviroments, it requires environment setup which requires resourses like manpower, hardware and time to maintain the environments.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published