Articles related to Testing

Getting Started With Cypress: An End-to-End Testing Framework

Cypress is a next-generation front end testing tool built for the modern web. It is the next generation Selenium and enables us to write tests faster, easier, and reliable. Some of the compelling features that I find interesting with Cypress are Time Travel…

Simulating Different Scenarios Using Fake JSON Server API

How many times have you had to update the API code to return an empty list or throw an error to test edge case scenarios? How do you demo these different API scenarios to someone? The pages and components of our application have different states. Most of these…

Setting Up Cypress + React App + JSON Server + TypeScript

For the past couple of weeks, I have been playing around with Cypress and been enjoying the experience. Cypress is a next-generation front end testing tool built for the modern web. It is the next generation Selenium and enables to write tests faster, easier…

Setting Up A Fake REST API Using JSON Server

JSON Server is a great way to set up a full fake REST API for front-end development. JSON server can be set up literally in ‘30 seconds’ and with no coding as the website claims. Capture some of the real API’s data if it already exists or create a mock data…

Managing Your Postman API Specs

In the previous post, we explored how to use Postman for testing API endpoints. Postman is an excellent tool to manage API specs as well, so that you can try API requests individually to see how things are working. It also acts as documentation for all your…

Automated API Testing Using Postman Collection Runner

A while back we looked at how we can use Postman to chain multiple requests to speed up out Manual API Testing. For those who are not familiar with Postman, it is an application that assists in API testing and development, which I see as sitting a level top of…

Semantic Comparison: Improve Test Assertions

One of the traits of a good unit test is to have just one Assert statement.. Consider Assert failures as symptoms of a disease and Asserts as indication points or blood checks for the body of the software. The more symptoms you can find, the easier the disease…

Use Tests As A Feedback Tool To Improve Code

A unit test suite provides immediate feedback when you make a change. A passing test suite gives the confidence on the changes made. It’s the confidence that the team has on the tests suite that matters more than the code coverage number. Tests also provide…

Tip of the Week: AutoFixture - Make Your Unit Tests Robust

AutoFixture is an open source library for .NET designed to minimize the ’Arrange’ phase of your unit tests in order to maximize maintainability. Its primary goal is to allow developers to focus on what is being tested rather than how to setup the test scenario…

Populating Data for Tests

Populating data for tests is the section of the test that usually ends up making tests more coupled with the code that it is testing. Coupling makes tests more fragile and refactoring code harder because of breaking tests. We should try to avoid coupling with…

Simulating delays in HTTP Calls For Manual Tests

At one of my clients, we were facing an issue of missing some part of a form data when processing a Submit request on the form. As per the current design, the form autosaves data to the database as and when user types in. When the user finally submits the form…

Introduce Tests when Fixing Bugs

When creating a subscription for a client, the calculated number of months was off by one at times - This was a bug reported from production application that I was currently working on. Though, not a blocker, it was creating enough issues for the end users…

Refactoring to Improve Testability: Extracting Dependencies

In the earlier post, Removing Unnecessary Dependencies, we saw how having an unnecessary dependency hinders testability. In this post we will see just the opposite of that - extracting functionality out of a class and creating another class to separate…

Refactoring Test Code: Removing Constructor Dependency

In the earlier post, Removing Unnecessary Dependencies, we saw how having an unnecessary dependency hinders testability. In this post we will see how the test code changed by the refactoring we did for removing the unnecessary dependency and explore ways to…

Refactoring to Improve Testability: Removing Unnecessary Dependencies

Nowadays I am trying to stick to TDD (with the test first approach) and have found it to be of great help. One of the biggest reward doing TDD is that it helps me to stay in the flow and regain speed faster after a distraction. This post explains how to…

Using Fiddler to help in Manual Testing

Fiddler is an HTTP debugging proxy server application, that captures HTTP and HTTPS traffic and displays to the user. It also enables modifying HTTP traffic when sent or received. Fiddler is one of the tools that I use daily and is an indispensable one for any…

Organizing Tests into Test Suites for Visual Studio

While working with large code base, that has a lot of tests (unit, integration, acceptance etc), running all of them every time we make a small change (if you are doing TDD or just using build for feedback) takes a lot of time. Organizing tests into different…

Is Code Coverage a Lie?

Code Coverage has been one of the important things that was always there on a daily build report and a number that managers were both interested and worried about. This has been the same for all projects that I had worked on, across various organizations…

Testing Multiple Implementations of same Interface

Often there are times when we need to test multiple implementations of the same interface. We would want to use the same test case against all the implementations so that we don’t repeat ourselves. In this post we will see how we can reuse the same test cases…

Subscribe to rahulpnath.com

And get the latest articles delivered right to your inbox!