Software testing seems to be one of the most opinionated things in the software ecosystem.
Some people swear by it and only do TDD (test-driven development), while others wing it and see what happens.
I'm not here to tell you which one to pick, as it's personal and dependent on your time/project/and many more factors.
But let's take a look at what testing can do for you.
Types of testing we'll look at
Before diving into this in-depth, let's look at which types of testing we'll be looking at.
- Manual vs. automated
- Unit testing
- Integration tests
- Functional tests
- End to End
Most of us will have at least done manual testing, which often means you create a system/feature and manually test different options to see if it works.
This is common regardless of the other tests you might have and is often needed to verify the initial product.
Automated testing
But we can enhance these manual tests by introducing automated tests. The significant part about these is that they are created once run forever.
It means it initially takes us some setup time, but we can keep running them and see no regression or bugs were introduced.
In the automated section, we have many different approaches to testing.
I won't be going over all of them, so here are some well-used ones.
Unit testing
Unit tests are the simplest form of automated tests. They are super low level and test a "unit", which can be one function, one component, or even one interaction.
The idea is to have them as small and quick as possible so we can test many small tests relatively fast and cheap.
Integration tests
These are used to test integrations with external factors, such as your database, user system, or external APIs.
They often require mocks of these external systems and are considered heavier to run.
Functional tests
These are kind of enhancements to the integration tests, where integrations only care about data coming from a connection.
Functional tests take it one step further and want the data to display correctly.
So an example could be:
- API returns users (Integration test)
- API returns users and renders them in a table (Functional test)
End to end tests
This kind of testing is there to validate user flows. We want to verify a user flows through a program correctly.
This can even include loading states, disabling a button, and showing a result from a form.
These tests are super valuable and quite expensive as they take a lot of resources and take longer to set up.
There are more
There are many more types of testing, and depending on your needs, they might be even more important.
However, for this basic introduction, I want to leave it here.
Do let me know what your favorite combination of tests is and how you go about automating it.
Thank you for reading, and let's connect!
Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter
Top comments (5)
One thing that upped my testing game was spending some time together with quality engineers to get a look into their mindset. Like a designer who only paints a static button, but leaves out focus, click and disabled behavior, we developers sometimes tend to only test the happy path and maybe the few edge cases that we already thought of even before writing the code. Some edge cases, you can avoid by type checking during compilation or runtme.
That's some solid advice!
And indeed could really up your game, thanks for that.
I love testing ❤️🔥! I started implementing automatic tests because I was tired of seeking/setting up an environment to reach the line of code/feature I want to test.
After a year of trying to incorporate automatic tests into my workflow, I am delivering a health code faster now.
I am a backend software engineer working with spring boot. I enjoy writing integration tests, It's so satisfying to see them running smoothly. Every time I implement a new feature and execute my regression tests, I feel confident when some of them failed and It brings me peace 😌 when I made it succeed again ☑️
My challenge now is to convince my manager that it is worth slowing down the delivery peace to learn to implement automatic tests. So my coworkers will be interested in automatic tests if the manager supports them by giving them the time to implement that.
This is amazing to hear Renan
And testing can indeed really change the game and actually speed up things!
Let's hope your manager understands that.
Thanks.
Regard
Karim