能否请您提供一些有关如何编写有关软件API(功能)的结构化,可测试的要求的指南?
例如,让我们看一下以下文档:
_Unwind_Reason _Unwind_RaiseException( struct _Unwind_Exception *exception_object );
Raise an exception, passing along the given exception object, which should have its exception_class and exception_cleanup fields set. The exception object has been allocated by the language-specific runtime, and has a language-specific format, except that it must contain an _Unwind_Exception struct (see Exception Header above). _Unwind_RaiseException does not return, unless an error condition is found (such as no handler for the exception, bad stack format, etc.). In such a case, an _Unwind_Reason_Code value is returned. Possibilities are:
- _URC_END_OF_STACK: The unwinder encountered the end of the stack during phase 1, without finding a handler. The unwind runtime will not have modified the stack. The C++ runtime will normally call uncaught_exception() in this case.
- _URC_FATAL_PHASE1_ERROR: The unwinder encountered an unexpected error during phase 1, e.g. stack corruption. The unwind runtime will not have modified the stack. The C++ runtime will normally call terminate() in this case.
If the unwinder encounters an unexpected error during phase 2, it should return _URC_FATAL_PHASE2_ERROR to its caller.
这是一个文档。必须将其转换为一组需求(层次结构列表?),并且每个需求必须具有其自己的唯一ID,并且必须可以清楚地测试。
非常感谢您的建议!