Using Equivalence Class Partition and Boundary Value Analysis while Unit Testing

Joseph Pasmore Programming, Testing Leave a Comment

The value of writing tests for code, especially unit tests, is clearly evident. Testing enhances software quality, improves security, inspires customer satisfaction, and most of all, saves the company money. Catching errors in the development phase before they reach production can save a company thousands.

I wanted to share a couple of the strategies I’ve followed in my career when it comes to writing unit tests. We’ll start with Equivalence Class Partitioning and finish with Boundary Value Analysis. While they are different, they can be used together to help make sure you’re writing the best unit tests you can write.

JASMINE SPIES UNIT TESTING

Unit Testing Using Jasmine Spies

Todd Leininger Development Technologies, Programming, Testing, Tutorial Leave a Comment

Unit testing is an important part of the development process. It gives us the ability to know that our code is working as intended and can also let us know if we may have broken something that we didn’t even think of.

With the help of Jasmine Spies, we can make our test setup easier, and we can give ourselves more options for what we can test against. Hopefully, this will give you a good starting point for all your Jasmine spying needs!

JSON Server for API Mocking

JSON Server to Mock API Servers: A Quick and Easy Solution

Todd Leininger Cloud, Development Technologies, JavaScript, Testing, Tutorial Leave a Comment

I have found myself in the following scenario many times throughout my career. Everyone is ready to get the project started. You know what you are going to be working on, and as the frontend developer, you get started right away. You get to the point that you are ready to test your code to see how the API calls work. There’s one major thing in your way, though. The APIs aren’t done yet.

You could just create some static JSON files and read them in, but that doesn’t really test out calling an API. That’s where JSON Server swoops in to save the day. In this post, I’ll walk through how to use JSON Server. We’ll set up our environment, serve a simple JSON file, and generate mock data.