&gt; Did you try to use OCaml and run into a bunch of difficult problems?<p>Yeah, I am a long date contributor and user of ocaml for little projects (mostly compilers and AIs). But not professionally.<p>&gt; It&#x27;s been years since I used OCaml and I don&#x27;t know anything about OPAM so I&#x27;m also interested in the answers.<p>Opam is Bundler done right. It manages ocaml toolchains and packages dependencies. It&#x27;s easy to pin a specific version or publish your own.<p>A setup oasis + ocamlbuild + $editor could go quite far. After that, it will depend of how you works and what you are developing.<p>&gt; Like, testing is basically just checking a bunch of if statements. You can use fancy frameworks that color your tests red and green, but other than that kind of thing, what&#x27;s the actual problem? Why do you say testing in isolation is particularly challenging with OCaml?<p>That <i>is</i> a very interesting question that deserve a blog post on its own. But I don&#x27;t have the time nor the patience to do so, so let it be the HN comment.<p>&gt; Like, testing is basically just checking a bunch of if statements.<p>Wrong ! There&#x27;s multiple kind of &quot;if statements to test&quot;;<p>-1- I want to test that `my_inner_fibo(0, 1) == 1`. This is unit test. Basically a transcript of the technical specifications into assertions. This is the easiest test, the most verbose, but it&#x27;s also the kind that test the least.<p>-2- I want to test that `UserModule.retrieve_orders(user, command)` makes the good calls. This is integration testing in white box, which test that the API contracts between you inner interfaces are respected (which is also part of the technical specifications). I don&#x27;t find it very useful but it&#x27;s better than nothing when you can&#x27;t do more.<p>-3- I want to test that, with a given state `user`, and `command`, when I call `UserModule.retrieve_orders(user, command)` I get exactly this object. This is integration testing in black box. This is useful to find errors in inner logic a group of modules (but you don&#x27;t know immediately what gone wrong). As the call stack could be very large (and so the scope of what you are testing), you want to reduce the moving parts and replace some of the modules with trivial mocks. Integration testing in a black box test a lot of things and is very useful to find bugs.<p>-4- I want to test that a call to `$.&#x2F;my-binary ctl command --flag=true` have a specific behavior. Could also be a network request to a server, a message to a deamon, a click on a GUI... Anything exterior to the program. Here we test the behavior. This is what the user will use, that&#x27;s why it&#x27;s functional testing. This could break often (in the case of a GUI) or not (in the case of a CLI binary). You should always do functional testing if you respect you users a little.<p>All these kinds of testing have different requirements, and some need a perfectly controlled state to be created. The issue is not in the conditional testing, but in the setup this perfect controlled state, which sometimes need to make the code believe it use the good module, but you gave him a stubbed one which does trivial work, or signal you when something happens.<p>I don&#x27;t know any simple way to spy on functions without using the MirageOS design which heavily use Functor injunction. It&#x27;s quite an academic way of doing it.