Synthetic data is deliberately generated data that resembles real data while making expected answers and unusual cases controllable. It supports testing when real examples are difficult to find or expensive to analyze. section 6.6 section 6.6.1
Effective synthetic test data should:
- Include edge cases that may be absent from the real dataset. section 6.6
- Stay close enough to real data that the tests represent likely production inputs. section 6.6.1
- Keep test cases together when a single file makes expected results easier to manage. section 6.6.1
A controlled player-statistics test file
A CSV can repeat Aaron Rodgers across several rows, include a running back with passing yards, and add zero and negative totals. The expected totals are therefore known: Rodgers has 800 yards, Kerryon Johnson 5, Leo Porter 0, Jared Goff 190, and Dan Zingaro −10. section 6.6.1
Table 6.3 Our file to test the NFL passing yards function
|
game_id
|
player_id
|
position
|
player
|
team
|
pass_cmp
|
pass_att
|
pass_yds
|
pass_td
|
|---|---|---|---|---|---|---|---|---|
|
201909050chi
|
RodgAa00
|
QB
|
Aaron Rodgers
|
GNB
|
20
|
30
|
200
|
1
|
|
201909080crd
|
JohnKe06
|
RB
|
Kerryon Johnson
|
DET
|
1
|
1
|
5
|
0
|
|
201909080crd
|
PortLe00
|
QB
|
Leo Porter
|
UCSD
|
0
|
1
|
0
|
0
|
|
201909080car
|
GoffJa00
|
QB
|
Jared Goff
|
LAR
|
20
|
25
|
200
|
1
|
|
201909050chi
|
RodgAa00
|
QB
|
Aaron Rodgers
|
GNB
|
10
|
15
|
150
|
1
|
|
201909050chi
|
RodgAa00
|
QB
|
Aaron Rodgers
|
GNB
|
25
|
35
|
300
|
1
|
|
201909080car
|
GoffJa00
|
QB
|
Jared Goff
|
LAR
|
1
|
1
|
–10
|
0
|
|
201909080crd
|
ZingDa00
|
QB
|
Dan Zingaro
|
UT
|
1
|
1
|
–10
|
0
|
|
201909050chi
|
RodgAa00
|
QB
|
Aaron Rodgers
|
GNB
|
15
|
25
|
150
|
0
|
Inspect the complete artificial CSV, including repeated records, non-quarterbacks, zero values, negative values, and single-entry players. section 6.6.1














