Tag: java

  • Specification-Based Testing: Exploring partitions

    When we are testing our code, we can’t only test things that will give us a successful return. Tests should be a way to help you find bugs, so in this step of the specification-based testing, we are going to understand the partitions of our code. And explore scenarios that could break our code or…

  • Specification-based Testing: Explore the program

    The third step of the specification-based test is to explore the program behavior. You can skip this step if you wrote the code that you are testing. This step is a good way to understand code that you need to test but was not implemented by you. In this scenario, you don’t have the complete…

  • 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 you or your teammates begun questioning the effectiveness of unit testing? Have you questioned whether there’s a better way to check your test’s effectiveness? The solution to all the questions…

  • 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 able to test many scenarios without writing much code. Isn’t that great? A parameterized test lets you test many scenarios. You just send a list of parameters. This way, you…

  • How to test complex conditions with the MC/DC criteria

    Introduction Have you needed help defining what to test when you encounter a complex condition in your code? Do you feel lazy when looking at a condition that has too many logical statements? It’s easy to look at that big if statement that you find in legacy code and think: “Man, what should I test…

  • 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,…

  • 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 is executed by your tests. It is often used as a way to measure the quality of your tests and your code. But is coverage a reliable indicator of quality?…

  • 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 mess! Every developer chooses a different approach because there are no set rules. Having a standard test naming convention will help you end this problem! When you write meaningful tests,…

  • 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 happen in production. Doing this tactic you can discover what data to use to test your code efficiently! So you don’t have to spend your Friday nights fixing bugs in…