What Test-Driven Scoffolding (TDS) does...

TDS is a slightly relaxed version of Test-Driven Development (TDD) for C# projects, providing templates for drivers of function members, such as methods or indexers, and (optionally) generating test reports.

(See Notes below for current status and FAQ-style questions..)

When you develop a new function member or modify an existing one, you must often also write some additional calling code that exists only to exercise the code that you are developing -- which is what you're really interested in. The software provided on this site (as C# source code) is intended to help you quickly produce this exercising or calling code, giving you a template that you may copy and use for this purpose, instead of writing custom code each time. It is intended to be easily modified to provide inputs to your code, to inspect the results, and to display a report of those results.

Basic instructions and examples are provided in the downloadable C# source-code file. The TDS code can support building a new function member (such as a method), then, after the new code is functional, the TDS code can easily be removed without affecting the new function member, in a manner similar to removing the scaffolding on a completed building.

The C# code provided in this site can be downloaded and used in a new or existing project, then removed (almost without a trace) when it is no longer needed. The code in TDS.cs is in the public domain and is intended to be modified in any way you might find useful, without restriction.


The TDS code may be used in any of the following ways:
  • Test methods based on the TDS templates may be used as drivers for use in tracing through or debugging the function members that you develop, without involving any unit-testing activity. For example, XSLT files or RegEx patterns can be tricky to develop, and TDS can help you exercise them by feeding them example inputs and observing the results.
  • The TDS built-in test facility may be used, instead of NUnit or Visual Studio Test, in conjunction with test methods based on the TDS templates, to generate unit-test reports on the Console. These reports can be saved for later comparison to verify that no significant change in behavior has occurred.
  • NUnit or Visual Studio Testing may be used to generate reports of unit tests based on the TDS templates. (TDS test methods can run unchanged with either NUnit or Visual Studio Test.)

If you notice any problems with code or documentation, please post a comment so that corrections can be posted.

System requirements

The current release has been tested with Microsoft Visual Studio Express 2013 for Windows Desktop (as well as VS 2012 and VS 2010). It may work with earlier versions but has not been tested with them. It has also been tested with NUnit 2.6.3 and Microsoft VS Test and appears to work correctly with them, generating results similar to those produced by the stand-alone version of TDS. (See the instructions for examples.)

Design goals included making TDS usable in a minimal development environment, such as with the free-of-charge Express versions of Visual Studio. Once developed, a TDS application may be called from a command prompt to test other code, but the instructions assume that the TDS test methods are developed with the assistance of Visual Studio.


Version 1.7 is available

The Visual Studio 2012/2013 version of the code is available on the Downloads tab. Please post any comments or requests in either "DISCUSSIONS" or "ISSUES" on this site. The Version 1.4 User's Guide is still usable and contains more detailed instructions and examples than are included in Version 1.7, though some details have changed. (Note: A typo in the code was corrected as of Dec. 23, 2013; see the Downloads page.)

How is TDS different from NUnit or VS Test?

TDS test reports, if all TDS filters are disabled, are designed to be almost identical to (a subset of) NUnit or VS Test reports. However, TDS uses a different filtering mechanism to facilitate debugging and tracing. With TDS filters enabled (via suitable edits to the TDS source code), a single test case of a single TDS test method, for example, may be selected for running. This makes it easy to trace into a rarely used part of the function member being developed. AFAIAA, it is more difficult to set up VS Test or NUnit to generate similar stimuli to exercise testable code.

Why is this not a Wizard?

This code is distributed exclusively as C# source code, rather than as a Wizard or in some other more automated form, to allow you as much flexibility as possible in incorporating it into your projects. Also, since you have access to all of the source code in this one file, you can easily examine the code to determine that it is safe to use.

I have considered expressing the TDS.cs code as a Visual Studio T4 text template, but for now have opted not to do so, to try to avoid complicating the code. (Some people may wish to edit and build without having to run a text-transformation tool such as Visual Studio.)

Is it a hassle to install and use TDS?

As I hope the instructions make clear, your first use of TDS will likely involve a modest amount of work, such as familiarizing yourself with its contents and navigation features, trimming out unneeded parts, and customizing the code to fit your project.

For example, in a current project of mine, I have chosen not to use either NUnit or VS Test, at least for now. For this project, since I expect to use TDS only as a driver to help debug it and to display a basic report showing which test methods are currently working, I deleted the unneeded code from TDS.cs. Doing this reduced the approximately 5000 lines of C# code in the downloadable file to about 2100 lines (plus the test methods I've added), giving me a lightweight mechanism to run and/or test a few function members, which is all that this project needs for now. If I should later need some of the code that I removed from this project's version of the TDS.cs file, it is easily restored by copying from the downloaded TDS.cs.

After you have customized the code, of course, it should be and remain quite easy to use.

Will a new version be published soon?

No, this is probably the last release for a while. Unless someone posts a bug report or requests a new feature, I have no current plans to release any further updates to TDS. (It's working well in my projects, and those projects need my attention more than TDS does.) I am therefore calling this a "stable" version not so much because I think it is free of bugs, as because it seems to do everything I need for the moment and I am not aware of any bugs. I hope you are able to find it useful as well. (As in previous releases, you are still invited to use the "Discussions" tab on this site to post feedback).

However, I may post some examples of TDS usage. I am using TDS to assist me in developing some code for modifying ADO.NET Entity Framework (*.edmx) files, and I may post some example TDS test methods along with the finished code. So... there are no plans to change the TDS.cs code, but there may be additions to the documentation on this site.

Last edited Mar 15 at 2:20 PM by vjohns, version 39