this post was submitted on 30 Dec 2024
141 points (99.3% liked)

Programming

17722 readers
280 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 62 points 5 days ago (1 children)

There are over 600 lines of test code for every line of code in SQLite

Holy mother of god

[–] tja 14 points 5 days ago (2 children)
[–] [email protected] 17 points 5 days ago (1 children)

A limitation of testing is that you can only write tests for cases that you can think of, and cases you can think of ways to write tests for.

It's still valuable despite this limitation, of course.

[–] [email protected] 5 points 4 days ago (1 children)

That's not entirely true, e.g. you can do fuzz testing or constrained random testing. Maybe you aren't including those in "testing"?

[–] [email protected] 5 points 4 days ago

I was mostly thinking about hand-written tests and manual test procedures, but yeah, fuzzing can help you catch issues as well and you don't necessarily consciously know about the test cases you put into the system in that case.

Then again, you have to design the fuzzing input consciously so I guess that's kind of a "what you can think about"-limitation.

Good point regardless, thanks

[–] [email protected] 5 points 5 days ago (1 children)

You can write shit tests. Finding new bugs doesn't surprise me. Putting that much effort in does, but 600:1? That's some serious red flags there. There are only so many variables in a single line of code. How many unhappy paths can there be for a single line?

[–] [email protected] 11 points 5 days ago

SQLite is one of the best tested codebases in existence. Having only so many variables per line means nothing