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:
- You are not allowed to write any production code unless it is to make a failing unit test pass.
- You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
- 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:
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:
- Dan North's original document on BDD
- BDD on Wikipedia
- Scala - specs2
- ScalaTest
- Java - Concordion
- FIT - Framework for Integrated Test
- 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.
Recent blog posts
- Free Scala and functional programming video training courses
- Free: Introduction To Functional Programming video training course
- The #1 functional programming (and computer programming) book
- The User Story Mapping Workshop process
- Alvin Alexander, Certified Scrum Product Owner (CSPO)
- Alvin Alexander is now a Certified ScrumMaster (CSM)
- Our “Back To Then” app (for iOS and Android)
- A Docker cheat sheet
- Pushing a Scala 3 JAR/Docker file to Google Cloud Run
- Reading a CSV File Into a Spark RDD (Scala Cookbook recipe)