Chapter 1. An Introduction to TAP

Table of Contents

History
Why would you use TAP in your Java programs?

The Test Anything Protocol (TAP) is a standard output format for test results. A producer generates TAP streams and then a consumer can read these streams and use them for different purposes. In a Java test project with TestNG, for instance, the TestNG tests would be the producer and an utility that interprets the results and build reports would be the consumer.

Following is an example of a simple TAP Stream with three tests.

1..4
ok 1 - Input file opened
not ok 2
ok 3 - Read the rest of the file
# Yeah, you can comment your TAP Stream
not ok 4 - Summarized correctly # TODO Not written yet
	

History

TAP was created by the Perl community. It surged as the output format of the Test::Harness module and was used later by Test::More. TAP is present in Perl since Perl's first version.

In the beginning TAP didn't have this name. Actually, it didn't have any name, it was usually referred to as the Test::More protocol. No, TAP wasn't named in a Pub conversation, although it is a good place to have great ideas. TAP was named in a chat with many members of the Perl community.

The current version of the protocol is 13. The first version was committed in Perl 1 by Larry Wall on January the 30th, as part of t/TEST.