matlab.unittest.qualifications.Verifiable Class
Namespace: matlab.unittest.qualifications
Qualification to produce soft-failure conditions
Description
The Verifiable
class provides a qualification to produce soft-failure
conditions. Apart from actions performed for failures, the Verifiable
class
works the same as other qualification classes in the matlab.unittest.qualifications
namespace.
Upon a verification failure, the Verifiable
class informs the testing
framework of the failure, including all diagnostic information associated with the failure,
but continues to execute the currently running test without throwing an exception. This
behavior is most useful when a failure at the verification point is not fatal to the remaining
test content. Often, you use verifications as the primary qualification type within a
Four-Phase Test. Use other qualification types, such as assumptions,
assertions, and fatal assertions to test for violation of preconditions or incorrect test
setup.
Because verifications do not throw an exception, all test content runs to completion even when the test fails. This behavior helps you understand how close a piece of software is to meeting the test suite requirements. Qualification types that throw exceptions do not provide this insight, because once an exception is thrown, an arbitrary amount of code remains that is not reached or exercised. Verifications also provide more testing coverage in failure conditions. However, if you overuse verifications, they can produce excess noise for a single failure. If a failure will cause later qualification points to also fail, use assertions or fatal assertions instead.
The matlab.unittest.qualifications.Verifiable
class is a handle
class.
Methods
Events
Event Name | Trigger | Event Data | Event Attributes |
---|---|---|---|
VerificationFailed | Triggered upon failing verification. A QualificationEventData
object is passed to listener callback functions. | matlab.unittest.qualifications.QualificationEventData |
|
VerificationPassed | Triggered upon passing verification. A QualificationEventData
object is passed to listener callback functions. | matlab.unittest.qualifications.QualificationEventData |
|