25 Years of Java : Is it time to move on from Java (especially for Test Automation)?

On 23rd May 2020, Java completed 25 Years.

Java has been a very key part of the IT industry and many applications created by the IT industry were made using Java since it's inception.

But the IT industry is one of the fastest growing and changing industry and there are many changes and technologies which got deprecated, so where does Java stand in such situation?

I am going to try my best to answer this question in the rest of this article, especially from Test Automation perspective and I would do this in a question-answer format with different questions (and answers).


1.What is Java?

Is this even a question? Java is an object oriented programming language, everyone knows this.

Well, the above answer is correct most of the time because mostly the context is of programming language when people use word Java.

But in reality, Java is used in two ways:

(i) As Language (Language + Platform)

(ii) As Platform 

The heart of Java Platform is JVM, one of the key thing the JVM provides is the platform-independence (here platform can mean different OS and/or Hardware) because of how it converts the code into bytecode and makes "write once, run anywhere" possible.

There are many languages which are using Java Platform but the most widely used are Groovy, Kotlin and Scala.

The above languages were created to take the maximum advantage of Java Platform and to satisfy some use cases which can't be satisfied with Java.


2. I am not sure which language I should start learning for Test Automation?

Well there are many languages which are supported by different tools, but the languages which are most popular are:

(i) Java

(ii) Python

(iii) Javascript


Now for UI Automation and especially for Web(Browser) Automation, Javascript based tools has been improved a lot over the time and have started getting more adoption as the tests are executed faster and less flakier.

Python is also being used widely especially for AI/ML and IoT related things and it can also be a good option.

But I would highly recommend Java over Python or Javascript due to the following reasons:

(i) While doing Automation, many times you may need or want something to automate which can't be exact test as such, but it would help you from keep doing such tasks manually (for example, file or data preparation or modification, etc). In able to do such tasks Javascript might not be able to help you and you have to work with some other language (Java or Python or any other).

(ii) Java is statistically typed language and Python is dynamically typed language. It means that in Python variable type declaration is not required which can cause difficulty in reading the code and/or debugging especially at a beginner level.

(iii) Java is more of a compiled type language and Python is more of a interpreted type language. Due to that one may come to know about some type of mistakes in code only at run time in Python, while in Java comparatively many mistakes are identified before running the code.

Note : I have used "more of" term because behind the scenes, both language does interpretation and compilation in some or other manner.

(iv) Generally, Java has faster execution time with compared to Python.

(v) Java is more backward compatible than Python.

(vi) Last but not the least, the support with Java especially combined with some automation tools which support both Java an Python (e.g. Selenium and Appium) is more wide and community is also bigger. So if in case you are stuck with something, you will be able to get help more easily.

So these were the reasons why I would highly recommend Java over other languages, still it's a person's preference regarding which language to start working with and there's nothing wrong if you choose Python or Javascript, but one should be aware of such things before making the choice.


3. I have worked with Java and due to the rise/demand I want to start learning Javascript or Python as Java doesn't seem to be as popular as before, am I doing the right thing?

First of all even though the Javascript and Python usage is on the rise, Java is still used more than these two languages. I am saying this from the TIOBE Index for June 2020. You can refer it here for more details.

So Java is not popular or in-demand as before possibility is out of question now.

Moving forward, IMHO there's nothing wrong in having knowledge of multiple languages, but before you proceed ask yourself this question: What level of knowledge you have in Java?

Let's say you have intermediate or basic level knowledge of Java, then I would recommend you to get more knowledge of Java before learning other language basics.

I have observed that many people are using Java 8, but they are still not using the new and very useful features of Java 8 like Streams, Lambda, etc.

Also there was a misunderstanding regarding Java won't be free to use anymore for commercial use, but that's not the case.

The release process have changed but you can always use OpenJDK variant which is free for commercial use.

And even Java 8 is comparatively old now, the latest version of Java available is Java 14 and there are lots of very useful features introduced with each new version of Java, making Java more and more helpful and useful for their users to achieve what they want to using code better than before.


Here ends the sets of questions and answers using which I tried to answer where Java stands in today's times.

Now to conclude, even though Java has completed 25 years and new languages are coming or the other existing ones are being used more than ever, I believe Java still is and would be in the game strongly for at least the foreseeable future as language and also as Platform.

Please feel free to add your points and/or feedback in the comments section.

And if you feel that this article was good or useful then please feel free to like and/or share this article.

Faiz Modi

Consultant @ Microsoft | Enabler @ The Test Chat Community | Thoughts/Views shared are my own and shared in personal capacity only | OCA Java 8 Programmer | ISTQB? (Foundation Level) Certified

3 年

A heads up for someone reading this article in 2022. This article is more than a year old. While most of the things mentioned in the article still hold true, the jdk latest version and jdk licensing have changed a bit. Currently the latest jdk version is 17 (as of Feb 2022) and the Oracle flavour of that is also free to use. For more details about the licensing refer this: https://blogs.oracle.com/java/post/free-java-license My heartfelt thanks to Amuthan Sakthivel for providing this wonderful and insightful suggestion to give heads up about these changes ????????????

Gaurav Khurana

Tester @ Microsoft | TesterOfTheYear2022 | Youtuber | topmate.io/gauravkhurana

4 年

Still people use C++ and many other languages. Just that some of the things might appear easy in one language , the software which are existing for years will not just switch to them.

Sumon Dey

Software Engineer ? Apple

4 年

Thanks for your insight Faiz. Personally, I started off with Java before I learnt JS and Python. Java's verbosity and error-check during compilation becomes a blessing in disguise and forces the beginners to learn a lot of things which helps in an easier transition to the dynamically-typed ones. Though for automation, some other parameters and context are also important to consider like "ease-of-learning", "quick prototyping", "project goal", "community support", "automation API, resources, docs availabilities" and also whether developers are involved in writing/helping to write the automation code.

要查看或添加评论,请登录

Faiz Modi的更多文章

社区洞察

其他会员也浏览了