top | item 47199755

(no title)

WestN | 1 day ago

Short take: replace TDD with BDD, and might add DDD as a spice. Otherwise this is a fairly good article.

Why not TDD? Since a lot of developers use LLMs to create tests today, plus a lot of the training data contains information on how to do this. Making it something that it either can figure out to do by itself or that it will cheat. Both equally bad.

A somewhat controversial take is that you should simply avoid writing tests which the LLM can produce by itself, similar to how we in the last week removed the agents.md file.

discuss

order

esperent|21 hours ago

Modern testing frameworks already use BDD (behavior driven development , which simply means writing tests in natural language. BDD is a superset of TDD:

    import { describe, it, expect } from 'vitest';

    describe('User Authentication', () => {
      it('should allow login with valid credentials', () => {
        const result = login('user@example.com', 'password123');
          expect(result.isAuthenticated).toBe(true);
  });

This is BDD and every testing framework I've used in my entire career and 95% of the tests I've written look something like that.