r/softwaretesting • • 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

5 comments sorted by

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".

OOP languages....allow you to break a program into "bit-sized" [sic?] problems that can be solved easily and better quality software with less maintenance cost.

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).

Python has standard libraries as well as third party libraries

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.

Java can run on any machine regardless of system and hardware...

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).

Java offers automatic garbage collection

So do Python and C#. Any language in which you do not explicitly ask for (allocate) and free (deallocate) memory has a garbage collector

Java also supports multithreading...

True...but pretty much every modern programming languages supports some degree of multithreading in 2022.

Multithreading allows you to increase the performance of your application

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.

[Java] is very memory-intensive

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.

Java syntax is complicated compared to other programming languages

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.

C# is also a statically-typed language...

So is Java...

C# is type-safe meaning you can only access the memory location of the objects...this is very important for security reasons.

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!

C# is very slow to load...you must recompile your whole program

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#...

2

u/ou_ryperd May 31 '22

Agreed. Test automation is such a maligned profession. "...to get a job..." <laughs>

3

u/NeilPork May 31 '22

This is also why it is a secure position.

Many programmers hear the word "testing" in the title and run--particularly ones just out of college. They want to be programmers, not testers.

Many people who have the testing skills don't have the coding chops for automation.

Consequently, there is always a shortage of automation engineers.

2

u/nascent May 31 '22

Hey, go easy, Java worked really hard on those marketing points in the late 90's. We shouldn't just dismiss them because every other language has achieved the same.

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.