Live data from Hacker News

Ask HN: How do you test and structure research code?

news.ycombinator.com

1–2 of 2 posts

Ask HN: How do you test and structure research code?

#1
Hey,

are there any books/websites which focus on testing and structuring of research code? I feel code that is written for research purposes has to be approached differently, than let's say a web application.

In company where I work, research code at some point actually becomes our production code and I'm kind of scared that there is no Q/A process established. I mean multiple people check it along the way, but given nobody knows exactly what the output looks like, I'd say chances are that there is a lot of bugs hidden in our codebase.

How would you generally test such code? In the same way as other web/desktop applications? I feel like approaches which normally work in dev (i.e. TDD) fall short when we're talking about research, where you do not know what the end state is. But at the same time, having no tests is also foolish and short-sighted.

Re: Ask HN: How do you test and structure research code?

#2
Although rewrites are notorious for being a bad idea, I think rewrites for research code are mandatory. Do the research, figure out what it is you're actually trying to accomplish, and then actually write the system you plan to use. Research code is best used for reference only.