|
|||||||||||||||||||||||||||||||||||
|
8 Reviews
|
Average Customer Review
Share your thoughts with other customers
Create your own review
|
|
Most Helpful First | Newest First
|
|
3 of 3 people found the following review helpful:
5.0 out of 5 stars
Great book for anyone interested in testing their Django applications,
By
This review is from: Django 1.1 Testing and Debugging (Paperback)
Once again I felt completely absorbed by the style chosen for this Packt Publishing book, as it makes use of a complete application to reinforce all of the topics covered. You start with a brief explanation of the benefits of testing your code and immediately start building a market research application from scratch.
Every chapter is built on the previous one, covering topics such as doctests, unittests, and adding coverage information and reports via Ned Batchelder's coverage script. You also learn about using Django's ''django.test.Client module and Twill to perform web testing and make sure that what your users see in their web browser is valid content and what they expected. I liked the fact that several chapters were dedicated to showing you how to properly debug, log, and understand the information collected by these methods. Also how to fix any issues that may come up during the development phase, as well as write tests to catch them! I have definitely learned several new ways to look at debug information that I will make sure to add to my arsenal. Some of the tools you'll learn include the awesome Django Debug Toolbar (I wrote about it here) and even the Python debugger (pdb), so if you've never heard of either one or need a refresher, you'll enjoy the last chapters of this book. By the time you're done reading this book, you'll have a complete market researching tool, including some Fancy Nancy charts generated by pygooglechart or matplotlib AND instructions on how to deploy it in a production environment and perform some load tests using siege! Overall, this book offers good quality screenshots, clear and concise directions and working source code to follow along! I recommend it for anyone who's doing Django development out there and would like to improve the quality of their applications by adding (more) tests!
2 of 2 people found the following review helpful:
4.0 out of 5 stars
Good overview and introduction,
By
This review is from: Django 1.1 Testing and Debugging (Paperback)
Packt Publishing sent me a copy of Django 1.1 Testing and Debugging for review. I was particularly interested in reading this title, as testing is something I know makes my code better, but don't feel like I do enough of, and because I work on a couple of Django-based projects in my spare time, with varying degrees of test coverage. While I consider myself comfortable with Python's stock unittest and doctest modules, I was curious to learn about how you can integrate Django with other Python testing tools.
Django 1.1. Testing and Debugging is split, as the title implies, into two halves: Testing, followed by Debugging. It uses a narrative approach, following the development of a survey application throughout. The book starts with an overview of the stock unittest and doctest facilities in Python. Most of chapters 1 through 3 are devoted to the basics of unit testing, specifically for Model classes. Tracey provides information about Django-specific nuances along with way. For example, I didn't realize Django ships with a customized doctest module to enabled ELLIPSES support in Python 2.3. Chapter 3 also provides information about how to use fixtures for providing test data, and how to specify those apart from the initial data fixtures developers may already be aware of. Chapter 4 mirrors some of the information found in Django's testing documentation: the Django TestCase, and how you use it to do basic view testing. Chapter 5 describes integrating Django with other tools, primarily by example. Tracey discusses how to replace the default Django test runner, and what interface the replacement needs to implement. She also provides a stub example of more "invasive" integration, crafting a new management command that could (possibly) handle code coverage reporting while running the tests. This stub was interesting, but didn't feel particularly testing related to me. Chapter 5 closes with examples of using the excellent coverage package with django-coverage, and integrating twill into Django tests. Chapter 6 begins the section on debugging with an overview of the Django settings that impact debugging, and how the development server supports debugging of applications. Chapter 7 follows with a thorough analysis of the development server's error page, as well as examples of debugging based on the information given. The examples continue to develop the survey application, and introduces what Tracey describes as "typical mistakes", then describes how to fix them. Chapter 8 begins to dig a little deeper, and I was happy to see mention of Rob Hudson's Django Debug Toolbar, an indispensable tool. Chapter 8 also includes details on using the logging module, and how to develop a decorator that marks function entry and exit. I know that I'm all too guilty of using print instead of logging, and it was nice to be reminded of how easy this is. Chapter 9 was my favorite part of the book. It gives a good overview of using pdb, and then goes on to demonstrate how to use pdb and a shell session to test a race condition and deal with it. Overall Django 1.1 Testing and Debugging seems like a good introductory book for Django developers who are new to testing (or Django). While many of the debugging examples seemed obvious to me, I suspect that someone new to Django could use this book as an introduction to development and debugging.
2 of 2 people found the following review helpful:
5.0 out of 5 stars
Great book, recommended,
This review is from: Django 1.1 Testing and Debugging (Paperback)
This book is nothing if not ambitious. Weighing in at over 400 pages, it aims to highlight the development of an entire web app, start to finish, with a particular emphasis on the testing and debugging tools that Django provides.
Starting with the fundamentals of doctests and unit tests, the book also discusses what should be tested - not just how. And in doing this, the book reveals its target audience. I would particularly recommend this book for the following groups of people: developers who are relatively new to Django, and developers who are new to MVC frameworks in general. The book then moves on to describe some of the tools you can use to extend Django's testing and debugging capabilities - the django-debug-toolbar, and Twill to name two. A detailed discussion of Django error pages comes next, before what was, for me, the highlight of the book: an examination of PDB - the Python Debugger. If, like me, your initial exposure to Python came through Django, then you might well have missed some of the gems that the standard library contains, such as PDB. The book contains a detailed walkthrough of how to use PDB, and if you haven't used it before, well, you'll love it. The book ends with a chapter on deployment, even including a section on load testing. Advanced topics such as testing threading issues are covered here too, ensuring that even seasoned Django developers will learn something from this book. The book's greatest strength is its breadth - covering the entire development process from start to finish. If there's one flaw though, it is that it goes into a little too much detail in places. Like Juho, I could have done without the section on reporting bugs in Django. You shouldn't let that put you off though - if the worst criticism I can muster is 'too much detail', that has to be a good thing! In particular, if you want to learn how to test your Django applications properly, or are new to Django and want to see the testing and debugging tools on offer, I would wholeheartedly recommend this book.
5.0 out of 5 stars
The most useful Django book available,
By Leon Matthews (Auckland, New Zealand) - See all my reviews
This review is from: Django 1.1 Testing and Debugging (Paperback)
A fantastic introduction, and deep delve into Django test-driven development. Much of the material applies to plain Python programming as well. If I had to pick just one book for a new Django developer, it would be this one, no question.
Only relatively recently has the Django community started to develop a good test-driven methodology, and I suspect this book might be part of the reason why -- it's a brilliant book. Don't let the slightly unfortunate title put you off, it's just as useful to users of Django 1.3 -- the only outdated advice are a couple of places where the author points out something that doesn't quite work yet, that now works in the latest versions of Django. There are relatively few nits. The visual presentation isn't great, and it can sometimes be a little difficult to follow along with the examples -- you have to make the same (deliberate) mistakes she does. Not knowing where the example was going, I had to back-track more than once and add the error I'd absentmindedly fixed!
5.0 out of 5 stars
Should be considered required reading for perfectionists with deadlines.,
By
This review is from: Django 1.1 Testing and Debugging (Paperback)
Django 1.1 Testing and Debugging covers all the essential tools for testing web applications, specifically Django apps. The topics covered are sometimes specific to Django but many are applicable to other web frameworks or straight Python code. Weighing in at about 400 pages, the book includes a balanced mix of discussion, code examples screenshots and stack traces. The book is targeted at web developers familiar with Python, Django and relational databases who are eager to learn more about testing and debugging. The author's writing style is relaxed yet not full of the smarmy jokes found in some technical books. She does a find job of explaining the concepts covered in the book. It should be considered required reading for perfectionists with deadlines.
The author's approach is to talk the reader through building one example web app of moderate complexity from start to finish, demonstrating the best practices of testing and debugging along the way. The demo app developed in the book is realistically complex including custom template tags, external libraries a race condition and bumping into a bug in the Django source. Each portion of the app is tested and/or debugged, introducing Django tools like Django's unit test extensions and test runners, as well as third party tools like Twill and the Django Debug Toolbar. The discussion of using the Python debugger (pdb) to step through code running on the web server particularly helpful and interesting. The book finishes with discussions of how to be efficient when seeking help from the Django community, deploying and debugging in the production environment and finally load testing the production app. The physical quality of the book seems above average. The paper is of a nice weight and so far this reviewer's copy has not separated from the binding. It's easy to distinguish the code samples from the command line output from the core text because of the use of different font style and weight. Each chapter includes a short introduction a the beginning and a helpful summary of what it covered at the end. The table of contents is good. The index is fair, if a little on the light side. The overall quality of the book is quite good.
4.0 out of 5 stars
A very good book for improving your Django skills,
This review is from: Django 1.1 Testing and Debugging (Paperback)
Disclaimer: I received a review copy of this book from the publisher, Packt Publishing.
I am using Django almost at full time since 0.96 (it was 2007, March when it was tagged 0.96), so from about 3 years now, and I have read almost every book has been out from Apress. This is the first book I read from Packt about Django (I have read one about Plone, one about Joomla and one about jQuery), and I may say that I am impressed from their way to package valuable and very specific contents in a single book. If many times it is easy to get specified contents on the web, in this case, for the topics covered by this book, this is not so obvious and anyway it is very nice to have all the material packaged and structured in an excelent way just in a single book. Intended audience of the book: for reading it you must have already a working experience on Django. If you want to learn Django, this is absolutely not the first book to go for, so keep it in mind! But if you have some experience it will teach you the latest best pratices about test and debugging. Basically, the book is divided in two parts: the first one is about testing, the second about debugging. In the part about testing you will basically learn about Doc Tests and Unit Tests. After describing the basic syntax for running tests in Django (the 'test' option of the django-admin utility), the book teach you how to write Doc Tests and what are their advantages. This kind of tests have the advantage to both test code and create documentation at the same time. There are also some disadvantages, as pointed out from the last part of the second chapter. Chapter 3 shows you how to write effective unit tests, and how to create and use test data (fixtures) for running this tests. The chapter 4 illustrates in great details the TestCase class, while chapter 5 shows you how to integrate Django with other test tools like Coverage (for determining how much of our code you are effectively testing) and Twill (a convenient way to navigate a web application from command line, if you are not satisfied with the test client API included in Django). Chapter 6 introduces the second main argument of the book: debugging. After this general introduction and a maybe too much detailed chapter about the debug page and the various type of errors you may find developing web application with Django, in chapter 8 there are excellent indications about how to track SQL queries, how to use the Django Debug Toolbar (a must-have tool for any serious developer!) and the several ways to log from within the application. Chapter 9 gives a detailed explanation of the pdb debugger (here, in my opinion, the autor should have at least mentioned the ipdb debugger, that basically is pdb for using within ipython for having tab completion and nice tracebacks). Chapter 10 gives other options if you are in a situation where all the other tools are failing: for example it shows you how to use the Django Project web site for researching help, for accessing (and creating) tickets and understanding their history and if a fixed has been released (basically is a Trac guide): maybe quiete obvious information for dedicating a whole chapter at it. Finally last chapter is about deploying a Django web site in production: after a basic tutorial for creating the WSGI script (actually the recommended way to deploy a Python web site), and an Apache virtual host, this chapter will show you how to debug Apache if problems arise and how to test multithreaded behavior. Principal benefits from this book --------------------------------- - Nice structure of the topics - Every chapter is built on the previous one, through a very nice step by step tutorial (a survey application). Note that, as not in many books, the whole code is perfectly working even for latter Django releases - Excellent collection of best practices for a developer: this book will make the difference! Const ----- - Too much details in some case (for example the bug section, as already other reviewers have indicated, and the many pages dedicated to the Django tracking system), and this is the reason because I give 4 stars and not 5 In any case, for people willing to make serious test-driven agile development with this beautiful web framework, this is a must-have book!
5.0 out of 5 stars
The BEST Book on Agile Django Development,
By
Amazon Verified Purchase(What's this?)
This review is from: Django 1.1 Testing and Debugging (Paperback)
First, a little about my background: I've been using Django for approximately 8 months, both professionally and for fun.
This book really blew me away. I learned more new things in this book than I have reading the past 5 or so tech books alone. This book is extremely useful for any developers who would like to be better all around Django programmers, as it provides a solid, proven system for developing, testing, and debugging Django applications. The rest of my review will be spent breaking this book down for anyone interested. TARGET AUDIENCE --------------- The target audience for this book are developers comfortable writing Django websites. This includes proficiency with: * models * forms * views * templates * settings (settings.py) * python modules * the concept of unit testing * the concept of 'agile development' If you are decent at any of the above, or can at least understand all of the terminology, and know WHY things work the way they do, then this book will be extremely useful to you. If you aren't really sure you know the topics above, consider reading another Django book before this one (but still buy this one). TOPICS COVERED -------------- The book covers the following topics in-depth: * Running tests on Django websites / applications. * How to write useful doctests. * How to write useful unit tests. * Doctest dependence and creation / specification. * Unicode problems with doctests, and how to fix them. * Basic, intermediate, and advanced unit testing. * What to unit test, what not to worry about. (EG: Don't test native parts of Django, it is already tested.) * Environmental dependence in tests: database dependence, test interdependence, etc. * How to generate test fixtures. * How to use test fixtures. * Testing Django admin applications. * Testing emails. * Testing other HTTP methods. * Testing URL configurations. * Testing templates with Django's test client, and twil. * Using nose as a test runner. * How to understand Django's debug pages. * How to use PDB to do intensive low-level debugging of running applications. * How to perform performance / stress tests using siege. * Fixing multi-threaded coding errors. * Tracking SQL queries and optimizing SQL requests. * Using Django Debug Toolbar. * How to use the Django ticketing system. * How to deploy using mod_wsgi + apache for fast websites. * How to log code effectively using the native python logger. * How to get *real* coverage reports using django-coverage. OVERALL REVIEW -------------- This book is by far the best book on agile development with Django that has been written. If it were up to me, I would require every programmer who uses Django to read this book before writing production code. It outlines the best practices for developing with Django (with a strong focus on testing), and WHY they are best practices. The author is an extremely good technical writer, and her focus and clarity is easily identifiable in the text. She is able to elegantly describe even the most complex thoughts, actions, and results with little reader friction. If you work with Django (for fun or profit), and haven't read this book, do yourself a favor and buy it. It will make a world of difference in your day-to-day work, and will make future programmers working on your code love you. It also covers details such as the best way to test models, how to test forms, etc., in a straightforward, easy to understand method.
3 of 5 people found the following review helpful:
4.0 out of 5 stars
Decent effort with some nitpicks,
This review is from: Django 1.1 Testing and Debugging (Paperback)
Disclaimer: I received a review copy of this book from the publisher, Packt Publishing.
I have been using Django for a few years (since 0.96 I think). My experience with Python spans a couple of years further. I was excited to receive the book for a review. I expected it to give insight particularly on debugging and deployment. It did manage to reach these goals I set for it to some extent. It's not the thinnest book around as it spans 400 pages or so. The book uses narrative based on example, a survey application, that's used throughout the book. I can see the merits of this approach to some extent. It sure does give the book some continuity. On the other hand it detracts its value as reference material. The chapters related to testing felt quite standard material to me. No surprises there. Both doctests and unittest module were covered as expected. Sadly there was no mention of higher level concepts, such as acceptance testing. On the other hand there was some good information about code coverage and twill testing tool that allows you to emulate an actual web browser quite easily. I think the highlights of the debugging chapters of the book for me were related to the introduction of debug toolbar and logging. There were some parts, such as how to report a Django bug, that felt a bit redundant to me but otherwise it seemed fine. It would have been useful to have some sort of checklists to aid in the debugging process as it tends to be quite formulaic (well, at least for me). The book ended with an enlightening chapter about deployment. It made some really good points that are going to bite you in an actual production environment. I would have appreciated even more information on deployment while a bit less on others aspects. I understand that might have gone too much out of scope of the book, though. As mentioned on the book description, it is definitely good to have some experience. I would not recommend this book for total newbies to Django or Python as itself. It's better to pick up some companion book or just refer to the freely available documentation. Unless you are an absolute Django guru, the book is bound to give some insight to the aspects covered. |
|
Most Helpful First | Newest First
|
|
Django 1.1 Testing and Debugging by Karen M. Tracey (Paperback - April 20, 2010)
$49.99 $42.51
In Stock | ||