2 added 28 characters in body; edited title
source | link

Unit Best practices on unit tests for consecutive functions

Let's say we have function A and function B which perform consecutive operations on some data, with B never receiving the data before A processes it.

Function A makes exhaustive checks on potential errors on the input data. For A, it's a no-brainer to write proper unit tests. What aboutShould there also be tests written for B? If it's given invalid data in tests, it crashes, but if there are checks in place there's a performance loss.

Unit tests for consecutive functions

Let's say we have function A and function B which perform consecutive operations on some data, with B never receiving the data before A processes it.

Function A makes exhaustive checks on potential errors on the input data. For A, it's a no-brainer to write proper unit tests. What about B? If it's given invalid data in tests, it crashes, but if there are checks in place there's a performance loss.

Best practices on unit tests for consecutive functions

Let's say we have function A and function B which perform consecutive operations on some data, with B never receiving the data before A processes it.

Function A makes exhaustive checks on potential errors on the input data. For A, it's a no-brainer to write proper unit tests. Should there also be tests written for B? If it's given invalid data in tests, it crashes, but if there are checks in place there's a performance loss.

1
source | link

Unit tests for consecutive functions

Let's say we have function A and function B which perform consecutive operations on some data, with B never receiving the data before A processes it.

Function A makes exhaustive checks on potential errors on the input data. For A, it's a no-brainer to write proper unit tests. What about B? If it's given invalid data in tests, it crashes, but if there are checks in place there's a performance loss.