At Conversant we’re constantly making changes, enhancements, and adding new features to our Java-based RTB and Ad platform. Keeping pace with these changes requires robust, automated testing tools. After years of working with various frameworks, both open source and developed in house, we’ve begun a transition from Java to ScalaTest as our primary scaffolding for our in house test development framework.
One may ask why move from Java to another JVM language? Over the years Java has evolved into a complex programing language, far too verbose, requiring unnecessary code ceremony to fulfill even simple tasks. If you prefer clean, concise code then Scala may be for you. Scala is easy to learn, feels like a scripting language, it is dynamic but incorporates a rich type system. It supports both functional and object-oriented programming and best of all, it runs along side Java code within the JVM!! Scala is designed primarily around this principle - “write less and do more”.
With respect to test automation the most important thing is a framework that enables one to quickly write automated tests that have a blend of the following features:
- associates tests with specifications
- facilitates simple design
- provides good data abstraction
- enables up-to-date documentation
- allows easy enhancements
- provides high visibility to all stakeholders – business, product, development, QA and management.
Our answer is ScalaTest, which has all the above said features with complete Java interoperability. ScalaTest is a higher-order API based on Scala. It utilizes a domain specific language (DSL) written in Scala which is very English like. To learn more look at the ScalaTest Traits and Assertions user guide.
To get started just download Scala SDK, ScalaTest jar and the plugin for your IDE (if you are using one). My presentation below has code samples, explains the key benefits and hopefully gets you started. And most importantly have fun writing Tests!!