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.
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
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