软件测试Hw3: Question in the book.

a) Draw the control flow graph for the printPrimes() method.

a) Consider test cases t1=(n=3) and t2=(n=5). Although these tour the same prime paths in printPrimes(), they do not neccessarily find the same fault. Design a simple fault that t2 would be more likely to discover than t1 would.

If we change the first for in the while loop “i++” to “i+=2”. In test case, we can get the right answer 2, 3, 5. But in test case2, we get the result 2,3,5,6,7, it’s wrong. Because , it escape the 3 when check 6. This is the fault that t2 would be more likely to discover than t1 would.

 

b) For printPrimes(), find a test case such the corresponding test path visits the edge that connects the beginning of the while statement to the for statement without going through the body of the while loop.

The test case is case=(n=1).

 

c) Enumerate the test requirements for node coverage, edge coverage, and prime path coverage for the graph for printPrimes().

Prime path:

1 2 3 4 5 7 8 9 10 11 13

1 2 3 4 5 7 9 10 11 13

1 2 3 4 8 9 10 11 13

1 2 10 11 13

11 12 11

4 5 6 4

2 3 4 5 7 8 9 2

2 3 4 5 7 9 2

2 3 4 8 9 2

转载于:https://www.cnblogs.com/lmns/p/6551373.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
java.lang.IllegalStateException: Failed to execute CommandLineRunner at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:798) [spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE] at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:779) [spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:322) [spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE] at com.unkown.data.hw.ipran.straight.collect.UnkownDataHwIpranStraightCollectApplication.main(UnkownDataHwIpranStraightCollectApplication.java:39) [classes/:na] Caused by: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.unkown.data.hw.ipran.straight.collect.dao.RTrsHwIpranCircuitDao.queryById at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:235) ~[mybatis-3.5.5.jar:3.5.5] at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:53) ~[mybatis-3.5.5.jar:3.5.5] at org.apache.ibatis.binding.MapperProxy.lambda$cachedInvoker$0(MapperProxy.java:115) ~[mybatis-3.5.5.jar:3.5.5] at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[na:1.8.0_271] at org.apache.ibatis.binding.MapperProxy.cachedInvoker(MapperProxy.java:102) ~[mybatis-3.5.5.jar:3.5.5] at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:85) ~[mybatis-3.5.5.jar:3.5.5] at com.sun.proxy.$Proxy108.queryById(Unknown Source) ~[na:na] at com.unkown.data.hw.ipran.straight.collect.service.impl.RTrsHwIpranCircuitServiceImpl.queryById(RTrsHwIpranCircuitServiceImpl.java:29) ~[classes/:na] at com.unkown.data.hw.ipran.straight.collect.controller.RTrsHwIpranCircuitController.IpranSend(RTrsHwIpranCircuitController.java:54) ~[classes/:na] at com.unkown.data.hw.ipran.straight.collect.MyRunner.run(MyRunner.java:24) ~[classes/:na] at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:795) [spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE] ... 5 common frames omitted
05-18

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值