Test Automation in InterSystems Cache and Ensemble

Atomic Object has been providing development and consulting services for a company in the healthcare industry. We’ll refer to this company as DoctorsInc hereinafter. Our primary focus was to bring agile project management and TDD practices to DoctorsInc’s development process. The group that we worked with at DoctorsInc uses a powerful ETL tool called

Ensemble is a product developed by a company called InterSystems that sits on top of another product called Cache. Cache is an integrated development platform and OODB that provides a powerful set of tools for development, database management, and much more.

DoctorsInc just recently finished the process of migrating from one medical software platform to another. During that process they used Ensemble to transform the old set of medical data to the new set. The process of transformation can be very complex and involved. It’s prone to human error just like all software development. The transformation toolset itself is great but that doesn’t mean it can protect a developer from performing erroneous data transformations. Data transformations (DTL) needed to be unit tested like any other software.

Existing Test Frameworks

InterSystems has done a great job of providing powerful tools and abstractions that made the transformation process easier. In the end, however, everything is built upon their Cache ObjectScript language. We discovered we could use their existing unit testing framework to test data transformations.

The unit test framework in Cache resembles most xUnit frameworks. It has all the necessary components to build and execute a set of tests. Even though InterSystems does not provide easy test execution via the Studio IDE or Continuous Integration they did provide us a path to build it on our own with relative ease.

Extending The Test Frameworks

We knew that in order to effectively promote test automation at DoctorsInc we would have to make it easy to execute tests and make test failures visible. Otherwise the tests would not be run, maintained, and would eventually become useless.

First we made the execution of an individual test and a suite of tests easily done through the Studio IDE. A developer can easily write a test, execute it from Studio, see the test failure, implement, and execute the test again to verify that is passes. Test-driven development of a Cache DTL was therefore possible.

Next was implementing Continuous Integration to improve regression testing and make test failure visible to the developers. Luckily for us Ensemble was built in such a way that the underlying components are generic and well abstracted. This allowed us to run a persistent Ensemble Production that periodically runs a suite of tests and alert the developers of a test failure via email.


The extensibility and flexibility of the technology provided by InterSystems enabled us to do test automation, continuous integration, unit testing of DTLs, and integration tests for Ensemble Productions. We were initially apprehensive about a large enterprise development environment and our ability to effectively test in it. Thankfully, however, our apprehension was quickly dissolved.

See the follow-up to this article entitled Testing Ensemble Productions.