If you are writing automated through-the-GUI tests for a web application, you are in danger of creating software tests that are more expensive to maintain than they are worth. With well-factored Selenium RC tests running in Junit or TestNG, you can keep your abstraction layers or “Lingos” – small bounded bits of slang for discrete parts of the object model – separate, thereby reducing the maintenance costs of your tests, and improving your sanity.
Software tests never run fast enough. To improve this performance, this article presents a process called DMAIC (Define, Measure, Analyze, Improve, Control). It shows how to apply this approach with Cucumber, an open source Behavior Driven Development tool. Cucumber lets you describe how software should behave in plain text. The text is written in a business-readable domain-specific language and serves as requirements documentation and source of automated acceptance tests.
This guide presents the mechanisms available to test your Ruby on Rails application. After an introduction to software testing in the Ruby on Rails context, the guide explains how to perform unit testing on your models and functional testing for the controllers. The guide also explains how Rails provides a generator to create an integration test skeleton. At the end, the guide proposes other popular testing approaches and plugins that could be used to test Ruby on Rails applications.
Practical Unit Testing with TestNG and Mockito is a book that is intended especially for those who would like to start unit testing their code, but are unsure about how to get started and what to focus on. It presents the unit testing domain with examples in the Java language using the TestNG and Mockito open source tools.
SpecsFor.Mvc is an open source tools that allows you to create automated acceptance tests using browser automation, meaning your entire application is tested from the UI all the way down to the database, exactly as a real user will use your application. However, unlike many other solutions which rely on recording actions or require you to learn a completely new framework and syntax, SpecsFor.Mvc uses familiar unit-testing tools and syntax.
In this blog post, Mark Barne shares some useful tips and techniques to challenge those attempting to adopt acceptance test driven development within a corporate environment. Amongst the tips that I liked the best I will mention “Don’t clean up after tests”. Leaving the data created by the test can help immensely when issues are found. “Create unique contexts for each test”. To prevent tests stepping on each other’s toes if they are run in parallel, create a unique context for the test. “Don’t write the test at all.” If the story doesn’t have much value, or the the systems you are using are not in your control and are not test friendly then stop just short of automating it.