build(sdlc): seed data, figures and rendered package for 23/09 feedback
This commit is contained in:
@@ -206,7 +206,11 @@ export const TEST_CASES = [
|
||||
];
|
||||
export const tcByUnit = (unitId) => TEST_CASES.find((t) => t[1] === unitId)?.[0] ?? '';
|
||||
|
||||
/** Traceability: CR id -> { sr: [...], un: [...] }. The test case is the one owned by the first unit. */
|
||||
/**
|
||||
* Traceability: CR id -> { sr: [...], un: [...], ev? }.
|
||||
* Every unit brings its own test case. Requirements met by a delivered document or record
|
||||
* (manuals, training, SLA, quality evidence) name it in `ev`, with or without software units.
|
||||
*/
|
||||
export const TRACE = {
|
||||
'CR01:001': { sr: ['SR03:001', 'SR08:001'], un: ['UN01.001'] },
|
||||
'CR01:002': { sr: ['SR03:001', 'SR04:001', 'SR07:005'], un: ['UN01.002'] },
|
||||
@@ -261,43 +265,45 @@ export const TRACE = {
|
||||
'CR07:004': { sr: ['SR01:003'], un: ['UN13.001'] },
|
||||
'CR08:001': { sr: ['SR01:003'], un: ['UN13.004'] },
|
||||
'CR08:002': { sr: ['SR01:003'], un: ['UN13.004'] },
|
||||
'CR08:003': { sr: ['SR05:004'], un: ['UN11.002'] },
|
||||
'CR08:003': { sr: ['SR05:004'], un: [], ev: 'Product Operation Guide (การเฝ้าระวังระบบ)' },
|
||||
'CR08:004': { sr: ['SR04:003'], un: ['UN12.001'] },
|
||||
'CR08:005': { sr: ['SR05:002'], un: ['UN11.002'] },
|
||||
'CR09:001': { sr: ['SR02:003', 'SR02:004'], un: ['UN13.001'] },
|
||||
'CR09:001': { sr: ['SR02:003', 'SR02:004'], un: [], ev: 'Software Design (Software Unit), Software Components' },
|
||||
'CR09:002': { sr: ['SR01:005'], un: ['UN13.003'] },
|
||||
'CR09:003': { sr: ['SR01:001'], un: ['UN13.004'] },
|
||||
'CR09:003': { sr: ['SR01:001'], un: [], ev: 'Maintenance Document, Correction Register' },
|
||||
'CR09:004': { sr: ['SR08:005', 'SR08:004'], un: ['UN13.001'] },
|
||||
'CR10:001': { sr: ['SR01:003', 'SR08:005'], un: ['UN13.001'] },
|
||||
'CR10:002': { sr: ['SR02:005'], un: ['UN13.002'] },
|
||||
'CR10:003': { sr: ['SR01:005'], un: ['UN13.003'] },
|
||||
'CR10:004': { sr: ['SR01:001'], un: ['UN13.001'] },
|
||||
'CR11:001': { sr: ['SR01:001'], un: ['UN01.002'] },
|
||||
'CR11:002': { sr: ['SR01:001'], un: ['UN13.001'] },
|
||||
'CR11:003': { sr: ['SR01:001'], un: ['UN01.002'] },
|
||||
'CR11:004': { sr: ['SR01:001'], un: ['UN13.004'] },
|
||||
'CR10:004': { sr: ['SR01:001'], un: ['UN13.001', 'UN13.002'], ev: 'Product Operation Guide (ขั้นตอนติดตั้ง)' },
|
||||
'CR11:001': { sr: ['SR01:001'], un: [], ev: 'Software User Document (WP 8.0)' },
|
||||
'CR11:002': { sr: ['SR01:001'], un: [], ev: 'Product Operation Guide (WP 10.0)' },
|
||||
'CR11:003': { sr: ['SR01:001'], un: [], ev: 'Training Report' },
|
||||
'CR11:004': { sr: ['SR01:001'], un: [], ev: 'Maintenance Document (SLA)' },
|
||||
'CR12:001': { sr: ['SR01:002'], un: ['UN13.001'] },
|
||||
'CR12:002': { sr: ['SR01:001'], un: ['UN13.001'] },
|
||||
'CR12:002': { sr: ['SR01:001'], un: [], ev: 'Software Configuration, Project Repository' },
|
||||
'CR12:003': { sr: ['SR01:004'], un: ['UN01.003'] },
|
||||
'CR12:004': { sr: ['SR01:001'], un: ['UN13.001'] },
|
||||
'CR12:004': { sr: ['SR01:001'], un: [], ev: 'List of Evidence, Verification Results' },
|
||||
'CR13:001': { sr: ['SR09:003'], un: ['UN08.002'] },
|
||||
'CR13:002': { sr: ['SR09:003'], un: ['UN04.002'] },
|
||||
'CR13:003': { sr: ['SR01:003'], un: ['UN13.004'] },
|
||||
'CR13:004': { sr: ['SR09:002'], un: ['UN10.002'] },
|
||||
'CR14:001': { sr: ['SR01:001'], un: ['UN01.002'] },
|
||||
'CR14:002': { sr: ['SR01:001'], un: ['UN01.002'] },
|
||||
'CR14:003': { sr: ['SR01:001'], un: ['UN01.002'] },
|
||||
'CR14:004': { sr: ['SR07:002'], un: ['UN12.001'] },
|
||||
'CR14:001': { sr: ['SR01:001'], un: [], ev: 'Test Report' },
|
||||
'CR14:002': { sr: ['SR01:001'], un: [], ev: 'Traceability Record' },
|
||||
'CR14:003': { sr: ['SR01:001'], un: [], ev: 'Validation Results, Acceptance Report' },
|
||||
'CR14:004': { sr: ['SR07:002'], un: ['UN12.001', 'UN12.002'], ev: 'Test Report, Correction Register' },
|
||||
};
|
||||
export const traceOf = (crId) => {
|
||||
const t = TRACE[crId];
|
||||
if (!t) throw new Error(`No traceability entry for ${crId}`);
|
||||
return { ...t, tc: tcByUnit(t.un[0]) };
|
||||
const tcs = [...new Set(t.un.map(tcByUnit))];
|
||||
return { sr: t.sr, un: t.un, ev: t.ev ?? '', tcs, tc: tcs.join(', ') || '-' };
|
||||
};
|
||||
// Sanity: every CR is traced and every trace target exists.
|
||||
// Sanity: every CR is traced, every trace target exists, and each CR ends in a test case or named evidence.
|
||||
for (const [id] of CRS) {
|
||||
const t = traceOf(id);
|
||||
for (const s of t.sr) if (!srTopic(s)) throw new Error(`${id} references unknown ${s}`);
|
||||
for (const u of t.un) if (!unitTopic(u)) throw new Error(`${id} references unknown ${u}`);
|
||||
if (!t.tc) throw new Error(`${id} has no test case`);
|
||||
if (t.tcs.some((tc) => !tc)) throw new Error(`${id} has a unit without a test case`);
|
||||
if (!t.tcs.length && !t.ev) throw new Error(`${id} has neither a test case nor evidence`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user