views:

93

answers:

5

I've recently have started writing unit tests for PL/SQL code in Ruby.

Are there any other language combinations where you write your code and unit tests in two completely different languages?

+1  A: 

We write groovy tests for our Java application. Mainly cause we want to learn and experience other programming languages.

LiorH
+1  A: 

I've seen unit tests written in Ruby for a C library wrapped with swig.

The main advantage compared to the same unit tests written in C being the interactive Rub interpreter (irb) that permits to do exploratory testing.

philippe
+1  A: 

Few years ago we used Python to test C++ code, using Boost to export classes. Unit tests were written in python. The interesting part of this architecture is that we were able to access to living objects from a python console, because the logic was expressed in python, C++ was used to build low level classes.

Zen
A: 

If you're adding a new language to an existing project it's perfectly reasonable to do functional/acceptance tests in the existing language.

When we first adopted Ruby on Rails, we still used JUnit and HTMLUnit to test the web front-end and did assertions directly against the database backend.

If you're still learning how to use a new piece of infrastructure it makes sense to keep using a testing method that you can trust whilst you do the transition.

We did eventually start using test/unit in ruby, and selenium - but it was useful to a transition period where we relied on our existing Java-based tests...

cartoonfox
+2  A: 

A common combination is code in Java and tests in Groovy. Which is particular interesting because Groovy is built "on top of" Java, for example Groovy even uses the same testing framework as Java.

Adrian