Photo by Stephanie Harvey / Unsplash

Exercise: Three Things

Exercises Apr 17, 2025 (Apr 23, 2025) Loading...

To be used as a 20 minute exercise in Workroom PlayTime 013

I built the same thing three times.

The small system, written as a web page, takes input in the form of an inputValue and a unit, and a scale to contextualise the number and the unit, and converts that number to a textOutput expressing that number as something else in the scale, typically of the right size to be comprehensible. Typical scales are time and distance.

Starting with the same tests, (mostly) the same instructions, and the same names for the target files, I asked an LLM to iterate until the code it put into the files passed the tests.

Here they are, each with their tests. They all take the same configuration, which sets out the units the things work with.

Starting at C??

I'd have sworn all the tests passed, but A and B show failures in the HTML handler. So now you have D and E.

Exercise 1

10 minutes, microphones on

Pick one. Explore it. Whatever way you like – knowing that they have the same configuration and pass the same tests, but have different code and may hav differing behaviours.

What looks wrong? Share.

Exercise 2

5 minutes, mics on

Pick another. Explore it, starting with what you saw that was 'wrong' in Ex 1.

Differently wrong? What else looks wrong?

Share.

Review

5 minutes, shared notes in Miro

Write down one novel way you'd try if you came across this situation at work.

Write down one artefact you wanted to use.

Share any conclusions about testing these things which pass the tests


Extension

  • Assess the tests
  • Look at the instructions
  • Write automation to see differences between C, D and E
  • Use diff or similar to see differences between the underlying code
  • Try it yourself! Get the test files into a directory. Ask your LLM of choice to make code to pass the tests in test-whatever.js, then give it feedback based on show-test-whatever.html . Give it rules.md, too – and whatever source you might imagine. You'll need to make (JavaScript) main, htmlhandler, relativeSizes, HTML page index. You'll ask for CSS styles if you like (there's no test, but you'll want the LLM to have read the rules, the index page and the htmlhandler. You can either use the units from here, or ask for a JSON config file to suit yourself (there's a test for that). Certainly change the rules, the tests and whatever else.

Member reactions

Reactions are loading...

Sign in to leave reactions on posts

Tags

Comments

Sign in or become a Workroom Productions member to read and leave comments.

James Lyndsay

Getting better at software testing. Singing in Bulgarian. Staying in. Going out. Listening. Talking. Writing. Making.

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.