Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Since I've moved to full time rust I'm finding it much harder to precede the code with tests (ignoring for a moment the maximalist/minimalist discussion). I think it's the because the abstractions can be so powerful that the development process is iterating over high level abstractions. The bit I worry about testing is the business logic, but that in my experience is not something you can test with a trivial unit test, and that test tends to iterate with the design to some extent. Essentially I end up with a series of behavioural tests and an implementation that as far as possible can't take inputs that can be mishandled (through e.g. the newtype pattern, static constraints etc).

I'm not quite sure what is right or wrong about my approach, but I do find the code tends to work and work reliably once it compiles and the tests pass.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: