Code Labs: Test Data

Classify data rules and script automated test routines.

Interactive Engine

Use the terminal below to systematically prove algorithms work under pressure.

> Waiting to compile...

The Crucible

Prove your knowledge of boundaries and error tracking.

Bronze (Data Classification)

The Exact Limit

An algorithm calculates shipping costs for weights between 1kg and 50kg.

Task: Read the code and assign a valid integer to the boundary_data variable to test the extreme edges of the 50kg limit exactly. (Hint: Test exactly on the line or exactly 1 outside it).

> Output will appear here...
Silver (Test Functions)

Code Injector

You have defined your test data, now you must pass it to the is_valid() function to see what the machine says!

Task: Call the is_valid(weight) function, pass in the invalid_data variable, and store/print the result.

> Output will appear here...
Gold (Automated Plans)

The Loop Execution

Instead of testing one variable at a time, programmers use arrays and FOR loops to run dozens of test scenarios instantly.

Task: Finish the loop so it passes each test value into the is_valid() function, and prints the boolean outcome exactly matching the format: Test 50 gives True

> Output will appear here...