TDD, BDD, software testing, and QA

The field of software testing has made some really interesting strides in recent years, primarily in the fields of test-driven development (TDD) and behavioral-driven development (BDD).

I'm not going to get into TDD and BDD too much in this article, but I would like to share some resources about each subject.

Test-driven development (TDD)

TDD was spawned from the Java JUnit tool and eXtreme Programming. In short, TDD can be described this way:

Write the test, then write the code.

Or, in a slightly longer approach, Robert Martin put forth the Three Laws of TDD:

  1. You are not allowed to write any production code unless it is to make a failing unit test pass.
  2. You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
  3. You are not allowed to write any more production code than is sufficient to pass the one failing unit test.

Here are a few links related to TDD:

  1. TDD on Wikipedia
  2. Bob Martin's Three Rules of TDD
  3. JUnit

Behavior-driven development (BDD)

These days, BDD is much more interesting to me than TDD. BDD brings the domain experts into the software testing and QA arena, and based on my experience, I think that's a very good thing. For years domain experts have had to rely on programmers to say, "Yes, the tests are passing", but the domain experts never really knew what those tests were.

BDD helps put the field of automated software QA in the hands of the domain experts, where they can either write the tests themselves in something very close to human language, or work with developers to write those tests -- in a way that is much easier than TDD. Beyond that, BDD also helps link software requirements directly to software tests, which is another great thing.

Here are a few links related to BDD:

  1. Dan North's original document on BDD
  2. BDD on Wikipedia
  3. Scala - specs2
  4. ScalaTest
  5. Java - Concordion
  6. FIT - Framework for Integrated Test
  7. Fitnesse - Built on FIT

TDD, BDD, software testing, and QA

I hope this very brief introduction into TDD, BDD, software testing, and QA has been helpful. As you can see from those BDD links, the software testing industry has made great strides in the last 5-10 years. While JUnit, XP, and automated testing were all very good things, the next wave of software testing appears to be in BDD, which directly ties software requirements to software tests that domain experts (non-programmers) can not only read, but can also create and execute themselves.

Reporting live from beautiful Boulder, Colorado, this is Alvin Alexander.

Valley Programming is currently a one-person business, owned and operated by Alvin Alexander. If you’re interested in anything you read here, feel free to contact me at “al” at (“@”) this website name (“valleyprogramming.com”), or at the phone number shown below. I’m just getting back to business here in November, 2021, and eventually I’ll get a contact form set up here, but until then, I hope that works.