Skip to content

Commit efbc413

Browse files
Add reimplements section
1 parent 2053ff0 commit efbc413

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

README.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Please see the [contributing guide](./CONTRIBUTING.md).
88

99
## Exercise Metadata
1010

11-
Each exercise's data lives in a directory under `exercises/` .
11+
Each exercise's metadata lives in a directory under `exercises/` .
1212

1313
```text
1414
exercises/
@@ -101,7 +101,42 @@ The file format is described in [canonical-schema.json](./canonical-schema.json)
101101

102102
- The `scenarios` field can use one or more of a predefined set of values, which are defined in a [`SCENARIOS.txt`](./SCENARIOS.txt) file.
103103
- The `scenarios` field can be mutated additively, by adding new scenarios. Existing scenarios must not be changed or removed. Adding new scenarios does therefore does not mean adding a new test case.
104-
- Library tests will have a `library-test` scenario added to allow for easy including/excluding of library tests. Application tests won't have their own scenario, as they must be included and should not be filtered on.
104+
- Library tests should have a `library-test` scenario added to allow for easy including/excluding of library tests. Application tests won't have their own scenario, as they must be included and should not be filtered on.
105+
106+
## Changing Tests
107+
108+
As test cases are immutable, a "bug fix" requires adding a new test case. We'll add metadata to test cases to link a re-implementation of a test case to the re-implemented test case.
109+
110+
- Re-implemented test cases _must_ have a `reimplements` field which contains the UUID of the test case that was re-implemented.
111+
- Re-implemented test cases _must_ use the `comments` field to explain why a test case was re-implemented (e.g. "Expected value is changed to 2").
112+
- Track generators _should not_ automatically select the "latest" version of a test case by looking at the "reimplements" hierarchy. We recommend each track to make this a manual action, as the re-implemented test case might actually make less sense for a track.
113+
114+
This is an example of what a re-implementation looks like:
115+
116+
```json
117+
[
118+
{
119+
"uuid": "e46c542b-31fc-4506-bcae-6b62b3268537",
120+
"description": "two times one is two",
121+
"property": "twice",
122+
"input": {
123+
"number": 1
124+
},
125+
"expected": 3
126+
},
127+
{
128+
"uuid": "82d32c2e-07b5-42d9-9b1c-19af72bae860",
129+
"description": "two times one is two",
130+
"comments": ["Expected value is changed to 2"],
131+
"reimplements": "e46c542b-31fc-4506-bcae-6b62b3268537",
132+
"property": "twice",
133+
"input": {
134+
"number": 1
135+
},
136+
"expected": 2
137+
}
138+
]
139+
```
105140

106141
## Conventions
107142

0 commit comments

Comments
 (0)