In software engineering, a design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design. It is not a finished design that can be transformed directly into source or machine code. Rather, it is a template for how to solve a problem that can be used in many different situations.
Few months ago, I read the book Selenium Design Patterns and Best Practices by author Dima Kovalenko. The author has explained various design patterns and best practices that can be used while working with Selenium Webdriver.
It is one of the anti…
Builder pattern is a creational design pattern that is designed to separate the construction of a complex object from its representation so that the same construction process can create different representations. It is used to construct a complex object step by step and the final step will return the object.
For majority of the apis, we have mandatory parameters and optional parameters. Lets say different payloads of Employee class are required for executing different types of api tests as mentioned below:
a) An Employee class object with only firstName
b) An Employee class object with firstName and age
API Gateway is a single entry point for all the clients. It is an additional layer introduced between clients and the servers.
So rather than clients directly interacting with servers, here api gateway behaves as the intermediate layer transferring requests to servers and sending back response to the clients.
Question : If clients and servers are able to work without API Gateway as well, then why to introduce this additional layer ?
Answer : This layer is introduced so that most of the common operations (being done at each service level) can be moved to a centralized layer. …
In this blog post I will give a quick guide for setting up SonarQube which can help us in writing cleaner, more secured and less buggy code.
It doesn’t not depends on the number of years a software engineer has spent writing code. It is impossible to write code that is free from issues like security flaws, naming conventions not consistent , and the list goes on.
If you think that these issues can be addressed in the PR review, then you are correct. …
A wise man once said you are not a real Java programmer until you’ve dealt with a null pointer exception.
NullPointerException is one of the most common exceptions in java programming. It is a RuntimeException. This exception is thrown when program attempts to use an object reference that has the “null” value.
Before using Optionals class , what most of the people did to prevent null pointer exceptions problem? They acted defensively and added null checks to prevent null dereferences.
For ex We have a class “User”, class has an entity “Address”, and Address has two fields “city” and “houseNumber”.
Problem : Configuring allure reports is quite straight forward, but getting historical trends in the reports is not 😔.
Getting historical test results in the report is quintessential to know the health of the system under tests over a period of time. Without it, we won’t be able to gaze whether a test failing today is due to recent code changes or was failing since last week.
Problem : There is a need to debug tests (junit / TestNG) that accepts multiple parameters values while running maven command. Directly clicking on debug option on IntelliJ will fail as the required parameter values are not set.
Sample command : mvn test -Dbrowser=chrome -Denv=staging -Dgroups=sanity
Open ‘Run / Debug Configurations’ popup > Click on ‘+’ icon > Select ‘Remote’ > Enter ‘5005 ’ in port box > Select project name from the ‘Use module classpath’ dropdown >…