Live data from Hacker News

How SQLite is tested

sqlite.org

51–60 of 87 posts

Re: How SQLite is tested

#51
post #18

Perhaps someone in the know can answer this: How reliable is SQLite at retaining data integrity and avoiding data corruption, compared to say, flat text files?

If you were to use SQLite within conventional means the answer is very. SQLite does provide repair tools for when such mishap occurs.

Re: How SQLite is tested

#52

Over a decade ago, the maintainer of SQLite gave a talk at OSCON about their testing practices. One concept that stood out to me was the power of checklists, the same tool pilots rely on before every flight. He also mentioned Doctors Without Borders, who weren't seeing the outcomes they expected when it came to saving lives. One surprising reason? The medical teams often didn't speak the same language or even know ea…

I highly recommend The Checklist Manifesto [1] for a excellent guide on how to construct good checklists.

[1] https://atulgawande.com/book/the-checklist-manifesto/

Re: How SQLite is tested

#54

Earlier quoted context omitted.

Overengineering is building a bridge that will stand 1000 years when 100 will do; it's excess rigor for marginal benefit. Juicero wasn't overengineering, it was building a crappy bridge to nowhere with a bunch of gaudy bells and whistles to try and hide its uselessness and poor design, that collapsed with the first people to walk over it

Have you looked at a Juicero teardown [0]? It's overengineered to the point where it's a genuinely astonishing bit of engineering art. It's also an incredibly stupid product. Those things are completely compatible. [0] https://blog.bolt.io/juicero/

Idk, it looks like most of what this person is complaining is that they don't see a lot of this in high volume consumer products. But like, most high volume comsumer products don't have to crank nearly the same amount of torque either.

It's a silly product, but as far as being over engineered, it looks like it's about what I'd expect for those requirements.

Re: How SQLite is tested

#55
I love SQLite's quality and their docs explaining this kind of things. However, not all parts of SQLite have the same level of quality. I was very disappointed when I found bugs related to its JSON functions (and several other similar bugs related to other features):

SQLite supports a set of JSON functions that let you query and index JSON columns directly, which looks very convenient—but be careful:

1. `json('{"a/b": 1}') != json('{"a\/b": 1}')`

Although the two objects are identical in terms of JSON semantics, SQLite treats them as different.

2. `json_extract('{"a\/b": 1}', '$.a/b') is null`, `json_extract('{"\u0031":1}', '$.1') is null`, `json_extract('{"\u6211":1}', '$.我') is null`

This issue only exists in older versions of SQLite; the latest versions have fixed it.

In many cases you can't control how your JSON library escapes characters. For example, `/` doesn’t need to be escaped, but some libraries will escape it as `\/`. So this is a rather nasty pitfall, you can end up failing to match keys during extraction with seemingly no reason.

Re: How SQLite is tested

#56

Over a decade ago, the maintainer of SQLite gave a talk at OSCON about their testing practices. One concept that stood out to me was the power of checklists, the same tool pilots rely on before every flight. He also mentioned Doctors Without Borders, who weren't seeing the outcomes they expected when it came to saving lives. One surprising reason? The medical teams often didn't speak the same language or even know ea…

On the other hand, I think this narrative also causes a lot of useless red tape. There might be some survivorship bias here.

Aviation, Doctors Without Borders, and SQLite have good checklists. Checklists are simple, so it's easy to think "oh I could do that too". But you never hear about the probably endless companies and organizations that employ worthless checklists that do nothing but waste people's time.

I wish there was more talk about what makes a checklist good or bad. I suspect it's kind of like mathematics where the good formulas look very simple but are very hard to discover without prior knowledge.

Re: How SQLite is tested

#57
> The TH3 test harness is a set of proprietary tests [...]

> The dbsqlfuzz engine is a proprietary fuzz tester.

It's interesting that an open-source (actually public domain) software uses some proprietary tests. It never occurred to me that this was a possibility, though in retrospective it's obviously possible as long as the tests are not part of the release.

Could this be an alternative business model for "almost-open-source" projects? Similar to open-core, but in this case the project would easy to copy (open features), hard to modify (closed tests).

Re: How SQLite is tested

#58

Over a decade ago, the maintainer of SQLite gave a talk at OSCON about their testing practices. One concept that stood out to me was the power of checklists, the same tool pilots rely on before every flight. He also mentioned Doctors Without Borders, who weren't seeing the outcomes they expected when it came to saving lives. One surprising reason? The medical teams often didn't speak the same language or even know ea…

I highly recommend The Checklist Manifesto [1] for a excellent guide on how to construct good checklists. [1] https://atulgawande.com/book/the-checklist-manifesto/

While I certainly found it insightful, I felt like this book (like so many in the genre) was a pamphlet's worth of material inflated to fill about 250 pages.

Re: How SQLite is tested

#59

Earlier quoted context omitted.

Have you looked at a Juicero teardown [0]? It's overengineered to the point where it's a genuinely astonishing bit of engineering art. It's also an incredibly stupid product. Those things are completely compatible. [0] https://blog.bolt.io/juicero/

Idk, it looks like most of what this person is complaining is that they don't see a lot of this in high volume consumer products. But like, most high volume comsumer products don't have to crank nearly the same amount of torque either. It's a silly product, but as far as being over engineered, it looks like it's about what I'd expect for those requirements.

Have you ever changed a tyre on a car?

If so, you may have noticed the jack you used didn't have several huge CNC machined aluminium parts, a seven-stage all-metal geartrain, or a 330v power supply and it probably didn't cost you $700. Probably it cost more like $40.

And sure, a consumer kitchen product needs to look presentable and you don't want trapping points for curious little fingers. But even given that, you could deliver a product that worked just as well for just as long at a far lower BOM cost.

Re: How SQLite is tested

#60

Earlier quoted context omitted.

Have you looked at a Juicero teardown [0]? It's overengineered to the point where it's a genuinely astonishing bit of engineering art. It's also an incredibly stupid product. Those things are completely compatible. [0] https://blog.bolt.io/juicero/

Idk, it looks like most of what this person is complaining is that they don't see a lot of this in high volume consumer products. But like, most high volume comsumer products don't have to crank nearly the same amount of torque either. It's a silly product, but as far as being over engineered, it looks like it's about what I'd expect for those requirements.

Something is overengineered for the actual problem even if it's necessary to meet the requirements, if the requirements are themselves unnecessary. Imagine speccing a 100m span to cross a small stream. The resulting bridge can reasonably be called overengineered.

You can achieve the same goal (getting juice from diced fruit without cleanup) much easier with different requirements. The post mentions that.

Post reply on HN