How SQLite is tested
sqlite.org
sqlite.org
I jumped through a lot of hoops to get to the point where I got a backtrace that showed me the SQL statement of a corrupted places.sqlite. I then loaded SQLite on the data file, ran the statement and reproduced the segfault. One of their lead devs then got in contact with me, grabbed the data file and fixed the issue.
I suspect that not only did my diagnosis lead to a fix for a LOT of Firefox crashes, but it stopped a lot of frustrating crashes on things like iPhones, etc :-)
I may not have done the fix, but I took the time to reproduce the problem. It felt damn good :-)
P.S. in case anyone is interested, the bug is https://bugzilla.mozilla.org/show_bug.cgi?id=581946 on Mozilla, and at SQLite it's at http://www.sqlite.org/src/ci/83395a3d24
I only found the bug, never quite understood it, and after seeing how disturbing the fix was decided some things were best left unlearned. http://www2.sqlite.org/cgi/src/fdiff?v1=fa113d624d38bcb36700...
That said, sqlite is one of the most reliable and better designed libraries I've used. Software is hard.
Very successful invisible (to non-developers) software.
zlib or libjepg, maybe.
I don't know to what extent the code of the BSD stack remains in Windows but you can bet even if a raw build of Windows doesn't have SQLite embedded somewhere within it (which it might well do) that there are probably multiple software installations with it embedded somewhere.
Would you actually describe the BSD networking code as being deployed in Linux even? I know it is derived from the BSD stack but is it really still the same software.
Zlib and libjpeg as someone else suggests are good suggestions and at least in the races with SQLite.
Whenever a bug is reported against SQLite, that bug is not considered fixed until new test cases have been added to the TCL test suite which would exhibit the bug in an unpatched version of SQLite. Over the years, this has resulted in thousands and thousands of new tests being added to the TCL test suite. These regression tests ensure that bugs that have been fixed in the past are not reintroduced into future versions of SQLite.
1. Find/identify/isolate the bug;
2. Create a test that fails if the bug is not fixed;
3. Run the test to make sure it detects the bug;
4. Fix the bug;
5. Run the test to make sure it passes now that the bug is fixed;
6. Add the test to the test suite and checkin/push the bugfix.
I don't always get to do this on my projects, but it's a good habit to get into. Having a good/easy to use test framework already setup can help a lot with this (if tests are hard to write/take too much time, they won't be written).
1. Find/identify/isolate the bug;
2. Fix the bug;
3. Create a test that fails if the bug is not fixed;
4. Run the test to make sure it passes now that the bug is fixed;
5. Revert the fix and run the test to make sure it detects the bug;
6. Add the test to the test suite and checkin/push the bugfix.
I prefer this order because if I make a mistake in step 1 I usually realize it in step 2, where I feel like you might not realize it until step 4. I'd be curious to know if there are advantages you know of to the order in which you do it.
The advantage, to me, is that you focus on the behavior of the application rather than the code. I have a tendency to get off-track when I'm coding and I'll start on refactors that, in hindsight, were a terrible idea.
By forcing myself to be sure that the feature/bug is something I really want, I stay on-track because that damned test keeps failing and I just want to make it go green! By writing the test beforehand, I can be sure that it's what I really want and not just what's easy to code.
That said, both ways work and I sometimes switch to an approach like yours.
Very much the same for me; I'm much like Lenny from "Memento" at times ("now what was I doing?"); add to this that reproducing the bug is essentially what you are doing by writing a regression test for it. Also it falls in line with TDD as applied to maintenance (keep coding until all the tests pass). One last thing: it's kind of a wash with VC these days (and reverting, as the GP said), but if you fix the bug first, are you certain your test is catching it? I like to have a piece of code that I can say "yes, when I do this, my code fails; now to fix it."
Because SQLite was designed for testability. No "techniques or tools" will help when the application isn't created with testability in mind from the outset.
Btw, the very same day he persuaded me to move to Fossil.
Edit: just to be clear, you should see it for all the good ideas he's explaining. Not for some marketing of a piece o of software.
It annoys me, because neither PostGres not MySql are a binary file you can just run with a query, unlike SQLite which is very convenient for embedding in a desktop app.
So, all in all...somewhat expected. I have a number of queries that simply cannot run in their most naive rendering on Postgres due to lack of skip scan.
A presentation from the Opus audio codec developers ( http://www.ietf.org/proceedings/82/slides/codec-4.pdf ) opened my eyes to just how many overlapping approaches you can use. In addition to listing a dizzying array of software tests (similar to the SQLite article), the Opus presentation summarizes the strengths and weaknesses of each approach, which is great for understanding when each approach is appropriate to use.
I known official Mozilla arguments. Which are quite week IMHO.
Is this was MS job? They where afraid that browser apps will make desktop apps obsolete?
http://h30499.www3.hp.com/t5/Following-the-Wh1t3-Rabbit-Down...