Stronger assertions can be given by static types. For more expressive assertions, dependent types[0] as seen in Idris[1] are very powerful.
When it comes specifically to cryptography, I think formal verification should be added for increased confidence.
(I'm not saying "don't bother writing tests if you're using a strongly typed language" - these things can and should be be complementary)