1*3f65a7dbSJim Jagielski<!-- 2*3f65a7dbSJim Jagielski Licensed to the Apache Software Foundation (ASF) under one 3*3f65a7dbSJim Jagielski or more contributor license agreements. See the NOTICE file 4*3f65a7dbSJim Jagielski distributed with this work for additional information 5*3f65a7dbSJim Jagielski regarding copyright ownership. The ASF licenses this file 6*3f65a7dbSJim Jagielski to you under the Apache License, Version 2.0 (the 7*3f65a7dbSJim Jagielski "License"); you may not use this file except in compliance 8*3f65a7dbSJim Jagielski with the License. You may obtain a copy of the License at 9*3f65a7dbSJim Jagielski 10*3f65a7dbSJim Jagielski http://www.apache.org/licenses/LICENSE-2.0 11*3f65a7dbSJim Jagielski 12*3f65a7dbSJim Jagielski Unless required by applicable law or agreed to in writing, 13*3f65a7dbSJim Jagielski software distributed under the License is distributed on an 14*3f65a7dbSJim Jagielski "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15*3f65a7dbSJim Jagielski KIND, either express or implied. See the License for the 16*3f65a7dbSJim Jagielski specific language governing permissions and limitations 17*3f65a7dbSJim Jagielski under the License. 18*3f65a7dbSJim Jagielski--> 19*3f65a7dbSJim Jagielski 209cdcc566SJim Jagielski# OpenFormula Test Gap Analysis — Apache OpenOffice Calc 219cdcc566SJim Jagielski 229cdcc566SJim JagielskiSource-of-truth: `test/aoo-test/`, `test/odf-validate/`, and AOO source. Findings marked **[CONFIRMED]** have file:line evidence; **[UNVERIFIED]** require runtime execution. 239cdcc566SJim Jagielski 249cdcc566SJim Jagielski## 1. Existing test inventories 259cdcc566SJim Jagielski 269cdcc566SJim Jagielski### test/aoo-test/data/openformula-functions.txt 27*3f65a7dbSJim Jagielski 2868f07d45SJim Jagielski- 414 lines: 391 function names after a 23-line license header. `test/odf-validate/openformula-functions.txt` has the same 391 names. 299cdcc566SJim Jagielski- Header: "Names of the functions defined in OpenDocument 1.2 Part 2 (OpenFormula) chapter 6, one per line. Used by formulacheck.py to tell standard functions from nonstandard ones (Part 2 5.7)." 309cdcc566SJim Jagielski- **[CONFIRMED]** Includes IFNA (line 183), SKEWP (line 350), BITAND/BITOR/BITXOR/BITLSHIFT/BITRSHIFT (lines 59-63). 319cdcc566SJim Jagielski- **[CONFIRMED]** Does NOT include EASTERSUNDAY — despite EASTERSUNDAY being an implemented ODF 1.3/1.4 function (`interpr2.cxx:261`, `core_resource.src:333`). 329cdcc566SJim Jagielski 339cdcc566SJim Jagielski### test/odf-validate/openformula-functions.txt 34*3f65a7dbSJim Jagielski 359cdcc566SJim Jagielski- 393 lines. 369cdcc566SJim Jagielski- Same header (ODF 1.2 Part 2 chapter 6). 379cdcc566SJim Jagielski- **[CONFIRMED]** Includes IFNA (line 162), SKEWP (line 329), BIT functions. 389cdcc566SJim Jagielski- **[CONFIRMED]** Does NOT include EASTERSUNDAY. 399cdcc566SJim Jagielski 409cdcc566SJim Jagielski**[CONFIRMED] Both inventories are ODF 1.2-based baselines.** They are stale relative to ODF 1.4 (2025-10-06): EASTERSUNDAY (ODF 1.3/1.4) is absent from both. They list IFNA/SKEWP as "standard" — IFNA and SKEWP were implemented in Milestone B and are no longer missing, so this is no longer a false-negative for conformance. 419cdcc566SJim Jagielski 429cdcc566SJim Jagielski### test/aoo-test/data/calcval-cases.tsv 43*3f65a7dbSJim Jagielski 449cdcc566SJim Jagielski- Present (test/aoo-test/data/). Formula evaluation test cases. 459cdcc566SJim Jagielski 469cdcc566SJim Jagielski### test/odf-validate/calcval-cases.tsv and calcval-cases14.tsv 47*3f65a7dbSJim Jagielski 489cdcc566SJim Jagielski- Present. `calcval-cases14.tsv` is ODF 1.4-specific. 499cdcc566SJim Jagielski 509cdcc566SJim Jagielski### test/odf-validate tooling 51*3f65a7dbSJim Jagielski 529cdcc566SJim Jagielski- `formulacheck.py`, `calcval.py`, `cmp7.py`, `compare.py`, `diff7.py`, `dump7.py`, `dump14.py`, `roundtrip.py`, `cov_*.py`, `crosscheck.py`, `gate.py`, `report.py`. 539cdcc566SJim Jagielski 549cdcc566SJim Jagielski## 2. Identified gaps 559cdcc566SJim Jagielski 569cdcc566SJim Jagielski### Outdated specification inventories 57*3f65a7dbSJim Jagielski 589cdcc566SJim Jagielski- Both `openformula-functions.txt` files are explicitly ODF 1.2 chapter 6. No ODF 1.3 or ODF 1.4 function inventory exists in test data. 599cdcc566SJim Jagielski- **[GAP]** No machine-readable ODF 1.4 Part 4 function/operator/requirements inventory in `test/`. 60*3f65a7dbSJim Jagielski 619cdcc566SJim Jagielski### Missing function tests 629cdcc566SJim Jagielski 639cdcc566SJim Jagielski- **[CONFIRMED]** IFNA: listed in inventories; implemented in Milestone B (`SC_OPCODE_IFNA=409`, `ScIfna` in `interpr1.cxx`, dispatch in `interpr4.cxx:3451`). Regression tests added to `calcval-cases14.tsv` (IFNA.num, IFNA.text, IFNA.na.num, IFNA.na.text, IFNA.otherr, IFNA.lazy.ok, IFNA.lazy.err, IFNA.nested, IFNA.ref, IFNA.ref.text, IFNA.range). 649cdcc566SJim Jagielski- **[CONFIRMED]** SKEWP: listed in inventories; implemented in Milestone B (`SC_OPCODE_SKEWP=410`, `ScSkewP` in `interpr3.cxx`, dispatch in `interpr4.cxx:3695`). Regression tests added to `calcval-cases14.tsv` (SKEWP.sym, SKEWP.pos, SKEWP.neg, SKEWP.vs.skew, SKEWP.one, SKEWP.zero, SKEWP.two, SKEWP.range, SKEWP.array, SKEWP.mixed, SKEWP.err). 659cdcc566SJim Jagielski- **[CONFIRMED]** EASTERSUNDAY: implemented (`interpr2.cxx:261`) but NOT in either function inventory. No dedicated test coverage confirmed. 669cdcc566SJim Jagielski 67759dc5c7SJim Jagielski**[CONFIRMED] IFNA and SKEWP are no longer missing functions.** Both were implemented in Milestone B. The test inventories list them as standard ODF functions, which is now correct. IFERROR, on the same lists, was missing until 2026-11-16 and is implemented now; the `IFERROR.*` calcval rows cover it. 68*3f65a7dbSJim Jagielski 699cdcc566SJim Jagielski### Missing semantic tests 709cdcc566SJim Jagielski 719cdcc566SJim Jagielski- No confirmed semantic test for CONVERT `atm` (fixed in Milestone C: 101325.1 Pa vs old 101324.996583 Pa). 729cdcc566SJim Jagielski- No confirmed semantic test for INDEX row-vector single-argument (fixed in Milestone A: ODF 1.4 error vs old column return). 739cdcc566SJim Jagielski- DATE `DATE(1500;1;1)` is out of §6.10.2 constraints (Year>=1904) and impl-defined/diagnostic (AOO observed #VALUE!); E.1 reclassified tests to reflect this (not a mandatory #ERR). 749cdcc566SJim Jagielski- No confirmed semantic test for BITAND/BITOR/BITXOR/BITLSHIFT/BITRSHIFT variadic params or negative-shift handling (interpr1.cxx:1231-1234 appears inverted). 759cdcc566SJim Jagielski- No confirmed semantic test for short-circuit AND/OR. 769cdcc566SJim Jagielski 779cdcc566SJim Jagielski### Missing parser tests 78*3f65a7dbSJim Jagielski 799cdcc566SJim Jagielski- No confirmed parser test inventory for operator precedence/associativity (e.g. `2+3*4`, `2^3^2`). 809cdcc566SJim Jagielski- No confirmed parser test for automatic intersection (whitespace), reference union `~`, intersection `!`, range `:`. 819cdcc566SJim Jagielski- Quoted labels as implicit intersection (ODF 1.4 §3.9) — UNVERIFIED whether tested. 829cdcc566SJim Jagielski 839cdcc566SJim Jagielski### Missing ODF round-trip tests 84*3f65a7dbSJim Jagielski 859cdcc566SJim Jagielski- No confirmed round-trip test verifying function names written on ODF export (e.g. `ORG.OPENOFFICE.CURRENT` vs `CURRENT`, `ORG.OPENOFFICE.ERRORTYPE` vs `ERROR.TYPE`, `ORG.OPENOFFICE.EASTERSUNDAY` vs `EASTERSUNDAY`, `ORG.OPENOFFICE.STYLE` vs `STYLE`, `ORG.OPENOFFICE.MULTIRANGE` vs `~`, `MULTIRANGE` legacy). 869cdcc566SJim Jagielski- `odf_docs/ODF14-KNOWN-LIMITATIONS-PUBLIC.md` notes formula cells with error results written as `office:value-type="string"` (ODF 1.4 adds `error` type) — no confirmed round-trip test for error value type. 87*3f65a7dbSJim Jagielski 889cdcc566SJim Jagielski### Existing tests that produce false confidence 899cdcc566SJim Jagielski 909cdcc566SJim Jagielski- `openformula-functions.txt` lists IFNA/SKEWP as standard ODF 1.2 functions; AOO now implements them (Milestone B), so this is no longer a false-negative for conformance. 919cdcc566SJim Jagielski- Inventories are ODF 1.2, so they do not flag ODF 1.4 regressions (INDEX row-vector fixed in Milestone A, CONVERT atm fixed in Milestone C, COUNTA empty cells/empty string). 929cdcc566SJim Jagielski 939cdcc566SJim Jagielski## 3. Proposed versioned test inventory 949cdcc566SJim Jagielski 959cdcc566SJim Jagielski| File | Version | Content | Source | 969cdcc566SJim Jagielski|------|---------|---------|--------| 979cdcc566SJim Jagielski| openformula-functions-1.4.txt | ODF 1.4 | Full normative function list from Part 4 chapter 6 | To be extracted from ODF 1.4 Part 4 | 989cdcc566SJim Jagielski| openformula-functions-1.3.txt | ODF 1.3 | ODF 1.3 function list | To be extracted | 999cdcc566SJim Jagielski| openformula-functions-1.2.txt | ODF 1.2 | Existing baseline (rename current files) | Current test files | 1009cdcc566SJim Jagielski| openformula-operators-1.4.txt | ODF 1.4 | Operator/grammar inventory | To be extracted | 1019cdcc566SJim Jagielski| openformula-semantics-1.4.tsv | ODF 1.4 | Conversion/error/short-circuit/array cases | To be derived from spec | 1029cdcc566SJim Jagielski 1039cdcc566SJim Jagielski## 4. Strategy for auto-generating tests from normative data 1049cdcc566SJim Jagielski 1059cdcc566SJim Jagielski- Parse ODF 1.4 Part 4 (or a machine-readable rendering) to extract function names, signatures, parameter classifications, and operator definitions. 1069cdcc566SJim Jagielski- Emit versioned `openformula-functions-<ver>.txt` inventories for formulacheck.py consumption. 1079cdcc566SJim Jagielski- Emit calcval-style cases from normative examples (each spec section's examples become expected-result cases). 1089cdcc566SJim Jagielski- Do NOT add tests to the normal production build (per audit constraint); keep in `test/odf-validate/` or a separate conformance suite. 1099cdcc566SJim Jagielski 1109cdcc566SJim Jagielski## 5. Gap summary 1119cdcc566SJim Jagielski 1129cdcc566SJim Jagielski| Category | Gap | Severity | 1139cdcc566SJim Jagielski|----------|-----|----------| 1149cdcc566SJim Jagielski| Spec inventory | No ODF 1.3/1.4 function/operator inventory in test/ | High | 115759dc5c7SJim Jagielski| Missing functions | None — IFNA and SKEWP implemented in Milestone B, IFERROR on 2026-11-16 | None | 1169cdcc566SJim Jagielski| Implemented but uninventoried | EASTERSUNDAY not in either test inventory | Medium | 1179cdcc566SJim Jagielski| Semantic tests | CONVERT atm (fixed Milestone C), INDEX row-vector (fixed Milestone A), DATE pre-1583, bit ops, short-circuit | High | 1189cdcc566SJim Jagielski| Parser tests | Precedence, intersection, union, quoted labels | Medium | 1199cdcc566SJim Jagielski| Round-trip tests | Function-name export aliases, error value type | Medium | 1209cdcc566SJim Jagielski| False confidence | None — IFNA/SKEWP now implemented, matching inventory | None | 1219cdcc566SJim Jagielski 1229cdcc566SJim Jagielski## E.1 Small Group corrections 1239cdcc566SJim Jagielski 1249cdcc566SJim Jagielski- Corrected `BL-001-1024chars` to 1026-char formula expression (`=1`+`+1`*512, result 513) and `BL-004-7nesting` to 7 genuinely nested IF levels. 1259cdcc566SJim Jagielski- Added `SG-SYN-001` Criteria syntax (§4.11.11) coverage in the Small Group test inventory. 1269cdcc566SJim Jagielski- Clarified `SG-SYN-009` named-expression test requires pre-defined name (`MYNAME`) not provided by calcval harness. 1279cdcc566SJim Jagielski- Updated COUNTA/COUNTBLANK fixtures for empty cells and empty string semantics per §6.13.7/§6.13.8; documented `""`-in-cell COUNTBLANK limitation of calcval fixtures. 1289cdcc566SJim Jagielski- Reclassified `FN-016-DATE-pre1583` / `DATE.pre1583` as implementation-defined/diagnostic for out-of-constraint input. 129