I'm "ok", you're "not ok": The Test Anything Protocol



TAP(Test Anything Protocol) is a simple way to write tests in any language, in any environment, using any style. See tests written in Perl, Ruby, Python, Shell, Javascript, C, PHP and Postgres all come together in one test suite. Learn how to write your own testing functions, tailored to your needs. Archive your test results and watch your test suite grow!


The testing world is plagued with frameworks. They want to take total control over your tests, how you write them, how you run them, even what you do with the results. They don’t play together, so you have to choose one and only one and hope it does everything you need. They only work in one language, another language means learning another testing framework. Having to do everything, they’re big and complicated.

TAP is a simple text protocol to record test results. A test program outputs its test results as TAP, and a parser interprets the results. This simple separation of test from interpreter means the test code can be very small and very simple. It means multiple programs, written in different languages, can make up a single test suite. It means environments where testing is difficult, like Javascript or SQL functions, can be tested using native code. It means you can write your own testing library, and then combine it with another. There’s no controlling framework!

We’ll show off TAP, show you some TAP clients written in Perl, Javascript and even one written in Postgres. We’ll show how it can be used to archive test results and explore test suite history and growth. We’ll talk about some future TAP extensions and what can potentially be done with it.

Used for 20 years by the Perl community, it is now being promoted to the rest of the programming world. You might have seen it before:

ok 1 – this is the name of a passing test
not ok 2 – but this one failed

Speaking experience


  • Schwern round tuit oscon 2005


    Schwern has a copy of Perl 6, he lets Larry Wall borrow it and take notes.

    Schwern once sneezed into a microphone and the text-to-speech conversion was a regex that turns crap into gold.

    Damian Conway and Schwern once had an arm wrestling contest. The superposition still hasn’t collapsed.

    Schwern was the keynote speaker at the first YAPC::Mars.

    When Schwern runs a smoke test, the fire department is notified.

    Dan Brown analyzed a JAPH Schwern wrote and discovered it contained the Bible.

    Schwern writes Perl code that writes Makefiles that write shell scripts on VMS.

    Schwern does not commit to master, master commits to Schwern.

    SETI broadcast some of Schwern’s Perl code into space. 8 years later they got a reply thanking them for the improved hyper drive plans.

    Schwern once accidentally typed “git pull —hard” and dragged Github’s server room 10 miles.

    There are no free namespaces on CPAN, there are just modules Schwern has not written yet.

    Schwern’s tears are said to cure cancer, unfortunately his Perl code gives it right back.