r/ProgrammerHumor • monkeyuser.com • Mar 06 '18

Focus

Post image
43k Upvotes

805 comments sorted by

View all comments

Show parent comment

3

u/fuckingoverit Mar 06 '18 edited Mar 06 '18

Totally agreed, especially when you’re writing tests as you write smaller functions that you test and compose on your way back up to whatever the api entry point is. There is no, “I don’t know where I am” feeling anymore.

I resisted testing for so long because it seemed like a waste of time in the beginning and then too hard to add when I needed it. The examples I saw of testing seemed like extra work with little value (like java code where there was a test to test a setter that i could clearly see worked). And all the TDD “Tests must be first” nonsense didn’t work for me.

But one day, I worked on something that had a 6 - 10 second build time when testing the UI, but no delay when running tests. I was all about giving it a shot for that elusive efficiency. Sure, I had to adjust the way I wrote code. But it wasn’t long before I saw how I could just break problems down, and then test each case individually, without having to click around some UI or leave my IDE/command line. I was sold on the value (or at least the speed and ease and logic to it all). And when I had to do a major framework version upgrade with 1000+ tests, I couldn’t ever go back.

And I swear people who don’t test think I’m so far up my own ass when I tell them how much more enjoyable automated testing has made development for me. Or they’ll see something and they’ll wonder why I tested such a simple function. But it really is just a paradigm shift. I don’t test the UI much at all when building JS apps or hit my APIs when building backends. Now it’s all at the end and while I find problems, they’re significantly fewer and further between.

1

u/XG_SiNGH Aug 12 '18

Very well said.

Thank you.

O_O