When running the tester with debug = true
, the tester gives out a detailed output of the decoded response, which is particularly helpful in ensuring that the values our implementation is serving are being properly encoded. I would love it if the tester also creates such a tree structure and logs all the values and fields for the requests it is sending, as:
- It is difficult to reverse engineer the values from the provided hexdump of the request for beginners
- It would make debugging the parsing of requests simpler, as now the user can simply log the values that they have parsed, and compare it easily with the values that the tester is sending.
Context: I was trying the challenge in Scala, and had to roll my own encoding for VarInt
& VarUInt
. It took me over half a day of implementing this myself for the tester to realise that the signed int encoding adds an additional bit to the number during encoding, something that I had previously glossed over as the same was available as a standard library function in GoLang. Having those logs made it possible to pinpoint the erroneous location, and bit-by-bit manual reading of requests (that too with randomized data) was too much of a pain.