Friday, June 15, 2012

2 Regressions in 3days

In the last 3 days 2 really bad regressions I introduced into afr were found :-(. This is not the first time I introduced regressions, I did introduce some before because I did not have the complete picture. I felt that I can reduce them as I learn more about the product. This time it is different, I have seen the second regression in my Unit testing. I assumed it is because I enabled stat-prefetch, disabling it made the test pass, but I did not realize that the test passed because the inode the fop happened belongs to different graph and it does not have split-brain flag. I could have avoided this if I had automated that test case.This made me feel pretty bad. After being frustrated with myself for a day I decided to reduce the probability of introducing regressions in the future.

This is my plan to minimize the regressions in future:
1) Every commit I make from now on is going to have 3 things in the comments:
*) RCA: Description of the reason for the bug.
*) Fix: What changes did  I introduce that would fix the issue.
*) Testcases: url to the test cases/ automated scripts I used for testing.
*) If a test is automatable I should do that without fail, no excuses.

In the code-review my colleagues can point out if I have missed any testcases.
Automation should make sure I don't introduce bugs while porting the fixes to other branches. Lets see how this approach goes.