本文由 @lonelyrains 出品。转载请注明出处。

文章链接: http://blog.csdn.net/lonelyrains/article/details/44225533

上一篇为 bug统计分析初步

本篇重点讨论基于sql的bug统计分析方法。

1、与时间和状态的关系:

1)考察每一个时间单位(年、月、日)产生的bug量

2)考察每一个时间单位(年、月、日)解决的bug量

3)考察每一个时间单位(年、月、日)遗留的bug量

4)考察每一个bug遗留的时间单位(年、月、日)

5)考察平均bug遗留的时间单位(年、月、日)

6)通过结合1)、2)、3)考察分析发现、解决bug的时间段(月、日、时)峰值

当中6能够用来指导測试、开发效率

2、与时间、角色的关系:

1)考察每一个測试每一个月发现的bug量

2)考察每一个开发每一个月解决的bug量

3)考察每一个測试自开发提交版本号測试之后,发现每一个新bug的时延

4)考察每一个开发自測试提交bug之后。解决每一个新bug的时延

此1234均能够用来指导绩效考核

3、其它能够考虑与bug发生关系的系数:

1)基于项目划分

2)基于模块(硬件、固件、底层软件、上层应用(前端、后台)等,依据不同项目能够不同的划分情况)

3)基于功能性质划分(非致命、一般、界面、崩溃等)

4)基于重现概率划分

等等

3、高级扩展

1)推断一个bug是否是难bug,并把它找出来:依据解决时延、反复reopen的次数、測试和开发者的标注

2)定义每一个项目子模块解决本项目子模块bug最多的人为项目子模块负责人。查询每一个人所负责的项目子模块数等

4、案例:

使用bugfree。会发现一个问题,全部的bug信息都放在一张表bf_buginfo里。

ModulePath字段在项目有多个子模块时,是作为整字段中间加'/'区分层级的。

以下是我用到的一些SQL统计语句(为当中一个考察点,笔者在下一篇博客里专门抽象出一个SQL面试题):

#--查询bug整体情况
#select ProjectName,ModulePath,BugTitle,BugStatus,OpenedDate from bf_buginfo order by ProjectName,ModulePath,OpenedDate; #--查询每一个项目的bug数目(XXXX算一个项目)
#select count(*),ProjectName from bf_buginfo group by ProjectName having count(*) >= 1; #--查询XXXX项目每一个模块的bug数目
#select count(*),ModulePath from bf_buginfo where ProjectName like 'XXXX' group by ModulePath having count(*) >= 1; #select * from bf_buginfo where ProjectName like 'XXXX' and ModulePath = '/'; #select BugId,ProjectName,ModulePath,BugTitle,BugStatus,OpenedDate from bf_buginfo order by OpenedDate,ResolvedDate,ClosedDate group by DATE_FORMAT(OpenedDate,'%Y%m'); #--查询每一个月产生的bug数目
#select count(*),DATE_FORMAT(OpenedDate,'%Y-%m') from bf_buginfo group by DATE_FORMAT(OpenedDate,'%Y%m'); #--查询XXXX每一个月产生的bug数目
#select count(*),DATE_FORMAT(OpenedDate,'%Y-%m') from bf_buginfo where ProjectName like 'XXXX' group by DATE_FORMAT(OpenedDate,'%Y%m'); #--查询XXXXbug高峰期的具体内容
#select ModulePath,BugTitle,BugStatus,OpenedDate,DATE_FORMAT(OpenedDate,'%Y-%m') from bf_buginfo where ProjectName like 'XXXX' and ( DATE_FORMAT(OpenedDate,'%Y%m') = '201310' or DATE_FORMAT(OpenedDate,'%Y%m') = '201406' ); #--查询XXXXbug状态情况
#select count(*),BugStatus from bf_buginfo where ProjectName like 'XXXX' group by BugStatus #--查询全项目bug状态情况
#select count(*),BugStatus from bf_buginfo group by BugStatus #--查询重难点bug:0基础过滤方法:从已解决的bug中分析:reopen的 : 须要了解怎样获取reopen的记录 :bf_testaction和bf_buginfo
#select count(distinct(bugId)) from Bf_testaction as taction , bf_buginfo as buginfo where ActionType = 'Activated' and taction.idvalue = buginfo.bugid
#select count(distinct(bugId)) from bf_testaction as taction , bf_buginfo as buginfo where ActionType = 'Activated' and taction.idvalue = buginfo.bugid and ProjectName like 'XXXX'
#activated 226
#activated 138 #--查询重难点bug:0基础过滤方法:从已解决的bug中分析:长时间未解决
#690/1695/2715 datediff>=2-fixed/closed/all
#select count(*),BugID,ResolvedDate,ProjectName,ModulePath,BugTitle,datediff(ResolvedDate,OpenedDate) from bf_buginfo where bugstatus = 'closed' and datediff(ResolvedDate,OpenedDate) >= 2 and Resolution = 'Fixed' order by ModulePath DESC,BugID DESC
#378/927/1248 datediff>=2-fixed/closed/all
#ResolvedDate用于对照svn记录。方便查看
#select BugID,ResolvedDate,ProjectName,ModulePath,BugTitle,datediff(ResolvedDate,OpenedDate) from bf_buginfo where ProjectName like 'XXXX' and bugstatus = 'closed' and datediff(ResolvedDate,OpenedDate) >= 2 and Resolution = 'Fixed' order by ModulePath DESC,BugID DESC #--依据解决人查询bug
#select count(*),ResolvedBy from bf_buginfo where Resolution = 'fixed' and BugStatus = 'closed' group by ResolvedBy order by count(*) #--定义每一个项目子模块解决本项目子模块bug最多的人为项目子模块负责人,查询每一个人所负责的项目子模块数
select count(*),ResolvedBy from (
select B.* from (select ModulePath, ResolvedBy, count(*) as num from bf_buginfo where Resolution = 'fixed' and BugStatus = 'closed' group by ModulePath, ResolvedBy) B ,
(select A.ModulePath, MAX(A.num) as num from (
select ModulePath,ResolvedBy,count(*) as num from bf_buginfo where Resolution = 'fixed' and BugStatus = 'closed' group by ModulePath, ResolvedBy
) A group by A.ModulePath )
C where B.ModulePath = C.ModulePath and B.num = C.num order by B.ResolvedBy ) D group by ResolvedBy

最新文章

  1. PHP 增删改查
  2. IIS处理并发请求时出现的问题及解决
  3. Spring的DI(Ioc) - 利用构造器注入
  4. 剑指offer系列56---连续子数组的最大和
  5. PHP READ PPT FILE
  6. Java学习笔记——内部类及其调用方法
  7. VS编译时自动下载NuGet管理的库
  8. 在服务器操作系统上使用TeamViewer
  9. warning LNK4098: 默认库“LIBCMT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library
  10. 将树莓派Raspberry Pi设置为无线路由器(WiFi热点AP,RTL8188CUS芯片)
  11. 查看Linux系统相关版本信息
  12. codecomb 2091【路径数量】
  13. 迈向angularjs2系列(2):angular2指令详解
  14. Linux时间转标准时间
  15. BZOJ4727 [POI2017]Turysta
  16. 重构:从Promise到Async/Await
  17. Day047--JS BOM介绍, jQuery介绍和使用
  18. 上传文件服务与web服务分离
  19. java.sql.SQLException: ORA-28040: 没有匹配的验证协议(12c或者12c rac)
  20. 关于unity3dGUI(uGUI)的一些自适应的收获,在这里跟大家分享一下

热门文章

  1. JavaScript 原生代码找对象的方法
  2. url编码函数encodeURI和encodeURIComponent
  3. 第2节 mapreduce深入学习:9、手机上行流量排序
  4. react-native 框架升级 安卓第三方插件报错 Android resource linking failed
  5. margin负值应用
  6. Python使用Flask框架,结合Highchart,自定义导出菜单项目及顺序
  7. 【Html,Css,JavaScript】初学总结
  8. Python之面向对象slots与迭代器协议
  9. vector元素的删除 remove的使用 unique的使用
  10. SSL 握手协议详解