Test Anything Protocol

Last updated

The Test Anything Protocol (TAP) is a protocol for communicating between test logic, called a TAP producer, and a test harness in a language-agnostic way. Originally developed for unit testing of the Perl interpreter in 1987, producers and parsers are now available for many development platforms.

Contents

History

TAP was created for the first version of the Perl programming language (released in 1987), as part of the Perl's core test harness (t/TEST). The Test::Harness module was written by Tim Bunce and Andreas König to allow Perl module authors to take advantage of TAP. It became the de facto standard for Perl testing. [1] [2] [3]

Development of TAP, including standardization of the protocol, writing of test producers and consumers, and evangelizing the language is coordinated at the TestAnything website. [4]

As a protocol which is agnostic of programming language, TAP unit testing libraries expanded beyond their Perl roots and have been developed for various languages and systems such as PostgreSQL, [5] MySQL, [6] JavaScript [7] and other implementations listed on the project site. [4] A TAP C library is included as part of the FreeBSD Unix distribution and is used in the system's regression test suite. [8]

Specification

A formal specification for this protocol exists in the TAP::Spec::Parser and TAP::Parser::Grammar modules. The behavior of the Test::Harness module is the de facto TAP standard implementation, along with a writeup of the specification on https://testanything.org.

A project to produce an IETF standard for TAP was initiated in August 2008, at YAPC::Europe 2008. [4]

Examples

Here's an example of TAP's general format:

1..48ok1 Description # Directive# Diagnostic .... ok47 Description ok48 Description 

For example, a test file's output might look like:

1..4ok1 - Input file opened not ok2 - First line of the input valid.     More output from test 2. There can be     arbitrary number of lines for any output     so long as there is at least some kind     of whitespace at beginning of line. ok3 - Read the rest of the file #TAP meta informationnot ok4 - Summarized correctly # TODO: not written yet

See also

Related Research Articles

<span class="mw-page-title-main">Bugzilla</span> Web-based general-purpose bugtracker

Bugzilla is a web-based general-purpose bug tracking system and testing tool originally developed and used by the Mozilla project, and licensed under the Mozilla Public License.

<span class="mw-page-title-main">PostgreSQL</span> Free and open-source object relational database management system

PostgreSQL, also known as Postgres, is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. PostgreSQL features transactions with atomicity, consistency, isolation, durability (ACID) properties, automatically updatable views, materialized views, triggers, foreign keys, and stored procedures. It is supported on all major operating systems, including Linux, FreeBSD, OpenBSD, macOS, and Windows, and handles a range of workloads from single machines to data warehouses or web services with many concurrent users.

<span class="mw-page-title-main">Perl</span> Interpreted programming language first released in 1987

Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language".

<span class="mw-page-title-main">SQLite</span> Serverless relational database management system (RDBMS)

SQLite is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the most widely deployed database engine, as it is used by several of the top web browsers, operating systems, mobile phones, and other embedded systems.

<span class="mw-page-title-main">FOSDEM</span> Annual event in Brussels centered on free and open source software development

Free and Open source Software Developers' European Meeting (FOSDEM) is a non-commercial, volunteer-organized European event centered on free and open-source software development. It is aimed at developers and anyone interested in the free and open-source software movement. It aims to enable developers to meet and to promote the awareness and use of free and open-source software.

<span class="mw-page-title-main">OTRS</span> Service management software

OTRS is a service management suite. The suite contains an agent portal, admin dashboard and customer portal. In the agent portal, teams process tickets and requests from customers. There are various ways in which this information, as well as customer and related data can be viewed. As the name implies, the admin dashboard allows system administrators to manage the system: Options are many, but include roles and groups, process automation, channel integration, and CMDB/database options. The third component, the customer portal, is much like a customizable webpage where information can be shared with customers and requests can be tracked on the customer side.

<span class="mw-page-title-main">DTrace</span> Dynamic tracing framework for kernel and applications

DTrace is a comprehensive dynamic tracing framework originally created by Sun Microsystems for troubleshooting kernel and application problems on production systems in real time. Originally developed for Solaris, it has since been released under the free Common Development and Distribution License (CDDL) in OpenSolaris and its descendant illumos, and has been ported to several other Unix-like systems.

In computing, a solution stack or software stack is a set of software subsystems or components needed to create a complete platform such that no additional software is needed to support applications. Applications are said to "run on" or "run on top of" the resulting platform.

<span class="mw-page-title-main">LAMP (software bundle)</span> Acronym for a common web hosting solution

LAMP is an acronym denoting one of the most common software stacks for the web's most popular applications. Its generic software stack model has largely interchangeable components.

<span class="mw-page-title-main">Catalyst (software)</span> Open-source web application framework

Catalyst is an open-source web application framework written in Perl. It closely follows the model–view–controller (MVC) architecture and supports a number of experimental web patterns. It is written using Moose, a modern object system for Perl. Its design is heavily inspired by frameworks such as Ruby on Rails, Maypole, and Spring.

The acronyms BAPP and BAMP refer to a set of open-source software programs commonly used together to run dynamic websites or servers. This set is a solution stack, and an open source web platform.

sync is a standard system call in the Unix operating system, which commits all data from the kernel filesystem buffers to non-volatile storage, i.e., data which has been scheduled for writing via low-level I/O system calls. Higher-level I/O layers such as stdio may maintain separate buffers of their own.

Embedded SQL is a method of combining the computing power of a programming language and the database manipulation capabilities of SQL. Embedded SQL statements are SQL statements written inline with the program source code, of the host language. The embedded SQL statements are parsed by an embedded SQL preprocessor and replaced by host-language calls to a code library. The output from the preprocessor is then compiled by the host compiler. This allows programmers to embed SQL statements in programs written in any number of languages such as C/C++, COBOL and Fortran. This differs from SQL-derived programming languages that don't go through discrete preprocessors, such as PL/SQL and T-SQL.

<span class="mw-page-title-main">Bricolage (software)</span>

Bricolage was a content management system (CMS) written in the Perl programming language.

<span class="mw-page-title-main">OpenXPKI</span> Open source public key infrastructure software

The OpenXPKI project stewards an open-source Public Key Infrastructure (PKI) software.

Test::More is a unit testing module for Perl. Created and maintained by Michael G Schwern with help from Barrie Slaymaker, Tony Bowden, chromatic, Fergal Daly and perl-qa.

Gearman is an open-source application framework designed to distribute appropriate computer tasks to multiple computers, so large tasks can be done more quickly. In some cases, load balancing rather than raw speed may be the main goal; a Web server, for instance, could use Gearman to send tasks for which it is not optimized to another computer.

Tarantool is an in-memory computing platform with a flexible data schema, best used for creating high-performance applications. Two main parts of it are an in-memory database and a Lua application server.

Qore is an interpreted, high-level, general-purpose, garbage collected dynamic programming language, featuring support for code embedding and sandboxing with optional strong typing and a focus on fundamental support for multithreading and SMP scalability.

<span class="mw-page-title-main">Octopussy (software)</span> Log analysis software

Octopussy, also known as 8Pussy, is a free and open-source computer-software which monitors systems, by constantly analyzing the syslog data they generate and transmit to such a central Octopussy server. Therefore, software like Octopussy plays an important role in maintaining an information security management system within ISO/IEC 27001-compliant environments.

References

  1. "A Perl toolbox for regression tests : Testing Tools". Nnc3.com. Retrieved 27 October 2017.
  2. Schilli, Mike. "Print as Print Can » Linux Magazine". Linux Magazine. Retrieved 27 October 2017.
  3. Szabo, Gabor. "TAP - Test Anything Protocol". Perl Maven. Retrieved 2019-08-07.
  4. 1 2 3 "The Test Anything Protocol website". Testanything.org. Retrieved September 4, 2008.
  5. McClive, Simon (2017-09-21). "Unit testing Postgres with pgTAP". Medium . Retrieved 2019-08-07.
  6. Gravelle, Rob (2012-08-13). "Testing Your MySQL Stored Procedures with MyTAP". Database Journal. Retrieved 2019-08-07.
  7. "Node Tap". Node Tap. Retrieved 2019-08-07.
  8. "TAP(3) manual page". FreeBSD . Retrieved 2019-08-07.