Test-Driven Development with Python
Obey the Testing Goat: Using Django, Selenium, and JavaScript
Publisher: O'Reilly Media
Final Release Date: June 2014
Pages: 498

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.

  • Dive into the TDD workflow, including the unit test/code cycle and refactoring
  • Use unit tests for classes and functions, and functional tests for user interactions within the browser
  • Learn when and how to use mock objects, and the pros and cons of isolated vs. integrated tests
  • Test and automate your deployments with a staging server
  • Apply tests to the third-party plugins you integrate into your site
  • Use a Continuous Integration environment to run your tests automatically
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyTest-Driven Development with Python
 
4.5

(based on 28 reviews)

Ratings Distribution

  • 5 Stars

     

    (17)

  • 4 Stars

     

    (8)

  • 3 Stars

     

    (2)

  • 2 Stars

     

    (1)

  • 1 Stars

     

    (0)

93%

of respondents would recommend this to a friend.

Pros

  • Helpful examples (23)
  • Easy to understand (20)
  • Well-written (19)
  • Accurate (15)
  • Concise (10)

Cons

    Best Uses

    • Intermediate (19)
    • Novice (17)
    • Student (12)
      • Reviewer Profile:
      • Developer (22), Maker (6), Educator (4), Designer (3), Sys admin (3)

    Reviewed by 28 customers

    Sort by

    Displaying reviews 1-10

    Back to top

    Previous | Next »

     
    4.0

    Python, Django and TDD

    By Panagiotis Koutsourakis

    from Greece

    About Me Developer

    Verified Reviewer

    Pros

    • Accurate
    • Concise
    • Well-written

    Cons

      Best Uses

      • Intermediate
      • Novice

      Comments about oreilly Test-Driven Development with Python:

      The book describes the process of building a web app for todo lists using Django and Test Driven Development, starting from a very simple application where people can input a list of thing in a web page, to a personalized social service.

      This is the first book on TDD that actually made me stick with the methodology. I have understood the theoretical motivation behind TDD, and its potential benefits, since I first heard about the idea, but whenever I tried to read a book about the subject, I always found the examples artificial and uninteresting. Although the application (todo lists) that is described does not seem very interesting at first, it
      is a non trivial example that has many creative and surprising aspects. For example I really enjoyed the integration of the Mozilla
      Persona service into the app. The author does a very good job to motivate each test written, by explaining thoroughly his thought process.

      This is the first programming book I've read since childhood, that made me want to copy the code written in it and see it work (and of course change and experiment with it). The author emphasizes that this is in fact the correct way to read the book, and I found it indeed a very rewarding experience.

      Moreover it has been a nice introduction to other subjects I was not familiar with (automated deployments, continuous integration, etc).

      The only reason I don't give it 5 out of 5 stars is that I think some sections could be written a bit more clearly.

      Obey the testing goat people!

       
      5.0

      The Best Django practical book.

      By Sang

      from Japan

      About Me Developer

      Pros

      • Accurate
      • Helpful examples
      • Well-written

      Cons

        Best Uses

        • Novice
        • Student

        Comments about oreilly Test-Driven Development with Python:

        There are many books about an tool. But, It is very hard to find the practical books using multiple tools like this. I think this book will be very good starting point of learning Django, Selenium, Git, Fabric, and ETC..

        (2 of 2 customers found this review helpful)

         
        5.0

        Best Django book available

        By Matthew

        from Independence, MO

        About Me Maker

        Pros

        • Accurate
        • Helpful examples
        • Well-written

        Cons

          Best Uses

          • Intermediate
          • Novice

          Comments about oreilly Test-Driven Development with Python:

          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.

          (2 of 2 customers found this review helpful)

           
          5.0

          Great book to experience TDD first hand

          By Darren

          from Australia

          About Me Qa Engineer

          Verified Reviewer

          Pros

          • Accurate
          • Easy to understand
          • Helpful examples
          • Well-written

          Cons

            Best Uses

            • Intermediate
            • Novice
            • Student

            Comments about oreilly Test-Driven Development with Python:

            This book is practical and took me through the TDD journey. I got to experience TDD step-by-step. This is important because TDD is a habit that needs to be learnt and you have to go though repetition and various ways of applying it to master it. I also learnt about git configuration management, debugging skills and re-factoring as well. The author was very responsive to my feedback and questions.
            Enjoyed the humor and love the testing goat.

            (2 of 2 customers found this review helpful)

             
            5.0

            Good balance: big ideas and datail

            By Jack of All Trades

            from UK

            About Me Developer, Educator, Maker

            Verified Reviewer

            Pros

            • Accurate
            • Concise
            • Easy to understand
            • Helpful examples
            • Well-written

            Cons

              Best Uses

              • Intermediate

              Comments about oreilly Test-Driven Development with Python:

              I really appreciate the author's attention to detail. Just the right balance, so as not to lose the view from above whilst being very clear about (to me) very important disclosures about the author's thought process. At random: "But we won't do them [refactoring] right away, because right now our application is in a broken state." Again: The author's thinking out loud about why you'd tend to Model Layer validation rather than towards a plethora of form validation. Good to think about; good to hear his reasoning. Along the way we're learning important things about Django.

              I think the author has been very clever to combine so large a number of really important ideas and, at the same time, pay justice to them with just the right amount of detail.

              It's so important, this detail. The hundreds of little micro-decisions a programmer decides during each hour of programming: what to call this variable? should I commit now? should I refactor yet? Is it worth writing a test for this? I should break this file / function into smaller pieces as I'm losing control of the idea ….

              So, to be able to read along with the author's thought processes as we explore new ways of doing things: making micro-decisions about new things we're just getting to grips with and that still feel a little unfamiliar under our fingers … I very much and appreciate this book. It's certainly been an eye-opener for me.

              ... and a very *enjoyable* read!

              (4 of 9 customers found this review helpful)

               
              3.0

              Transmogrification in Progress

              By Stephen

              from Lawrence, KS

              About Me Developer, Maker, Perl's Evil Ex, Sysadmin

              Verified Reviewer

              Pros

              • Accurate
              • Helpful examples

              Cons

              • The Scope Has Crept

              Best Uses

                Comments about oreilly Test-Driven Development with Python:

                TL;DR: This might not be the droid you are looking for.

                I purchased this book as an Oreilly/pre-release/early-beta volume--python testing and TDD being things that I am interested in as my python skills mature.

                The title indicates that this is (should be) just the volume to seek out for such topics, and, early on, it was. It was also rough--the text walked a bit like Frankenstein's monster; however, it was on topic.

                The text flow has tightened up and I believe this is the 2nd or 3rd (pre) release of this volume since I made the original purchase. That being said, it is now quite entangled with web development and Django.

                These are two topics I am actually interested in; however, there are many good volumes dealing with both topics while there are very few (python-specific) testing volumes. The scope enhancements will undoubtedly appeal to many readers--having such a rich framework to work with while developing testing skills and awareness are not at all the worst idea that has ever been presented.

                I will read this book in-depth when it is released in its final version--I just have no time to do so right now. I was hoping for a more specific treating of TDD in the python world. I believe that book is still within the pages of this volume, I just don't have time just now to deal with its expanded scope.

                At this point I would only strongly recommend this volume if the reader is goal-oriented towards web/framework development.

                I may have cause to write a new review with different opinions later, because these are merely opinions and they very well may change!

                (2 of 2 customers found this review helpful)

                 
                5.0

                Great bang for your buck

                By Dave

                from Palmerston North, NZ

                About Me Educator, Maker

                Verified Buyer

                Pros

                • Accurate
                • Concise
                • Easy to understand
                • Helpful examples
                • Sells Tdd Well
                • Well-written

                Cons

                  Best Uses

                  • Expert
                  • Intermediate

                  Comments about oreilly Test-Driven Development with Python:

                  What a great book! As advertised you'll get a good introduction to TDD principles and applications. But you really get a lot more than that. The working example covers version control of the project with GIT, on top of a pretty good introduction to the Django web framework. The authors writing style is excellent, tight, detailed, and quirky enough to be a fun read!

                  (5 of 5 customers found this review helpful)

                   
                  5.0

                  not only about py, bdd, tdd

                  By lascar

                  from madrid

                  About Me Developer

                  Verified Reviewer

                  Pros

                  • Accurate
                  • Concise
                  • Easy to understand
                  • Helpful examples
                  • Well-written

                  Cons

                    Best Uses

                    • Intermediate
                    • Novice
                    • Student

                    Comments about oreilly Test-Driven Development with Python:

                    it is not only about testing py, it's about what to test, how and in which context.
                    you have to read it!
                    No matter your level. It's about writing good sofware.

                    (1 of 1 customers found this review helpful)

                     
                    5.0

                    Great introduction to TDD & Django

                    By troybetz

                    from Austin, Texas

                    About Me Designer, Developer, Maker

                    Verified Reviewer

                    Pros

                    • Concise
                    • Easy to understand
                    • Helpful examples
                    • Well-written

                    Cons

                      Best Uses

                      • Intermediate

                      Comments about oreilly Test-Driven Development with Python:

                      I've been putting off picking up Django for a while now, but this book changed all of that. Great introduction to Django, and TDD if you're not already into it.

                      (2 of 3 customers found this review helpful)

                       
                      4.0

                      a great book but can be better

                      By Tholapz

                      from Los Angeles,CA

                      About Me Developer, Educator, Maker

                      Verified Buyer

                      Pros

                      • Accurate
                      • Concise
                      • Easy to understand
                      • Helpful examples
                      • Well-written

                      Cons

                      • Too basic

                      Best Uses

                      • Expert
                      • Intermediate
                      • Novice
                      • Student

                      Comments about oreilly Test-Driven Development with Python:

                      A great book full of detailed information I need to develop my mindset for TDD. It would be nice however, if there is a cheat sheet page that list all of the useful commands, procedures, or tips for references.

                      Displaying reviews 1-10

                      Back to top

                      Previous | Next »

                       
                      Buy 2 Get 1 Free Free Shipping Guarantee
                      Buying Options
                      Immediate Access - Go Digital what's this?
                      Ebook: $35.99
                      Formats:  DAISY, ePub, Mobi, PDF
                      Print & Ebook: $49.49
                      Print: $44.99