Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Tweaks to the testing documentation. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
3b5097e2555ca1006e165176251bb6d9 |
User & Date: | drh 2009-08-26 13:13:57.000 |
Context
2009-08-31
| ||
13:47 | Query planner documentation update. (check-in: d8db9f9b5c user: drh tags: trunk) | |
2009-08-26
| ||
13:13 | Tweaks to the testing documentation. (check-in: 3b5097e255 user: drh tags: trunk) | |
02:00 | Updates, clarifications, and typo fixes in the SQL language documentation. (check-in: 7b2b285803 user: drh tags: trunk) | |
Changes
Changes to pages/testing.in.
︙ | |||
54 55 56 57 58 59 60 61 62 63 64 65 66 67 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | + + | set stat(sltsNFile) 610 ;# Files of SLT test script # sloc md5.c slt_*.c sqllogictest.c set stat(sltcSLOC) 1307 ;# Non-comment lines of SLT C code # grep '^query' `fossil ls | awk '/\.test$/{print $2}'` | wc set stat(sltNTest) 7195024 ;# Number of test cases in SLT # grep 'assert(' sqlite3.c | wc set stat(nAssert) 2717 ;# Number of assert statements # grep 'testcase(' sqlite3.c | grep -v define | wc set stat(nTestcase) 535 ;# Number of testcase statements set stat(totalSLOC) [expr {$stat(tclcSLOC)+$stat(tclsSLOC)+ $stat(th3SLOC)+$stat(sltcSLOC)+$stat(sltsSLOC)}] proc GB {expr} { set n [uplevel #0 expr $expr] hd_puts [format %.2f [expr {$n/(1000.0*1000.0*1000.0)}]] |
︙ | |||
393 394 395 396 397 398 399 | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | - + | not possible to write cross-platform tests for those modules. Extensions such as FTS3 and RTree are also excluded from the analysis.</p> <h3>7.1 Statement versus branch coverage</h3> <p>There are many ways to measure test coverage. The most popular metric is "statement coverage". When you hear someone say that their |
︙ | |||
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 | 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 | + + + - + | macros that precede the if statement verify that both cases are tested:</p> <blockquote><pre> testcase( mask & SQLITE_OPEN_MAIN_DB ); testcase( mask & SQLITE_OPEN_TEMP_DB ); if( (mask & (SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_TEMP_DB))!=0 ){ ... } </pre></blockquote> <p>The SQLite source code contains <tcl>N {$stat(nTestcase)}</tcl> uses of the testcase() macro.</p> <tcl>hd_fragment {mcdc} {MC/DC}</tcl> <h3>7.4 Branch coverage versus MC/DC</h3> <p>Two methods of measuring test coverage were described above: "statement" and "branch" coverage. There are many other test coverage metrics besides these two. Another popular metric is "Modified Condition/Decision Coverage" or MC/DC. <a href="http://en.wikipedia.org/wiki/Modified_Condition/Decision_Coverage"> Wikipedia</a> defines MC/DC as follows:</p> <ul> <li> Each decision tries every possible outcome. <li> Each condition in a decision takes on every possible outcome. <li> Each entry and exit point is invoked. <li> Each condition in a decision is shown to independently affect the outcome of the decision. </ul> <p>In the C programming language |
︙ | |||
678 679 680 681 682 683 684 | 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 | - + | check for correctness. Static analysis consists mostly of making sure SQLite compiles without warnings, even when all warnings are enabled. SQLite is developed primarily using GCC and it does compile without warnings on GCC using the -Wall and -Wextra flags. There are occasional reports of warnings coming from VC++, however.</p> <p>Static analysis has not proven to be helpful in finding |
︙ |