DEV Community

Discussion on: There are only two types of automated software tests, fast ones and not fast ones

Collapse
 
chenge profile image
chenge • Edited

It seems Rust has better compile and need less tests. Right?

Collapse
 
geshan profile image
Geshan Manandhar

No idea, never tried Rust.

Collapse
 
notriddle profile image
Michael "notriddle" Howell • Edited

A well-designed type system can replace micro-scale "fast tests" that are basically intended to check that a unit work correctly on all of the data types that it's specified to work on.

The slow tests, that run the entire application, aren't affected. Look at the incredible amount of test cases that the Rust compiler and Servo have that don't even use the normal unit testing framework, because they want to be able to launch the entire user interface and check its inputs and outputs (or, in Servo's case, because the test harness is supposed to work with software that isn't even written in Rust). In my (admittedly limited) experience, those are the tests that eat most of your time, because they end up hitting race conditions and bugs in the test code itself, even if you write less of them and more of the decent unit tests. But they do catch actual bugs that unit tests wouldn't catch.

Collapse
 
rhymes profile image
rhymes

Don't fall in the trap that a strongly typed language doesn't need tests. Yes, you won't write tests for types but you still need to verify that your function does what it's supposed to do and that your app does as well.

Collapse
 
chenge profile image
chenge

I said less, :)

Thread Thread
 
rhymes profile image
rhymes

ahhahaha sorry :D