Code Happier With The Cycle: Code, Test, Fail, Diff, Fix, Pass, Commit, Repeat



If I could convince developers of one thing it would be this: Writing tests and using version control together during development is the simplest way to improve your life. So I will.


After 15 years of being a developer, teaching software engineering, trying to get people to see the light on testing, I have hit upon the single most important technique you can learn. If you do nothing else to improve your life as a developer, it is to learn this simple cycle:

1) Write code.
2) Write tests.
3) Fail the tests.
4) Look at the diff and fix it.
5) Pass the tests.
6) Commit.
7) Repeat.

This simple, short development cycle (code, test, fail, diff, fix, pass, commit, repeat) will make you code faster, happier and with more confidence. It takes advantage of the synergy between aggressive, but simple, use of testing and version control. It can, and should, be learned by any developer of any technology in all circumstances.

If you’re struggling as a developer.
If you fear changing code.
If you’ve never gotten around to writing tests.
If you’re never sure when to commit code.
If your code always has bugs.
Attend this session.

Speaking experience


  • Schwern round tuit oscon 2005


    Schwern has a copy of Perl 6, he lets Larry Wall borrow it and take notes.

    Schwern once sneezed into a microphone and the text-to-speech conversion was a regex that turns crap into gold.

    Damian Conway and Schwern once had an arm wrestling contest. The superposition still hasn’t collapsed.

    Schwern was the keynote speaker at the first YAPC::Mars.

    When Schwern runs a smoke test, the fire department is notified.

    Dan Brown analyzed a JAPH Schwern wrote and discovered it contained the Bible.

    Schwern writes Perl code that writes Makefiles that write shell scripts on VMS.

    Schwern does not commit to master, master commits to Schwern.

    SETI broadcast some of Schwern’s Perl code into space. 8 years later they got a reply thanking them for the improved hyper drive plans.

    Schwern once accidentally typed “git pull —hard” and dragged Github’s server room 10 miles.

    There are no free namespaces on CPAN, there are just modules Schwern has not written yet.

    Schwern’s tears are said to cure cancer, unfortunately his Perl code gives it right back.


      • Title: How To Report A Bug
      • Track: Cooking
      • Room: Broadway
      • Time: 3:454:30pm
      • Excerpt:

        Bug reports drive Open Source, but too often it’s a hostile experience. As a user, how do you report a bug without being treated like you’re dumping a sack of crap on the developer’s doorstep? As a developer, how do you encourage users to report bugs? This is not a tutorial, but an examination of the social aspects of bug reporting.

      • Speakers: Michael Schwern
      • Title: Your Internets are Leaking
      • Track: Cooking
      • Room: Morrison
      • Time: 4:455:30pm
      • Excerpt:

        Using your computer on a public network is like having a conversation on a city bus: people you don’t know can hear everything you say. They’ll probably be polite and ignore you, but you still might not want to shout out your credit card number. Yet this is what your computer does. All the time. And you don’t know it.

      • Speakers: Reid Beels, Michael Schwern