10/01/2008

Limitations of test coverage

I fixed Stack so that now Emma shows its coverage is 100%. However, some developers say it still possibly have bugs. This time, I try to put a bug in the code and still make it to have 100% coverage.

Insert a bug

After thinking for a while, I found out that I am able to do it by changing "this.top();" to "this.pop();" inside "getTop()". Emma still shows its coverage is 100%, but logically it returns different object.

Conclusion

I successfully inserted a bug in the code, yet Emma shows its coverage is 100%. This means that we are not able to think the code has definitely no bugs even the coverage is 100%. It is true that Emma help us a lot to detect what we didn't test yet or which part possibly have bugs, but we will need to do final check manually in order to make a reliable and secure system.

The code with a bug can be downloaded from here.

No comments: