Praspel与C程序漏洞检测技术解析
Praspel:基于契约的PHP测试规范语言
Praspel是一种用于PHP基于契约测试的规范语言,下面我们详细了解其相关概念与应用。
测试用例生成算法
以下是测试用例生成算法的代码:
function generateTests(nbTests, maxTries, methods)
begin
tests ← 0
do
tries ← 0
f ← select method under test amongst methods
do
tries ← tries + 1
for each parameter p of f do
t ← select realistic domain of p
i ← generate random value ∈[1..card(t)]
v ← ith value of realistic domain t
assign value v to parameter p
done
while f precondition fails ∧ tries ≤ maxTries
if tries ≤ maxTries then
run test case / keep test case
超级会员免费看
订阅专栏 解锁全文
7

被折叠的 条评论
为什么被折叠?



