Articles Feed

Authors

Categories

BOC

by: micah | November 12th, 2006 |

BOC (Build Operate Check) n. : The typical flow of an automated test*

BOC is a testing pattern that Unclebob briefly mentioned on fitnesse.org shortly after it was published. It describes the typical steps taken in an automated test.

Experienced test writer use BOC whether they know it or not. For new-commers to automated testing, BOC is lesson #1.

If you think about it, BOC is very logical. Every test is testing something; some Operation that the system under test (SUT) performs. That’s where the Operate step comes from.

In almost all cases, you can’t just invoke the operation. The automated test Builds a testable environment first. Maybe data needs to be put in a database, or a service layer needs to be started. Either way, the Build step comes first.

After invoking the Operation, a test needs to Check that it behaved as expected. Clearly, the Check step has to come last.

Example:

Consider a test for the Withdraw feature of an ATM machine.

Build:

Operate:

Check:

Next time you’re writing an automated test, think about it. More likely than not, you’re using BOC.

1 Response to “BOC”

  1. David Chelimsky Says:
    BDD is based on a similar triad - basically the same, but with different names: Given, When, Then. The nice thing about that is that customers and developers can talk about it and it means the same thing: Given an account with 500 bucks When you withdraw 250 Then there should still be 250 It's almost exactly the same, just possibly more customer friendly lingo.

Leave a Reply

#