From 3e3cb00013f7727f73197f88aad1aabc9298e2d0 Mon Sep 17 00:00:00 2001 From: JasonHomeWorkstationUbuntu Date: Mon, 9 Nov 2020 15:10:06 +1100 Subject: [PATCH] Chapter 5. Recap --- textbook/chap5.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/textbook/chap5.md b/textbook/chap5.md index 6e6760d..5bc7cdc 100644 --- a/textbook/chap5.md +++ b/textbook/chap5.md @@ -422,4 +422,25 @@ AssertionError: '2: Use peacock feathers to make a fly' not found in ['1: Buy pe ``` rm db.sqlite3 python manage.py migrate --noinput -``` \ No newline at end of file +``` + +## Recap + +Learning outcome: +* Setup a form to add new items to the list using POST. +* Setup a simple model in the database to save list items. +* Creating database migrations, for both test database and real database +* 2 Django template tags `{% csrf_token %}` & `{$ for ... endfor $}` loop + +Useful TDD Concepts: +* **Regression**: When new code breaks some aspect of application (which used to work). +* **Unexpected failure**: When a test fails unexpectedly. Reason: + * 1. mistake in our tests; + * 2. Tests have helped us find a regression, and we need to fix sth in our code. +* **Red/Green/Refactor**: TDD process in another language. + * Write a test and see it fail (Red) + * Write some code to get it pass (Green) + * Refactor to improve implementation +* **Triangulation**: Generalizing the implementation by adding new test case to cover new specific e.g. +* **Three strikes and refactor**: Rule to remove duplication from code. +* **Scratchpad to-do list**: to-do list to write during coding, and check what we're doing. \ No newline at end of file