In a system number of paths is number of permutation of units. And this number is big. For 20 units it is more than a million. Most paths in the system will be not taken by a user.

Ofc, we don't need to test all permutations. We usually test only 20 units, and then allow tools like typescript to test that connection between them are valid.

But then we have a question: what is a unit? Unit is something is worth of testing. In my practice, especially in UI, not all things were worth of testing.

Imagine a concrete example from my practice. There is a React form on screen. There is functionality that it resets after submit. To test this functionality you need to write code. Does it worth your time?

Imagine a flow:

- user pressed submit

- received "you have submitted" message

- but data was not reset (the feature is broken, and we didn't catch it without test)

- frustrating, but if he would like to clean the data he can refresh the page

At least in my case it was not a mission critical functionality. This feature is not impactful, it doesn't make money for the business. We don't lose money if it doesn't work. Ofc, it would be cool to polish it, but I had more important things to do.

We have an endless backlog of stuff to do. It is impossible to do everything and polish everything. This is why we need to carefully choose where to spend our effort. Not all things are worth of testing

--

Freelancer (Upwork Top Rated Plus). Full-stack Azure cloud developer. JavaScript and TypeScript connoisseur.

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

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