Object Test Bench (OTB)
We’ve all done it: added a Console.WriteLine, hit F5, navigated through five screens of UI, and finally reached the one method we actually wanted to test. Object Test Bench (OTB) exists to make that loop unnecessary.
OTB is a Visual Studio feature that lets you create live object instances and invoke their methods interactively, directly from Class View. No test project, no console harness, no UI navigation. You pick a class, construct an instance with whatever parameters you need, and call methods one at a time while watching the results in the OTB window.
Getting started
Open your project’s class diagram via View → Class Diagram in the project properties. Once the diagram is visible, switch to Class View, right-click the class you want to exercise, and select Create Instance. Visual Studio will prompt for constructor parameters and a name for the instance—give it something meaningful if you plan to call multiple methods.
The instance then appears in the Object Test Bench window. From there you can right-click any method, supply arguments, and invoke it. The return value appears inline. Change the parameters, invoke again. It’s interactive in the same way a REPL is interactive, but for any .NET class without any configuration overhead.
A concrete example
Say you have a StringProcessor class with a Format(string input, int maxLength) method. Rather than wiring up a unit test just to verify edge cases, you open OTB, instantiate StringProcessor, and call Format with null, with an empty string, with a value longer than maxLength. Each call takes seconds. You see exactly what the method returns or whether it throws.
This is especially useful when you’re unfamiliar with a class you’ve just inherited—OTB lets you probe it empirically before you start reading through the implementation.
What it isn’t
OTB is a development-time exploration tool, not a replacement for automated tests. It doesn’t record your sessions, it doesn’t assert outcomes, and it doesn’t run in CI. Think of it as a scratch pad for your object model. The tests you write afterward should be informed by what you discovered in OTB, not replaced by it.
The Microsoft documentation on OTB covers the full workflow if you want to go deeper.