def test001(a):
if a>0:
print("输出语句1")
else:
print("输出语句2")
以上函数片段,流程图转流图如下:流图可看出复杂度(条件个数+1)与用例数
def test001(a,b):
if a>0 and b<0:
print("输出语句1")
else:
print("输出语句2")
一个条件一个圈:
def test001(a,b):
if a>0 or b<0:
print("输出语句1")
else:
print("输出语句2")
def test001(a,b):
if a>0 and a<10 and b>10 and b<20:
print("输出语句1")
elif a>=10 and a<100 and b>20 and b<10:
print("输出语句2")
else:
print("输出语句3")
本文内容不用于商业目的,如涉及知识产权问题,请权利人联系51Testing小编(021-64471599-8017),我们将立即处理