Seeing as there's no shortage of topics I should've learned about earlier, I'm surprised it took so long to write another "Introduction I Wish I Ha...
For further actions, you may consider blocking this person and/or reporting abuse
Always, always, always beware of False Positive.
Awesome introduction to Testing @maxwell_dev . Didn't knew about Percy. i will surely check it out
I have a few False Positive horror stories, and I actually wish I'd called them that since it's a great way to sum up that testing issue!
And definitely check out Percy, part of me hopes it can be a more reliable, mainstream VR tester for programmers someday.
It is a sad reality, and honestly if I didn't work with good programmers in my current job who knew to emphasize testing I likely would have not learned it myself at this point. It's tough because a lack of tests are like working near a nuclear waste spill - it doesn't do any immediate damage, but the damage it does is slow, gradual, and by the time you notice the damage it's likely too late and you're incapable of having children.
So for the sake of future generations, extra focus on tests is needed!
Great summary for testing but you may have forgotten performance and stress tests.
Regarding unit tests, it can become very complex when it comes to mocking dependencies or testing asynchronous functions.
Thanks for your post!
Ah good catch with the performance and stress tests. Sadly right now in my career I haven't had much exposure to those, so those slipped through my focus. I'll need to do some more research later, thank you for bringing those up!
Great introduction. I would add two - often underrated - items to your Why Testing Matters section:
Unit and integration tests promote modular software design. Designing for testability makes code easier to understand and maintain.
Tests can serve as an additional documentation, especially to help other developers familiarize themselves with the code. Tests define what the software is supposed to do and what not.
These are good points and I thank you for bringing them up here! Especially the point about tests serving as extra documentation. I had planned to include a "tests make your code's aims explicit" section but that header felt too wishy-washy to me and I removed it. But if I'd framed it as documentation I likely would have kept it since it gets more to the point of how it adds value.
Absolutely nailed the article! Thanks for this!
I just happened to write an article about testing myself and stumbled onto this gem. (get it?)
dev.to/jtenner/testing-with-assemb...
I managed to develop a testing framework from scratch for the new
AssemblyScript
language (TypeScript subset compiled to Web Assembly) and would love your thoughts on how it is written.Thanks a bunch, and cheers on your endeavors! 🎉
The React testing struggle is definitely real. I've been spoiled by Ember testing, and the big tradeoff with that is I've gotten much less experience adding my own tests or customizing them when needed. All the more reason it matters to build up a few apps from nothing for better understanding.
Loved your article! I've been always bothered by how little emphasis there is on testing. I just finished my degree in CS and just started hearing about testing in my penultimate semester. Had to take a course from another career (IT) to get an introduction to testing! So hadn't I gone out of my way to take that particular class I may have never heard about it up to this point.
When I was doing internship as backend developer (ruby on rails), one of my first task was to test the existing apis. My senior fellow recommend me to use 2 gems, factory bot and faker. Factory bot helped me in automatically injecting dummy data for testing. For dummy data itself, Faker played its role. It's a powerful gem that can mock almost all types of data (dates, phone number, coordinates, names etc). These 2 gems really eased the testing process.
P.S awesome article
Good recommendations, and we actually use those same two gems for testing in our own Rails app! Plus the RSpec testing library, since it does so much to make the tests explicit, readable, and even fun to write in classic Ruby fashion.
Can someone advise me a suitable article on the ABC of testing for a newbie like me?
Love this article Max! Very helpful overview of the different types of testing - it can feel a bit overwhelming when one just sees a list of the different code tests without any succinct explanations. Added this to my "core articles" list (a list I maintain on Diigo of all the articles I think are really essentialy on various topics).
Try react-testing-library! It is awesome, makes testing React so much easier.
What about System Testing?
I think system testing or end-to-end testing is a kind of integration test at a large scale.
Interesting article! Definitely recommend checking out WireMock as a useful data stubbing solution: wiremock.org/
I can wholeheartedly recommend Obey the Testing Goat!: obeythetestinggoat.com/. It covers all of this in great and practical detail. We have all our juniors work through it during onboarding.
I love that! That's a great onboarding topic, it must really help keep the codebase consistently strong.
That would make an amazing t-shirt to, "Obey the Testing Goat."
I have always thought that tests are unskipable and those who did were lazy people.
Excellent article!
For VR testing I have tried BackstopJS seemed easy to setup and provide what I needed for a small site.