这里没有软件测试的泛泛理论,只有博主的最佳实践。
博主的研究方向为静态分析和性能测试,致力于各种测试工具的引入、评估和开发。
本博的测试文章均为作者原创,转载请务必注明出处。
基于目标码的覆盖率测试报告
上一篇 /
下一篇 2008-07-29 11:45:51
废话不多说,有心人一看便明白。
COVERAGE SUMMARY:
Number of instructions in the listing: |
33 |
|
Instructions executed: |
25 |
75.76% |
Instructions not executed: |
8 |
24.24% |
Incomplete conditions: |
0 |
0.00% |
Status: |
*** COVERAGE INCOMPLETE *** |
COVERAGE LISTING:
1
2 sut.o: file format pe-i386
3
4 Disassembly of section .text:
5
6 00000000 <_functionUnderTest>:
7 #include "FunctionUnderTest.h"
8
9 /**************************************/
10 int functionUnderTest(char c)
11 {
12 * 0: 55 push %ebp
13 * 1: 89 e5 mov %esp,%ebp
14 * 3: 83 ec 08 sub $0x8,%esp
15 * 6: 8b 45 08 mov 0x8(%ebp),%eax
16 * 9: 88 45 ff mov %al,0xffffffff(%ebp)
17 if (IS_DEC_DIGIT(c))
18 * c: 80 7d ff 2f cmpb $0x2f,0xffffffff(%ebp)
19 * 10: 7e 12 jle 24 <_functionUnderTest+0x24>
20 * 12: 80 7d ff 39 cmpb $0x39,0xffffffff(%ebp)
21 * 16: 7f 0c jg 24 <_functionUnderTest+0x24>
22 {
23 return DEC_VALUE(c);
24 * 18: 0f be 45 ff movsbl 0xffffffff(%ebp),%eax
25 * 1c: 83 e8 30 sub $0x30,%eax
26 * 1f: 89 45 f8 mov %eax,0xfffffff8(%ebp)
27 * 22: eb 1f jmp 43 <_functionUnderTest+0x43>
28 }
29 else if (c >= 'a' && c <= 'f')
30 * 24: 80 7d ff 60 cmpb $0x60,0xffffffff(%ebp)
31 * 28: 7e 12 jle 3c <_functionUnderTest+0x3c>
32 * 2a: 80 7d ff 66 cmpb $0x66,0xffffffff(%ebp)
33 * 2e: 7f 0c jg 3c <_functionUnderTest+0x3c>
34 {
35 return (int)(c - 'a')+10;
36 * 30: 0f be 45 ff movsbl 0xffffffff(%ebp),%eax
37 * 34: 83 e8 57 sub $0x57,%eax
38 * 37: 89 45 f8 mov %eax,0xfffffff8(%ebp)
39 * 3a: eb 07 jmp 43 <_functionUnderTest+0x43>
40 }
41 else
42 {
43 return -1;
44 * 3c: c7 45 f8 ff ff ff ff movl $0xffffffff,0xfffffff8(%ebp)
45 }
46 }
47 * 43: 8b 45 f8 mov 0xfffffff8(%ebp),%eax
48 * 46: c9 leave
49 * 47: c3 ret
50 - 48: 90 nop
51 - 49: 90 nop
52 - 4a: 90 nop
53 - 4b: 90 nop
54 - 4c: 90 nop
55 - 4d: 90 nop
56 - 4e: 90 nop
57 - 4f: 90 nop
Coverage analysis generated by:
VerOCode Analyzer version 2.2.1 [Win32/GCC] - Demo Version
收藏
举报
TAG: