Dunit2
Re-write of Dunit
Design aims used during project development, not necessarily
in any particular order :-
- Introduce SetUpOnce and TearDownOnce per TestCase and
TestSuite.
- Hopefully improve speed of test execution.
- Introduce multiple "Projects" and open the way to
run projects in separate threads.
- Improve the ease of using Dunit. (in part by adding more
example documentation)
- Ensure TTestCase Constructors and Destructors only
execute once, not for each contained test method.
- Provide a non global var means for sharing high level setup
data between test units.
- Improve the applicability of time measurements.
- Provide a visual count of detected memory leaks and checkless
tests.
- Provide an optional count to identify which Check()
failed.
- Continue support for Win32 (D5..BDS2006) and DotNet.
Current status is as follows:-
- New code remains compatible with existing test suites not
relying on user modified Dunit code.
- New code remains compatible with existing test suites not
relying on low level TestFramework functions (e.g.
TTestResult).
- New code introduces a Project and
ProjectManager class between the GUI and TextTestRunners
to assist the future introduction of threaded unit testing.
- SetupOnce and TeardownOnce code reduces node and name clutter
where test decorators would have previously been required.
- New Test Decoration code is easier to comprehend and
extend.
- Execution call depth per TestCase procedure has been reduced
in an effort to improve testing efficiency. (Execution path is
easier to follow and so eases future code change).
- Individual test procedure timing is now taken on just the
test method and excludes SetUp and TearDown times. The intention
being to provide higher timing accuracy for method profiling.
Overall Timing still brackets all code.
- All existing Check procedures are supported. Several new
Check procedures have been added to complete the range
available.
- New unit tests have been created to verify all Check()
procedures detect pass and fail conditions.
- All tests run without memory leaks or the need to allow
leaks.
- New unit tests are more comprehensive including checks to
ensure setup conditions are properly met before executing the
required tests.
- A Project class now handles registration and execution of
grouped TestCases (TestSuites) and TestCases.
- Unit tests compiled into DLLs can be registered and execute
as projects. However, the count of executed tests in projects has
become intermittent. Aaarrghhh)
- Counted Tests can now be invoked inside nested Test
Decorators to provide 2 or more dimensional test data
- Non Optimized empty tests still fail.
- Tests that don't call Check() can be globally armed to
fail, i.e. from the GUI.
- Similarly tests causing memory leaks can optionally be
globally armed to fail.
- Individual tests can optionally override the above GUI
settings. (e.g. where a 3rd party component has a know leak)
- All tests that override GUI settings can optionally be
identified after test execution by additional node colours.
- A count of overridden test failures is included in the
execution status display.
- Overridden tests which would otherwise have failed generate a
separate warning count visible in the updated GUI.
- Test Method names are decoupled from the execution process,
allowing post compile information to be displayed at the GUI
level.
- Added XML report generator, supplementing both GUITestRunner
and TextTestRunner.
- Added capability in both GUITestRunner and TextTestRunner to
skip (Exclude) individual tests separate from Enabling/Disabling
tests.
- Tool buttons to GUITestRunner to ease control and show at
runtime which soft options have been selected.
To facilitate early testing without completely re-developing
GUITestsRunner and TextTestRunner an intermediate Proxy unit and
a TTestResults replacement has been interposed between the GUI
and new TestFramework. Although the original aim was to
eventually completely re-develop the GUI the "Proxy"
classes are working very well and may not need further work.
Back to Top
Further ideas are:-
- Support multiple exception types in CheckExceptions by adding
a new Check, taking a const array of exception classes.
- As an option, enable the GUI to display the collapsed view
and only expand the node view for failed TestCases.
- Add the ability to run a minimal set of Summary Level tests
and automatically display and execute "Detailed Level"
test methods when a Summary level Check fails.
- Add support for multiple Behavior Driven Development (BDD)
functions per test method to seamlessly allow a change in focus
from unit testing to specifying behavior.
- Allow tests to call external scripts to enable a data driven
testing process.
- Enable test execution times and success to be recorded for
historical comparison.
Back to Top
Page last updated 27th-Dec-2007