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

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 27 reviews)

Ratings Distribution

  • 5 Stars

     

    (17)

  • 4 Stars

     

    (7)

  • 3 Stars

     

    (2)

  • 2 Stars

     

    (1)

  • 1 Stars

     

    (0)

92%

of respondents would recommend this to a friend.

Pros

  • Helpful examples (23)
  • Easy to understand (20)
  • Well-written (18)
  • Accurate (14)
  • Concise (9)

Cons

    Best Uses

    • Intermediate (19)
    • Novice (16)
    • Student (11)
      • Reviewer Profile:
      • Developer (20), Maker (7), Educator (4), Designer (3), Sys admin (3)

    Reviewed by 27 customers

    Sort by

    Displaying reviews 1-10

    Back to top

    Previous | Next »

     
    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.

       
      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.

        (1 of 1 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.

           
          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!

            (3 of 4 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!

              (1 of 1 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!

                (4 of 4 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.

                   
                  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 2 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.

                    (3 of 3 customers found this review helpful)

                     
                    5.0

                    Great book on TDD, Django Dev, and more!

                    By Sceva

                    from Omaha, NE

                    About Me Developer

                    Verified Buyer

                    Pros

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

                    Cons

                      Best Uses

                      • Intermediate
                      • Student

                      Comments about oreilly Test-Driven Development with Python:

                      I have been learning Python and Django for a web application, and had been frustrated trying to learn how to include testing. TDD, Selenium, models, views, controllers, html, JavaScript, ... all of these together were overwhelming me. Harry's book does a great job introducing all these concepts and more. His minimalist style (YAGNI) has been illuminating also. Did I mention that the code in the book has no errors - the most accurate programming book I have ever read.

                      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, Web Application
                      Print & Ebook: $49.49
                      Print: $44.99