统计背景:
为提高编码质量,把软件开发过程中出现的bug提交上个人网站,年度终结,给它做个统计。
统计项目:1个上线项目,3个开发中项目,1个私人项目
项目开发人员:作者本人、同行5人
项目主题:电商、系统应用
信息收集日期:2014-08-13 20:37:54(捕获第一个异常)到2015-01-10 00:19:36(统计时最后一个异常提交时间)
异常信息数量:3192个
数据库收集到的异常信息:
异常信息统计sql:
SELECT (SELECT count(Id) From t_apperror WHERE Context LIKE '%Exception:CannotperformthisactionafteronSaveInstanceState%') / (SELECT count(ID) From t_apperror) as 'Framage隐藏失败' /** 0.0047 **/ SELECT (SELECT count(Id) From t_apperror WHERE Context LIKE '%Exception:syntaxerror%') / (SELECT count(ID) From t_apperror) as 'syntaxerror' /** 0.0119 **/ SELECT (SELECT count(Id) From t_apperror WHERE Context LIKE '%Stringcannotbecastto%') / (SELECT count(ID) From t_apperror) as 'string转型错误(大多数转向json)' /** 0.0103 **/ SELECT (SELECT count(Id) From t_apperror WHERE Context LIKE 'Exception:Invalidint%') / (SELECT count(ID) From t_apperror) as 'json解析错误' /** 0.0229 **/ SELECT (SELECT count(Id) From t_apperror WHERE Context LIKE '%Exception:null_%') / (SELECT count(ID) From t_apperror) + (SELECT count(Id) From t_apperror WHERE Context LIKE '%Exception:java.lang.NullPointer%') / (SELECT count(ID) From t_apperror) as "空指针" /** 0.3932 **/ SELECT (SELECT count(ID) From t_apperror WHERE Context LIKE 'Exception:Fragmentalreadyadded%') / (SELECT count(ID) From t_apperror) as 'Exception:Fragmentalreadyadded' /** 0.0063 **/ SELECT (SELECT count(ID) From t_apperror WHERE Context LIKE 'Exception:Unabletoaddwindow%') / (SELECT count(ID) From t_apperror) as 'Exception:Unabletoaddwindow' /** 0.1263 **/ SELECT (SELECT count(ID) From t_apperror WHERE Context LIKE 'Exception:Unabletodestroyactivity%') / (SELECT count(ID) From t_apperror) as 'Unabletodestroyactivity' /** 0.0276 **/ SELECT (SELECT count(ID) From t_apperror WHERE Context LIKE 'Exception:BinaryXMLfile%') / (SELECT count(ID) From t_apperror) as 'xml布局错误' /** 0.0053 **/ SELECT (SELECT count(ID) From t_apperror WHERE Context LIKE 'Exception:Invalidindex%') / (SELECT count(ID) From t_apperror) as "超出索引" /** 0.0103 **/
统计结果:
统计结论:
1.空指针错误是最常见的。
2.编译器会犯傻,binaryxml和syntaxerror错误都会出现。
3.编码上 fragment错误比较多,可能是编码人员对 fragment不够了解构成的。
以上统计不太全面,仅供参考。
时间: 2024-10-10 06:05:29