我试图使用doxygen来记录我的单元测试,但我想记录它们与代码而不是在测试头中的行,以减少复制/粘贴错误时进行类似的测试。值得注意的是,我正在使用RTF输出格式。记录单元测试符合代码
/** @brief A method for testing doxygen method documentation
* @test
* -#Step 1
* -#Step 2
* -#Step 3
*/
[TestMethod()]
public void DoxygenScratchPadInHeader()
{
// code that may or may not be in sync with header
}
/** @brief A method for testing doxygen method documentation
* @test
*/
[TestMethod()]
public void DoxygenScratchPadInLine()
{
/// @par
/// -# Initialize the value to 0
int i = 0;
/// @par
/// -# Add a number
i += 3;
/// @par
/// -# Assert that the number is three
Assert.AreEqual(3, i);
}
测试列表输出:
会员UpdateProtocolQATests.CUpdateProtocolTest.DoxygenScratchPadInHeader()
- 步骤1
- 步骤2
- 步骤3
会员UpdateProt ocolQATests.CUpdateProtocolTest.DoxygenScratchPadInLine()
{注意这里没有台阶}
功能描述输出:
空隙UpdateProtocolQATests.CUpdateProtocolTest.DoxygenScratchPadInHeader()
一种用于测试doxygen的方法的文档的方法。 测试:
- 步骤1
- 步骤2
- 步骤3
空隙UpdateProtocolQATests.CUpdateProtocolTest.DoxygenScratchPadInLine()
一种用于测试doxygen的方法的文档的方法。 测试:
1. Initialize the value to 0
1. Add a number
1. Assert that the number is three
{显示最后一位为代码,因为计算器是纠正重复1. 1. 2. 3 ...这是我真正想要的到底是...}
任何更好的想法来实现在线测试步骤文档?我不太关心没有出现在测试列表中的步骤,我们只能参考这些功能。
有时需要满足监管要求。 FDA不专注于理解明确的代码,他们有时希望以段落形式列出所有内容。我的测试不到十行代码,很容易被开发人员理解,但不一定非开发人员。 –
这种模式的评论比代码更多,在我与之合作的医疗设备公司中相当标准。 –
你有一个很好的观点;我想我们都已经读过关于Therac-25的某个或那个点。对于无建树的评论感到抱歉。 – Augusto