https://docs.google.com/document/d/1bJrzcsm7YjN_uD-qx9MOaHf6BHw8wnCZptxcwkF4pjU/edit
Thursday, August 18, 2016
Thursday, August 11, 2016
[LeetCode] Programming Bug Note
1. Delete Element In Unordered ArrayList, Vectors
a. Say delete 3 from 1 3 5 7 9, we replace 3 with 9 and erase 9, resulting in 1 9 5 79
b. But when deleting element 9, when we replace 9 with 9, then delete 9, (Seems works ok)
But in the Leetcode problem Insert 380 381 Delete GetRandom O(1), when the index of the removed element, 1 in example 1, and 4 in example 2 is going to be used again in the future. Index 4 is actually out of bound in the second example.
In this case, operation sequence matters, it is infact two different types of operation sequence, while the result coincidents in some cases.
a. Say delete 3 from 1 3 5 7 9, we replace 3 with 9 and erase 9, resulting in 1 9 5 7
But in the Leetcode problem Insert 380 381 Delete GetRandom O(1), when the index of the removed element, 1 in example 1, and 4 in example 2 is going to be used again in the future. Index 4 is actually out of bound in the second example.
In this case, operation sequence matters, it is infact two different types of operation sequence, while the result coincidents in some cases.
Tuesday, August 9, 2016
[Test] Test Cases
关于TC的问题:
1. 分类 (classification)
unit test -> functional test -> integration test -> scenario test
越往右边TC的数目应该越少一些
2. 设计TC,还是要分类
1) positive TC - happy path
2) negative TC - 0, NULL, exception, overflow/underflow,
3) corner TC
3. 其他TC(基本就是靠嘴巴说)
1) Performance
2) Scalability
3) Load
4) Stress
5) Code coverage
6) Localization
7) Internationalization
8) Security
1. 分类 (classification)
unit test -> functional test -> integration test -> scenario test
越往右边TC的数目应该越少一些
2. 设计TC,还是要分类
1) positive TC - happy path
2) negative TC - 0, NULL, exception, overflow/underflow,
3) corner TC
3. 其他TC(基本就是靠嘴巴说)
1) Performance
2) Scalability
3) Load
4) Stress
5) Code coverage
6) Localization
7) Internationalization
8) Security
Subscribe to:
Posts (Atom)