Artima released this week ScalaTest 1.0, an open-source testing framework for both Java and Scala code. ScalaTest promises to reduce the effort required for writing good tests with a combination of high-level testing abstractions, by supporting multiple testing paradigms, and with integration with most of the popular Java unit testing tools. Few developers would argue about the value of good tests and high test coverage. Yet, while testing, and even test-driven development, are accepted as articles of faith in the developer community, writing tests is still harder than it should be. A similar problem existed in the real of Web application development until various Web frameworks simplified Web app construction, mainly with high-level abstractions that mimicked the natural flow of a Web application. ScalaTest aims to similarly simplify the development of tests. Using advanced Scala constructs, such as traits, it lets developers mix and match various testing styles that suit a specific need or a developer's taste and experience. At the same time, ScalaTest users need only minimal Scala knowledge to use the tool effectively. Indeed, ScalaTest can be a low-risk way to introduce Scala in an environment with lots of existing Java code. ScalaTest creator Bill Venners notes that:
ScalaTest 1.0 is a Scala application that enables developers to work at a higher level than JUnit and TestNG when writing tests. ScalaTest 1.0 runs on the JVM and can be used to test Java as well as Scala code. In addition to deep integration with JUnit and TestNG, it also supports an Ant task, integrates with maven, and includes improved syntax for popular Java mocking frameworks JMock, EasyMock, and Mockito. Via its JUnit integration ScalaTest can easily be used with IDEs such as Eclipse, NetBeans, and IntelliJ IDEA and productivity tools such as Infinitest.
What do you think of ScalaTest's higher-level approach to testing?