Skip to content

Commit 452a9f8

Browse files
committed
docs: sync REFACTOR_GUIDE.md
1 parent af4047b commit 452a9f8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

REFACTOR_GUIDE.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@ When adding a parameter to an already-released function (e.g. `classConsistencyC
129129
- Add a performance test for each refactored client function. Follow the pattern in `test-perf-ds.class.R`: call the function in a timed loop, compare against a reference rate from the perf profile CSV.
130130
- Run with `PERF_DURATION_SEC=2 devtools::test(filter = "perf-")` during development; the default 30-second duration is for CI.
131131
- **Do not** include Arjuna Technologies copyright headers in new test files. The existing headers in pre-refactor files should be left as-is, but new files we create should not carry third-party copyright.
132-
- **Align perf test calls with smoke tests.** Before writing a perf test, check the corresponding `test-smk-ds.functionName.R` for the correct dataset (`connect.studies.dataset.*`), column names, and parameter values. Do not use generic placeholder calls. A perf test that calls the function with the wrong dataset or column names will fail even though the refactoring is correct.
133-
134-
**Pre-merge review of perf tests (all batches):** The perf tests for batches 3-10 were generated from a template and some used incorrect datasets or parameters. Before merging any batch, verify that each perf test's function call matches the smoke test pattern (correct dataset, columns, and parameter names).
132+
- **The perf test must replicate the smoke test.** Before writing a perf test, read the corresponding `test-smk-ds.functionName.R` and copy:
133+
1. The `connect.studies.dataset.*()` line (same dataset, same columns)
134+
2. The `disconnect.studies.dataset.*()` line
135+
3. The function call (same parameters, same column names, same argument names)
136+
137+
The perf test should exercise the same code path as the smoke test's happy-path call. Do not use generic placeholder calls or different datasets.
135138

136139
**Design decisions:**
137140
- Functions accepting any class: use `.loadServersideObject()` only, no `.checkClass()`

0 commit comments

Comments
 (0)