Crafting Test-Driven Software with Python

Test-Driven Development (TDD) is a set of best practices that helps developers to build more scalable software, and is used to increase the robustness of software by using automatic tests.

This book shows you how to apply TDD practices efficiently in Python projects. From Alessandro Molina, the Author of Modern Python Standard Library Cookbook

You’ll begin by learning about built-in unit tests and Mocks before covering rich frameworks like PyTest and web-based libraries such as WebTest and Robot, and understand how Python allows you to embrace all modern testing practices with ease. Moving on, you’ll find out how to design tests and balance them with new feature development and discover how to create a complete test suite with PyTest. The book helps you adopt a hands-on approach to implementing TDD and associated methodologies that will have you up and running and make you more productive in no time. With the help of step-by-step explanations of essential concepts and practical examples, you’ll explore automatic tests and TDD best practices and get to grips with the methodologies and tools available in Python for creating effective and robust applications.

Reviews & Testimonials

Crafting Test-Driven Software with Python provides an in-depth look at this important programming topic ... Overall, this is a superb tutorial for Python testing in general as well as TDD/BDD;

It's a great book. I can only compare this book to "Effective Python: 90 Specific Ways to Write Better Python". I thought I know Python well. Well, after reading this book, I realized that I was mistaken.

This is a good book by Alessandro Molina. He have used his 15+ years of experience to design and layout all the chapters of the book carefully.

What's inside?

  1. Getting Started with Software Testing

  2. Test Doubles with a chat application

  3. Test Driven Development while creating a TODO list application

  4. Scaling the Test Suite

  5. Introduction to PyTest

  6. Dynamic and Parametric Tests and Fixtures

  7. Fitness Functions explained using a contact book application example project

  8. PyTest Essential Plugins

  9. Managing test environments with Tox

  10. Testing Documentation and
    Property Based Testing

  11. Testing for the Web: WSGI vs HTTP

  12. End to end testing with Robot framework

Articles and Mentions

How to get your projects automatically verified for you and on multiple Python versions.

A deep insights on why Python is one of the best languages for automation and automatic testing.

A complete overview of the Unittest testing module that comes with the Python Standard Library

Python Resources

Official Documentation of the Python Standard Library module to implement test suites.

The PyTest framework to implement flexible and powerful test suites in your Python projects.

The RealPython.com guide on how to implement test suites using the PyTest framework.