← ACARA Digital Technologies Years 7–8

Generating sample test data

A tool that makes random sample data, with fields and rows you choose, to practise with when real data is not available. You can export it to a spreadsheet. It is test data, not real data.

Understanding Generating sample test data in ACARA Digital Technologies Years 7–8

What it does: A CSV file made by the data generator can be opened in a spreadsheet to practise sorting, filtering and formulas. Naming the file test_data reminds everyone that the values are random and not real results. Fields are the kinds of data in each column. The row count is a separate choice. The row count sets how many records you get. Fields set the columns. A data generator needs at least one row to make sample data. Choose a sensible row count such as 50.

Common mistakes: A single = stores the row count in the variable. Two equals signs (==) compare values, so rows would never be set. It should be rows = 50. A for loop line must end with a colon. Without it the generator will not run. It should be for i in range(30):.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 204–236) and word search (Modules 189–236).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
You want to practise spreadsheet formulas but have no real data yet. What could you use?
A sensor that has been switched offA data generator
Matches
Rows: 0
↓
A row count of 0 makes no data, so there is nothing to practise with. Choose a number such as 50.
Applying
Meanings
Term
data generator
Meaning
A tool that makes random sample data, with fields and rows you choose, to practise with when real data is not available. You can export it to a spreadsheet. It is test data, not real data.
Practice
Name,Age,Score
Testing
Gaps
=(1,100)
Check Answer
Spots
1rows == 50
2fields = ['Name', 'Age']

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Nebula Cat' badge — Orbit Debugger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. You want to practise spreadsheet formulas but have no real data yet. What could you use?
A. A sensor that has been switched off
B. A data generator ✓
A data generator makes random sample data to practise with when real data is not available.
2. Which statement describes data made by a data generator?
A. It is real data collected from people
B. It is random test data ✓
Generated data is made up by the tool. It is test data, not real data.
3. When using a data generator, you choose the fields. What is a field?
A. A column type such as Name, Age or Score ✓
B. The total number of rows in the file
Fields are the kinds of data in each column. The row count is a separate choice.
4. You set a data generator to make 50 rows. What does this control?
A. How many records are created ✓
B. How many columns are created
The row count sets how many records you get. Fields set the columns.
5. Which is the best way to use generated data in a spreadsheet?
A. Export it as a file, then open or import it ✓
B. Retype each cell by hand from memory
Data generators let you export the data, for example as a CSV file, and open it in a spreadsheet.

Match the Pairs

Fields: Name, Age, Year → Chooses the columns (fields) that each generated record will have
Rows: 50 → Tells the data generator to make 50 records of sample data
Export the generated data so it can be opened and practised on in a spreadsheet → Export as CSV
Generated data is only test data, so the file name should show it is not real → Filename: test_data.csv
Rows: 0 → A row count of 0 makes no data, so there is nothing to practise with. Choose a number such as 50.
Use test_data.csv as our real survey results → Generated data is random test data, not real data. It must not be used as real survey results.

Key Term

data generator
A tool that makes random sample data, with fields and rows you choose, to practise with when real data is not available. You can export it to a spreadsheet. It is test data, not real data.

Fill in the Blanks

1. =RANDBETWEEN(1,100)
Hint: Type the function name that makes a random whole number between two limits, for filling a column with sample data.
2. =CHOOSE(RANDBETWEEN(1,2),"Red","Blue")
Hint: Type the function name that picks one item from a list using a position number, so a generator can make random text values.
3. =ROUND(RAND()*100,1)
Hint: Type the function name that makes a random decimal between 0 and 1, which is scaled up to make sample decimal values.
4. Save as: sampledata.csv
Hint: Type the file extension for plain comma-separated data that a generator exports so it can open in a spreadsheet.
5. =COUNTA(A2:A21)
Hint: Type the row number of the last data row when 20 generated rows sit under a header in row 1, so the formula counts every row.

Spot the Error

Question 1
A rows == 50
B fields = ['Name', 'Age']
C data = make_data(fields, rows)
D export(data, 'test.csv')
Line A — A single = stores the row count in the variable. Two equals signs (==) compare values, so rows would never be set. It should be rows = 50.
Question 2
A from random import randint
B ages = []
C for i in range(30)
D a = randint(11, 14)
E ages.append(a)
Line C — A for loop line must end with a colon. Without it the generator will not run. It should be for i in range(30):
Question 3
A fields: Name, Age, Score
B rows: 100
C export: CSV
D note: real student data
Line D — Generated data is made up, so it is test data, not real data. The note should say that it is test data, not real data.
Question 4
A import random
B names = ['Ava', 'Liam', 'Mia']
C pick = random.choose(names)
D print(pick)
Line C — The function that picks a random item from a list is random.choice(), not random.choose(). It should be pick = random.choice(names).
Question 5
A import csv
B f = open('test.csv', 'r')
C w = csv.writer(f)
D w.writerow(['Name', 'Age'])
Line B — 'r' opens the file for reading only, so the generator cannot save data to it. To export, open it for writing with 'w'.

Student with a class code? Join your class →