From 2c19e4f221b8b417f2212452312bfd506c3771dc Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Sun, 9 Jun 2019 22:01:02 +0200 Subject: [PATCH] Add mocking idea --- fuzzing/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fuzzing/README.md b/fuzzing/README.md index fd96240..e6c07e2 100644 --- a/fuzzing/README.md +++ b/fuzzing/README.md @@ -14,3 +14,17 @@ Currently the following parts are individually tested: * Http method/url router No defects or issues are left unfixed. + +## Mocking +If you think about it, uWebSockets is really just a piece of data transformation code. Being standard C++ with no dependencies other than uSockets, all it does is: + +* read & parse data +* act on & handle data +* format & write back data + +If we mock the uSockets interface and link to it instead of the real thing, we can actually fuzz-test the entire project in a more integration-testy way rather than the above mentioned unit-testy way. + +* A mock server is created +* libFuzzer emits data which we hack up in pieces and emit to uWebSockets via uSockets. +* Whatever happens next, happens. +* Fix bugs.