Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 13, 2019 02:41 pm GMT

ELI5: Useful Unit Testing

I've been trying to get better about writing more complete tests, but often feel I'm being somewhat redundant. Sometimes the tests I'm writing feel like they're just verifying that the language works as anticipated (if I pass in a parameter, is it accessible in the local scope? Does this math function that accepts integer types reject non-integer inputs?), or that the framework works (If I pass in a string prop to render as a text node, does React indeed render this text node?).

In a dynamic language extra checks for proper types make sense, but in a type-safe language I'm more than happy to trust my compiler for that. As a result, my unit tests feel sparse. It feels more natural to write integration tests that encompass multiple parts of the application in an end-to-end or round-trip manner.

How do you decide what's worthy of a unit test and what isn't?


Original Link: https://dev.to/deciduously/eli5-useful-unit-testing-1gon

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To