Skip to content

Commit 011ea7f

Browse files
authored
Merge pull request #255 from Xronophobe/re-rita-review-chapter-12
Re: Rita's review on chapter 12
2 parents 6502ee1 + 3c9c64c commit 011ea7f

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

chapter_12_organising_test_files.asciidoc

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
[[chapter_12_organising_test_files]]
22
== Splitting Our Tests into Multiple Files, and a Generic Wait Helper
33

4-
// RITA: Reword/remove this warning since you have reviewed the chapter text in detail?
5-
.🚧 Warning, chapter update in progress
6-
*******************************************************************************
7-
This chapter is currently in the process of being rewritten for the 3e.
8-
9-
The code listings should all be valid,
10-
and work with Python3.12 + Django 4,
11-
but I haven't reviewed the chapter text in detail yet.
12-
13-
*******************************************************************************
144

155
Back to local development!
166
The next feature we might like to implement is a little input validation.
@@ -894,10 +884,15 @@ Don't forget the "Refactor" in "Red, Green, Refactor"::
894884
((("Red/Green/Refactor")))
895885
896886
Don't refactor against failing tests::
897-
// RITA: Why shouldn't you refactor against failing tests in general? A brief explanation would be nice here for clarity.
898-
* In general!
899-
// RITA: Please clarify the next line. It's somewhat ambiguous. Are you saying that you should refactor against failing tests in the FT you're currently working on?
900-
* But the FT you're currently working on doesn't count.
887+
* The general rule is that you shouldn't mix refactoring and behaviour
888+
change. Having green tests is our best guarantee that we aren't changing
889+
behaviour. If you start refactoring against failing tests, it becomes much
890+
harder to spot when you're accidentally introducing a regression.
891+
* This applies strongly to unit tests. With functional tests, because we
892+
often develop against red FTs anyway, it's sometimes more tempting to
893+
refactor against failing tests. My suggestion is to avoid that temptation
894+
and use an early return, so that it's 100% clear if, during a refactory,
895+
you accidentally introduce a regression that's picked up in your FTs.
901896
* You can occasionally put a skip on a test which is testing something you
902897
haven't written yet.
903898
* More commonly, make a note of the refactor you want to do, finish what

0 commit comments

Comments
 (0)