3 ms·
I've never had success doing this in languages like Java or Python, but where it's been very very helpful is in hardware description languages. Since you are of
by buildbot 7y ago
I've never had success doing this in languages like Java or Python, but where it's been very very helpful is in hardware description languages. Since you are often implementing a piece of hardware with known input and output specs, writing tests first can work and show you how much of you design meets the spec as you go forward.
Plus writing HDL without tests is basically guaranteed to create something nonfunctional.
I hate unit testing in for example Java though, individual functions are typically very basic and don't do much. A service? Integration tests? Sign me up, but unit testing to 100% coverage a function with ten lines that reads a bytestream to an object and sets some fields is boring, and fairly difficult to mock.