Small Tricks Learned from Professor Tri Pham‘s CS2B Class at Foothill College

在编程中,测试是关键但可能耗时。Foothill学院的ProfessorTriPham提供了一个技巧,即始终测试数组的第一个、最后一个和中间的元素,以确保覆盖不同情况,避免错误并提高效率。这种方法有助于尽早发现潜在问题,改善测试流程。
摘要由CSDN通过智能技术生成

1) Always remember to test the First, the Last, and the Middle objects in the array.

As a computer science student, testing your code is an essential part of the development process. It can also be one of the most time-consuming and frustrating aspects of programming. However, Professor Tri Pham from Foothill College taught us a simple trick that can help make the testing process more efficient.

The trick is to always test the first, last, and middle objects in an array. By testing these three objects, you can ensure that your code covers different scenarios and that it handles both the beginning and end of the array, as well as the middle. This approach can help prevent silly mistakes and save time in the long run.

In conclusion, testing is an important step in software development, and by following Professor Pham's advice, you can improve your testing process and catch any potential issues early on. Remember to always test the first, last, and middle objects in an array.

Here is one example coming from our assignment#2 testing requirement. 

However, today, I found this method really helped me from making stupid mistakes. I am writing this down to help me better remember it next time.    

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值