Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 12 Defects. 山东大学计算机学院 2 In the chapter  Concept of Defects  Defects and software quality  What is Defect?  Defects versus Bugs  Defect types.

Similar presentations


Presentation on theme: "Chapter 12 Defects. 山东大学计算机学院 2 In the chapter  Concept of Defects  Defects and software quality  What is Defect?  Defects versus Bugs  Defect types."— Presentation transcript:

1 Chapter 12 Defects

2 山东大学计算机学院 2 In the chapter  Concept of Defects  Defects and software quality  What is Defect?  Defects versus Bugs  Defect types  Recording defects and counting defects  The Defect Recording Log  The updated PSP process

3 山东大学计算机学院 3 Software quality  Must be in terms that are meaningful to the product’s users.  Meet users’ needs;  Reliably and consistently doing the user’s job.  It’s essential to have clear and exact requirements. So the development, clarification, and refinements of requirements is a major subject however it’s beyond the scope of this class.

4 山东大学计算机学院 4 Hierarchy of Needs  Software performs its required tasks  Product meets its performance requirements  Software is usable  Development is economical and timely  Product is dependable and reliable

5 山东大学计算机学院 5 Defects & Software quality  Defects are the primary measure of quality in PSP.  Finding and fixing defects will do great help to improving software quality.  Finding and fixing defects is necessary but not sufficient to assure software quality.

6 山东大学计算机学院 6 Top 10 lists about Defects and quality  Finding and fixing a software problem after delivery is often 100 times more expensive than finding and fixing it during the requirements and design phase.  About 40-50% of the effort on current software projects is spent on avoidable rework.  About 80% of the avoidable rework comes from 20% of the defects.  About 80% of the defects come from 20% of the modules and about half the modules are defect free.  About 90% of the downtime comes from at most 10% of the defects.

7 山东大学计算机学院 7 Top 10 lists about Defects and quality  Peer reviews catch 60% of the defects.  Perspective-based reviews catch 35% more defects than non-directed reviews.  Disciplined personal practices can reduce defect introduction rates by up to 75%.  All other things being equal, it costs 50% more per source instruction to develop high-dependability software products than to develop low-dependability software products. However, the investment is more than worth it if significant operations and maintenance costs are involved.  About 40-50% of user programs enter use with nontrivial defects.

8 山东大学计算机学院 8 Some Fix Time Data  Some typical fix time ratios  IBM rules of thumb - coding: 1.5; testing: 60; usage: 100  Boehm - design: 1; development test: 15 to 40; acceptance test: 30 to 70; operation: 40 to 1000  Remus - design: 1, code: 20, test: 82  Ackerman - test: 2 - 10 times inspection time  Russell - inspection: 1, test: 2 to 4, use: 33  PSP research - unit test takes 12 times longer than code review to find and fix defects, also the cost!

9 山东大学计算机学院 9 Related concepts about Defects  Defect:  something wrong with a program, such as a syntax error, a misspelling, or an incorrect program statement.  Defect injection:  Defects introduced by engineers making errors.  All defects, in fact, result from human errors.  Defect Prevention  Finding defects is expensive so it is better to avoid them in the first place  Defect Removal  The improvement of defect finding and fixing process  Understanding the defects you have injected, identify the mistakes that caused them, and learn how to avoid repeating the same mistakes in the future.

10 山东大学计算机学院 10 Software Bugs  Latent bugs must  be operationally insignificant  not be destructive( 破坏性的 )  not be observed often  Bugs are not important to the customer if they do not  affect operations  cause inconvenience  cost time or money  cause loss of confidence in software results

11 山东大学计算机学院 11 Defects versus Bugs  ‘Bugs’ trivializes a critical problem and fosters a wrong attitude.  ‘Bugs’ versus ‘Time bomb’  Defects are more like time bomb than bugs  Trivial mistakes can have unforeseeable consequence.  For example, buffer overflow  Defects is a general concept than bugs

12 山东大学计算机学院 12 No Defects or Bugs!  The software engineer who writes a program is best able to find an d fix its defects.  They take personal responsibility for the quality of the programs they produce.  Learn to write a defect-free program is an enormous challenge for a software engineer and it takes data, effective technique,and skill.

13 山东大学计算机学院 13 Class exercise  Write a program to input the grades (Math, Program, Data structure, Algorithm Design, English) of a class and calculate the mean grades of each course.  写一个函数计算当参数为 n(n 很大 ) 时的 值 1-2+3-4+5-6+7......+n  Use any language, 10 minutes.  Find the defects be injected  List the defects you often injected in your programming process

14 山东大学计算机学院 14 Answer 1  long fn(long n) { long temp=0; int i,flag=1; if(n<=0) { printf("error: n must > 0); exit(1); } for(i=1;i<=n;i++) { temp=temp+flag*i; flag=(-1)*flag; } return temp; }

15 山东大学计算机学院 15 Answer 2  long fn(long n) { if(n 0); exit(1); } if(0==n%2) return (n/2)*(-1); else return (n/2)*(-1)+n; }

16 山东大学计算机学院 16 Type No.Type nameDescription 10 documentation Comments, messages 20Syntax Spelling, punctuation, typos( 打字 ), instruction formats 30Build, PackageChange management, Library, version control 40AssignmentDeclaration, duplicate, names, scope, limits 50InterfaceProcedure calls and references, I/O, user formats 60CheckingError messages, inadequate checks 70DataStructure, content 80FunctionLogic, Pointer, loops, recursion, computation, function defects 90systemConfiguration, timing, memory 100EnvironmentDesign, compile, test, other support system problem Defect types

17 山东大学计算机学院 17 Understanding defects  1.gather defect data  Keep a record of every defect you find  Record enough information on each defect  Analyze these data to see what defect types caused the most problem  Devise ways to find and correct defects  2.understand the defects,avoid them  3.figure out how to find,fix,prevent

18 山东大学计算机学院 18 The Defect Recording Log Date Number Type Inject Remove Fix Time Fix Defect —— —— ——— ——— ———— ———— ————— Description —————————————————————————  Help to gather defect data.  Describe each defect in enough detail so you can later understand it.  Analyze the data to see where you injected and removed defect,and which types caused the most trouble.

19 山东大学计算机学院 19 How to complete the log?-1  1.When starting to develop a program  2.When you first encounter a defect  3.Use a separate line for each found  4.Enter the date the defect was found Date Number Type Inject Remove Fix Time Fix Defect 10/28 —— ——— ——— ———— ———— —————  5.After fixing the defect, enter the defect type Date Number Type Inject Remove Fix Time Fix Defect 10/28 —— —20— ——— ———— ———— —————

20 山东大学计算机学院 20 How to complete the log?-2  6.Enter the phase of the process when you injected the defect Date Number Type Inject Remove Fix Time Fix Defect 10/28 —— —20— code ———— ———— —————  7.Enter the process phase when you removed the defect. Date Number Type Inject Remove Fix Time Fix Defect 10/28 —— —20— code complie ———— —————  8.For the defect fix time, estimate the time from when you first were aware Date Number Type Inject Remove Fix Time Fix Defect 10/28 —— —20— code complie —1 min— —————

21 山东大学计算机学院 21 How to complete the log?-3  9.The fix defect entry  10.Write a brief description of the defect in the description section Date Number Type Inject Remove Fix Time Fix Defect 10/28 —— —20— code complie —1 min— ————— Description ——missing;————————————————————

22 山东大学计算机学院 22 Counting Defects  Defect number  Defect type  When to count defect  Start counting defects whenever you complete a phase for a product or part of a product.  So, after the design phase,you could count all design defects.  In this class, we only count the defect in compiling and testing phase.

23 山东大学计算机学院 23 Why using the Defect Recording Log  To improve your programming  To reduce the number of defects in your program  To save time  The longer defects stay in a program, the more time they take to find and the harder they are to fix.  Remove the defects as soon as possible after you inject them  To save money  To do your job responsibly

24 山东大学计算机学院 24 Updated PSP process  Updated PSP scripts: See table 12.5 in p150

25 山东大学计算机学院 25 Updated PSP process

26 山东大学计算机学院 26 Updated PSP process

27 山东大学计算机学院 27 Updated PSP process

28 山东大学计算机学院 28 Updated PSP process

29 山东大学计算机学院 29 Updated PSP process

30 山东大学计算机学院 30 Updated PSP process

31 山东大学计算机学院 31 PSP Quality Strategy - part 1  Identify PSP quality objectives, e.g.  remove all defects before first compile  Establish PSP process quality measures, e.g.  overall process yield  LOC reviewed per hour  Examine products reviewed  determine their ratings on the measures  see which behaviors impacted these results

32 山东大学计算机学院 32 PSP Quality Strategy - part 2  Based on these data, identify your most effective work practices.  Incorporate these practices in your process artifacts  process scripts  checklists  forms  Identify measures that predict process quality  use these as control variables  set specifications for these variables

33 山东大学计算机学院 33 PSP Quality Strategy - part 3  Track your performance against these specifications.  Track your process to determine  when and if to change these specifications  actions to take for further process improvement

34 山东大学计算机学院 34 Summary  Summary  Software quality  Software defects  Record the software defect-Defect Recording Log  Defect types  Updated PSP process

35 山东大学计算机学院 35 remember  1. Software quality starts with defects.  2. If defects are not managed, more important quality issues cannot be adequately addressed.  3. The most effective way to manage defects is with the individual software engineer  4. If you don ’ t eliminate your own defects, they will be much more expensive and time consuming to remove later.

36 山东大学计算机学院 36 Assignment  Use the Defect Recording Log to record every defect find in the program you write. Summarize the defect data in the Project Plan Summary for each program.


Download ppt "Chapter 12 Defects. 山东大学计算机学院 2 In the chapter  Concept of Defects  Defects and software quality  What is Defect?  Defects versus Bugs  Defect types."

Similar presentations


Ads by Google