Synopses & Reviews
Is there any sexier topic in software development than software testing? That is, besides game programming, 3D graphics, audio, high-performance clustering, cool websites, et cetera? Okay, so software testing is low on the list. And that's unfortunate, because good software testing can increase your productivity, improve your designs, raise your quality, ease your maintenance burdens, and help to satisfy your customers, coworkers, and managers.
Perl has a strong history of automated tests. A very early release of Perl 1.0 included a comprehensive test suite, and it's only improved from there. Learning how Perl's test tools work and how to put them together to solve all sorts of previously intractable problems can make you a better programmer in general. Besides, it's easy to use the Perl tools described to handle all sorts of testing problems that you may encounter, even in other languages.
Like all titles in O'Reilly's Developer's Notebook series, this "all lab, no lecture" book skips the boring prose and focuses instead on a series of exercises that speak to you instead of at you.
Perl Testing: A Developer's Notebook will help you dive right in and:
- Write basic Perl tests with ease and interpret the results
- Apply special techniques and modules to improve your tests
- Bundle test suites along with projects
- Test databases and their data
- Test websites and web projects
- Use the "Test Anything Protocol" which tests projects written in languages other than Perl
With today's increased workloads and short development cycles, unit tests are more vital to building robust, high-quality software than ever before. Once mastered, these lessons will help you ensure low-level code correctness, reduce software development cycle time, and ease maintenance burdens.
You don't have to be a die-hard free and open source software developer who lives, breathes, and dreams Perl to use this book. You just have to want to do your job a little bit better.
About the Author
Ian Langworth (http://langworth.com/) has been writing Perlfor years and actively involved in the community since 2003.He has contributed a handful of modules to the CPAN, most ofwhich are Kwiki-related. He has spoken at Perl-relatedconferences as LISA and YAPC. Ian is also the authorsurprisingly widespread utility, Cadubi, which is packagedfor many free operating systems.Ian is currently studying Computer Science and CognitivePsychology at Northeastern University. Whilst pursuinga degree, he's participating in an volunteer systemsadministration group and working toward making higher codequality and robustness an easier goal to achieve.He currently resides in Boston, Massachusetts where heparticipates in the local Boston Perl Mongers group and livesprecariously close to Fenway Park.
chromatic is the technical editor of the O'Reilly Network, coveringopen source, Linux, development, and dynamic languages. He is also the author of the Extreme Programming Pocket Guide and Running Weblogs with Slash, as well as the editor of BSD Hacks and Gaming Hacks. He is the original author of Test::Builder, the foundation for most modern testing modules in Perl 5, and has contributed many of the tests for core Perl. He has given tutorials and presentations at several Perl conferences, including OSCON, and often writes for Perl.com, which he also edits. He lives just west of Portland, Oregon, with two cats, a creek in his backyard, and, as you may have guessed, several unfinished projects.
Table of Contents
The Developer's Notebook Series; Notebooks Are...; Notebooks Aren't...; Organization; Preface; What This Book Covers; Conventions Used in This Book; Using Code Examples; Safari Enabled; Comments and Questions; Acknowledgments; Chapter 1: Beginning Testing; 1.1 Installing Test Modules; 1.2 Running Tests; 1.3 Interpreting Test Results; 1.4 Writing Your First Test; 1.5 Loading Modules; 1.6 Improving Test Comparisons; Chapter 2: Writing Tests; 2.1 Skipping Tests; 2.2 Skipping All Tests; 2.3 Marking Tests as TODO; 2.4 Simple Data Structure Equality; 2.5 Data Composition; 2.6 Testing Warnings; 2.7 Testing Exceptions; Chapter 3: Managing Tests; 3.1 Organizing Tests; 3.2 Checking Your Coverage; 3.3 Writing a Testing Library; 3.4 Testing a Testing Library; 3.5 Writing a Testing Harness; 3.6 Testing Across the Network; 3.7 Automating Test Runs; Chapter 4: Distributing Your Tests (and Code); 4.1 Testing POD Files; 4.2 Testing Documentation Coverage; 4.3 Distribution Signatures; 4.4 Testing Entire Distributions; 4.5 Letting the User Decide; 4.6 Letting the User Decide (Continued); 4.7 Bundling Tests with Modules; 4.8 Collecting Test Results; 4.9 Validating Kwalitee; Chapter 5: Testing Untestable Code; 5.1 Overriding Built-ins; 5.2 Mocking Modules; 5.3 Mocking Objects; 5.4 Partially Mocking Objects; 5.5 Overriding Live Code; 5.6 Overriding Operators Everywhere; Chapter 6: Testing Databases; 6.1 Shipping Test Databases; 6.2 Testing Database Data; 6.3 Using Temporary Databases; 6.4 Mocking Databases; Chapter 7: Testing Web Sites; 7.1 Testing Your Backend; 7.2 Testing Your Frontend; 7.3 Record and Play Back Browsing Sessions; 7.4 Testing the Validity of HTML; 7.5 Running Your Own Apache Server; 7.6 Testing with Apache-Test; 7.7 Distributing Modules with Apache-Test; Chapter 8: Unit Testing with Test::Class; 8.1 Writing Test Cases; 8.2 Creating Test Fixtures; 8.3 Inheriting Tests; 8.4 Skipping Tests with Test::Class; 8.5 Marking Tests as TODO with Test::Class; Chapter 9: Testing Everything Else; 9.1 Writing Testable Programs; 9.2 Testing Programs; 9.3 Testing Interactive Programs; 9.4 Testing Shared Libraries; Colophon;