Editing
Test Traceability Matrix
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== 4. Test Case Catalogue == Each test case below is a planning entry. Fields marked <code>[TBD]</code> must be completed when the test is implemented. ----- <span id="tc-ut-001-sieve-known-prime-confirmation"></span> === TC-UT-001 β Sieve: known prime confirmation === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-UT-001 |- | Level | Unit |- | Program under test | primesgen (r80-test-number logic) |- | Requirements covered | FR-02 |- | Description | Verify that known prime numbers are correctly identified. |- | Pre-conditions | A test harness that can call primesgen with a synthetic primes-session and a stub primes DAL returning pre-set dividers. Prime 2 pre-seeded in stub. |- | Test data | Candidates: 3, 5, 7, 11, 13, 17, 19 (all prime). Stub DAL returns pre-calculated divisors. |- | Expected result | Each candidate is written (r85-write-prime called) exactly once for each prime. No composite candidate is written. |- | Status | Planned |- | Defects linked | β |} ----- <span id="tc-ut-002-sieve-known-composite-rejection"></span> === TC-UT-002 β Sieve: known composite rejection === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-UT-002 |- | Level | Unit |- | Program under test | primesgen |- | Requirements covered | FR-02 |- | Description | Verify that known composite numbers are not written as primes. |- | Pre-conditions | Same harness as TC-UT-001. |- | Test data | Candidates: 4, 6, 8, 9, 10, 15, 21, 25, 49. |- | Expected result | r85-write-prime is never called for any of these candidates. |- | Status | Planned |- | Defects linked | β |} ----- <span id="tc-ut-003-ui-six-per-line-accumulation"></span> === TC-UT-003 β UI: six-per-line accumulation === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-UT-003 |- | Level | Unit |- | Program under test | primesui |- | Requirements covered | FR-04 |- | Description | Verify that exactly 6 prime entries are accumulated before a line is written to the print file. |- | Pre-conditions | Call primesui with ui-methods=βstartβ; then call with ui-methods=βwriteβ seven times. Inspect file after calls 6 and 7. |- | Test data | u-sequence = 1β7; u-number = 2, 3, 5, 7, 11, 13, 17. |- | Expected result | One line written after 6th entry. File buffer reset. 7th entry starts a new accumulation cycle. |- | Status | Planned |- | Defects linked | β |} ----- <span id="tc-ut-004-ui-print-file-cannot-be-opened"></span> === TC-UT-004 β UI: print file cannot be opened === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-UT-004 |- | Level | Unit |- | Program under test | primesui |- | Requirements covered | FR-06 |- | Description | Verify that primesui returns ui-method-result = 1 when the print file cannot be created (e.g.Β directory is read-only). |- | Pre-conditions | Set up a read-only target directory so <code>primes.prt</code> cannot be created. |- | Test data | Call primesui with ui-methods=βstartβ. |- | Expected result | ui-method-result = 1; error status displayed on console; no abort/crash. |- | Status | Planned |- | Defects linked | β |} ----- <span id="tc-ut-005-dal-database-connection-failure"></span> === TC-UT-005 β DAL: database connection failure === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-UT-005 |- | Level | Unit |- | Program under test | primes (DAL) |- | Requirements covered | FR-06 |- | Description | Verify that primes returns dal-result = 1 and logs a message when the database is unreachable. |- | Pre-conditions | PostgreSQL not running, or DATASRC points to an invalid host. |- | Test data | CALL primes USING primes-dal with dal-methods=βconnectβ. |- | Expected result | dal-result = 1; SQLCODE β 0; error message on console; no crash. |- | Status | Planned |- | Defects linked | β |} ----- <span id="tc-it-001-generation-integration-first-100-primes"></span> === TC-IT-001 β Generation integration: first 100 primes === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-IT-001 |- | Level | Integration |- | Programs under test | primesgen + primes (DAL) |- | Requirements covered | FR-01, FR-02 |- | Description | Run the full generate path for the first 100 primes (up to 541). Verify correctness of results in the database. |- | Pre-conditions | Database reset (<code>reset-primes.sql</code>). Prime 2 manually inserted. PostgreSQL running. primesui replaced with a stub that accepts βwriteβ calls silently. |- | Test data | Generate until test-number > 541. |- | Expected result | <code>SELECT prime FROM primes.primes ORDER BY ident</code> returns exactly the first 100 primes: 2, 3, 5, 7, 11, β¦ 541. |- | Pass criteria | 100 rows; each row is a known prime; no duplicates; sequence matches insertion order. |- | Status | Planned |- | Defects linked | D-01 (generate loop commented out in primesmain β this test bypasses primesmain and calls primesgen directly) |} ----- <span id="tc-it-002-report-integration-all-primes-from-database"></span> === TC-IT-002 β Report integration: all primes from database === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-IT-002 |- | Level | Integration |- | Programs under test | primesgen + primes (DAL) + primesui |- | Requirements covered | FR-03, FR-04 |- | Description | Seed 12 known primes in the database; run the report path; inspect <code>primes.prt</code>. |- | Pre-conditions | Database reset. Insert the first 12 primes (2 through 37) manually. |- | Test data | 12 primes β 2 data lines (6 per line); should produce one page with heading, 2 data lines, footing. |- | Expected result | <code>primes.prt</code> contains: heading line, column header line, data line 1 (primes 2β13), data line 2 (primes 17β37), footing line with page 1. |- | Status | Planned |- | Defects linked | β |} ----- <span id="tc-st-001-system-test-full-generate-run-first-1000-primes"></span> === TC-ST-001 β System test: full generate run (first 1,000 primes) === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-ST-001 |- | Level | System |- | Programs under test | All (primesmain β primesgen β primes + primesui) |- | Requirements covered | FR-01, FR-02, FR-05 |- | Description | Full end-to-end generate run via <code>primesmain generate</code>. |- | Pre-conditions | All programs compiled and linked. Database reset. Prime 2 seeded. Fix for D-01 (generate loop) applied or tested separately. |- | Expected result | Database contains the first 1,000 primes (2 through 7,919). Console log shows all lifecycle messages. Process exits without crash. |- | Status | Blocked β D-01 (generate loop commented out) |- | Defects linked | D-01 |} ----- <span id="tc-st-002-system-test-full-report-run"></span> === TC-ST-002 β System test: full report run === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-ST-002 |- | Level | System |- | Programs under test | All (primesmain β primesgen β primes + primesui) |- | Requirements covered | FR-03, FR-04, FR-05 |- | Description | Full end-to-end report run via <code>primesmain report</code> after TC-ST-001 has populated the database. |- | Pre-conditions | TC-ST-001 has run successfully; database contains at least 1,000 primes. |- | Expected result | <code>primes.prt</code> contains all primes in order; correct page headings and footings; last page flushed correctly. |- | Status | Planned |- | Defects linked | β |} ----- <span id="tc-st-003-system-test-bad-command-line-argument"></span> === TC-ST-003 β System test: bad command-line argument === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-ST-003 |- | Level | System |- | Programs under test | primesmain |- | Requirements covered | FR-06 |- | Description | Run <code>primesmain badarg</code>; verify graceful exit. |- | Pre-conditions | All programs compiled. |- | Expected result | Console message βBad parameter, program initialisation failed.β Process exits. No database connection attempted. |- | Status | Planned |- | Defects linked | β |} ----- <span id="tc-nft-001-performance-generation-throughput"></span> === TC-NFT-001 β Performance: generation throughput === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-NFT-001 |- | Level | Non-functional |- | Requirements covered | NFR-PERF-01 |- | Description | Time the generation of the first 10,000 primes; calculate primes-per-second. |- | Pass criteria | β₯ 1,000 primes/second. |- | Status | Planned β requires D-01 fix and index on <code>ident</code> (NFR-PERF-03) |} ----- <span id="tc-nft-002-performance-divider-lookup-query-plan"></span> === TC-NFT-002 β Performance: divider lookup query plan === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-NFT-002 |- | Level | Non-functional |- | Requirements covered | NFR-PERF-03 |- | Description | Run EXPLAIN ANALYZE on <code>SELECT prime FROM primes.primes WHERE ident = 500</code> with 1,000 rows in the table. |- | Pass criteria | Query plan shows Index Scan; execution time < 50 ms. |- | Status | Planned β likely to fail until index on <code>ident</code> is added |} ----- <span id="tc-nft-003-reliability-graceful-db-failure-mid-run"></span> === TC-NFT-003 β Reliability: graceful DB failure mid-run === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-NFT-003 |- | Level | Non-functional |- | Requirements covered | NFR-REL-02 |- | Description | Kill the PostgreSQL process during a report run; verify clean exit and no zombie connections. |- | Pass criteria | Program logs an error and exits; <code>primes.prt</code> is closed; no orphan DB connections. |- | Status | Planned |} ----- <span id="tc-nft-004-security-no-credentials-in-binary"></span> === TC-NFT-004 β Security: no credentials in binary === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-NFT-004 |- | Level | Non-functional |- | Requirements covered | NFR-SEC-01 |- | Description | Run <code>strings primes</code> (the compiled binary) and grep for the password string <code>pr1mes_user</code>. |- | Pass criteria | String not found in binary. |- | Status | Planned β expected to FAIL until ADR-006 remediation is applied |} ----- <span id="tc-nft-005-operability-non-zero-return-code-on-error"></span> === TC-NFT-005 β Operability: non-zero return code on error === {| !width="50%"| Field !width="50%"| Value |- | ID | TC-NFT-005 |- | Level | Non-functional |- | Requirements covered | NFR-OPER-02 |- | Description | Run <code>primesmain badarg</code>; check <code>echo $?</code>. |- | Pass criteria | Exit code β 0. |- | Status | Planned β expected to FAIL until <code>MOVE 1 TO RETURN-CODE</code> is added |} ----- <span id="defect-traceability"></span>
Summary:
Please note that all contributions to Webhuis wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
Project:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Voorpagina
Cobol and PostgreSQL
PostgreSQL
CFEngine
Proxmox
Webhuis Kennisbank
Basale infra
Webhuis bouwstenen
Webhuis configuratie
Webhuis Infra
Webhuis Support
Webhuis Raspberry
Opzet Applicaties
Business Applicaties
Community portal
Current events
Recent changes
Random page
Help
sitesupport
Tools
What links here
Related changes
Special pages
Page information