In discussing languages for testing, often the discussions can turn into debates, and the debates can turn into “religious” wars.
Ruby!
Python!
Perl!
And the list goes on…
But in some cases, the scripting language doesn’t matter all that much. At least, not for testers. All the scripting languages have some very basic functionality which makes them ideal for testing:
- test frameworks
- exception handling
- regular expressions
- vast module libraries to deal with things like database access, operating system functions, network connections etc.
And, sometimes it is more important what you’re trying to do than how you’re trying to do it. Let’s think of, to pay homage to Brian Marick, an example.
Below is a basic example of a web application, and a web services interface to it.
As you can see, the application can be accessed via the browser. However, there is also a web services interface (accessed via HTTP basic authentication) where functionality can be exercised simply by passing a URL to the server from a scripted web client.
This allows a tester to write automation in virtually any scripting language to automate actions on a web application, without having to go through the user interface. This could render which language you use to automate your tests (almost) irrelevant.
However, I still like Ruby.