Vibecoding 16: a test says yes or no
Write down the answer you expect, run two versions of a function, and watch the judge say yes to one and no to the other. Lesson 16 of the vibecoding course.
1. Write down the answer you expect
2. Run the code
3. Let the judge compare
The larger of 3 and 9 is
- Working code
if a is above b give a, else give b - Code with a slip
always give a
1. Write down the answer you expect
2. Run the code
3. Let the judge compare
The larger of 3 and 9 is 3
Working code
if a is above b give a, else give b
It gave 9
No: it gave something else
Code with a slip
always give a
It gave 3
Yes: it gave what you wrote down
1. Write down the answer you expect
2. Run the code
3. Let the judge compare
The larger of 3 and 9 is 9
Working code
if a is above b give a, else give b
It gave 9
Yes: it gave what you wrote down
Code with a slip
always give a
It gave 3
No: it gave something else
1. Write down the answer you expect
2. Run the code
3. Let the judge compare
The larger of 9 and 3 is
- Working code
if a is above b give a, else give b - Code with a slip
always give a
1. Write down the answer you expect
2. Run the code
3. Let the judge compare
The larger of 9 and 3 is 3
Working code
if a is above b give a, else give b
It gave 9
No: it gave something else
Code with a slip
always give a
It gave 9
No: it gave something else
1. Write down the answer you expect
2. Run the code
3. Let the judge compare
The larger of 9 and 3 is
- Working code
if a is above b give a, else give b - Code with a slip
always give a
1. Write down the answer you expect
2. Run the code
3. Let the judge compare
The larger of 9 and 3 is 9
Working code
if a is above b give a, else give b
It gave 9
Yes: it gave what you wrote down
Code with a slip
always give a
It gave 9
Yes: it gave what you wrote down
1. Write down the answer you expect
2. Run the code
3. Let the judge compare
The larger of 3 and 9 is
- Working code
if a is above b give a, else give b - Code with a slip
always give a
A yes means the code agrees with your answer for these inputs, nothing more. Try the numbers the other way round.