From 304ec7751bd39ff6d54862c2cd10958ef90123ff Mon Sep 17 00:00:00 2001 From: Jens Tirsvad Nielsen Date: Fri, 9 Oct 2026 11:26:58 +0800 Subject: [PATCH 1/2] Add DRY, dependency and SOLID criteria to the code checklists (MIL-009 task 5) New criteria, appended after the existing ones (nothing renumbered or changed): - DRY in all five qc-programming-* checklists (python, c, cpp, csharp, shell) - dependency rule in all but shell (imports, includes or references point inward, no cycles; in C also one responsibility per module) - SOLID in python, cpp and csharp - qc-dcd.md criterion 9: dependencies between classes and packages point inward (cycles stay with criterion 8) Each is tagged with an ISO/IEC 25010 characteristic, and the criterion Notes name the rule in the framework's coding-conventions skill, which defines it once. Each checklist has a new Proposed Version History row for S02, who accepts coding-standard changes. Common Defects gain a bullet per criterion. --- qc-dcd.md | 3 +++ qc-programming-c.md | 6 ++++++ qc-programming-cpp.md | 7 +++++++ qc-programming-csharp.md | 7 +++++++ qc-programming-python.md | 7 +++++++ qc-programming-shell.md | 3 +++ 6 files changed, 33 insertions(+) diff --git a/qc-dcd.md b/qc-dcd.md index 91d8f14..29c7f82 100644 --- a/qc-dcd.md +++ b/qc-dcd.md @@ -11,6 +11,7 @@ | Date | Status | Author | Reviewer | Change | Commit | | --- | --- | --- | --- | --- | --- | | 2026-10-01 | Accepted | Jens Tirsvad Nielsen | S07 | First public release (1.0.0) | — | +| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criterion 9 (dependency direction) | pending | --- @@ -32,6 +33,7 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio | 6 | Method signatures are traceable to Operation Contracts and/or design Sequence Diagrams | Mandatory | Functional Suitability, Maintainability | Prevents drift between design layers | | 7 | Class names and structure remain consistent with the Domain Model concepts they refine | Mandatory | Maintainability, Compatibility | Design classes should not silently rename or drop domain concepts | | 8 | No circular dependencies between classes/packages unless explicitly justified | Optional | Maintainability, Reliability | Circular coupling harms testability and portability | +| 9 | Dependencies between classes and packages point inward: domain classes do not depend on infrastructure, delivery or framework classes | Mandatory | Maintainability, Portability | Business rules must be buildable and testable without the outer layers; cycles are criterion 8 | ## Common Defects @@ -40,6 +42,7 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio - Composition used where the parts do not share the whole's lifecycle (or vice versa) - Method signatures that don't match any Operation Contract or Sequence Diagram message - Unannotated or inconsistently applied design patterns +- Domain classes that depend on persistence, user-interface or framework classes ## Traceability Rule diff --git a/qc-programming-c.md b/qc-programming-c.md index 213d527..1d53ba2 100644 --- a/qc-programming-c.md +++ b/qc-programming-c.md @@ -11,6 +11,7 @@ | Date | Status | Author | Reviewer | Change | Commit | | --- | --- | --- | --- | --- | --- | | 2026-10-01 | Accepted | Jens Tirsvad Nielsen | S07 | First public release (1.0.0) | — | +| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criteria 14 to 15 (DRY and dependency rule) | pending | --- @@ -37,6 +38,8 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio | 11 | Error reporting (status codes, `errno` use) is documented in the header | Optional | Usability, Reliability | | | 12 | Tests cover new behaviour and run under address and undefined-behaviour sanitizers in at least one build | Optional | Reliability, Security | | | 13 | Modules and functions trace to the Design Class Diagram or design artifact they implement | Mandatory | Functional Suitability, Maintainability | | +| 14 | Each piece of knowledge (a business rule, constant, format, validation or query) is defined in one place; code is merged only where it expresses the same knowledge, not where it merely looks alike | Mandatory | Maintainability | Modularity, Reusability. Rule: `coding-conventions` skill, “State each piece of knowledge once” | +| 15 | Includes point inward: business-rule modules include no I/O, platform or UI headers, the include graph has no cycles, and a module has one responsibility (rules are not mixed with I/O) | Mandatory | Maintainability, Portability | Modularity, Portability. Rule: `coding-conventions` skill, “Dependencies point inward” | ## Common Defects @@ -47,6 +50,9 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio - Macros doing the work of `static inline` functions or `enum` - Identifiers starting with an underscore and an uppercase letter - Undefined behaviour hidden by a build that happens to work +- The same rule, constant or table written in two modules +- A business-rule module that includes a platform, I/O or UI header, or modules that include each other +- A module that mixes business rules with file or device access ## Traceability Rule diff --git a/qc-programming-cpp.md b/qc-programming-cpp.md index 009259d..1b3316f 100644 --- a/qc-programming-cpp.md +++ b/qc-programming-cpp.md @@ -11,6 +11,7 @@ | Date | Status | Author | Reviewer | Change | Commit | | --- | --- | --- | --- | --- | --- | | 2026-10-01 | Accepted | Jens Tirsvad Nielsen | S07 | First public release (1.0.0) | — | +| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criteria 14 to 16 (DRY, dependency rule and SOLID) | pending | --- @@ -37,6 +38,9 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio | 11 | Static analysis with the Core Guidelines checks is clean, or each suppression is justified | Optional | Reliability, Maintainability | | | 12 | Tests cover new behaviour and run under address and undefined-behaviour sanitizers in at least one build | Optional | Reliability, Security | | | 13 | Classes and operations trace to the Design Class Diagram they implement; deviations are recorded | Mandatory | Functional Suitability, Maintainability | | +| 14 | Each piece of knowledge (a business rule, constant, format, validation or query) is defined in one place; code is merged only where it expresses the same knowledge, not where it merely looks alike | Mandatory | Maintainability | Modularity, Reusability. Rule: `coding-conventions` skill, “State each piece of knowledge once” | +| 15 | Includes and link dependencies point inward: business-rule code includes no I/O, platform, UI or framework headers, and the include graph has no cycles | Mandatory | Maintainability, Portability | Modularity, Portability. Rule: `coding-conventions` skill, “Dependencies point inward” | +| 16 | SOLID holds: a class has one reason to change; new behaviour is added by a new derived type, not by editing a type switch in several places; derived classes honour the contract of their base (`override`); abstract interfaces are narrow; high-level code depends on abstract types and receives its implementations | Mandatory | Maintainability | Single responsibility is the most commonly violated. Rule: `coding-conventions` skill, “SOLID” | ## Common Defects @@ -47,6 +51,9 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio - Macros for constants or small functions - Returning a reference or view to a local or temporary - Exceptions and error codes mixed in the same module without a stated rule +- The same rule, constant or validation written in two places, or two functions merged because they look alike although they change for different reasons +- Business-rule code that includes a framework, platform or database header +- A class with several unrelated responsibilities, or a `switch` on a type code repeated in several places ## Traceability Rule diff --git a/qc-programming-csharp.md b/qc-programming-csharp.md index 3f19157..2c149cb 100644 --- a/qc-programming-csharp.md +++ b/qc-programming-csharp.md @@ -11,6 +11,7 @@ | Date | Status | Author | Reviewer | Change | Commit | | --- | --- | --- | --- | --- | --- | | 2026-10-01 | Accepted | Jens Tirsvad Nielsen | S07 | First public release (1.0.0) | — | +| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criteria 14 to 16 (DRY, dependency rule and SOLID) | pending | --- @@ -37,6 +38,9 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio | 11 | Public async APIs accept and pass a `CancellationToken` where the operation can be cancelled | Optional | Performance Efficiency, Reliability | | | 12 | Tests cover new behaviour, are named `Method_Condition_Expected`, and do not depend on order, time or the network | Mandatory | Reliability, Maintainability | | | 13 | Classes and members trace to the Design Class Diagram they implement; deviations are recorded | Mandatory | Functional Suitability, Maintainability | | +| 14 | Each piece of knowledge (a business rule, constant, format, validation or query) is defined in one place; code is merged only where it expresses the same knowledge, not where it merely looks alike | Mandatory | Maintainability | Modularity, Reusability. Rule: `coding-conventions` skill, “State each piece of knowledge once” | +| 15 | Namespace and project references point inward: business-rule code references no framework, database, UI or delivery-mechanism code, and there are no reference cycles | Mandatory | Maintainability, Portability | Modularity, Portability. Rule: `coding-conventions` skill, “Dependencies point inward” | +| 16 | SOLID holds: a class has one reason to change; new behaviour is added by extension, not by editing a type test in several places; subtypes honour the contract of their base; interfaces are narrow; high-level code depends on interfaces and receives its implementations by injection | Mandatory | Maintainability | Single responsibility is the most commonly violated. Rule: `coding-conventions` skill, “SOLID” | ## Common Defects @@ -47,6 +51,9 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio - Undisposed `HttpClient`, streams or database connections - `DateTime` used for instants, or `double` for money - Several public types in one file, or a file name that differs from its type +- The same rule, constant or validation written in two places, or two methods merged because they look alike although they change for different reasons +- Business-rule code that references the ORM, the web framework or a database driver +- A class with several unrelated responsibilities, or `is`/`switch` type tests repeated in several places ## Traceability Rule diff --git a/qc-programming-python.md b/qc-programming-python.md index f379239..15efe63 100644 --- a/qc-programming-python.md +++ b/qc-programming-python.md @@ -11,6 +11,7 @@ | Date | Status | Author | Reviewer | Change | Commit | | --- | --- | --- | --- | --- | --- | | 2026-10-01 | Accepted | Jens Tirsvad Nielsen | S07 | First public release (1.0.0) | — | +| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criteria 14 to 16 (DRY, dependency rule and SOLID) | pending | --- @@ -37,6 +38,9 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio | 11 | Tests exist for new behaviour, are named for the behaviour, and do not depend on order or the network | Mandatory | Reliability, Maintainability | | | 12 | Type checker runs in strict mode without errors; `Any` is justified in a comment | Optional | Reliability, Maintainability | | | 13 | Dependencies are declared and pinned in the project's dependency file, none unused | Optional | Portability, Security | | +| 14 | Each piece of knowledge (a business rule, constant, format, validation or query) is defined in one place; code is merged only where it expresses the same knowledge, not where it merely looks alike | Mandatory | Maintainability | Modularity, Reusability. Rule: `coding-conventions` skill, “State each piece of knowledge once” | +| 15 | Imports point inward: business-rule modules import no framework, database, UI or delivery-mechanism code, and there are no import cycles | Mandatory | Maintainability, Portability | Modularity, Portability. Rule: `coding-conventions` skill, “Dependencies point inward” | +| 16 | SOLID holds: a class or module has one reason to change; new behaviour is added by extension, not by editing a type test in several places; subclasses honour the contract of their base; protocols are narrow; high-level code depends on protocols or abstract types and receives its implementations | Mandatory | Maintainability | Single responsibility is the most commonly violated. Rule: `coding-conventions` skill, “SOLID” | ## Common Defects @@ -47,6 +51,9 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio - `print` used for diagnostics; wildcard imports - Code reformatted by hand, or an unrelated reformat mixed into a functional change - Classes or methods that appear in no design artifact and have no stated reason +- The same rule, constant or validation written in two modules, or two functions merged because they look alike although they change for different reasons +- Business-rule modules importing the ORM, the web framework or a database driver +- A class with several unrelated responsibilities, or an `isinstance` chain repeated in several places ## Traceability Rule diff --git a/qc-programming-shell.md b/qc-programming-shell.md index 4184717..4069ac8 100644 --- a/qc-programming-shell.md +++ b/qc-programming-shell.md @@ -10,6 +10,7 @@ | Date | Status | Author | Reviewer | Change | Commit | | --- | --- | --- | --- | --- | --- | | 2026-10-02 | Accepted | Jens Tirsvad Nielsen | S07 | Initial version | — | +| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criterion 15 (DRY) | pending | --- @@ -37,6 +38,7 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio | 12 | Formatted with `shfmt` (or the project's formatter) | Optional | Maintainability | | | 13 | Safe to re-run: a second run does not duplicate or corrupt what the first did | Optional | Reliability | | | 14 | Bash version and external tools it needs are stated; GNU-only options are named | Optional | Portability | | +| 15 | A command sequence, constant, path or message used more than once is defined once (a function, a variable or a sourced helper); a helper is shared between scripts only where it expresses the same knowledge | Mandatory | Maintainability | Modularity, Reusability. Rule: `coding-conventions` skill, “State each piece of knowledge once” | ## Common Defects @@ -47,6 +49,7 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio - A token echoed to the terminal or kept in the script - No usage message, so a wrong call fails with a cryptic error - A script that implements nothing in any task or design +- The same path, option list or message pasted into several places in one script, or copied between scripts ## Traceability Rule -- 2.54.0 From 7b91f649ada7c8559e54bd0a726e7c9e15b7ab14 Mon Sep 17 00:00:00 2001 From: Jens Tirsvad Nielsen Date: Fri, 9 Oct 2026 11:26:59 +0800 Subject: [PATCH 2/2] Resolve pending commit links in Version History (code checklists) --- qc-dcd.md | 3 ++- qc-programming-c.md | 3 ++- qc-programming-cpp.md | 3 ++- qc-programming-csharp.md | 3 ++- qc-programming-python.md | 3 ++- qc-programming-shell.md | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/qc-dcd.md b/qc-dcd.md index 29c7f82..14bca2a 100644 --- a/qc-dcd.md +++ b/qc-dcd.md @@ -11,7 +11,7 @@ | Date | Status | Author | Reviewer | Change | Commit | | --- | --- | --- | --- | --- | --- | | 2026-10-01 | Accepted | Jens Tirsvad Nielsen | S07 | First public release (1.0.0) | — | -| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criterion 9 (dependency direction) | pending | +| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criterion 9 (dependency direction) | [304ec77] | --- @@ -58,3 +58,4 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio [QC-CL-001]: ./qc-programming-c.md [QC-CPP-001]: ./qc-programming-cpp.md [QC-CS-001]: ./qc-programming-csharp.md +[304ec77]: https://git.tirsystem.com/TirSystem/SQA-QC-Checklists/commit/304ec7751bd39ff6d54862c2cd10958ef90123ff diff --git a/qc-programming-c.md b/qc-programming-c.md index 1d53ba2..ce48733 100644 --- a/qc-programming-c.md +++ b/qc-programming-c.md @@ -11,7 +11,7 @@ | Date | Status | Author | Reviewer | Change | Commit | | --- | --- | --- | --- | --- | --- | | 2026-10-01 | Accepted | Jens Tirsvad Nielsen | S07 | First public release (1.0.0) | — | -| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criteria 14 to 15 (DRY and dependency rule) | pending | +| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criteria 14 to 15 (DRY and dependency rule) | [304ec77] | --- @@ -63,3 +63,4 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio [QC-DCD-001]: ./qc-dcd.md [QC-ADR-001]: ./qc-adr.md +[304ec77]: https://git.tirsystem.com/TirSystem/SQA-QC-Checklists/commit/304ec7751bd39ff6d54862c2cd10958ef90123ff diff --git a/qc-programming-cpp.md b/qc-programming-cpp.md index 1b3316f..da00fb0 100644 --- a/qc-programming-cpp.md +++ b/qc-programming-cpp.md @@ -11,7 +11,7 @@ | Date | Status | Author | Reviewer | Change | Commit | | --- | --- | --- | --- | --- | --- | | 2026-10-01 | Accepted | Jens Tirsvad Nielsen | S07 | First public release (1.0.0) | — | -| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criteria 14 to 16 (DRY, dependency rule and SOLID) | pending | +| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criteria 14 to 16 (DRY, dependency rule and SOLID) | [304ec77] | --- @@ -64,3 +64,4 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio [QC-DCD-001]: ./qc-dcd.md [QC-ADR-001]: ./qc-adr.md +[304ec77]: https://git.tirsystem.com/TirSystem/SQA-QC-Checklists/commit/304ec7751bd39ff6d54862c2cd10958ef90123ff diff --git a/qc-programming-csharp.md b/qc-programming-csharp.md index 2c149cb..d3ff333 100644 --- a/qc-programming-csharp.md +++ b/qc-programming-csharp.md @@ -11,7 +11,7 @@ | Date | Status | Author | Reviewer | Change | Commit | | --- | --- | --- | --- | --- | --- | | 2026-10-01 | Accepted | Jens Tirsvad Nielsen | S07 | First public release (1.0.0) | — | -| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criteria 14 to 16 (DRY, dependency rule and SOLID) | pending | +| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criteria 14 to 16 (DRY, dependency rule and SOLID) | [304ec77] | --- @@ -64,3 +64,4 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio [QC-DCD-001]: ./qc-dcd.md [QC-ADR-001]: ./qc-adr.md +[304ec77]: https://git.tirsystem.com/TirSystem/SQA-QC-Checklists/commit/304ec7751bd39ff6d54862c2cd10958ef90123ff diff --git a/qc-programming-python.md b/qc-programming-python.md index 15efe63..abaf357 100644 --- a/qc-programming-python.md +++ b/qc-programming-python.md @@ -11,7 +11,7 @@ | Date | Status | Author | Reviewer | Change | Commit | | --- | --- | --- | --- | --- | --- | | 2026-10-01 | Accepted | Jens Tirsvad Nielsen | S07 | First public release (1.0.0) | — | -| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criteria 14 to 16 (DRY, dependency rule and SOLID) | pending | +| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criteria 14 to 16 (DRY, dependency rule and SOLID) | [304ec77] | --- @@ -64,3 +64,4 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio [QC-DCD-001]: ./qc-dcd.md [QC-ADR-001]: ./qc-adr.md +[304ec77]: https://git.tirsystem.com/TirSystem/SQA-QC-Checklists/commit/304ec7751bd39ff6d54862c2cd10958ef90123ff diff --git a/qc-programming-shell.md b/qc-programming-shell.md index 4069ac8..18ac8f6 100644 --- a/qc-programming-shell.md +++ b/qc-programming-shell.md @@ -10,7 +10,7 @@ | Date | Status | Author | Reviewer | Change | Commit | | --- | --- | --- | --- | --- | --- | | 2026-10-02 | Accepted | Jens Tirsvad Nielsen | S07 | Initial version | — | -| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criterion 15 (DRY) | pending | +| 2026-10-09 | Proposed | Jens Tirsvad Nielsen | S02 | Added criterion 15 (DRY) | [304ec77] | --- @@ -60,3 +60,4 @@ Level: **Mandatory** criteria are the baseline every instance must meet; **Optio [QC-DCD-001]: ./qc-dcd.md [QC-ADR-001]: ./qc-adr.md +[304ec77]: https://git.tirsystem.com/TirSystem/SQA-QC-Checklists/commit/304ec7751bd39ff6d54862c2cd10958ef90123ff -- 2.54.0