Foundations of Agile Python DevelopmentChromodromic writes "'Agile' is a common enough catchword these days, but an important one which encapsulates a development philosopy and its accompanying practices and tools, all of which address the goal of defeating the enormous failure rate of software projects while delivering to the client exactly (or better than) what he asked for. Apress tackles development practices at the language level of detail with "Foundations of Agile Python Development", by Jeff Younker. This is a book which specifically and very effectively provides a roadmap to agile development tools and practices in the Python universe. It does quite a bit more than this, too, with a few chapters rising to the level of "essential reading".
Learning language details well is only part of the process by which a developer becomes productive. For example, it's usual for a developer new to a language to peruse the various blogs written by the community in order to acquire a feel for the culture, but especially to learn the best-practice approaches which address the language's typical problem domains. "Foundations" functions in this context a bit like the ultimate blog postzilla, quickly introducing a Python developer to the tools and terms which form the basis of the community's lingua franca. Not every Python developer I know uses all of the tools and practices in this book — but every serious Python developer I know uses some subset of them, and is familiar with all of them.
Unless you've been programming Cobol in a cold, dark basement for the last six or seven years, you've at least heard the term agile as it applies to development methodology — Jeff Younker excerpts "The Agile Manifesto" in his overview of the topic:
Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan
That is, while there is value in the items on the right, we value the items on the left more.
Manifesto for Agile Software Development (http://agilemanifesto.org/)
Younker then provides an overview of core agile philosophy as it applies to the pragmatics of software development, explaining how essential concepts reinforce the overall approach. These concepts include pair programming, user stories, the system metaphor, unit tests and test-driven development, refactoring, simple design, collective code ownership, short iterations, continuous reflection, continuous integration, and the agile approach to documentation. I'm usually not one for much introductory material, preferring to get right to the good stuff, but I found Younker's quick overview of these concepts and approaches to be important in framing the content of the coming chapters.
On to the good stuff. There's plenty of it. The book gets you up and running with PyDev and Mylyn on Eclipse. The chapter moves quickly and really only serves to introduce PyDev's featureset while beginning to build what will become a complete, platform independent Python development environment. The IDE is just the beginning — though, if you've ever used PyDev, you know what a useful beginning it is.
A discussion of revision control in general, and Subversion in specific, follows. Here, the book begins to roll. Not only does Younker introduce a typical Subversion work cycle, but he elaborates with a discussion of Subversion and Eclipse integration. The chapters can stand alone, but good work is done throughout the book by continually reviewing how the various tools interoperate. So it's simple to take from the information what you like and leave the rest, which is a real necessity for developers who have grown particularly attached to particular tools — editor choices, for example, are frequently religious in intensity. Subversion, too, is an excellent choice for this chapter which addresses revision control concepts on a broad scale. Because Subversion is hugely popular, the information offered here is both theoretically and pragmatically useful, especially viewed, as it is, through an agile lens.
Chapters 4 through 7 are key, especially for anyone who will be using Python as a team member on medium or large projects. These chapters cover in detail often assumed components of the agile development process, with every chapter following the theory-tool-practice pattern. Using a stock Python installation, Chapter 4 introduces the creation of a test/build harness, which functions as the heartbeat of a test-driven developed project. In order to demonstrate how this harness works, the book also introduces a sample project: a simple RSS reader. It's difficult to overstress how useful this contextualized example becomes.
Python's setuptools are used to establish the harness, which, when completed, builds the sample project on any stock Python installation. In a little over 20 pages you're introduced to setuptools' inner workings along with, again, how they best integrate with Subversion and Eclipse. Because you're involved with building a simple but fun project, dry material is rendered as interesting, or at least as interesting as it can be. Never before this book had I found the setuptools documentation very compelling. Maybe that's just me.
Chapter 5 discusses build systems in an agile environment and Buildbot in particular, a Python-based system which automates the compile/test cycle. Build systems are extremely important, for solitary developers but especially for teams, because they implement the agile philosophy of catching bugs as soon as they're introduced. Essential concepts are covered along with an explanation of how to make Buildbot and Subversion talk to each other via Subversion hooks. Because all of this happens very quickly, once again, potentially dreary material — if picked up out of context — is made enjoyable and trivial to follow. In Chapter 6, the process of test-driven development concepts and setup are discussed at length, and the discussion continues in Chapter 7 with many test-driven examples and further demonstrations of monkeypatching and test mocking. The tools explained in these chapters are unittest, Nose, a test runner, along with pMock (based on Java's jMock library) and PyMock, both (obviously) mocking tools and, no, these are not normally used to communicate with non-Django developers.
I'll sum up the rest of the book — the chapters all follow, essentially, the established pattern of theory-tool-practice discussions. Chapter 8 addresses concepts around coding standards and code coverage, mentioning a number of useful tools while outlining the agile philosophy. Chapter 9 introduces Python ORMs, focusing on SQLObject and SQLAlchemy and framing their roles in agile development methodology. Chapter 10 discusses Web TDD and Chapter 11 provides an overview of functional testing, with detail provided on acceptance testing using PyFit. Whew!
This is a lot of material for 368 pages, but I found, once I was knee-deep in it all, that it was hugely valuable to see how the pieces could fit together, and, along the way, I saw a nice overview of the Pythonic agile development process. It's a great way to build software.
Problems? Nothing too serious. I read the book and worked through examples on my Ubuntu Hardy Heron machine. Mostly, everything installed as advertised and the instructions served well, but in a book which moves this quickly, little attention is paid to small installation details and, especially in the case of Eclipse and Mylyn, I had to do a bit of fumbling to get things humming along. This is not a "how to set everything up" manual in the sense of covering every configuration scenario. Again, the purpose of the book is to provide a pragmatic overview of agile development for Python. Your specific environment's mileage may very with regard to some setups, but there's little cause for worry. Again, most things were pretty smooth and, in the process, you will get a solid foundation regarding what Python expects out of your platform.
Don't grab this book if you're brand new to Python. (Grab this one, if that's the case.) But if you've made a leap into the Python multiverse (trust me, you will enjoy it here) and you have a desire to write bug-free software — yes, I'm being facetious — then this book is more than worthwhile. I remember first going to the Python user group here in Orange County and trying to keep track of all the tools that others were simply assuming I knew about, especially with regard to building and testing. I'd get home and begin to madly Google names and phrases. This book would have bridged a significant knowledge gap and, along those lines, I would definitely recommend it to anyone wanting to get not only the Python's Greatest Hits of Agile Tools and Development, but a set of instructions on how to make everything dance nicely together. Nice work."