Progress Acquires MarkLogic! Learn More

Build Applications that Last with MarkLogic Unit Test

Back to blog
2 minute read
Back to blog
2 minute read

A good way to ensure that you’re building applications that last is by investing in automated testing. Without automated testing, the next person who has to work on your application will have a much tougher time knowing they could break something, or not knowing why your code does something. Automated testing will make sure your application works today and in the future, which is necessary for when you bring on new developers to work on the application.

With MarkLogic Unit Test, this process is simple. MarkLogic Unit Test is a testing component that enables you to build unit tests that are written in, and can be tested against, both XQuery and server-side JavaScript. When building applications, unit testing allows you to:

  • Gain confidence that your code does what you think it does
  • Show other developers how you expect your code will be used
  • Ensure that new code does not reintroduce old bugs
  • Easily automate the tedious job of testing code coverage

What is it?

MarkLogic Unit Test is a testing framework that allows a project to test your MarkLogic code. With one import, a project immediately has access to:

  1. A framework for writing and running MarkLogic unit tests, including several built-in assertion functions
  2. A UI for viewing and running unit tests executed within MarkLogic
  3. A REST endpoint to run and report unit test results with other tools

You can watch the Introduction to MarkLogic Unit Test video tutorial for a deeper understanding.

Who would use this?

Experienced MarkLogic developers can use this tool to write and run unit tests to ensure that the capabilities they are delivering are well-built. Using MarkLogic Unit Test requires an intimate understanding of how MarkLogic works and how it runs, so it’s not for developers who are inexperienced with MarkLogic.

The tool runs within MarkLogic so you do not have to develop an external testing solution. You can write unit tests in both JavaScript and XQuery, but we recommend JavaScript.

How can I get started?

If you’d like to get started with MarkLogic Unit Test, read through the Getting Started tutorial on its GitHub Wiki. You can find the tool on its repository on GitHub.

MarkLogic Unit Test is an important tool to help teams build lasting applications. Just as a UI or middle-tier developer would be expected to test their code, this tool allows a MarkLogic developer to test code executed within MarkLogic, ensuring that this layer of the application is built and tested well.

Share this article

Read More

Related Posts

Like what you just read, here are a few more articles for you to check out or you can visit our blog overview page to see more.


Semantics, Search, MarkLogic 11 and Beyond

Get info on recent and upcoming product updates from John Snelson, head of the MarkLogic product architecture team.

All Blog Articles

Integrating MarkLogic with Kafka

The MarkLogic Kafka Connector makes it easy to move data between the two systems, without the need for custom code.

All Blog Articles

Introduction to GraphQL with MarkLogic

MarkLogic 11 introduces support for GraphQL queries that run against views in your MarkLogic database. Customers interested in or already using GraphQL can now securely query MarkLogic via this increasingly popular query language.

All Blog Articles

Sign up for a Demo

Don’t waste time stitching together components. MarkLogic combines the power of a multi-model database, search, and semantic AI technology in a single platform with mastering, metadata management, government-grade security and more.

Request a Demo