Potentially: test your code with constructed data. If you don't get as a result the conclusions you've previously built into your data, your code is wrong.
I'm a big fan of TDD in software development! It’s often listed on CVs and job specs but rarely used in practice, so it’s great to see it gaining traction in the data science space!
I’ve been doing (a version of) TDD since about 2005 and blogging (https://tdda.info) about and developing a library for (https://github.com/tdda/tdda) for TDDA for nearly a decade. It’s definitely starting to get more traction.
Science is hard. Kudos to you for owning the mistake. It might be cathartic to read about James Mahaffey and the Georgia Tech Research Team walking back their cold fusion announcement. The experiment was flawed because of a temperature sensitive bias in their neutron detector.
Comments
Well done for admitting this. It's a breath of fresh air for research.
If you write code, *always* have someone review your code. Preferably someone experienced!
As someone literally writing a book called Test-Driven Data Analysis (which you might feature in...), this is great to see.
I’ve been doing (a version of) TDD since about 2005 and blogging (https://tdda.info) about and developing a library for (https://github.com/tdda/tdda) for TDDA for nearly a decade. It’s definitely starting to get more traction.
https://codecheck.org.uk
https://sortee.github.io/peer-code-review/