Skip to Content
Test-Driven Development with Python, 2nd Edition
book

Test-Driven Development with Python, 2nd Edition

by Harry Percival
August 2017
Intermediate to advanced
624 pages
12h 18m
English
O'Reilly Media, Inc.
Content preview from Test-Driven Development with Python, 2nd Edition

Part I. The Basics of TDD and Django

In this first part, I’m going to introduce the basics of Test-Driven Development (TDD). We’ll build a real web application from scratch, writing tests first at every stage.

We’ll cover functional testing with Selenium, as well as unit testing, and see the difference between the two. I’ll introduce the TDD workflow, what I call the unit-test/code cycle. We’ll also do some refactoring, and see how that fits with TDD. Since it’s absolutely essential to serious software engineering, I’ll also be using a version control system (Git). We’ll discuss how and when to do commits and integrate them with the TDD and web development workflow.

We’ll be using Django, the Python world’s most popular web framework (probably). I’ve tried to introduce the Django concepts slowly and one at a time, and provide lots of links to further reading. If you’re a total beginner to Django, I thoroughly recommend taking the time to read them. If you find yourself feeling a bit lost, take a couple of hours to go through the official Django tutorial (make sure to use the 1.11 version), and then come back to the book.

You’ll also get to meet the Testing Goat…

Be Careful with Copy and Paste

If you’re working from a digital version of the book, it’s natural to want to copy and paste code listings from the book as you’re working through it. It’s much better if you don’t: typing things in by hand gets them into your muscle memory, and just feels much more real. You also inevitably ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Test-Driven Development with Python, 3rd Edition

Test-Driven Development with Python, 3rd Edition

Harry Percival

Publisher Resources

ISBN: 9781491958698Errata Page