Sample Code
1 int t, x, y, z; // Dead Code(t)
2
3 x = 1; // DD Anomaly(x)
4 if(y>0) // UR Anomaly(y)
5 x=2;
6 z=x+1; // DU Anomaly(z)
UR Anomaly : A variable not written but read
- This is a bug and leads to an error
DD Anomaly : A value written twice to a variable
- This is ominous but don't have to be a bug
DU Anomaly : A variable written but not read
- It can be removed to improve the architecture
Dead Code : A variable is neither written nor read
- It can be removed to improve the readability