minaremonshaker's avatar

why feature test are always slower that unit tests?

I’ve always wondered why feature tests, especially those that interact with databases, tend to be slower than unit tests. Is it because connecting to and retrieving data from the database adds extra overhead, or are there other factors involved?

0 likes
3 replies
Glukinho's avatar
Level 30

Is it because connecting to and retrieving data from the database adds extra overhead

Besides that, additional time is spent to fill temp database with test data, and it is done again before each test.

Snapey's avatar

and feature tests boot the framework.

martinbean's avatar

@minaremonshaker You‘ve answered your own question: because feature tests do more than a simple unit test. So all of those extra things (booting the framework, establishing a database connection, reading/writing records) are going to increase the time.

Please or to participate in this conversation.