A method and system for dynamically invoking and/or checking conditions of
a computer test program. Test cases that verify class/component
functionality are automatically created from the DbC contracts. When the
classes/components that contain DbC contracts are added to the system,
the invention automatically verifies whether the system uses them
correctly. The information in the contract continents is used to generate
more comprehensive and better quality test cases.In one embodiment, a
code's specification information is analyzed and a class with extra
bytecodes that describe how the class is supposed to work and be used is
generated. Next, the instrumented class is integrated into the system,
and the system is run. The system is monitored as it runs and contract
violations are automatically detected.