Business Requirement Document

From Webhuis wiki
Jump to navigation Jump to search

Business Requirements Document[edit]

Field Value
Document ID PGCBL-BRD-001
Document Type Business Requirements Document
System pgcobol — Prime Numbers Application v1.0
Version 1.0
Status Approved
Owner Lead Developer
Author [reverse-engineered from source artifacts]
Reviewers — (pending)
Approved by — (pending)
Created 2026-03-17
Last modified 2026-03-17
Classification Internal
Parent document PGCBL-SAD-001 (Scope and Applicability)
Supersedes

Version History[edit]

Version Date Author Status Change Summary
0.1 2026-03-17 Draft Initial reverse-engineering baseline
1.0 2026-03-17 Approved Baselined



Table of Contents[edit]

  1. Purpose and Scope
  2. Assumptions and Dependencies
  3. Stakeholders
  4. Functional Requirements
  5. Non-Functional Requirements
  6. Constraints
  7. Out of Scope
  8. Related Documents
  9. Open Issues



1. Purpose and Scope[edit]

1.1 Purpose[edit]

This document defines what the pgcobol system must do from a business perspective. It is the primary input to all technical and design documents in the specification set. Any feature not described here is out of scope.

1.2 Scope[edit]

This document covers all externally observable behaviour of pgcobol v1.0: prime-number generation, database persistence, and printed report production.

1.3 Out of Scope[edit]

  • How the system achieves its requirements (that is PGCBL-TSD-001).
  • Internal program structure and algorithm details (PGCBL-PLG-001).
  • Non-functional quality attributes in detail (PGCBL-NFR-001).

1.4 Audience[edit]

Business analysts, QA engineers, and stakeholders who need to understand what the system does without needing to read COBOL.

1.5 Related Documents[edit]

Document ID Title Relationship
PGCBL-SAD-001 Scope and Applicability Navigation; defines document set
PGCBL-NFR-001 Non-Functional Requirements Complements this BRD with quality attributes
PGCBL-TSD-001 Technical Specification Implements requirements in this document
PGCBL-TTM-001 Test Traceability Matrix Maps each requirement here to a test case
PGCBL-ADD-001 Architecture Decision Records Documents why the design is as it is



2. Assumptions and Dependencies[edit]

See PGCBL-SAD-002 for the full register. Key items:

ID Item Type
A-01 Prime 2 is manually seeded in the DB before generation Assumption
A-02 DB is empty at the start of a generation run Assumption
DEP-03 PostgreSQL running on localhost:5432 Dependency
DEP-08 Prime 2 seeded before first generation Dependency



3. Stakeholders[edit]

Role Interest
System operator Runs generation and reporting jobs from the command line
Database administrator Owns the PostgreSQL schema; manages credentials and data
Report consumer Reads the formatted print file primes.prt



4. Functional Requirements[edit]

FR-01 — Prime Generation[edit]

  • The system shall accept a generate command-line argument to trigger prime-number generation.
  • The system shall test every odd integer from 3 upward for primality using trial division.
  • The system shall store each confirmed prime in the database in ascending order of discovery.
  • Generation shall continue until the candidate number reaches 999,999,999.

FR-02 — Trial-Division Algorithm Correctness[edit]

  • For each candidate number N, the system shall divide N by each known prime p where p ≤ √N.
  • If any p divides N exactly (remainder = 0), N is composite and shall not be stored.
  • If no p ≤ √N divides N, N is prime and shall be persisted.

FR-03 — Prime Reporting[edit]

  • The system shall accept a report command-line argument to trigger report generation.
  • The system shall read all stored primes from the database in sequence order.
  • The system shall write a paginated, formatted print file containing all primes.

FR-04 — Print Report Format[edit]

  • The report shall contain a page heading (“primes overview”) and column headers on each page.
  • Each data line shall display six prime entries side by side: sequence number and prime value.
  • Each page shall carry a page-number footing.
  • The print record width shall be 132 characters.
  • The report shall be written to a file named primes.prt.

FR-05 — Operational Logging[edit]

  • The system shall write progress and status messages to the system console throughout execution.
  • Each message shall identify the issuing program name and paragraph.

FR-06 — Error Handling[edit]

  • The system shall log an error message and stop cleanly if an unrecognised command-line argument is provided.
  • The system shall log an error message and stop cleanly if the print file cannot be opened.
  • The system shall log database connection or cursor failures and set an error indicator before exiting.



5. Non-Functional Requirements[edit]

Summary only — see PGCBL-NFR-001 for full specification.

ID Category Requirement
NFR-PERF-01 Performance ≥ 1,000 primes generated per second
NFR-REL-01 Reliability Batch runs to completion without manual intervention
NFR-SEC-01 Security No credentials in compiled binary
NFR-MAIN-01 Maintainability SQL only in primes.cbl; file I/O only in primesui.cbl
NFR-OPER-02 Operability Non-zero process return code on failure



6. Constraints[edit]

ID Constraint
C-01 Must run on Linux with GnuCOBOL 4.0
C-02 Must use PostgreSQL as the database
C-03 Upper generation limit: 999,999,999 (hard-coded)
C-04 Single-user batch execution only



7. Out of Scope[edit]

  • Interactive or web-based user interfaces.
  • Concurrent or distributed execution.
  • Generation of prime numbers by any algorithm other than trial division.
  • Any prime number below 2 or above 999,999,999.
  • Checkpoint/restart capability for interrupted generation runs.



8. Related Documents[edit]

As listed in §1.5.



9. Open Issues[edit]

ID Issue Owner Target Status
OI-01 FR-01: generate loop is commented out in current source — this is defect D-01. FR-01 is not fully met by the current code. Developer Open
OI-02 FR-06: the process does not return a non-zero exit code on error (NFR-OPER-02 gap). Developer Open

Terug naar: Design standards | Cobol and PostgreSQL