软件测试(一)

I have met various problems when I am coding. There are several reasons as below.

  • Logical Mess

When I was dealing with ACM contest problems, this kind of fault always comes because the problems always require edge cases. Meanwhile, the logic of the problems are considerable complex.

  • Wrong Types of Variable

This kind of mistake will takes place when using strong typing language such as C, C++. When implement type casting or calculation which need high precision, improper selection of type will cause errors. Once I need to calculate the eigenvectors which are theoretically orthogonal, output showed -0.000000. It was correct when the number is regarded as 0. However, the result indicated that they are not orthogonal. In the end, it was proved that if it shows -0.000000, it is a number slightly less than 0 but no way to be able to replace 0.

As for weak typing languages such as Javascript and Matlab, though it can automatically decide which type to use, it still cause problems. It is hard for us to confirm which type they are using now. For example, once I used d3, a library of Javascript, to complete an alignment, I failed to sort an array because the functions thought I was sorting an string array so that 9 is larger than 10. Another example is that once Matlab chose a number to be uint8, the number will never be larger than 128 any more.

  • Choose wrong function or class

There are thousands of classes for Java. Some of them are quite similar to each other except some little differences like return type.

  • Environment

Some libraries are not compatible between versions, while some program will have different results when run on different hardware platforms. A project run well on me computer crashed when I transplant it to my teammates’s computer.

转载于:https://www.cnblogs.com/ph0en1x/p/6429900.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值