2

I work on a test management tool that includes a REST API.

We are looking to add code examples for consumption of the API as well as client libraries.

Initially we were looking to target Python for our examples, because it's a popular language for teaching etc. so there are plenty of good online resources for upskilling people who may not be a full time developer, to a level where they could then write simple scripts against our API's.

For testers who also do scripting/automation etc. - is there a trend towards any particular language that I need to be aware of - or do testers generally adopt the same languages as are being used by their development team?

6 Answers 6

7

I'm going with my favorite response here: it depends.

Sometimes the decision is made because that's the language the tool supports. Sometimes the language is a flavor of the language used by the development team - this often happens where there's an expectation that the development team will be writing at least some of the test automation code. Sometimes it's the language the most experienced automator prefers. And sometimes it's the language the offers the best match to the problems you're using automation to solve.

Ultimately, so long as everyone in the team can pick up and work with the automation, I don't see much difference between different languages. In your position, I'd look for the language that gives you the cleanest and simplest access to the API without imposing too high an adoption cost to your team.

1

If you aspire to upskill people who may not be full time developers, it may not be enough to target a single language, no matter how popular it is. A full time developer worth their salt should be able to translate any popular language to their own favorite language, but someone with less development experience may need more help getting started. If it were me, I would choose a few languages -- perhaps Python, Java, and something from the .NET world -- for examples.

I might also devise a way to get feedback on languages that I should have covered. If a single smart-aleck asks for examples in Fortran IV, I might ignore them, but if lots of people request examples in Ruby, I might try to accommodate them.

Finally, you did not mention what functions your API provides. Does the API allow tests to post test results? Is it for managing test cases? Depending on the feature set, integrating with the management tool might be more of an IT function than a QA function, in which case your audience would be IT people with light programming experience rather than QA people.

2
  • The API is fairly broad, covering test case management, posting results, requirements management, defect management, searching etc. dev.enterprisetester.com/help/#API_Resources But it sounds like perhaps what I need to do is divide our API audience into personas i.e. tasks for testers, tasks for integrators, tasks for people building new clients i.e. mobile, and then maybe consider what language choices would make sense for each I guess. Commented Sep 12, 2012 at 22:47
  • Yes, I think dividing the API audience into personas is a good idea.
    – user246
    Commented Sep 12, 2012 at 22:58
1

You should pick up the same language your development team is using. It fosters better communcation and collaboration in teams. It also gives the added benefit for testers stuck on a issue to use the knowledge within thier development community and developers have the ability to write tests (sweet!).

To be honest, you are always going to have execeptions to this. Like when developing software, there can and will be multiple languages in use.

Everyone will have thier own opinion on what would be the best language to use. If I had to take a shot at what is most common I'd say Java, Python, Ruby, and vbscript(QTP!).

On a side note: You might want to check out soapUI for testing REST APIs.

3
  • RE: vbscript for QTP, on a side-note I had considered javascript as one of our options (we support CORS, so it's possible to interact with the API from inside a script, such as selenium.... or even node for command line execution) - is Javascript a language testers are reasonably familiar with, is it on their radar? Commented Sep 12, 2012 at 22:51
  • Javascript is as common as the web, so any tester with coding and web experience would have knowledge. codecademy.com is a great place to send those who want to start learning it. As BJ mentioned, its more important to focus on programming concepts. Commented Sep 13, 2012 at 2:20
  • We have started to build examples of using the API in Javascript now: github.com/catch-software/EnterpriseTester-API-Examples/tree/… - feedback from few customers who have taken the time to look has been good. Commented Sep 18, 2012 at 0:10
1

In general I agree with Steve that the language of the test code match the language of the product code. The reason for this is to avoid artificial translation layers between the test code and the product code. However, this is not always possible or feasible.

But, I would not recommend choosing a language because it might be popular, or that you think it might be easier to teach people who need to be 'upskilled.' (Teaching people to code whether it is application or tests should be grounded in programming concepts, data structures, etc.)

Once folks learn programming concepts, you should also consider languages that are appropriate for the type of automation you want/need because there are some significant differences between programming languages that could impact your automated test effort. For example, a dynamic scripting language may be appropriate for automating a relatively small set of UI tests that exercise elements on web pages, but those same languages may not be the best choice for high volume automation (e.g. 250K+ tests on daily builds), or tests that target API integration.

1
  • Agree re: choosing the appropriate language, though I think in relation to performance characteristics of dynamic languages, I would suspect the API would reach saturation before the limits of the language, or suggest a very chatty API that could perhaps be overcome with better API design. Commented Sep 12, 2012 at 22:58
1

One answer to your question is to look at this site which measures popularity of programming languages: http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

You will see that both Java and C# top Python in that list and all 3 of these languages are popular in the QA community. Note that this does not speak to how popular these languages are in the QA community alone, only overall popularity. My entire career has been at 2 companies, both of which have used C# (almost) exclusively in QA.

3
  • Well that's certainly an interesting observation, I certainly see that a little in-house...the product is developed in .Net (C# and F#) and certainly our automated testing tends to favour .Net as well, even though it really does not need to. Is the licensing barrier around Visual Studio an issue in these cases i.e. having to give your QA staff Visual Studio licenses? Commented Sep 12, 2012 at 22:56
  • @Bittercoder Visual Studio licenses have not been a barrier where I worked... One of the companies was Microsoft, the other a long time consumer of the Microsoft stack. I'm not sure if it is or would be a barrier in other companies.
    – Sam Woods
    Commented Sep 12, 2012 at 23:11
  • Actually, related to another comment below re: javascript, I'm now toying with the idea of using Microsoft web matrix 2 (microsoft.com/web/webmatrix) which is free and has support for NodeJS (server-side javascript). Commented Sep 13, 2012 at 5:28
1

My personal way is to totally avoid anything that looks like Visual Basic or VBscript.

I think any good object oriented language would do the job, as long as you're not forced to use OOP when it's not needed.

1
  • Certainly I think providing succinct examples of visual basic or vbscript for a REST API would definitely not be much fun, given those tools and libraries predate things like JSON. Other then scripting QTP, or working VBA in Office products thought, how many testers even come across Visual Basic or VBScript these days? (I'm assuming Visual Basic .Net is not on the list, as that really is a different kettle of fish... I would see providing VB.Net examples being up there with providing c# examples) Commented Sep 27, 2012 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.