Ask HN: Why reusing e2e tests output is bad?
I have n features f_1, ..., f_n. Each of them requires other features (a subset of them) to be executed in order to test the ith f_i. For each feature there is an end to end test t_i, which executes the corresponding feature and its dependencies and then makes some assertions on the feature under test.
Argument: the all set of test executions is a boolean expression t_1 AND ... AND t_n. So, for each t_i, we can describe it as f_i AND f_j AND ... for each dependency f_j of feature f_i, because if a dependency fails, the all test fails (it can't arrive to evaluating its assertions).
So the whole test execution could be represented as a BDD (https://en.wikipedia.org/wiki/Binary_decision_diagram) and reduced. Basically when I make a test, i reuse the output of a previous test which encompasses all the dependencies of the feature under test, for which assertions have already passed. Of course this means tests should have a precise scheduling order.
What's wrong with my idea? Thanks for the dedicated time.
4 comments
[ 2.8 ms ] story [ 17.7 ms ] threadYou can try out how I do it if your are interested. The application is at:
https://github.com/prettydiff/share-file-systems
The test command is:
Let's say that a user can book a flight and after it's booked he can manage his flight. I can have two tests: one to book a flight, and one to manage a booked flight. The second one doesn't need to book another flight as precondition, it can use the one booked when executing the first test. Hope this makes my point clearer.
To increase performance I use websockets for everything. The Google answer for maximum network speed is gRPC with protobuf. That is supposedly 10x faster than JSON over HTTP, but protobuf is a pain in the ass. The way I execute websockets is 8x faster than HTTP and more convenient. Since I am not dealing with binary transform to protobuf my websocket approach with JSON serialization might actually be faster than (or at least as fast as) the Google solution.