What This Book Covers

     

The nine chapters of this book cover testing in Perl, starting as if you've never written a test before and ending by exploring some of the testing problems you'll encounter in the real world. The authors expect you to know Perl already well enough to install and use Perl modules effectively in your own programs. You should have a decent understanding of Perl data structures and object-oriented programming. You need to have Perl newer than 5.6.0 installed, but the authors recommend at least Perl 5.6.1 and suggest that you consider upgrading to the latest version of the stable 5.8 series.

As for the chapters themselves , they discuss:


Writing basic tests

This chapter explains everything you need to start writing and running tests, including how to install testing modules, how to understand test results, and the basic test functions you'll use in every test.


Improving your tests

This chapter builds on the previous chapter, demonstrating further test techniques and modules. Once you're familiar with writing tests, you'll encounter some common tasks and troubles. Here's how to solve them.


Organizing and running tests well

This chapter shows how to take advantage of the basic testing tools to customize them for your environment and projects. In particular, it shows how to write your own testing libraries and harnesses.


Bundling tests and code into projects

Tests are just code, and all of the normal rules of disciplined coding apply. This chapter covers some of the issues you'll face when you want to distribute your project, especially the issues of non-code portions of your project.


Testing hard-to-test code

Unit testing seems easy in theory, but complex projects have complex interactions that might seem impossibly untestable at first. This chapter claims otherwise. It recommends another way of thinking that allows you to substitute testable code ”under your control ”for code that otherwise looks untestable.


Testing databases and their data

Many programs interact with databases: relational, object, and flat file. While these normally seem outside the purview of what you can test from Perl, there are simple and effective techniques to verifying that your code does what it should. This chapter describes them.


Testing web sites and web projects

Layered applications, with display, logic, and data pieces, also seem difficult to test, especially if they're not really layered after all. This chapter explores an alternative web application design strategy that makes projects easier to maintain and easier to test, too, as well as how to test them.


Unit testing

Traditional Perl testing differs from xUnit-style testing in the way it organizes, structures, and runs tests. You can have the best of both worlds , though. This chapter discusses a Perl testing framework that allows good code reuse within object-oriented project tests and yet works within the familiar Perl testing libraries.


Testing non-Perl and non-modules

There's a whole world outside of Perl. Now that you know the power, flexibility, and ease of automated testing with Perl, this chapter suggests a few ways to use everything you've learned to test other projects written in other languages. Go forth and improve software quality worldwide.



Perl Testing. A Developer's Notebook
Perl Testing: A Developers Notebook
ISBN: 0596100922
EAN: 2147483647
Year: 2003
Pages: 107

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net