Showing posts with label Java Automation QA. Show all posts
Showing posts with label Java Automation QA. Show all posts

Thursday, July 6, 2023

Interview preparation series: Write a Java Program to count the occurrences of each character in a String value

In this post, I am going to solve this programming puzzle using two approach. First, using Regular Expression and Second, using String functions. Given below the code, kindly go through it, if you don't understand something then leave a comment, I will be happy to answer. If you have any suggestion for me to improvise the contents, please leave a comment. If you are liking my posts, then please share it with your friends.

Steps to solve the problem during interview or online test:

1. Patiently analyse the problem for 2-3 minutes, conceptualizing the needed calculations. You may rephrase the problem statement and check with the interviewer if you have fully understood the problem, as otherwise your program will not output the expected result.

2. Use your favorite IDE (if you are giving a remote interview and using own device) for Java programming, like InteliJ, Eclipse etc. Ensure that you have Java 8 or above installed and the JAVA_HOME path is set in the environment variable.

3. Create a java class file, use appropriate visibility (private, public, protected) and follow naming best practices. For online interviews/coding challenges, if there is no specific ask to show inheritance, then no need to create any interface or abstract class to complicate the excercise.

4. Create a main method to execute the program. This is also required by most of the online coding test platforms, as they run different unit tests to measure accuracy of the program.

5. It is a good practice to seek inputs from the user using meaningful prompts to make the program interactive, rather than hard coding it inside code. The inputs can also be accepted from commandline arguments.

6. Put meaningful names for the variables, but remain careful and avoid creating unnecessary variables.

7. Write the code in a simple manner. Often the code could be written in different ways, in such a situation, follow the way you are more comfortable with. Focus on writing correct logic than spending time in ornamentation or showcasing your coding prowess.

8. Before running the program for the first time, always do a proof reading and make any needed corrections, since if the first run fails, it could create a negative impact to the evaluators mind. Often we do mistakes in anxity, so keeping calm is a necessity. In organizations and enterprizes, the real-time programming will be much complex and there could be pressing deadlines to achive shorter milestones, therefore during recruitment, they observe the behaviour of the programmer to assess whether the candidate could handle work pressure, stress and the quality of work in a seamless manner.

9. Run the test with different inputs, to prove that the logic is working fine. If you are writing the code in any of the online test platform, then don't worry, it will fire unit tests upon the code submission and highlight the failures, you could correct them before the test meet its time outs. 

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* Java program to count occurrence of each characters within
* a String valueBelow program accepts an input from user,
* then counts the occurrence of each character in that String
* There are two implementations, first one is using Regular
* Expression and the other one is using String functions
* @Author: Susnigha Chatterjee
*/
public class CountEachCharOccurrenceInAString {
public static void main(String args[]) {
String inputText = new Scanner(System.in).nextLine().toLowerCase();
int counter=0;
char[] inputTextCharacters = inputText.toCharArray();;
//First implementation: Using Java Regular expressions
for(int x=0;x<inputTextCharacters.length; x++ ) {
Pattern objPattern = Pattern.
compile(""+inputTextCharacters[x]+"");
Matcher objMatcher = objPattern.
matcher(inputText);
counter=0;
while(objMatcher.find())
{
counter++;
}
System.out.print(inputTextCharacters[x] +" => ");
System.out.println(counter);
}
System.out.println("---------Separating the outputs----------");
//Second implementation: Using Java String functions
for (int i = 0; i < inputText.length();i++) {
counter = 0;
System.out.print(inputTextCharacters[i] +" => ");
for( int j=0; j<inputText.length(); j++) {
if((inputText.charAt(j)==inputTextCharacters[i]))
counter++;
}
System.out.println(counter);
}
}
}
Given below the outputs:
ulupolupolo
u => 3
l => 3
u => 3
p => 2
o => 3
l => 3
u => 3
p => 2
o => 3
l => 3
o => 3
-------------- Separating the outputs---------------
u => 3
l => 3
u => 3
p => 2
o => 3
l => 3
u => 3
p => 2
o => 3
l => 3
o => 3

Wednesday, July 5, 2023

Recruiting Test Automation talent vs Upskilling existing talent

Problem statement:

In IT organizations or Software Engineering units of corporate organizations, a question seldom strikes the mind of leadership, whether they recruit a test automation talent from the labour market or make internal arrangements to upskill their existing talent pool to fill up any open positions in their projects. 

It’s not an easy decision to make, since hiring process for both permanent or contractual talent could take up significant time, jeopardising the project needs and schedule. The recruitment process will involve creating an open position, advertising the job, collecting, and filtering the resumes that best matches the job criteria, identifying an able interview panel to conduct the technical evaluation (sometimes, it is outsourced to consultancies), scheduling managerial rounds, negotiating notice period and salary as per fitment, making an offer, offer acceptance, onboarding etc. Filling the position from an existing vendor organization may reduce the lead time, but it will increase OPEX, and provide less degree of freedom on that resource’s performance management and over time it will establish dependency. More often vendor organizations are unable to source an automation resource ticking all boxes of the skill and experience requirements for the job.

Over past few years, many organizations conducted inhouse upskilling programs to migrate all manual testers/quality assurance professionals to test automation skill sets. Some did partnerships with external training providers to design a customised training plan suiting their organizational strategy and resourcing forecasts for upcoming years. They did lots of investments in their learning and certification budget apart from investing time, but still they find that many of the upskilled resources are not able to fulfil the promise when they are deployed into challenging projects, most of which are following Agile lifecycles.

So, what's common among these options, is identifying the right talent for the job.

Recommended Solutions:

ü Recruiting a candidate from job market:

All recruitment decisions originate from the organization strategy to support the organizational vision. For example, if the vision is “delivering IT projects on or before the end date, within budget, meeting all quality standards”, then recruiting the people with right skills and experiences must be part of their strategy, as they may not be interested investing time in training, which would increase their CAPEX and OPEX, and not help much in achieving their vision on short term. However, if the vision is for long term, and the mission is to earn recognition of say to be in the list of top 10 employers, then investing in training would be required.

 

As every project undertaken, have an impact on the organization’s profitability, vision and mission, any recruitment for the open position in the project should be taken seriously.

1.     Clearly draft the job description (JD) - elaborate on the job roles and responsibilities, the specific test automation skills and relevant experiences that are expected out of a candidate. Always involve the projects Technical Architect, Delivery Lead, Project Manager Test Manager/Architect in the JD drafting and review process. If the role going to be crucial, it’s advisable to mandate having some specialised professional certifications on certain skills/technologies. Example, if the project requires an Automation Architect/Automation Lead/Automation Manager, then "ISTQB certified Automation Engineer" certification could be mandated. This will ensure that the candidate is having professional knowledge on test automation principle and practices. Optionally include any programming language certification in Java, JavaScript or Python that will ensure the candidate has good coding background.

2.     Structure the selection process in 4 stages: Every organization have different recruiting process. My recommendation is a 4-stage process:

a.     Assign technical people to screen resumes.

b.     Online screening: max 7 multiple choice questions on test automation and related technologies, plus couple of small programming puzzles to solve.

c.     Technical Round: wrap up within 90 minutes, focus on the technical challenges, debugging skills and innovation that the candidate has carried out, his contribution towards the automation optimization and its impact on ROI. Consider any contribution to Git-Hub or any other opensource platforms, any publications on test automation journals/blogs. Most importantly, asses the candidates’ level of passion for automation, coding, problem solving and learning.

d.     Managerial Round: max 30 mins, understanding their motivation, whether its financial rewards, achieving a certain designation or getting wider recognition. Their capability to perform under tight timelines balancing their stress, ability to work as a team player. 

Most importantly, carefully deal with those who are not passionate and self-motivated towards automation. They may not be a good fit in the long run.

ü Upskilling existing workforce:

This is an excellent idea, for sustainability, earning reputation, balancing geo-political impacts, and display commitments towards people development. Since, upskilling involves both CAPEX and OPEX, organizations should:

1.     Start by gathering statistics on the skills their customers and clients are looking for, the ones that their competitors are using. In terms of test automation skills, the tools are aligned with the layers of testing. Like, UI Automation using specific tools and languages (i.e., playwright, cypress, webdriverio, selenium with JavaScript/Java/Python, robot-framework, Copado, Provar, AccelQ, UFT, Test Complete, TOSCA, RFT etc.), API Automation (i.e., ReadyApi, RestAssured, Postman, SoapUI, Swagger, Pact, rest, soap, http/https, ftp, ssh, json, xml, GraphQL, Mulesoft, Kong, RIT, karate etc.), Mobility Automation (i.e. Appium, Perfecto, SeeTest etc.), Robotic Process Automation (RPA tools, i.e. Uipath, BluePrism, Robot Framework RPA etc.), Database Automation (i.e. using Java, JavaScript, Python etc.)

2.     Do a survey on existing testing talent pool, identify the sample populations, those are willing to upskill in test automation skills, and those are willing to upskill for a different job role that they wish to move to (example: Scurm Master, Business Analyst, PMO etc.). Upskilling all manual testers to automation without giving any choice, may not be the wise idea, and I personally believe this type of move never make much impact for the organization in the long term. Some people are phobic towards coding, as they are to Mathematics. No matter how simplified the coding materials are written, they won't develop much interest to learn and nurture it. These people may be more interested to upskill as such they could take up roles like:  Scrum Master, Business Analyst, Project Managers, Content Writer, Product Manager. So, Choosing the right candidates to upskill to automation skills is the key here.

3.     Next, develop training plans, schedule trainings, conduct trainings, gather feedbacks, and feed the inputs to revisit the the training plan. According to me, when developing training plan, beside the basics, advance concepts (like dynamic xpaths in case of Selenium, usage of Regular Expressions, JSON handling, executing DB queries from code etc) with practical case studies and programming tasks (both guided and un-guided) should be include. At the end of the training, it is advisable to conduct one online test (including programming) to ascertain that all participants have successfully met the training goals and objectives. Always identify actionable items on the feedbacks received on the training plan, material and the trainers. This will generate key performance indicators for the training program.

 


Test Automation Strategy for Oracle Forms application running in Citrix servers

  Context : There are many product based applications developed using Oracle Forms and Java thick-client architecture, and most of them are ...