Try XQSuite
This is a pretty spot; here is a "minimal example":
declare namespace test="http://exist-db.org/xquery/xqsuite";
declare function %test:assertEquals("Hello world") local:hello() { "Hello world" };
XSpec also works great for testing XSLT (for example, it provides well-formatted HTML test results). BUT it seems like a bit of work is needed with XQuery testing. Over the past few years, the project has become inactive.
Pete
source share