One quick story: I was adding a new feature that needed an API client created by another developer. The API required three inputs: ID, country…
JUnit
From Bugs to Brilliance: Enhancing Code Reliability Through Mutation Testing
Introduction Have you worked on a project with high test coverage? Ever wondered why, despite extensive coverage, bugs still manage to slip into production? Have…
Less Code, More Tests: Exploring Parameterized Tests in JUnit
Introduction Regarding writing tests, some developers are lazy writing fewer test scenarios as possible. And sometimes they can write no scenarios at all. Imagine being…
How to write meaningful test assertions that help you not break your code base
The article emphasizes the importance of writing meaningful assertions and verifications in software testing. It explains how specific and descriptive assertions help in detecting bugs early, improving code quality, and increasing confidence in the code. It provides examples of common mistakes and how to avoid them, highlighting the significance of writing specific assertions to ensure code reliability and efficiency.
Simplify Your Tests and Save Time: A Guide to Test Data Builders
Test data builders provide a solution to the time-consuming and complex task of setting up test scenarios. By pre-populating domain objects with valid data, developers can easily modify and reuse data for their tests. This technique not only simplifies the test setup process but also significantly improves the readability and maintainability of the test code, ultimately enhancing the developer experience.
How to Create and Use a Custom ResultMatcher for Date Testing with MockMvc
In this tutorial, you will learn how to create a custom ResultMatcher for MockMvc, to suit your project needs. Imagine you are testing an API…
Use Coverage as a guide, not a goal
Introduction If you are a developer, you probably know what code coverage is. It is a metric that tells you how much of your code…
How to make your test case easy to understand by using test naming conventions
Introduction A common problem developers have is how to write the test name. Most projects don’t follow a convention, making the test cases a real…
How to find bugs before sending it to production using boundary testing technique
Introduction When you think of efficient testing you should consider boundary testing! This technique is crucial to help you find bugs faster even before they…