2.3 nunit/dunit testing
unit testing is a methodology of adding tests to your code in such a way, that the tests themselves can be run and verified by a test project, reporting the continued validity of your source code. for best results, unit testing should be applied right from the start, adding tests to your classes as you write the actual code itself (some people even believe you should write your test first, and then the actual code to test). unit testing can also play a very helpful role when applying refactoring, if only to verify that the resulting refactored source code is still behaving the same - correct - way.
dunit/nunit
a unit testing framework is often called an xtreme testing framework, related to xtreme programming. delphi 2005 includes both dunit (for win32 and .net) and nunit. dunit (http://dunit.sourceforge.net/) is the delphi version of the unit-testing framework (for both win32 and .net), while nunit (http://www.nunit.org/) is a .net language neutral unit-testing framework which can be used with both c# and delphi for .net.
both dunit and nunit are included and integrated with delphi 2005.
test project wizard
for every project, you can add an associated test project to the project group using the new test project wizard. for delphi win32 projects, this will use the dunit test framework. for delphi for .net projects, you can select either the .net version of the dunit test framework, or the nunit test framework, and finally for c# projects this will use the nunit test framework. both the dunit (for .net or win32) and nunit test frameworks offer a choice of a gui or console test runner to execute and display the test results.
test case wizard
within a test project, you can use the new test case wizard to add specific test cases for units that belong to the project. for each unit, you can select the classes and methods of these classes that will be added to the test. an example test skeleton can also be generated so you can later add your own tests manually.
test runners
once a test project with test cases is maintained, there is a separate test-runner environment that you can start from the delphi 2005 ide to run the tests, and view the results. you get feedback on all errors and failures (if any), the tests that were not run, and the output written to the console.
unit testing helps to increase the quality, maintainability and reuse capabilities of your code, and having unit testing integrated into the delphi 2005 ide makes it even easier to implement.
2.4 database
borland delphi 2005 offers ado.net-specific as well as vcl and vcl for .net database support.