DEV Community

Discussion on: Are you for or against testing for beginners?

Collapse
 
vampiire profile image
Vamp • Edited

What are we qualifying as a beginner? If they understand the basics of programming and have written a few personal projects then they are ready. Introducing testing before that point is just going to confuse them and distract from learning the fundamentals.

You need to be comfortable enough with a language to think about it in the abstract way required to write tests. If you can't write a function how can you be expected to test one? If you can't understand what would break a function when it is used or composed you can't understand how to test for that behavior. If you haven't written a few projects yet then you are going to drown in tests (many of which will change or be added / removed along the way) before learning how to plan and build one.

I think the best introduction to testing is through algorithm challenges. That will teach you how the "input expect output" flow works. From there you can apply those fundamental testing principles to real project code and continue developing your testing process.

edit: I wanted to respond before reading their articles to remove bias. After reading both I don't think they are contradicting each other. Both are saying the same thing (as what I said as well) which is that testing is valuable but only when you have enough fundamental understanding to learn it.

I personally wish I had learned testing long ago. I think a sweet spot for me would have been around 6 months of coding. In the time since I started testing I have learned and grown so much in my strategy and usage of testing libraries. That sort of knowledge can't be found in a video or an article but through testing many different applications and use cases.