Integration Testing of Non-Blocking Retries With Spring Kafka

Kafka Non-Blocking Retries

Non Blocking retries in Kafka are done via configuring retry topics for the main topic. An Additional Dead Letter Topic can also be configured if required. Events will be forwarded to DLT if all retries are exhausted. A lot of resources are available in the public domain to understand the technicalities. 

What To Test?

It can be a challenging job when it comes to writing integration tests for the retry mechanism in your code. 

Harnessing the Power of Integration Testing

Integration testing plays a pivotal role in ensuring that these interconnected pieces work seamlessly together, validating their functionality, communication, and data exchange. Explore the benefits and challenges of integration testing here!

In the ever-evolving world of software development, creating complex systems that seamlessly integrate various components and modules has become the norm. As developers strive to deliver robust, reliable, and high-performing software, the significance of integration testing cannot be overstated. Integration testing plays a pivotal role in ensuring that the interconnected components of software work seamlessly together, validating their functionality, communication, and data exchange.

Ensuring Code Quality With Unit Testing and Integration Testing in CI/CD

In the world of software development, ensuring code quality is critical to the success of any project. Code that is buggy, unreliable, or inefficient can lead to costly errors and negative user experiences. One way to ensure code quality is through the use of testing methodologies, such as Unit Testing and Integration Testing. These two integration tests can be especially effective when integrated into a Continuous Integration and Continuous Deployment (CI/CD) workflow. 

Explore the importance of Unit Testing and Integration Testing in CI/CD pipelines in this article. Here, we'll discuss how these two approaches can help to ensure code quality and reliability throughout the software development process. Also, we'll explain these two testing approaches in detail here and know the differences between the two. Let's take a look!

What kind of tests should be automated?

As software development becomes more complex and fast-paced, test automation has become a crucial part of the development process. Automated testing can help software teams save time, reduce costs, and improve the overall quality of the product. However, not all tests are suitable for automation, and deciding which tests to automate is a critical decision that can affect the success of the project. In this article, we will discuss what kind of tests should be automated and why.

Regression Testing

Regression testing is a type of testing that ensures that changes made to the software do not have any unintended effects on the existing functionality. Regression testing is an ideal candidate for automation because it involves running the same tests repeatedly, which can be time-consuming and error-prone if done manually. Automated regression tests can quickly identify any issues and ensure that new features and changes do not break existing functionality.

Smoke Testing

Smoke testing is a quick and straightforward test that verifies whether the critical functions of the software are working correctly after a new build or release. Smoke tests can be automated and run automatically after each build to identify any critical issues early in the development process.

Performance Testing

Performance testing is a type of testing that ensures that the software can handle a certain level of load and stress. Performance testing can be time-consuming, complex, and requires a significant amount of resources. Automating performance testing can help save time and resources and provide accurate and consistent results.

Security Testing

Security testing is a type of testing that ensures that the software is secure and protects user data from potential threats. Security testing involves identifying vulnerabilities and weaknesses in the software and verifying that security controls are working as intended. Automating security testing can help identify security issues quickly and ensure that security controls are functioning correctly.

Integration Testing

Integration testing is a type of testing that verifies whether different components of the software can work together as intended. Integration testing can be complex and time-consuming, and automating this type of testing can help save time and improve the overall quality of the software.

GUI Testing

GUI (Graphical User Interface) testing is a type of testing that ensures that the user interface of the software is working as intended. GUI testing can be time-consuming and error-prone if done manually, and automating GUI testing can help save time and ensure that the user interface is functioning correctly.

What kind of tests should not be automated?

While test automation can bring many benefits to software development teams, not all tests should be automated. There are certain types of tests that are better suited for manual testing or require a human touch to identify issues that automated tests may miss. Let's discuss what kind of tests should not be automated and why.

Exploratory Testing

Exploratory testing is a type of testing that involves exploring the software to identify issues and areas that require further testing. This type of testing requires human intuition and creativity and cannot be replicated by automated tests. Exploratory testing allows testers to find unexpected issues that may not have been considered during the design and development process.

Usability Testing

Usability testing involves testing the software's user interface and user experience to ensure that it is easy to use and meets user needs. Usability testing often requires subjective analysis and feedback from users, which cannot be replicated by automated tests. Human testers can identify issues such as confusing user interfaces or non-intuitive workflows that automated tests may miss.

Ad Hoc Testing

Ad hoc testing involves testing the software without a predefined test plan or script. This type of testing is often used to explore the software's functionality and identify issues that were not considered during the development process. Ad hoc testing requires human intuition and creativity and cannot be replicated by automated tests.

User Acceptance Testing (UAT)

User acceptance testing is a type of testing that involves testing the software with end-users to ensure that it meets their needs and requirements. UAT requires feedback from human users to identify issues such as usability, user experience, and compatibility with other software tools that automated tests may miss.

Exploratory Performance Testing

Exploratory performance testing involves testing the software's performance in real-world scenarios, such as high traffic or concurrent users. This type of testing requires human intuition and creativity to identify the right scenarios to test and cannot be replicated by automated tests.

Compatibility Testing

Compatibility testing involves testing the software's compatibility with different hardware, operating systems, and web browsers. This type of testing requires human testers to identify any issues with the software's compatibility with different configurations and cannot be fully automated.

Conclusion

Automated testing can provide significant benefits to software development teams by saving time, reducing costs, and improving the overall quality of the product. However, not all tests are suitable for automation, and it is essential to decide which tests to automate based on their complexity, frequency, and impact on the software. Tests such as regression testing, smoke testing, performance testing, security testing, integration testing, and GUI testing are ideal candidates for automation and can help software teams deliver high-quality software faster and more efficiently.

Simple Code: Integration Tests

An integration test is something that tests a functionality that is dependant on an external system e.g. a database, HTTP API, or message queue.

Integration vs Unit Tests

The line is thin in my opinion. The integration part can be faked, or embedded services can be used in place of the actual integration point, and with these solutions, the interaction with the external system is bounded in the test context and the tests can be executed in isolation so they are very much like unit tests. 

Simple Code: Acceptance Tests

Acceptance tests are a great tool to verify that the application or system works as expected from end to end. Sometimes these tests can be called end-to-end tests but sometimes end-to-end tests have a different meaning. Another term to describe the same functionality is QA tests and a subset of acceptance tests is often referred to as smoke tests.

The Idea

The idea is to define input and the expected output and once the system and all its dependant services are running the whole system can be verified to work as expected. In an ideal world, the acceptance tests would be implemented based on the acceptance criteria of the use case.

User-Friendly API Publishing and Testing With Retrofit

Any web service needs to export their public API if consumers want to make the best use of that service. A developer-friendly approach to do so if you work in the Java ecosystem is to package DTOs and endpoint interfaces in an API jar file and use the Retrofit framework to create type-safe clients for integration testing. This article discusses a complete example.

If you’ve worked in enterprise Java projects you will remember good old Web Services Description Language, the XML based format for describing network services by IBM and Microsoft. Maybe you still work with it? WSDL and its twin XML Schema are among those W3C standards that seasoned developers love to hate. Its specification files are not very human readable, let alone human writable. Fortunately you don't have to. They can be generated by your server endpoint and fed straight into a code generator to create transfer objects (DTOs) and service stubs.

Turn Databases Into APIs for Data-Driven Testing

The most effective method of testing an API program involves creating multi-step integration tests that validate common API consumer flows. API endpoints are meant to work together, so it follows that test data coming from one API that feeds another API should not be fixed or pre-built. This is very important because the less you rely on fixed data, the more unpredictable and therefore thorough the testing path will be.

Moreover, API mutation operations may have side effects that cannot be evaluated by simply validating the same endpoint. Side effects propagate throughout the system, and their efficacy can only be validated by querying other endpoints and comparing the results.

Functional Increments in Web Services

Functional Increments in Web Services

Have you seen code reviews where the code being added is not yet used anywhere in a web service? It's not yet covered with automated tests? It will likely be refactored or deleted in a subsequent pull request (aka PR)? Is a library that is not or only partially used? All of these cases represent non-functional increments to a web service.

A functional increment contains only code that is being used by the service to achieve some functionality. Such code is typically fully covered with automated tests. A functional increment should also be self-contained in a way that it doesn't rely on future changes to expose functionality.

Compare Software Testing Methodologies for Your Needs

The choice is yours!

The choice is yours. You know your product. You know the problem it solves and why it will soon become vital to the working lives of untold numbers of users. What you might not know is how best to test that product so that your development intention becomes a product reality.

There are a number of different software testing methodologies available to you to reach that reality. Each is designed with a specific purpose in mind, and each has value in a comprehensive test plan.

Top Testing Types to Use in Automation Testing

Planning automated tests.

For any organization, the overall testing culture is influenced by the prevailing testing approach, apart from how they envision the test automation and how are they planning to collaborate beyond the development teams. Establishing test automation in an organization is not your conventional practice and that is why you would want to learn the best approaches possible.

This means retrospecting the current process, finalizing and deciding the new test approach as well as determining the level of testing, roles, and responsibilities of the team members.

Integration Testing: What It Is and How to Do It Right

For software to work properly, all units should integrate together and behave correctly.

Integration testing is like inviting your two favorite groups of friends to the same birthday party and hoping they all get along. Will they cooperate and “blend” when they’re all in the same room? The only way to know is to perform an “integration test” by pulling them all together and seeing how they interact with one another.

Smart Wearable Device Testing: Main Steps to Cover

Whenever you track your steps or wonder how many hours you’ve slept, smart wearable devices are always handy. The stages described in this article are common for the testing phases of most wearable devices that make it to the market. Also, in this article, we’ll address the device-specific stages based on the type of gear being tested.

In terms of QA, what is more important is how the hardware integrates with the software — and how smooth this interaction is. The faster and more seamless the integration is, all those quality requirements are equally applicable to the wearables’ testing

Acceptance Testing Using Arquillian (Jakarta EE)

In agile projects using Java/JEE, the focus and scope of developer testing are usually diminished to either unit testing or very basic functional testing. Arquillian brings in a newer thought process of integration and acceptance testing that includes Continuous Integration and testing within the JEE container, especially for JEE products or solutions that require functionalities to be tested across various containers. This provides the most productive way. According to the internet, Arquillian was also the "Duke's Choice Award for Developer Productivity at JavaOne Conference 2011." In my experience, it not only enhances the productivity of developers but also promotes good practices. 

It allows you to convert your TestNG or JUnit (among others) test cases into Arquillian test cases with few changes. Also, it allows you to directly use CDI in your test code. This allows you to inject dependencies such as EJB or web services directly in your test cases. The central thought process involved in using Arquillian is the ShrinkWrap API provided by it. It allows you to package your product or project code into Archives like JAR, WAR, and EAR. Along with the project code that is to be tested, the test cases are also packaged. It then allows multiple Maven configurations to allow direct deployment into one of these modes (that we used for our product).

Using ASP.NET Core Identity Users in Integration Tests

I have an application that uses ASP.NET Core Identity with classic logins and there's a need to cover this application with integration tests. Some tests are for anonymous users and others for authenticated users. This blog post shows how to set selectively set authenticated ASP.NET Core user identities for ASP.NET Core integration tests.

Getting Started

We start with an ASP.NET Core web application where basic authentication is done using ASP.NET Core Identity. There's an integration tests project that uses a fake startup class and custom appsettings.json from my blog post, Using custom startup class with ASP.NET Core integration tests. Take a look at this post as there are some additional classes defined.

The Mystery Behind Testing ”The Integration of Payment Gateways”

Payment gateways are one of today's most important integrations that are done in the ever trending online market space. Any online market space that requires a transaction needs a payment gateway, be it Amazon, Flipkart, Uber, Airbnb, MakeMyTrip, Big Basket, etc.

Integration testing remains a mystery for an application with a payment gateway. I say so because most of us usually do not unveil the actual testing efforts required to test the gateway integration. We have a tendency to ensure payments happen with a valid card, and it does not happen with an invalid card. But trust me, it's much more than that.