To Mock or Not to Mock, That is The Question

Photo by James Harrison on Unsplash

Mocking dependencies of your code is one of the fundamental aspects of software testing. It’s a powerful method that allows developers to gain control over a certain part of your code and create an isolated environment for your test if done too much. This will make your tests less reliable and create a false sense of security, which is exactly not what we want.

--

--

--

Lifelong learner working as a frontend engineer. React. Self Development and Reflection. Testing. Technical Blogging.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

I’m learning to code (#2) — Quantity leads to quality

GitHub Education: A spring board for a student developer

What Is a Mobile App Development — Guide for Business Owners Interested in Building a Mobile App

Bitwise AND of Numbers Range(Python)

What’s a makefile and how can be useful?

How to fix Elgato Wave 3 Microphone Update Issues

Flutter HTTP Request and Mock API — Processing API Request and Response Data — Part-1

Write faster code with C++ Expression Templates for optimized compile-time evaluation

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Chak Shun Yu

Chak Shun Yu

Lifelong learner working as a frontend engineer. React. Self Development and Reflection. Testing. Technical Blogging.

More from Medium

Let’s talk about (scheduled) background tasks

Testing Software Systems

Testing Software: What is TDD and should I use it?

What to Test When You’re Testing