Skip to content

Commit ae4bfc0

Browse files
committed
Merge remote-tracking branch 'atlas/main'
2 parents 5a0f58b + 6526be3 commit ae4bfc0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+750
-527
lines changed

acknowledgments.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ and make it up to you in any way I can.
7979
And finally thanks to you, the latest reader, for deciding to check out
8080
the book! I hope you enjoy it.
8181

82+
[role="pagebreak-before less_space"]
8283
=== Additional Thanks for the Second Edition
8384

8485
Thanks to my wonderful editor for the second edition, Nan Barber, and to

ai_preface.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ when working with AI.
6868

6969
=== Leaky Abstractions and the Importance of Experience
7070

71-
https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/["Leaky abstractions"]
71+
https://oreil.ly/PgWjL["Leaky abstractions"]
7272
are a diagnosis of a common problem in software development,
7373
whereby higher-level abstractions fail in subtle ways,
7474
and the complexities of the underlying system leak through.

appendix_IX_cheat_sheet.asciidoc

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,16 @@ Relevant chapters:
3232
<<chapter_02_unittest>>,
3333
<<chapter_03_unit_test_first_view>>.
3434

35-
35+
[role="pagebreak-before less_space"]
3636
=== The Basic TDD Workflow: Red/Green/Refactor
3737

38+
[role="two-col"]
3839
* Red, Green, Refactor((("cheat sheet", "TDD workflow")))((("Test-Driven Development (TDD)", "overall process of")))
39-
4040
* Double-loop TDD (<<Double-Loop-TDD-diagram2>>)
41-
4241
* Triangulation
43-
4442
* The scratchpad
45-
4643
* "3 Strikes and Refactor"
47-
4844
* "Working State to Working State"
49-
5045
* "YAGNI"
5146

5247

@@ -68,9 +63,9 @@ Relevant chapters:
6863
Ensure your components work together: web server, static content, database.((("cheat sheet", "moving beyond dev-only testing")))
6964

7065
* Build a production environment early, and automate deployment to it.
71-
- PaaS vs. VPS
66+
- PaaS versus VPS
7267
- Docker
73-
- Ansible vs Terraform
68+
- Ansible versus Terraform
7469

7570
* Think through deployment pain points: the database, static files,
7671
dependencies, how to customise settings, and so on.
@@ -82,7 +77,7 @@ Relevant chapters:
8277
<<part2>>,
8378
<<chapter_25_CI>>.
8479

85-
80+
[role="pagebreak-before less_space"]
8681
=== General Testing Best Practices
8782

8883
* Each test should test one thing.((("cheat sheet", "testing best practices")))((("testing best practices")))
@@ -109,7 +104,7 @@ Relevant chapters:
109104
* Use explicit rather than implicit waits, and the interaction/wait pattern.
110105

111106
* Avoid duplication of test code--helper methods in a base class and the
112-
Page pattern are possible solutions.
107+
page pattern are possible solutions.
113108

114109
* Avoid double-testing functionality.
115110
If you have a test that covers a time-consuming process (e.g., login),
@@ -140,6 +135,6 @@ Be aware that integration tests will get slower and slower over time.
140135
Find ways to shift the bulk of your testing to unit tests
141136
as your project grows in size and complexity.
142137

143-
Relevant chapters:
138+
Relevant chapter:
144139
<<chapter_27_hot_lava>>.
145140

appendix_X_what_to_do_next.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ and compare how much faster they are than running against Postgres.
3636
Set it up so that your local machine uses SQLite for testing,
3737
but your CI server uses Postgres.
3838

39-
Does any of your functionality actually depend on postgres-specific features?
39+
Does any of your functionality actually depend on Postgres-specific features?
4040
What should you do then?
4141

4242

@@ -120,7 +120,7 @@ without needing to refresh the page...
120120

121121
`pytest` lets you write unit tests with less boilerplate.
122122
Try converting some of your unit tests to using 'py.test'.
123-
You may need to use a plug-in to get it to play nicely with Django.
123+
You may need to use a plugin to get it to play nicely with Django.
124124

125125

126126
=== Check Out coverage.py

appendix_bdd.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ In the Python world, we have a couple of equivalent test running tools,
6262
http://lettuce.it/[Lettuce] and http://pythonhosted.org/behave/[Behave].
6363
Of these, only Behave was compatible with Python 3 at the time of writing,
6464
so that's what we'll use.
65-
We'll also use a plug-in called
65+
We'll also use a plugin called
6666
https://pythonhosted.org/behave-django/[behave-django].
6767

6868

appendix_github_links.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ So, if you ever want to compare your code against mine,
1010
you can take a look at it there.
1111

1212
Each chapter has its own branch named after it, like so:
13-
https://github.com/hjwp/book-example/tree/chapter_01
13+
https://github.com/hjwp/book-example/tree/chapter_01.
1414

1515
Be aware that each branch contains all of the commits for that chapter,
1616
so its state represents the code at the 'end' of the chapter.
1717

1818
=== Full List of Links for Each Chapter
1919

2020
|===
21-
| Chapter | Github Branch Name & Hyperlink
21+
| Chapter | GitHub branch name & hyperlink
2222

2323
| <<chapter_01>>
2424
| https://github.com/hjwp/book-example/tree/chapter_01[chapter_01]
@@ -152,7 +152,7 @@ https://github.com/hjwp/book-example/archive/chapter_04_philosophy_and_refactori
152152
=== Don't Let it Become a Crutch!
153153

154154
Try not to sneak a peek at the answers unless you're really, really stuck.
155-
Like I said at the beginning of the <<chapter_03_unit_test_first_view>>,
155+
Like I said at the beginning of <<chapter_03_unit_test_first_view>>,
156156
there's a lot of value in debugging errors all by yourself,
157157
and in real life, there's no "harrys repo" to check against
158158
and find all the answers.

atlas.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"preface.asciidoc",
1010
"ai_preface.asciidoc",
1111
"pre-requisite-installations.asciidoc",
12-
"video_plug.asciidoc",
1312
"acknowledgments.asciidoc",
1413
"part1.asciidoc",
1514
"chapter_01.asciidoc",

bibliography.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ and which I enthusiastically recommend.
99
++++
1010
<ul class="simplelist">
1111
<li>Kent Beck, <em>Test Driven Development: By Example</em>, Addison-Wesley</li>
12-
<li>Martin Fowler, <em>Refactoring_, Addison-Wesley</em></li>
13-
<li>Ross Anderson, <em>Security Engineering, Third Edition</em>, Addison-Wesley: https://www.cl.cam.ac.uk/archive/rja14/book.html</li>
12+
<li>Martin Fowler, <em>Refactoring, Addison-Wesley</em></li>
13+
<li>Ross Anderson, <em>Security Engineering, Third Edition</em>, Addison-Wesley: <em>https://www.cl.cam.ac.uk/archive/rja14/book.html</em></li>
1414
<li id="GOOSGBT">Steve Freeman and Nat Pryce, <em>Growing Object-Oriented Software Guided by Tests</em>, Addison-Wesley</li>
1515
<li>Hal Abelson, Jerry Sussman and Julie Sussman, <em>Structure and Interpretation of Computer Programs</em> (SICP), MIT Press</li>
1616
<li>Dave Farley, <em>Modern Software Engineering</em>, Addison-Wesley</li>

book.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ include::praise.forbook.asciidoc[]
1414
include::preface.asciidoc[]
1515
include::ai_preface.asciidoc[]
1616
include::pre-requisite-installations.asciidoc[]
17-
include::video_plug.asciidoc[]
17+
//include::video_plug.asciidoc[]
1818
include::acknowledgments.asciidoc[]
1919

2020
include::part1.forbook.asciidoc[]

chapter_01.asciidoc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ UnknownError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:530:5
113113
[...]
114114
----
115115

116+
[role="pagebreak-before"]
116117
You should see a browser window pop up trying to open _localhost:8000_,
117118
showing the "Unable to connect" error page.
118119
If you switch back to your console,
@@ -144,7 +145,7 @@ image::images/tdd3_0102.png["A pop-up window saying 'Firefox is trying to instal
144145
This happens when Firefox has automatically downloaded a new version,
145146
in the background.
146147
When Selenium tries to load a fresh Firefox session,
147-
it wants to install the latest version of its "geckodriver" plug-in.
148+
it wants to install the latest version of its "geckodriver" plugin.
148149
149150
To resolve the issue, you have to close the Selenium browser window,
150151
go back to your main browser window
@@ -204,6 +205,7 @@ NOTE: Make sure your project folder looks exactly like this!
204205

205206
The _superlists_ folder is intended for stuff that applies to the whole project--like _settings.py_, which is used to store global configuration information for the site.
206207

208+
[role="pagebreak-before"]
207209
But the main thing to notice is _manage.py_.
208210
That's Django's Swiss Army knife,
209211
and one of the things it can do is run((("development server", "running with manage.py")))((("manage.py file", "running a development server"))) a development server.
@@ -273,7 +275,7 @@ image::images/tdd3_0103.png["Screenshot of Django Installed Successfully Screen"
273275
So many introductions to TDD ((("Roman numerals in examples")))use Roman numerals in their examples
274276
that it has become a running joke--I even started writing one myself.
275277
If you're curious, you can find it
276-
on https://github.com/hjwp/tdd-roman-numeral-calculator/[my GitHub page].
278+
on https://github.com/hjwp/tdd-roman-numeral-calculator[my GitHub page].
277279
278280
Roman numerals, as an example, are both good and bad.
279281
It's a nice "toy" problem, reasonably limited in scope,
@@ -291,7 +293,7 @@ more like real life, and less like that of a toy project.
291293
292294
*******************************************************************************
293295

294-
296+
[role="pagebreak-before less_space"]
295297
=== Starting a Git Repository
296298

297299
((("Git", "starting repositories")))
@@ -332,9 +334,10 @@ $ *ls*
332334
db.sqlite3 functional_tests.py manage.py superlists
333335
334336
$ *git init .*
335-
Initialised empty Git repository in ...goat-book/.git/
337+
Initialized empty Git repository in ...goat-book/.git/
336338
----
337339

340+
[role="pagebreak-before less_space"]
338341
.Setting the Default Branch Name in Git
339342
*******************************************************************************
340343
@@ -353,7 +356,7 @@ hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
353356
hint: 'development'. The just-created branch can be renamed via this command:
354357
hint:
355358
hint: git branch -m <name>
356-
Initialised empty Git repository in ...goat-book/.git/
359+
Initialized empty Git repository in ...goat-book/.git/
357360
----
358361
359362
Consider following the advice and choosing an explicit default branch name.((("default branch name in Git")))((("Git", "default branch name, choosing")))
@@ -367,7 +370,7 @@ $ *git config --global init.defaultBranch main*
367370
# then let's re-create our git repo by deleting and starting again:
368371
$ *rm -rf .git*
369372
$ *git init .*
370-
Initialised empty Git repository in ...goat-book/.git/
373+
Initialized empty Git repository in ...goat-book/.git/
371374
----
372375
373376
*******************************************************************************
@@ -393,6 +396,7 @@ $ *echo "db.sqlite3" >> .gitignore*
393396
$ *echo ".venv" >> .gitignore*
394397
----
395398

399+
[role="pagebreak-before"]
396400
Next we can add the rest of the contents of the current "." folder:
397401

398402
[subs="specialcharacters,macros"]
@@ -436,6 +440,7 @@ $ pass:[<strong>echo "__pycache__" >> .gitignore</strong>]
436440
$ pass:[<strong>echo "*.pyc" >> .gitignore</strong>]
437441
----
438442

443+
[role="pagebreak-before"]
439444
Now let's see where we are...
440445

441446

@@ -479,13 +484,14 @@ $ *git add .gitignore*
479484
$ *git commit*
480485
----
481486

487+
[role="pagebreak-before"]
482488
When you type `git commit`, it will pop up an editor window for you to write your commit message in.
483489
Mine looked like <<first_git_commit>>.footnote:[
484490
Did a strange terminal-based editor (the dreaded Vim) pop up and you had no idea what to do?
485491
Or did you see a message about account identity and `git config --global
486492
user.username`?
487493
Check out the Git manual and its
488-
http://git-scm.com/book/en/Customizing-Git-Git-Configuration[basic configuration section.]
494+
http://git-scm.com/book/en/Customizing-Git-Git-Configuration[basic configuration section].
489495
PS: To quit Vim, it's Esc, then `:q!`]
490496

491497
[[first_git_commit]]

0 commit comments

Comments
 (0)