Repository navigation
Test Specification Complexity Profile Modernized
Issue: #2092. Screen: gui/templates/testcases/specComplexity.html. BFF: api/speccomplexity/index.php.
This net-new read-only project report answers a question the 1.9.20 test-specification screens could not answer in one place: which test-case designs are unusually heavy, and what makes them heavy (steps, expected results, linked requirements, keywords, active project design custom fields and long summaries)?
Legacy screens list test cases and their steps, requirements and keywords separately. specComplexity joins the project suite tree, latest tcversions, tcsteps, req_coverage, object_keywords and active design custom fields into one Dashio report with a transparent score and high/medium/low bands. It is a design-time report: no execution evidence is used.
- Toolbar: Suite (full nested path), Complexity band and Min. steps filters, Refresh, Export CSV, Apply and Close.
- Context panel: project, applied suite, band and minimum steps.
- Verdict banner: none / high / medium / clear, localized and derived from the applied scope.
- KPI strip: cases, high/medium/low counts, average score, steps, steps missing an expected result, cases without requirement, cases without keyword and cases with design fields.
- DataTable: prefixed external ID, case, suite path, version, steps, expected %, requirements, keywords, design fields, summary characters, score and band, plus a Details button.
- Detail modal: summary, every design step with expected result, keywords, linked requirement IDs and active design custom-field values; Escape and Close dismiss it and focus returns to the trigger.
- UTF-8 CSV with BOM,
;delimiter, quoted cells and formula-injection guard; localized 400/401/403/404/405 state cards and aTLi18nlocale switcher.
- Scope is the latest version of every test case under the requested project and optional suite subtree. Case IDs and version IDs are
intval-guarded before being interpolated into SQL. -
score = steps × 2 + round(expected-result coverage / 10) + requirements × 3 + keywords × 2 + filled design fields × 2 + min(5, floor(summary characters / 200)). - Bands:
highwhen score >= 25,mediumwhen score >= 12, otherwiselow. Every input and its contribution is visible in the row and detail modal. - Only project-linked custom fields with
ctp.active = 1andcf.enable_on_design = 1count, both in the score and in the detail modal. Values must be non-empty. - Requirements use active
req_coveragelinks of the latest version; keywords useobject_keywords.fk_table = 'tcversions'. Both are counted distinctly. - External IDs are shown as
<project prefix>-<tc_external_id>; when a legacy case has no positive external ID the raw value is shown without a leading dash. - Rights (
mgt_view_tc) are checked on the addressed project before the project record is loaded. Denials return an opaqueno_rightcode and write an AUDIT event.
| Case | HTTP | Code |
|---|---|---|
GET|HEAD action=init, action=report, action=case success |
200 | ok |
| Unknown action / invalid parameters | 400 | invalid_request |
| Anonymous / expired session | 401 |
not_authenticated / session_expired
|
Missing mgt_view_tc on the addressed project |
403 |
no_right (AUDIT) |
| Unknown project / unknown test case | 404 |
tproject_not_found / tcase_not_found
|
| Non GET/HEAD | 405 |
method_not_allowed (Allow: GET, HEAD) |
Security: bffSameOriginGuard() + bffEnforceSession(), nosniff and no-store headers, integer-only IDs, escaped client rendering, whitelisted bands and AUDIT logging for denials.
-
api/speccomplexity/index.php—init,reportandcase. -
lib/functions/common.php—$actions->specComplexity. -
api/aside/index.php— Test Case Design entry with project and plan IDs. -
gui/templates/i18n/*.json— 82scx.*/footer keys in all 10 bundles;ai/verify_i18n_coverage.shpasses 9/9 with 13872 keys. -
locale/*/strings.txt—$TLS_href_spec_complexityin all 19 server locales.
- Fixture
tmp/fixtures_2092.php: projectsSCX2092andSCX2092 EMPTY, nested suites, four cases (1/4/8/0 steps), two design custom fields, three keywords, two requirement links and a role-3scxnorightsuser. - Suite
Issue #2092: browser-verified normal/filtered/detail/CSV/RO/empty/no-right states, all error cards, i18n and syntax gates, Event Viewer and wiring. Suite gate reports 34 PASS / 0 FAIL / 0 SKIP. - Bugs found during testing/code review: #2093 (external IDs lost the prefix and raised PHP warnings) and #2094 (design-field KPI mixed filled values with field count). Both were filed with the
buglabel, fixed in separate pushed commits, browser-reverified and closed. The review also aligned detail-modal custom fields with the active/enabled joins and deferred CSV object-URL revocation. - PHP lint, extracted
node --check, JSON validation, i18n coverage and suite gates pass. Event Viewer has 0 Error, 0 L18N and 3 historical Warning rows from #2093, all emitted before that fix; no Warning/Error was generated afterwards.
