test-suite-brainstorming
This article is a stub. You can help the microformats.org wiki by expanding it.
Microformats can be used to express language-agnostic test suites on the web.
Problems Being Solved
- Having to write a new test suite for each different implementation of the same code
- ”It’d be ideal to have some test framework which lets us test both our ruby and PHP implementations” — Aaron Parecki in IWC IRC
- Having to keep documentation and code in sync with each other
- “I hate reading documentation which has code errors and/or sample output that is incorrect. I [snip] wrote a quick readme parser that can lint sample source code or execute and inject the actual result” — Carbon documentation
Previous Work
The microfomats parser test suite is a real-workd project which uses the test-fixture poshformat and it’s draft microformats2 update to both generate a test suite and to test various microformats2 parsers written in different languages.
Open Standards Use Cases
Open standards like the URI specification need to be implemented in almost every language, but typically there is either no canonical test suite, or it’s difficult to find.
- is there a canonical URI test suite, e.g. for relative URI resolution? --bw 18:26, 4 October 2013 (UTC)
- There are some examples for relative URI resolution in RFC3986 5.4
Typically each function described by these standards doesn’t have complex testing requirements (put a string in, make sure the string which comes out matches the expected value).
If a canonical, language-agnostic test suite could be published using microformats and HTML, all implementations could easily be compared.