Skip to content

Enrich unit tests with symbolic proofs#846

Open
tiferrei wants to merge 39 commits into
smoltcp-rs:mainfrom
GaloisInc:feat/verification
Open

Enrich unit tests with symbolic proofs#846
tiferrei wants to merge 39 commits into
smoltcp-rs:mainfrom
GaloisInc:feat/verification

Conversation

@tiferrei

Copy link
Copy Markdown

Hi there,

Over the past few weeks I have been working on making some of the tests for the TCP implementation more powerful. I have been using Kani to be able to prove stronger theorems resembling the unit tests' behavior.

This mostly means proving that the behavior expected by the unit tests is met not only with the specific mocked IPs, sockets, packets, etc. but in general with any such structures, as long as the actually meaningful properties of such structures are met.

I saw that smoltcp makes use of some fuzzing to increase the trust in correctness of the library, and so thought symbolic execution would be a great addition to cover even more scenarios, and unexpected edge cases.

We were hoping to upstream these efforts into smoltcp, to hopefully be able to capture breaking issues in code changes before they're published. We have also configured a CI job that can run the proofs automatically to check they're still being met.

So far the proofs cover the wire parts of TCP, mostly proving that serializing and deserializing are inverse operations (w.r.t most fields being made symbolic), and we have theorems that augment the TCP socket tests for Closed, Listen, and Syn-Received states.

We would love to get some feedback!

@tiferrei tiferrei changed the title Feat/verification Enrich unit tests with symbolic proofs Sep 29, 2023
@codecov

codecov Bot commented Sep 29, 2023

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@edfdb23). Learn more about missing BASE report.
⚠️ Report is 417 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #846   +/-   ##
=======================================
  Coverage        ?   79.59%           
=======================================
  Files           ?       78           
  Lines           ?    27838           
  Branches        ?        0           
=======================================
  Hits            ?    22159           
  Misses          ?     5679           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant