Skip to main content

Development guides

Layout of the top level directories

The top directories are as followings:

DirectoryDescription
src/TQUIC implementation
tools/TQUIC Example tools
benches/Benchmark tests
fuzz/Fuzzing tests
interop/Interoperability testing
include/Generated header files for C/C++
tip

The header file include/tquic.h should be updated if any changes are made to the src/ffi.rs. The header file can be automatically generated using the following command:

cbindgen -o include/tquic.h

Layout of the TQUIC implementation

Directory/FileDescription
src/connection/Core implementation of the QUIC protocol
src/congestion_control/Various congestion control algorithms
src/multipath_scheduler/Various multipath scheduling algorithms
src/tls/An wrapper of boringssl/rustls
src/h3/HTTP/3 protocol
src/qlog/Qlog
src/ffi.rsForeign Function Interface for C/C++
src/build.rsBuild tools for boringssl
src/*.rsFundamental building blocks for the TQUIC library

Unit testing

  • How to output test case logs
# You should replace the `test_name` with the actual test case name
RUST_LOG=trace cargo test test_name -- --nocapture
  • How to check the unit test coverage

It is recommended to use tarpaulin to produce a unit test coverage report:

# install tarpaulin
cargo install cargo-tarpaulin

# change to the base directory of the project
cargo tarpaulin --exclude-files "deps/*" -o html

Fuzz testing

  • How to install the tool cargo-fuzz for for fuzzing
rustup install nightly
rustup default nightly
cargo install cargo-fuzz
  • How to list all the existing fuzz targets
cargo fuzz list
  • How to run a fuzzing target
cargo fuzz run <target_name> -- -max_total_time=30

Refer to the cargo-fuzz documentation for more information.

Conformance testing

We maintaine a formal specification of the QUIC v1 protocol using the Ivy language. This specification can be used to test implementations of QUIC using compositional specification-based testing methods.

For further information, kindly consult this document.

Interoperability testing

Automated, continuous interop testing is performed using the quic-interop-runner. The results of this continuous testing are posted on this webpage.

Rust package documentation

  • How to build the documentation for tquic
cargo doc --no-deps