banyan-cli icon indicating copy to clipboard operation
banyan-cli copied to clipboard

Data Prep Correctness Testing

Open laudiacay opened this issue 3 years ago • 1 comments

What:

Overarching Correctness Testing Issue Tracker

Goal

Comprehensive Test suite and Framework that both:

  • Primary: Tests code correctness (do things work the way they're supposed to)
    • See below for groupings of test kinds and references to other issues:
  • Secondary: Tests microbenchmarks (does code run quickly / be able to track how changes affects performance)

Related Issues and Test Categories

START

by implementing #13 . This should be as simple as creating a test/ directory. See Resources for more help :) also maybe keep in mind issue #40. Doc tests are a powerful and useful tool for documenting and testing rust functions in parallel! If you wanna practice using them in this repo, go ahead :)

DIRECTORY/FILE TEST EPIC: test on files & directories with randomized names and file contents.

  • [x] #14
  • [x] #15
  • [x] #16
  • [x] #17
  • [x] #18
  • [x] #19
  • [x] #20
  • [x] #21
  • [ ] #22
  • [ ] #23
  • [ ] #24
  • [x] #25
  • [x] #26
  • [x] #27

DEDUPLICATION TEST EPIC

  • [x] #28
  • [x] #29
  • [x] #30
  • [x] #31
  • [x] #32

COMPRESSION-ENCRYPTION-PIPELINE TEST EPIC

  • [x] #33
  • [x] #34
  • [x] #35

GENERAL

  • [ ] #36
  • [x] #37
  • [x] #38
  • [x] #40

Resources

  • How to use Doc Tests in rust: https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html
  • How to use Test Macros and write a test crates folder: https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/first-edition/testing.html
  • How to write tests: https://doc.rust-lang.org/book/ch11-01-writing-tests.html
  • Benchmarking Rust code: https://nnethercote.github.io/perf-book/benchmarking.html
  • Criterion (a library for managing benchmarking): https://github.com/bheisler/criterion.rs

laudiacay avatar Jan 23 '23 03:01 laudiacay

How to Start

Start by stubbing out something for #13

Then

  • write a bunch of "filesystem creator" functions that do a setup
  • one or two functions to check the copying/encryption/decryption/compression/decompression stuff individually or in groupings
  • one function to ensure the filesystem ended up back in its original state.

Then iterate. Basically have tests that put all the different weird filesystem setups through their paces with the code.

amiller68 avatar Jan 23 '23 18:01 amiller68