r/softwaretesting • u/FlatFeature9045 • May 30 '22
Best programming language to learn as an Automation engineer. With the ease of getting a job with the each languages.
https://youtu.be/x0dW20DjLiU
0
Upvotes
3
u/NeilPork May 31 '22
The choice of which language to use often comes down to which language the application under test is written in.
I used C# once because it was a Microsoft shop.
I used groovy once because they were writing their application in groovy.
I used java once because the application was written in java.
In each case there was plenty of local support to help me if I got stuck on a programming question.
The one thing you don't want to do is pick a language that nobody else in the shop is using.
16
u/ManiiaDaWizard May 31 '22
I hate to be that guy, but this video is full of misleading or unimportant information. Most of the reasons proposed as "differences" or pro/con analysis of the 3 languages either aren't differences or are unimportant to the overall point of "good languages to use for testing".
Sure, but none of that is OOP-specific. Any well designed program can be broken down into smaller problems, can be high quality and can be low maintenance.
OOP has 4 core principles: abstraction, encapsulation, inheritance, and polymorphism (Wikipedie for the curious).
This is true for pretty much every programming language that is used by more than a handful of people -- this is not a selling point that makes Python somehow better than other langauges.
In practice, this is true for Python and C# as well. Java can run on any machine that supports installation of the Java Runtime Environment (which includes the Java Virtual Machine). Python can run on any machine that can install the Python interpreter. C# can run on any machine that can install .NET.
In the overwhelming majority of cases, this means Windows, macOS, and the popular flavors of Linux (Ubuntu, Fedora, Arch, etc). If a new operating system was introduced tomorrow (that was not based directly on an existing operating system), none of the 3 languages would magically be able to run on it; they would need to have support added (by porting their respective runtime environments).
So do Python and C#. Any language in which you do not explicitly ask for (allocate) and free (deallocate) memory has a garbage collector
True...but pretty much every modern programming languages supports some degree of multithreading in 2022.
This is not a hard-and-fast rule. Poorly done multithreading will actually slow your program down. And, writing and reading multithreaded code is MUCH more complicated than single-threaded code. Especially for testing, introducing multiple threads should not be a decision made lightly -- introducing flakiness into tests (through low percentage race conditions, etc) is not worth the minor performance increases. Tests should favor accuracy, precision, and reusability over raw speed.
Compared to, say, C, sure. Compared to interpreted languages? Not at all.
Memory performance of a programming language should be one of the lowest considerations when trying to decide what language to use for testing.
Compared to maybe Python or Ruby? Sure. But Java is in the C-family of langauges...if you can read one, you can basically read them all.
So is Java...
So is Java.
For test code, type-safety doesn't really matter -- the code is not running on production systems that are openly available to the public. Security should not be a main concern of testing code, nor should tests have tons of pre-built error handling for type issues (e.g. if a dynamically-typed language performed
1 / "hello"). Test programs crashing is a sign that either 1) tests were poorly written or 2) something incorrect happened, which means the tests caught it, which is a good thing!This is true of any compiled language...including Java...
tl;dr basically no good reasons were given as to why someone should choose Python or Java or C#...