Tag: tdd

  • Specification-Based Testing: Devise test cases

    This is the last part of the specification-based testing series. Now we are going to put all of the knowledge that we gained from the other steps and start creating our tests efficiently. If you followed every step, you already have questioned and prepared the scenarios that will help catch as many faults in your…

  • Specification-Based Testing: Analyze boundaries

    When conducting specification-based tests, analyzing boundaries is crucial. Boundaries, such as inclusive and exclusive intervals, often harbor bugs. For instance, in the CHIP-8 emulator code, the boundary condition for the carry flag at exactly 255 requires thorough testing. Testing exact, minus one, and plus one boundary values is essential to identify potential bugs and clarify…

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

  • Specification-based Testing: Understand the requirements

    Understanding the requirements is an important part of testing your code. If you already know the business rules you can create tests to validate it. Also, you can create some that will prevent unwanted behavior too. When writing tests, consider the inputs, how they affect the code, and if the results meet your business rules. Do you have some doubts about it? What should be the result in some…

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