By taking you through the development of a real web application from beginning to end, this hands-on guide demonstrates the practical advantages of test-driven development (TDD) with Python. You’ll learn how to write and run tests before building each part of your app, and then develop the minimum amount of code required to pass those tests. The result? Clean code that works. In the process, you’ll learn the basics of Django, Selenium, Git, jQuery, and Mock, along with current web development techniques. If you’re ready to take your Python skills to the next level, this book clearly demonstrates how TDD encourages simple designs and inspires confidence.
This is by far my favorite book on Django. In addition, it's probably one of the best written computer books I've read.
If you want to learn the Django syntax, read the Django documentation and go through the tutorial. Learning the syntax of a programming language or framework is the relatively easy part though. The harder part is learning how to efficiently and practically use the language/framework to create an actual application. That's where Harry Percival's Test-Driven Web Development with Python really shines.
Harry walks you through all the steps necessary to create, build, test, and deploy a Django website. Topics include:
- Using Selenium and Firefox for functional testing - Creating unit tests - Using Fabric to deploy code - Authentication using Mozilla Persona - Test fixtures - Continuous integration
If you want to build a dynamic, database-backed website using Django, I heartily recommend buying Harry Percival's Test-Driven Web Development with Python.
یکی از بهترین کتاب هایی که در زمینه تست نرمافزار خواندم. کتاب قرار است با استفاده از فریمورک جنگو (چارچوبی برای برنامه نویسی تحت وب) یک سیستم ثبت کارهای روزانه توسعه دهد. روش آموزش کتاب مبتنی برای ایجاد تست-رانه است. ایجاد تست-رانه یکی از رویههای کاری معروف متدولوژیهای چابک است که در آن قبل از اینکه کد نرم افزار نوشته شود، برای آن تست نوشته میشود. یکی از نکات جالب این کتاب این است که تا جای ممکن همه چیز را به صورت خودکار در میآورد تا در نهایت بتوانید تحویل مستمر داشته باشید. تحویل مستمر یعنی این که هر لحظه که تیم پروژه اراده کرد بتواند محصول توسعه داده شده را به دست مشتری برساند بدون آنکه زمانی برای کارهای عملیاتی صرف شود.
In terms of test-driven development the concepts are pretty well explained, I think because I came from a non-webdev perspective a lot of the practical stuff in the book re: Django isn't for me. Note that if you are TRYING to learn Django do NOT use this book because it's pretty obsolete and I've found the author would spend a lot of time talking about certain parts of Django but completely glosses over some more confusing but important concepts (like database migrations).
If you're like me and you're trying to get into TDD, this is a good book to skim and deep dive into the CONCEPTS of TDD, but I would recommend against what I did which is trying to implement all the code exercises/project in the book. Django is kind of a nightmare to debug, at least this older version of the framework the book uses.
The authors writing style is a little too cute for me, but that's a personal preference thing.
Я думаю, це важлива книжка, щоб дізнатись більше про TDD. Мені, зокрема, вона була важлива як частина розвитку в роботі. Але в плані нових знань я не знайшла для себе багато нового, бо все це вже знала. Натомість, книжка буде корисною, якщо ви ще незнайомі (або майже незнайомі) з фреймворком Django. Хоча, в сучасному світі більше використовується складніша версія - Django Rest Framework, про який автор говорить лише в додатку і не дуже багато, тож будьте до цього також готові. Сама ідеологія TDD для мене трохи mind-blowing і здається трохи недолугим - ти пишеш 10 тестів, щоб змінити (написати) 1-2 рядки коду. Але, як і сказав автор, треба бути готовим, що внутрішньо ми будемо цьому противитись, бо вигода від TDD не "тут і зараз", а колись потім, в майбутньому, до чого також не всі готові. Тим не менш, дізналась трохи цікавих ідей та підходів, тож, гадаю, книжка, зрештою, була корисна для розширення мого кругозору.
Once again I am tricked by the book title. This book would better find its target audience if it was titled Intro to Test-Driven Development with Selenium and Django. That has all the right keywords and would not mislead the reader into believing it serves a more general purpose than it does.
The writing is clever, however, and I have a singular appreciation for his git-centric tutorial approach. If you are looking for an intro to some subset of Selenium, TDD, Django, and Git, I think this will fit the bill nicely.
I would not recommend it for an experienced programmer though.
This is an excellent introduction to the Test Driven Development programming paradigm. Harry manages to make this book accessible and entertaining while at the same time delving into the details of complex concepts. The text can also be used as an introduction to web development using the Django framework. If you are interested in developing tools the right way make sure to take a look at this book and obey the testing goat.
I'm quite a fan of TDD approach and have been trying at least partly to use it in my own projects. I believe it can have real benefit for building simple, good designed code. I expected from this book to find some good tips&trick how to make it better. What I didn't expect was besides the obvious unit tests tool there will be also functional testing included in this pack, a this was very interesting. Even though I consider very important that dedicated QA's are responsible for Functional/System Tests, this is giving quite a complex view also on this facet of testing part and can be very helpful for smaller teams or more simple projects.
The edition I was reading was a little bit out-dated but still, most of the discussed is valid. But as the book progressed farther, it started to be - at least from my point of view - a little bit chaotic, and Appendixes part maybe interesting, but not so much related.
Btw - not sure if intended, but the name "Internet Exploder" gave me quite a laugh reading in the train reading during my commute to work :)
This book is the killer intro/lay-of-the-land to those unsure about the whole TDD thing in python. Start here it will give you everything you need to go-go-go.
Starting around my first reading of this legendary "Goat" book I started dabbling in TDD. Now I like to say that I can't even remember how to write code not-TDD. How do people deal with the insecurity? How do you know your code works? Don't you have to write tests anyway?
Given away copies/recommended countless times to students and younger devs and they rant as enthusiastically as I do (if they actually read it).
This book has a permanent place on my bookshelf. Long live the goat book!
Thanks to covid-19 which gave me the time to finish this book, after long time that this book was in my reading list! I really enjoyed reading this book. I did know about unit tests and functional tests before reading this book and had written many unit tests for java projects. But this book shows many new aspects of testing. I specially liked the author's explanations from development level all the way to staging and production and how to make everything automated. Obeying the testing goat is definitely hard but I learned to obey more in my future projects!
The book offers a good and detailed introduction into testing your Python code. The author explains tools that will make testing a lot simpler and shows in detail how you can test complicated tings like CSS well enough so that your tests find bugs and not your users. I do not use the same frameworks as the author; therefore, the last 200 pages got a bit boring. Nevertheless, this is a good book that offers a lot.
The best book I've ever read on programming and Django in particular! Even if it says "Test-Driven Development" you'll find so much more than that. Like application design, OOP practices, deployment and even CI! I always knew that tests are important but dreaded to try it. Now I can't wait to implement the knowledge I got from this book. It's a must read 100%!
Excellent introduction to Test-Driven Development, Web Frameworks, and Django! Worthwhile for the beginner programmer as well as the intermediate.
That said, it’s only after finishing that I realized how clear and easy-to-follow the Django docs are. Much of the content can be found there. (Although the philosophy of TDD is only briefly mentioned.)
Truly excellent. The author doesn't just introduce Test Driven Development. He also includes a full demo of Django plus intros to Bootstrap, server setup, git-based deployments, and more.
I'm using this now to build a web application for my union and it's been very helpful.
Really good explanation of TDD. Some of the concepts and approaches I've carried to other languages. One thing though as somebody mentioned. It's quite focused on Django. But other than is quite transferable.
Excellent books for web development and TDD beginner
The book strikes wonderful balance between theories and practical stuffs, a good sense of humour and coverage. Totally love it and will read it several times.
Este es un libro que si estás comenzando en Python y Testing es imperdible, es uno de los mejores libros técnicos que he leído, por su ritmo, profundidad, humor y manera entretenida y didáctica de escritura.
No leí toooodas las partes a profundidad, ya que es un libro muy práctico que tiene muchas partes de código (además de que está un poco desactualizado), pero creo que los principios que puedes aprender si trasladas el código a algo moderno, son muy valiosos.
Este libro cubre todas las partes de del testing, desde unit testing hasta behavior y pruebas de integración. No sólo te enseña a hacerlas, sino que además trata preguntas y puntos de vista diferentes, muchas veces evolucionando en los acercamientos a las soluciones.
Algo que tienes que saber es que usa Django para lograr muchas de las hace, por lo cuál muchas de las técnicas están estrechamente ligadas al Django del tiempo en el que se escribió y las soluciones que Django usa para hacer tests limpios, como por ejemplo, la creación y destrucción de la base de datos cada vez que se corre un ciclo de pruebas.
Sin duda, creo que este libro lo deberían leer todos los desarrolladores interesados en testing, o por lo menos echarle una lectura rápida (skimming) para ver en qué partes de las que profundiza te pueden servir tanto para empezar como aprender testing.
La última desventaja que le veo (en 2022) es su edad y que no usa herramientas de desarrollo y testing tan modernas como PyTest, pero creo que complementándolo con recursos que te las enseñen, se pueden aprender los conceptos de forma moderna. Espero haya una tercera edición actualizada pronto.
I love this book so much. I read it 2 times already (different early release versions) as I am new to testing in general. It is worth every Baht I paid for to O'Reilly. Thanks to my friend who introduces this book to me and thanks to the author too. I will have to read it for the third time after I practice about the mocking. I got lost at that chapter. It is a difficult topic as the author said.
This is realy a great book, Harry is an outstanding professional and he used a simple language to describe a lot of testig topics and best practise. I definitely recommend it to anyone who works with Django and "web"-Python.
However there is a problem - Django is not mentioned in the title and it absolutely should. Short "Web" is not enough. If you know nothing about Django and you not a web developer you will lose a lot of time and maybe even fail to finish the book.
A must read for every TDD enthusiast and Python and Django devs. It teaches you Django and JS testing and mocking. Yes, I said mocking. A real gem for TDD learning and understanding. Even if you practice TDD, you surely can learn something new along the way.
Also the Automation and Deployment parts were really useful even for experienced 'deployers'.
The integration of testing into a 'real' (simplified) python application fills a real hole on my bookshelves; too often testing is about work with a 'calculator' or similar toy program, or is shown in Java (which uses very different approaches in its testing).