Blog

TestBox: Write Better Tests, Build Better BoxLang & CFML Apps

Victor Campos February 13, 2026

Spread the word

Victor Campos

February 13, 2026

Spread the word


Share your thoughts

TestBox: Modern Testing for BoxLang and CFML Applications

Building reliable software isn’t just about writing good code it’s about proving it works, every single time. As applications grow in complexity, having a solid, expressive, and flexible testing framework becomes essential.

That’s where TestBox comes in.

TestBox is a next-generation testing framework designed for BoxLang and CFML, combining modern BDD workflows, traditional xUnit testing, powerful assertions, mocking utilities, rich reporting, and seamless tooling all in one cohesive ecosystem.


Overview

TestBox is a BDD-first testing framework built for the JVM-based BoxLang language and fully compatible with CFML engines. It provides a clean, expressive syntax for writing tests while supporting everything from unit tests to full integration suites.

Out of the box, TestBox includes:

  • A full testing framework
  • Console, IDE, and web runners
  • Assertions and expectations libraries
  • Mocking and debugging utilities
  • Multiple reporting formats

Whether you prefer modern behavior-driven specs or classic test-case-driven workflows, TestBox adapts to your style.

TestBox Docs


Testing Styles

TestBox supports two complementary testing approaches, letting teams choose what fits best—or mix both in the same project.

BDD (Behavior Driven Development)

BDD focuses on describing behavior, not just testing methods. Instead of centering tests around implementation details, you define expectations around features and outcomes using a readable DSL.

Common BDD constructs include:

  • describe()
  • feature()
  • story()
  • given()
  • when()
  • then()
  • it()
  • test()

This style is ideal for feature-level testing, integration tests, and highly readable specifications.

xUnit (Test Driven Development)

The xUnit style follows the traditional TDD approach. You create a test bundle class that mirrors the system under test, with individual test methods validating each behavior.

This approach is structured, familiar, and ideal for teams coming from legacy testing frameworks or traditional unit-testing workflows—including developers familiar with JUnit-style patterns.


Assertions & Expectations

TestBox offers two assertion models, depending on how expressive you want your tests to be:

  • Assertions Library – A classic, explicit assertion style
  • Expectations Library – A fluent, readable approach for modern specs

Both libraries can be used interchangeably across BDD and xUnit tests, giving teams flexibility without sacrificing consistency.


Life-Cycle Callbacks

Both BDD and xUnit styles support rich life-cycle hooks, allowing you to prepare and clean up state during test execution.

You can run logic:

  • Before or after each spec
  • Before or after the entire test suite

This makes it easy to manage setup, mocks, caches, database state, or external resources in a predictable and maintainable way.


Utilities

TestBox ships with a set of powerful utilities to support real-world testing scenarios, including:

  • Debug output buffering
  • Class, method, and property mocking
  • JSON and data mocking
  • Logging and diagnostics

These tools help you test complex systems without relying on fragile or slow external dependencies.


Runners & Reports

Tests can be executed via:

  • CommandBox CLI
  • Your IDE
  • A web-based runner

TestBox also supports a wide range of reporting formats, including:

  • CLI and VSCode output
  • JSON and XML
  • JUnit and TAP
  • HTML and documentation reports
  • Custom report formats

This makes TestBox easy to integrate into CI/CD pipelines and modern JVM workflows.


Installation

Getting started with TestBox is quick and straightforward using CommandBox.

Install it as a development dependency:

box install testbox--saveDev

TestBox is intended for development and testing environments and should be installed as a development dependency only. It should be excluded from your production runtime, following standard CI/CD best practices.

TestBox works best with BoxLang 1+, but is also compatible with Lucee 5+ and Adobe ColdFusion 2021+.


CLI Tooling

TestBox includes a dedicated CLI that allows you to:

  • Generate test harnesses
  • Create BDD or unit tests
  • Run test suites from the command line

You can scaffold an entire testing harness in seconds and start writing tests immediately.


IDE Tooling

A modern editor dramatically improves the testing experience. We strongly recommend VSCode, where TestBox integrates seamlessly alongside the BoxLang tooling.

The VSCode plugin allows you to:

  • Run tests directly from the editor
  • Generate tests
  • Navigate test suites efficiently

MXUnit Compatibility

Legacy Tests, Modern Runner

TestBox is fully compatible with MXUnit xUnit test cases, allowing teams to modernize their tooling without rewriting existing tests.

By mapping /mxunit to TestBox’s compatibility layer, legacy tests continue to work as-is while benefiting from TestBox’s execution engine and runners.

Expected exceptions are also supported via annotations and helper methods, with synchronous execution recommended for full compatibility.


Final Thoughts

Good tests don’t just catch bugs—they document behavior, protect refactors, and build trust in your codebase.

If you’re serious about quality in BoxLang or CFML applications, TestBox isn’t just a testing framework it’s a complete testing strategy built for modern JVM environments.

👉 Install TestBox:

box install testbox--saveDev

Leran More

Join the Ortus Community

Be part of the movement shaping the future of web development. Stay connected and receive the latest updates on, product launches, tool updates, promo services and much more.

Subscribe to our newsletter for exclusive content.

Follow Us on Social media and don’t miss any news and updates:

Add Your Comment

Recent Entries

Your API Returns 200. Did the Business Transaction Actually Work?

Your API Returns 200. Did the Business Transaction Actually Work?

The customer submits an order. The portal shows a confirmation. The API returns 200 OK, and the release checks pass.

The next morning, operations asks why the order never appeared in the approval queue. Support has a ticket. A developer has to trace the order through the database and figure out whether someone can safely submit it again.

For teams maintaining a ColdFusion or Lucee application, this is a frustrating kind of release failure: the team ...

Maria Jose Herrera
Maria Jose Herrera
November 11, 2026
BoxLang AI 3.7: Profiles, Embeddings Defaults and MCP Rate Limiting

BoxLang AI 3.7: Profiles, Embeddings Defaults and MCP Rate Limiting

Ortus Solutions announces the release of BoxLang AI 3.7. Name a provider, model, params and API key once, then pick it by name for a call, an agent, or a single agent run. Embeddings get their own defaults, MCP servers you build get rate limiting and trusted proxies, and a handful of important fixes land along the way.

Luis Majano
Luis Majano
November 05, 2026
BoxLang  1.19.0: See Everything Your Code Does

BoxLang 1.19.0: See Everything Your Code Does

Ortus Solutions today announces the release of BoxLang 1.19.0, the software productivity platform for building, modernizing and running applications, with developers and AI agents working together. This release is about observability: built-in code coverage and execution profiling, the missing post-invocation events for BIFs, and new query and transaction events, and it pairs with the new BxLens beta, the debug bar and ops console that exposes hotspots and bytecode profilers. It also adds your own global settings in boxlang.json, static method interception, raw binary HTTP streaming and a lot of hardening across JDBC, Java interop and CFML compatibility.

Luis Majano
Luis Majano
November 05, 2026