Why testing is important?
Tags: testing, webdev, beginners, flutter
Published: 2021-08-02 12:36:19

Testing is by far one of the most important things to do during programming, but it as well one of the most overlooked things.  
  
Testing ensure that you have a well working Website, Application or Software, let me explain.  


{% youtube enRzQAwP8ko%}

## Why Testing is important?

We are humans, we forget, we make mistakes, we change things, ideas; This if we work solo, imagine when you are in a team!  
  
When we add new features or edit previously made code, to be clear, when we touch stuff, sometimes you can create some issues in the other part of your application;  
  
Wouldn't be cool if someone could check for you that is everything fine or you have broken 3 modules of x or y class, function, or whatever?  


## Nah, it takes time

Yes, it takes time, following for example TDD takes a little bit of time, but, if you count the time that you will not spend looking for bugs after you find that 50% of you application is broken, it is better.   
  
I would say that it will takes a little bit of time at the beginning, but at the end will take less time.  
  
Instead if you code without testing when you have a full production application and, for example, you add a new feature breaking parts of you Application, I'm pretty confident that you'll have a harder time.  
  
The beautiful thing about testing is that you are able to follow the exact point in which your function has problems.  


![Process of testing illustration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y0x4ap4tlmroqrjlupk6.png)

Yes you guessed it, this is the purpose of testing...  
  
We are not perfect, testing allows us to check that everything is as it was before nothing has changed and every behavior is exactly how we have coded it before, the function receives the same inputs and gives the same outputs, the overall Application works as intended.  
  
If you could catch minor problems before they transform in huge holes in your software in the same moment you create them I think that it's a fantastic news.   
  
If you don't, a simple bug after days and days, weeks, months, more people working on the project and you have to solve a huge problem that you could have solved by implementing some tests.

## More tests, better quality

If you cover a well amount of your Application's modules, you can be pretty confident that you have a well working Software, that means that the quality is better since your double check everything.   
  
Another important benefit of testing, is that helps you and other to understand more about x or y function, since you will have a descriptive name that give the reader what are you testing.

## How I should start?

I suggest you to follow the Test Driven Development process always abbreviated as TDD;  
  
It works like this, first before you write any function that you want to test, you begin by creating the test, yes before even the actual thing that you want to test exist.  
  
You write a test for that function with the main goal that you want to achieve in your mind, then you develop the function.  
  
Probably you would not expect this point when you follow TDD but it helps you to be more productive!  
  
Probably you would not expect this point when you follow TDD but it helps you to be more productive!  


## More?

There are many types of testing, the one that I've described is defined as Unit Test, there are many types of testing.  
  
Unit Testing focuses only on a single unit, as the name suggests, and it doesn't care about the connection of your function with other parts, in which you should follow another type of testing, for example, Integration Testing.  


## This is it!

I've learned about testing in many sources that I cannot recall now, but one book that I remember for sure is Clean Code...

I link a referral here, if you prefer the digital version, I suggest you to get a bundle by the author of Clean Code and Clean Coder at a lower price.

---- US ----
<a href="https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship-dp-0132350882/dp/0132350882?_encoding=UTF8&me=&qid=&linkCode=li3&tag=903509-20&linkId=b91bff47378c47b9085089009e746245&language=en_US&ref_=as_li_ss_il" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=0132350882&Format=_SL250_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=903509-20&language=en_US" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=903509-20&language=en_US&l=li3&o=1&a=0132350882" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />

<a href="https://www.amazon.com/gp/product/B00666M59G?&linkCode=li3&tag=903509-20&linkId=74f8a7c5e57b2adf3fd822bcd8e1ef21&language=en_US&ref_=as_li_ss_il" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B00666M59G&Format=_SL250_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=903509-20&language=en_US" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=903509-20&language=en_US&l=li3&o=1&a=B00666M59G" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />

---- IT ----
<a href="https://amzn.to/3j2kHd4" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=0132350882&Format=_SL250_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=903509-20&language=en_US" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=903509-20&language=en_US&l=li3&o=1&a=0132350882" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />

<a href="https://amzn.to/3ycw3Sl" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B00666M59G&Format=_SL250_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=903509-20&language=en_US" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=903509-20&language=en_US&l=li3&o=1&a=B00666M59G" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />

## Thank you for reading 😀👋

I hope that you enjoyed the content and it was nice to read, inshAllah in the future I want to release a more specific example about testing, with Flutter and Javascript.

If you want to follow me on other socials here I'have some links...

 [Youtube](https://www.youtube.com/channel/UC9FtVivCn-y_YFIxffP-qXQ) 
[Twitter](https://twitter.com/Aspiiire1)