Hacker News new | ask | show | jobs
by louis___ 1802 days ago
I do not know anything about drugs, but I searched for "heroin", and was brought to the "Diamorphine" page, which seems a bit different.

Regarding your request on unit tests : do not do too much of them, too low-level. Try to write tests whose output should not change, should you refactor, this way they will help you avoid side-effects of refactoring. If your unit tests are too low-level, you will need to change them everytime you change your code.

One good think to test would be your fuzzy-matching logic, with edge cases taken into account.

Happy hacking !

3 comments

Diamorphine is heroin, so that's correct
Someone else suggested including a disambiguation to highlight synonyms, which should be helpful in cases like codeine/heroin.

Thanks for the helpful advice re unit tests!

Heroin is the (former) Bayer trade name for diamorphine.

Edit: it was available over the counter and was pitched as a less addictive alternative to morphine