Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,155,533 members, 7,826,994 topics. Date: Tuesday, 14 May 2024 at 02:47 AM

Why You Need To Write Test As A Programmer/developer /software Engineer - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Why You Need To Write Test As A Programmer/developer /software Engineer (331 Views)

Please Help! How Can I Be A Self-taught Programmer/developer? / Can A Pro Programmer/developer Answer This Question? / Programmer/developer (2) (3) (4)

(1) (Reply)

Why You Need To Write Test As A Programmer/developer /software Engineer by peterincredible: 12:48pm On Dec 09, 2021
Hi all, I get it you hate writing test or dont even know why you need to write test or what writing test is for me to explain this i will you just a little example or case scenerio to explain it i hope you understand why writing test is necessary

ok imagine you have just been employed in a company as a developer and you where handed a code base to change a column in the sql database and change some logic in some sections of the codebase e.g(may be authentication of new user or anything like that ) and
you successfully did it and then the authentication is working fine and every where is good and dandy then you tried to visit another page in the website or the app and then you discovered that the column in the sql table you changed earlier is really required for the page to function then the reality hits you that you dont know how many places have been affected badly by the new changes you did and you now start going through the whole app just to be sure your changes did not affect other section negatively if is a small app that wont be a problem but imagine if it is a very large app that will be a serious pain in the ass now here is where writing test shines

writing test is like creating a small simulation of how each part of your app work how each feature works and checking if that part behaves the way you want it to behave take for example writing test for the authenthication feature

personally to me i just know two types of test

1. unit testing : this is writing test for just a unit of the app eg writing a test for a method or function you created
2. feature testing: this is writing test for a feature in your app eg authenthication,upload of profile image features e.t.c

now imagine if a test was written for the codebase/app by programmers who worked on it earlier before you inherited the codebase/app,
you won't be scared of the changes you made if it will cause a ripple negative effect on other part of the app because all you have to do is run the test and then you will know other places that was affected negatively by you new changes and all you have to do is go to those part and makes some slight changes for it to work normal as it used to be and then you update the test in those area so that other programmers that inherit the codebase/app from you after you have left won't swear for you or use ogun to lay a curse on you .

also writing test also makes you understand i new codebase/app quickly because all you have to do is run the test and read it and you will have a good idea where all part of codebase work and even sometimes how they are connected

and pls i beg you dont decieve yourself and think you will write test after you are done with the app pls as you add a working feature to you new app or code/base you inherited or make any changes pls let those changes too reflect in the test too as quick as possible

i hope you all read what i wrote and trie to write test.

popular test library for javascript is (jest) and for php( we have phpunit) they wont take you up to a week to learn

pls you all don't mind my english oo na soso ffff i get for school back then i hope i have made sense gracias

5 Likes

(1) (Reply)

The Opencart Back In Stock Notification Extension By Knowband - Know More! / Surprising News From IBM / Exactly what does an RPA programmer do?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.