DEV Community

Discussion on: Testing 101: Introduction to Testing

Collapse
 
pesse profile image
Samuel Nitsche

Great article, thanks for sharing.
What I miss a bit is a review of strong opinions against - especially - extensive Unit-Testing like the famous "Why Most Unit Testing is Waste" or its follow-up by James Coplien.

I think it's also good to remember that testing is less about specific tools (e.g. Unit-tests, Mocks, TDD) and more about a mindset to solve a business problem, check it works and expect/deal with the unexpected.
This can be achieved in various ways - Unit-/Integration-/End-to-End-Tests are some tools as are Constraints, Type-Systems, Design-by-Contract techniques.

Additional benefits of automated self-testing:

  • Help focus on the "what" instead of (only) the "how"
  • Encourage critical thinking which might lead to finding gaps in the specification
  • Can serve as documentation and example code describing the functionality
Collapse
 
alysivji profile image
Aly Sivji

I agree with a lot of the things said in the articles by James Coplien. Higher level testing provides a lot of value for the time investment. I see folks mocking out things like databases, file systems, etc and that seems to miss the point of what we should actually be testing.

There are a ton of opinions out there, but it's about finding the balance for what you are trying to do. It's your program, what kinds of tests will give you the peace of mind that it does what it should?