"Perl for Perl Newbies" - Part 5 - Good Programming PracticesAutomated TestingTypes of Tests: Unit Tests, Integration Tests, System Tests

2.3. Types of Tests: Unit Tests, Integration Tests, System Tests

Software design methodologists distinguish between several types of automated tests. First of all, unit tests (also see the Wikipedia article) test only a single "unit" of the code (say a module or a class), to see if it behaves as expected. They generally make sure that the behaviour of the module is sane and desirable, while not trying to see if it works as part of the larger scheme.

On the other hand, system tests test the entire system. For example, if we're writing code to generate a web-site, we could test that the various pages of the resultant site contain some of the qualities that we expect. System tests tests the system as a whole, to see if there's a bug somewhere.

Between unit tests and system tests there could be several intermediate layers of tests, normally called integration tests .

You can write all these tests using TAP, Test::More and other testing modules on the CPAN, but it's important to be aware of the distinction.

Smoke Tests

“Smoke tests” is a term referring to a subset of the tests used to see if the software application performs its very basic operation well enough to give way for further testing. It is akin to plugging in an Electronics device and making sure it doesn't raise smoke from mis-operation. As a result, if the entire tests suite is time consuming, the smoke testing should take a short time to perform.

Using Perl for Testing Code in Other Programming Languages

You can use Perl to test software written in many other programming languages:


Written by Shlomi Fish