As a developer who has primarily been doing functional programming in F# for the last several years, I'm very attached to my REPL and use it run my code as I go, testing and refining each function as I write it. However, one area where I often fall short as a developer is in creating good unit tests for every function and submitting them with my initial code-review request.
Other developers on my team who come from a more OOP/C# background have a workflow that is less REPL-driven and use unit tests (MSTEST) to do the experimental testing that I do in the REPL. While this leaves them with a bunch of unit tests at the end of their cycle, I still prefer the REPL, because I can iterate and test much more quickly, without having to build the project and wait for the test-engine each time.
Since we are an F# team, I believe the REPL is the right tool for experimental testing during development, but I also believe we need to have formal unit tests that are executed during builds as part of our gated check-in process. I also don't especially like that since we have to create test classes and test methods for the unit tests, since we don't really use classes very often anywhere else, but I can deal with that. The value of having a repeatable set of tests run on every build to immediately point out any breaking changes is useful enough to deal with the idiosyncrasies of an OOP testing framework.
In doing some research, I have seen things like the Cursive IDE for Clojure which combines a REPL with the
clojure.test framework so that the code you write in the REPL can become the unit tests. This seems like an ideal solution, and it looks like the F# testing project Expecto might partially support this pattern, so I'm considering making a proposal to try it out. However, I don't want to introduce a disruptive change to the workflow and testing process unless it's the best available solution.
Are there any simple workflow changes I've overlooked that could resolve this without a change in testing tools? How are REPLs and Unit Tests used together on other large FP-based projects?