-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodereview.txt
More file actions
78 lines (62 loc) · 2.4 KB
/
Codereview.txt
File metadata and controls
78 lines (62 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@@@@@@@@ Checklist for HA/Distributed Systems Codereview @@@@@@@@
Running Time Complexity
-----------------------
- At a high level, measure the runtime complexity with few hundred/thousand
requests coming in
DB/Cache Requests
-----------------
- With sample requests, check number of DB calls (or Redis Cache requests) being
made.
* Ex: DPS Monitoring App was making 80K+ Redis calls for 200 BoC with some
minimum uplinks. KairosDB and Cassandra calls were also huge and causing
lot of delays
@@@@@@@@@@@@@@@@@@@ Checklist for C Codereview @@@@@@@@@@@@@@@@@@
--------------------------
NOTE: This list is prepared mostly from personal experience.
Function Arguments:
----------------
- Check if right values are passed as func args, especially, if these args
are pointers and are dereferrenced inside the routine. (Static code
analysis tools can do this check too).
Function Return Type:
---------------------
- Examine what values are being returned. And if those values are handled
properly by calling function.
Copying Objects:
---------------
- When an object (or a data structure) is copied to another object using
memcpy, What is the intent?
(a) Copy all attributes of the object?
(b) Copy only some?
If its (a), what happens if only some attributes are changed (Eg.,
update of a profile) and rest remain same? Will the old attributes get
copied?
Deleting configs:
-----------------
- In case of profiles on a ccts, what SHOULD happen when they are deleted?
Should attributes take default value? Should they take some other value?
Read/Write to Event Queues:
---------------------------
- If multiple threads are writing to an event queue (producers), they should
not be setting flags (or values in shared data) indicating that 'event has
been consumed'. Only the consumer of the event should do that job. Of
course, producers can set flags to the effect 'event has been produced',
but not 'event has been consumed'.
@@@@@@@@@@@@@@@@@@@@@@@ STATIC CODE ANALYZERS @@@@@@@@@@@@@@@@@@@@@@
Static Analysis Tools
---
Free
* cppcheck
* valgrind (not a static checker, but code profiler)
* Uno
* Coverity Prevent (there is a free version)
* Sparse - Used in linux kernel dev.
* splint (or even lint is good and constantly updated).
* RATS
* SMATCH
* FlawFinder - Written by David Wheeler.
* PScan
Paid
* cppdefender
* Flexelint
* pc-lint