Just realized my 'working' code was never actually tested, all because of one comment on my calculator project | Coding For Beginners - Opinions Matter
Just realized my 'working' code was never actually tested, all because of one comment on my calculator project
I built a little tip calculator in Python last month, ran it once with 20 bucks and 15 percent, saw "3.0" pop up, and called it done. Posted the code in a beginner Discord and a guy named dev_marcus replied "you only tried one input, that's not testing, that's hoping." He made me run it with a bill of 0 and a 200 percent tip, and it gave me negative numbers and a crash on blank input. Now I keep a little notepad file of weird test cases next to every script before I think it's finished. What is the dumbest edge case that broke something you wrote?
Built a script that renamed a bunch of files based on dates in the filename. Ran it on my test folder with three files, worked great. Then ran it on my actual photos folder and half the files had no date in the name, so it renamed everything to "None_None_1.jpg" and stacked them all with numbers. Spent an hour undoing that mess. The folder with zero files case also just threw an error instead of doing nothing. Now I check for empty folders and weird names before I touch anything real.