Skip to content
cccskills

Test log of test-driven-development

For each task: the request, the rubric and the score for each item, time and tokens for every run, Claude Code’s full logs, and the files it produced. The raw data is here too, so the score can be recomputed if the weighting changes.

Run on Nov 24, 2026 (runs: claude-sonnet-5-5 / judge: claude-opus-5-5). Figures are medians. The tasks were written by AI from SKILL.md, so they may lean toward situations where the skill helps.

Raw data (JSON)Tasks, per-run measurements, judgments and the summary as stored.

Measurements per run

RunResultTimeTokensCostTurnsSkill usedLog
Task 1 Run 1 Without skillDone12s68,086$0.0497-Full log
Task 1 Run 1 With skillDone18s136,394$0.08110YesFull log
Task 1 Run 1 With skill (not named)Done18s112,625$0.07910YesFull log
Task 1 Run 2 With skillDone19s112,290$0.06310YesFull log
Task 1 Run 2 Without skillDone13s67,745$0.0274-Full log
Task 1 Run 2 With skill (not named)Done15s111,054$0.0577YesFull log
Task 2 Run 1 Without skillDone15s51,080$0.0424-Full log
Task 2 Run 1 With skillDone27s139,131$0.0919YesFull log
Task 2 Run 1 With skill (not named)Done19s107,487$0.0588NoFull log
Task 2 Run 2 With skillDone21s139,662$0.0769YesFull log
Task 2 Run 2 Without skillDone14s69,091$0.0315-Full log
Task 2 Run 2 With skill (not named)Done22s107,573$0.0458NoFull log

“With skill (not named)” runs only measure the pick-up rate and are not judged.

Task 1: Fix a bulk-discount boundary bug in a Python pricing module

Request

We got a bug report from support: "A customer ordered exactly 10 units of SKU A-100 at $4.99 each and was charged the full $49.90 — they should have gotten the bulk discount." Can you fix this in pricing.py? Please make sure it doesn't happen again.

Rubric

  1. pricing.py is fixed so that exactly 10 units gets 10% off (line_total(499, 10) == 4491) and exactly 50 units gets 20% off; quantities of 9 and 49 still get the lower tier
  2. Test(s) were added under tests/ that cover the reported case (exactly 10 units) and the boundary values around both tiers (e.g. 9/10 and 49/50)
  3. All pre-existing tests still pass unchanged, and the full suite passes with `python3 -m unittest discover -s tests`
  4. The final message explains the root cause (strict > comparisons instead of >=), notes the 50-unit boundary had the same bug, and reports the actual test run result

Score per rubric item (1 = met, 0.5 = partly, 0 = not met)

#Run 1
Without skill / With skill
Run 2
Without skill / With skill
11 / 11 / 1
21 / 11 / 1
31 / 11 / 1
41 / 11 / 1
Starting files(3)

README.md

# pricing

Small pricing helpers used by the checkout service.

## Bulk discount policy

- 10 or more units of a line item: 10% off that line
- 50 or more units of a line item: 20% off that line
- Discounted line totals are rounded to the nearest cent (half up).

## Running tests

```
python3 -m unittest discover -s tests -v
```

pricing.py

"""Pricing helpers. All money values are integer cents."""


def bulk_discount_rate(qty):
    """Return the discount rate for a line with `qty` units.

    Policy: 10 or more units -> 10%, 50 or more units -> 20%.
    """
    if qty < 0:
        raise ValueError("qty must be non-negative")
    if qty > 50:
        return 0.20
    if qty > 10:
        return 0.10
    return 0.0


def line_total(unit_price_cents, qty):
    """Total for a line in cents, after bulk discount, rounded half up."""
    if unit_price_cents < 0:
        raise ValueError("unit price must be non-negative")
    gross = unit_price_cents * qty
    rate = bulk_discount_rate(qty)
    # integer math to avoid float rounding surprises: percent as integer
    percent_off = int(round(rate * 100))
    discounted_times_100 = gross * (100 - percent_off)
    return (discounted_times_100 + 50) // 100


def order_total(lines):
    """lines: iterable of (unit_price_cents, qty)."""
    return sum(line_total(p, q) for p, q in lines)

tests/test_pricing.py

import os
import sys
import unittest

sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))

from pricing import bulk_discount_rate, line_total, order_total  # noqa: E402


class BulkDiscountRateTest(unittest.TestCase):
    def test_small_order_has_no_discount(self):
        self.assertEqual(bulk_discount_rate(3), 0.0)

    def test_mid_size_order_gets_ten_percent(self):
        self.assertEqual(bulk_discount_rate(25), 0.10)

    def test_large_order_gets_twenty_percent(self):
        self.assertEqual(bulk_discount_rate(100), 0.20)

    def test_negative_qty_rejected(self):
        with self.assertRaises(ValueError):
            bulk_discount_rate(-1)


class LineTotalTest(unittest.TestCase):
    def test_no_discount_line(self):
        self.assertEqual(line_total(499, 2), 998)

    def test_discounted_line_rounds_half_up(self):
        # 15 * 333 = 4995; 10% off = 4495.5 -> 4496
        self.assertEqual(line_total(333, 15), 4496)


class OrderTotalTest(unittest.TestCase):
    def test_sums_lines(self):
        self.assertEqual(order_total([(499, 2), (100, 1)]), 1098)


if __name__ == "__main__":
    unittest.main()

Run 1: Tie (Rubric met 100% / 100%)

Both made the same >= fix, added boundary tests, explained the cause and 50-unit bug, and reported results.

Without skill100%

Final message

I fixed the bug in pricing.py. All 10 tests pass, including the new ones.

Cause: bulk_discount_rate used qty > 10 and qty > 50. The documented policy, in the docstring and the README, says "10 or more" and "50 or more". An order of exactly 10 got no discount, and so did an order of exactly 50, which also missed the 20% tier. I changed both comparisons to >=.

Result: 10 units at $4.99 now come to $44.91 (10% off) instead of $49.90. 50 units now get 20% off.

Regression tests in tests/test_pricing.py:

  • Rate boundaries at 9, 10, 49 and 50.
  • line_total(499, 10) == 4491, which is the exact case from the support report.
  • line_total(499, 50) == 19960.

The existing tests used quantities of 3, 25 and 100, which never touched a boundary. That's why the bug wasn't caught.

I haven't looked for customers who were already overcharged on orders of exactly 10 or 50 units. Support may want to check for refunds.

Files created or changed

With skill100%

Final message

Fixed. An order of exactly 10 units now gets the bulk discount, and all 13 tests pass.

Cause: bulk_discount_rate in pricing.py used qty > 10 and qty > 50. The documented policy is "10 or more" and "50 or more", so both thresholds were off by one. Orders of exactly 50 units were also getting 10% instead of 20%. That second bug wasn't in the report.

Fix: I changed both comparisons to >=.

Tests: I added tests before the fix and confirmed 4 of them failed against the old code.

  • Boundaries: the rate at 9, 10, 49 and 50 units.
  • Reported case: 10 × $4.99 now totals $44.91 (4491¢) instead of $49.90.
  • 50-unit case: 50 × $4.99 now totals $199.60 (19960¢).

These pin the boundaries, so a future change to the comparisons will fail the suite.

The customer in the report was overcharged $4.99. Any other orders of exactly 10 or 50 units were overcharged too. You may want to look for those and refund them, but that's outside this code.

Files created or changed

Run 2: Tie (Rubric met 100% / 100%)

Both made the same >= fix, added 9/10/49/50 tests, explained the cause and 50-unit bug, and reported test results.

Without skill100%

Final message

Fixed. The tier checks in bulk_discount_rate used > instead of >=, so the discount only started at 11 units and 51 units. That didn't match the policy in the README and docstring ("10 or more", "50 or more"). I changed both checks to >= in pricing.py.

An order of 10 units at $4.99 now comes to $44.91 (10% off) instead of $49.90. The same bug hit exactly 50 units, which now get 20% off.

To keep it from coming back, I added three tests to tests/test_pricing.py:

  • Tier boundaries: checks 9, 10, 49 and 50 units.
  • Reported case: 10 × 499¢ = 4491¢.
  • 50 units: 50 units at 100¢ = 4000¢.

All 10 tests pass.

Any customers who already bought exactly 10 or exactly 50 units were overcharged. Support may want to find those orders and refund the difference. The code can't tell me which orders those are.

Files created or changed

With skill100%

Final message

I fixed the bug in pricing.py. The customer's 10 units at $4.99 now come to $44.91 (10% off) instead of $49.90. All 12 tests pass.

Cause: bulk_discount_rate used qty > 10 and qty > 50. The policy in the docstring and README says "10 or more" and "50 or more". The same off-by-one meant orders of exactly 50 units got 10% off instead of 20%. I fixed both thresholds to >=.

Tests added to tests/test_pricing.py:

  • Customer's case: line_total(499, 10) should equal 4491. This test failed before the fix with 4990.
  • Boundary cases: the rate at 9, 10, 49 and 50 units. The tests at 10 and 50 failed before the fix.

The existing tests used 3, 25 and 100 units, so they never hit a threshold. That's why the bug got through.

Orders of exactly 10 or 50 units were undercharged for the discount before this fix. You may want to tell support so they can look at past orders for refunds.

Files created or changed

Task 2: Extend a Node.js slugify with diacritics handling and maxLength

Request

Our slugify in src/slugify.js produces ugly URLs for some blog titles. Please change it so that:
1. Accented letters are transliterated instead of dropped: "Café Déjà Vu" should become "cafe-deja-vu" (right now it's "caf-dj-vu").
2. Runs of dashes collapse to one and there are never leading/trailing dashes: "a -- b" -> "a-b", "-Hello-" -> "hello".
3. It accepts an optional second argument `{ maxLength }`. When the slug is longer, cut it at the last dash boundary that fits so words aren't split, with no trailing dash. If the first word alone is longer than maxLength, just hard-cut it to maxLength.
Existing behavior that callers rely on must keep working.

Rubric

  1. slugify('Café Déjà Vu') returns 'cafe-deja-vu'
  2. slugify('a -- b') returns 'a-b' and slugify('-Hello-') returns 'hello' (no repeated, leading, or trailing dashes)
  3. maxLength works as specified: e.g. slugify('The quick brown fox', { maxLength: 12 }) returns 'the-quick' (word boundary, no trailing dash), a single over-long word is hard-cut to exactly maxLength, and slugs already within the limit are unchanged
  4. All original tests in test/slugify.test.js still pass, and new tests were added covering each of the three requested behaviors
  5. The suite was run with the project's command (`npm test` / `node --test test/`) and the final message reports the actual result

Score per rubric item (1 = met, 0.5 = partly, 0 = not met)

#Run 1
Without skill / With skill
Run 2
Without skill / With skill
11 / 11 / 1
21 / 11 / 1
31 / 11 / 1
40 / 10.5 / 1
50 / 10.5 / 1
Starting files(3)

package.json

{
  "name": "blog-utils",
  "version": "1.0.0",
  "private": true,
  "type": "commonjs",
  "scripts": {
    "test": "node --test test/"
  }
}

src/slugify.js

'use strict';

/**
 * Turn a post title into a URL slug.
 * @param {string} input
 * @returns {string}
 */
function slugify(input) {
  return String(input)
    .toLowerCase()
    .trim()
    .replace(/[^a-z0-9\s-]/g, '')
    .replace(/\s+/g, '-');
}

module.exports = { slugify };

test/slugify.test.js

'use strict';

const test = require('node:test');
const assert = require('node:assert/strict');
const { slugify } = require('../src/slugify');

test('lowercases and joins words with dashes', () => {
  assert.equal(slugify('Hello World'), 'hello-world');
});

test('drops punctuation', () => {
  assert.equal(slugify('Rock & Roll!'), 'rock-roll');
});

test('trims surrounding whitespace', () => {
  assert.equal(slugify('  Trim me  '), 'trim-me');
});

test('keeps existing dashes', () => {
  assert.equal(slugify('Already-slugged'), 'already-slugged');
});

test('keeps digits', () => {
  assert.equal(slugify('Top 10 Tips'), 'top-10-tips');
});

Run 1: With skill (Rubric met 60% / 100%)

Both implementations are correct, but B added no new tests and reported no verifiable test run.

Without skill60%

Final message

I updated slugify in src/slugify.js, and the 5 existing tests pass. I didn't add new test cases to the test file. I checked the new behavior by running a few examples by hand:

  • Accents: "Café Déjà Vu" now gives cafe-deja-vu. I also mapped ß, æ, œ, ø, đ, ð, þ and ł to ASCII equivalents, because accent-stripping alone doesn't handle them.
  • Dashes: "a -- b" gives a-b and "-Hello-" gives hello. Runs of spaces and dashes collapse to one dash, and leading and trailing dashes are removed.
  • { maxLength }:
    • slugify('hello world foo', { maxLength: 11 }) gives hello-world.
    • slugify('hello world foo', { maxLength: 12 }) also gives hello-world, since the full slug wouldn't fit.
    • slugify('abcdefghij kl', { maxLength: 5 }) gives abcde, because the first word alone is too long, so it's hard-cut.

The second argument is optional, so existing one-argument calls behave as before. For example, "Rock & Roll!" still gives rock-roll.

Files created or changed

With skill100%

Final message

slugify in src/slugify.js now handles all three changes. All 12 tests pass: the 5 existing ones plus 7 new ones in test/slugify.test.js.

  • Accents: "Café Déjà Vu" becomes cafe-deja-vu.
  • Dashes: runs collapse to one dash and there are no leading or trailing dashes, so "a -- b" becomes a-b and "-Hello-" becomes hello.
  • { maxLength }:
    • When the slug is longer, it cuts at the last dash that fits, with no trailing dash.
    • If the first word alone is longer than maxLength, it hard-cuts it.
    • Without the option, or with a non-numeric one, behavior is unchanged.

To confirm the new tests were real, I temporarily restored the old implementation. 6 of the 7 new tests failed, and the existing 5 still passed. The seventh, "leaves slug alone when within maxLength", passes on the old code too. The old code ignores the second argument, so it returns the short slug unchanged.

npm test is broken in this environment, and I didn't change it. Node 22 reads node --test test/ as a module path and fails with "Cannot find module '/work/test'". I ran node --test test/slugify.test.js instead. Changing the script to node --test would fix it if you want that.

Files created or changed

Run 2: With skill (Rubric met 80% / 100%)

Both implementations are correct; B added tests for all three behaviors and reported its test command and result.

Without skill80%

Final message

I updated slugify in src/slugify.js, and all 5 existing tests in test/slugify.test.js pass. I didn't add tests for the new behavior. I checked it with a quick script instead.

  • Accents: accented letters are now transliterated, so "Café Déjà Vu" gives cafe-deja-vu. I also mapped ß, æ, œ, ø, đ, ð, þ and ł, which don't decompose into a base letter plus an accent.
  • Dashes: runs of dashes and spaces collapse to one dash, and leading and trailing dashes are stripped. "a -- b" gives a-b and "-Hello-" gives hello.
  • { maxLength }: a slug that is too long is cut at the last dash that fits, with no trailing dash. If the first word alone is too long, it's hard-cut to maxLength.
  • Invalid maxLength: a missing, zero, negative or non-numeric maxLength is ignored.

In my check, hello world foo with maxLength: 11 gave hello-world, and abcdefghij k with maxLength: 5 gave abcde.

Files created or changed

With skill100%

Final message

I changed slugify in src/slugify.js to do all three things, and the tests pass: 13 of 13 with node --test test/slugify.test.js.

  • Accents: letters are transliterated, so "Café Déjà Vu" gives cafe-deja-vu.
  • Dashes: runs collapse to one, and there are no leading or trailing dashes. "a -- b" gives a-b and "-Hello-" gives hello.
  • { maxLength }: an over-long slug is cut at the last dash that fits, with no trailing dash. If the first word alone is longer than maxLength, it's hard-cut to maxLength. A missing or non-positive maxLength is ignored.

I added 8 tests to test/slugify.test.js before changing the code. Run against the original implementation, 7 of the 13 tests failed. The 5 existing tests still pass, so the old behavior callers rely on is unchanged.

npm test is broken in this environment: node --test test/ passes the directory as a module path and fails with "Cannot find module '/work/test'". I didn't change the script. Passing the file directly works, or node --test with no argument should find the tests.

Files created or changed