Why Unit Testing is Developer's Best Friend

in #india5 years ago

We all know about never stopping fight between the developers and testers in the Software Development and how both of them put their best foot forward to state that they are correct. Being in the industry for quite some time I can say that none of those two are always correct and none of those are always false.

d80nr8prne.jpg
PC: Pinterest.io

Now in some organisation as a developer your incentive or your yearly reivew directly proportional on how many bugs has been encountered on your feature. Thus we developers always wants to give as buggy feature as much as possible. But being a developer we always miss some edgy case.

Now this is where the unit test can come into picture. Let's take an example of a React app where almost everything is been written as a component. Inside a component we have a lot of components life cycle as well as some functions. Now whenever I write a function I make sure that function should have been pass through unit tests with multiple inputs. If it passes I can continue writing more functions.

In that way you are not only following the test driven development but also you know all the possible values your function can get and how to not miss those edgy case. One more thing I tend to follow is that more than 90% of the lines of code which I write should have an equivalent test case written which means that my code coverage should always show percentage more than 90.

Though it's easy to say than done because of the tight deadline or any thing which developer has to consider. But when you follow agile first thing to do it to allocate some time for unit test too along with writing case in that way everyone will know that if you want less buggy software you need to give time to the developer for testing his own feature.

Sort:  

Thanks for using eSteem!
Your post has been voted as a part of eSteem encouragement program. Keep up the good work! Install Android, iOS Mobile app or Windows, Mac, Linux Surfer app, if you haven't already!
Learn more: https://esteem.app
Join our discord: https://discord.gg/8eHupPq

Hi @codingdefined!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 4.534 which ranks you at #2066 across all Steem accounts.
Your rank has improved 3 places in the last three days (old rank 2069).

In our last Algorithmic Curation Round, consisting of 116 contributions, your post is ranked at #96.

Evaluation of your UA score:
  • Some people are already following you, keep going!
  • Your contribution has not gone unnoticed, keep up the good work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

I think today, none actually. The developer constructs the code. The continuous integration tool handles the testing. Software testing is now getting automated. This will avoid answering the questions like - “It was working in the pre-deployment machine here. You can learn more by visiting website Performance Lab company

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63626.66
ETH 2640.26
USDT 1.00
SBD 2.75