Can you find the bug in the Legacy Code? A coding Choose your own Adventure

man sitting in front of three computers

You are a new employee at the code factory. The job listing said that you’d get to do all sorts of fancy machine learning applications but it turns out you’re needed to fix old legacy code that doesn’t work anymore! You re-run the code against the test cases laid out by the last guy who worked on this legacy code and it’s outputting the error.

ERROR: Traceback line(942) RunTest()
Line(633) StepAlgorithm()
Line(912) ReInitParams()
Line(220) Calc_AGP_F_OLD()
NaN Value found in Attribute Error in Non-Zero Reference de-allocated in name 

What do you do?

  1. Google the Error
  2. Look through the code line by line
  3. Strategically add a bunch of debug logging print statements
  4. Ask the guy who wrote the code
  5. Try running the code again

Published by B McGraw

B McGraw has lived a long and successful professional life as a software developer and researcher. After completing his BS in spaghetti coding at the department of the dark arts at Cranberry Lemon in 2005 he wasted no time in getting a masters in debugging by print statement in 2008 and obtaining his PhD with research in screwing up repos on Github in 2014. That's when he could finally get paid. In 2018 B McGraw finally made the big step of defaulting on his student loans and began advancing his career by adding his name on other people's research papers after finding one grammatical mistake in the Peer Review process.

One thought on “Can you find the bug in the Legacy Code? A coding Choose your own Adventure

Leave a Reply

%d bloggers like this: