Java vs. Python for test automation? Why Ruby is the better choice – TechBeacon

What's the top language for writing software test automationscripts? Your guess is as good as anyone else's, becausethere's no agreement on this. And that's unfortunate. You would think by now we testers would have settled the debate.

Java and Python at the top two candidates. However, this is a holdover from the way that code wastested in the past. Developers were tasked with creating their tests, so they wrote testscripts that used languages they already knew.

That's all well and good if you have developers testing, but these days, who has time for that?

Developers should be spending their time producing new code. Which means testers are in charge of the testing process. And that means they get to choose what language they use to write their test automation scripts.

For those whoare up in arms about using the same language both to write and test, keep in mindthat what you write for the web doesn't actually compile in that language. Whether you use Java or Python or .NET to create a webpage, you're ultimately creating HTML code.

So we've had this difference between front-end and back-end languages all along;we just didn't admit it. It's the same thing here,and this is why you need to use Ruby for writing test automation code.It's a solid alternative to either of the two big names.

(To be clear, the version of Ruby I'm referring to here isjust "regular" Ruby andnot derivatives such asJRuby or CRuby.Ruby by itself does let you do some more "illegal" things as opposed to a compiled language.)

[ Learn whatyour team needs to know to start taking advantage of test automation with TechBeacon's Guide. Plus: Get the Buyer's Guide For Software Test Automation Tools ]

Like Java and Python, which have their own strengths and preferred audiences, Ruby is a language that's very powerful for specific uses. For example, Pythonis great at gobbling up unsorted data caches and processing them efficiently. That's why it's popular in unstructured settings such as data science.

For its part,Ruby, because it's an array-based language, works particularlywell with ordered datasets.

And you know what's an ordered dataset? A website. There's always a logical flow to the structure, and there's always a way to locate what you're looking for. Because Ruby is a language that works better for this specialized service, it makes sense to pull it out of the toolbox.

A Swiss Army knife may be okay for lots of different tasks, but when you really get down to it, you don't want your surgeon using one to take out your appendix.You want your doctor to use the right tool for the job. Andbecause Ruby matches so well with what you're doing in test automation, it makes sense to use it.

New test automation professionals are trying to learn two things at once: what test automation is, and a scripting language. This is a compound problem. If you can remove some of the barriers, that will allow new testers to progress faster not onlythrough their test backlog, but up thecareer ladder as well.

With that mindset, then,look at which language is faster to learn if you're not trying to become a developer, but to become a test automator. My vote is for Ruby.

The first time I worked with Ruby,I was tasked with the impossible: create some test automation for a homebrewed Captcha form. The in-house developers beat their heads against the wall for a while and finally threw it over the wall to me. After about a week of exploration and dirty tricks, I had an automation to get through it.

When was the last time you learned a language in a week? That's what I thought.

The ease with which I picked up Ruby blew me away. Because of that short learning curve, Ruby is a great language to use when you're trying to learn test automation at the same time.

[ Understand quality-driven development with best practices from QA practitioners in TechBeacon's Guide. Plus: Download the World Quality Report 2019-20 ]

Ruby has some specialized functions that otherlanguages don't have.For example, you can make methods at runtime. This is like code writing itselfyou don't have to know everything or have everything completely defined when you start out. This simplifies and speeds up your test automation scriptwriting.

And, most importantly, if you tried to do this kind of bootstrapping with a compiled language, you'd immediately get shouted out of the auditorium. You just can't do it.

But with Ruby, since it has a lotof flexibility, you can do a lot more with it. Admittedly this kind of functionality may be for those a little more advanced. But, hey, wouldn't you like to go into a project knowing this is a possibility rather than beingcompletely verboten?

Two questions willhelp you decide whether to write your test automation scripts in Ruby or another language. The first is about the practitioners.

Who is going to be performing the testing? If it's the developers (not recommended, by the way), then by all means, let them write the test automation in the language they're comfortable with. If it's a separate set of testers, though, then you're a candidate for Ruby.

And the second question is related:

Do your testers want to learn automation? If not, and if everyone is good with manual testing, then no worries;no need to learn Ruby or Python or Java or anything. Just go about your day and we'll see you on the other sideif you can keep up.

However, if your testers (and your management) are interested in speeding up the test process through automation, then it makes sense to consider Ruby. Because if you're in that boat, it's likely your testers might not have experience in learning any language.

Some testers might fear that adding automation to testing would mean they aren't needed anymore. That may have been a fear way back when assembly lines were first introduced, but if testers are part of adding in automation, they'll be demonstrating that they're integral to the release calendar.

They won't be eliminated because they'll be helping the company to accelerate everything from scoping (like planning developer time for developing only) to release.

Seriously. You should absolutely look into it. Because when you have to learn both test automation and a language, it can be intimidating.

Cut down one of the hurdles significantly by choosing (yes, you have a choice) a language like Ruby, which has a short learning curve and is a specialized tool for exactly what you need. Your work product, and your career, will be better for it.

[Understandthe issuesand risks that come with SAP modernization with TechBeacon's Guide. Download: Ensure SAP Modernization Success with DevOps ]

The rest is here:

Java vs. Python for test automation? Why Ruby is the better choice - TechBeacon

Related Posts

Comments are closed.