Comments on: What is Defect Density in Testing? Formula with Example https://www.softwaretestinghelp.com/defect-density/ Passion for Quality! Fri, 09 May 2025 10:53:02 +0000 hourly 1 https://wordpress.org/?v=6.9 By: Stuart https://www.softwaretestinghelp.com/defect-density/#comment-278487 Fri, 03 Jan 2025 07:24:29 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-278487 Good technique but would certainly be improved by considering severity as others have pointed out.
This would be easily achieved by using a multiplier to convert number of defects into an impact measure, eg x10 for Critical, x5 for medium and x1 for minor/cosmetic.

]]>
By: Ankush Jain https://www.softwaretestinghelp.com/defect-density/#comment-497106 Thu, 10 Oct 2024 04:22:26 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-497106 If there is any setup changes in system and no new code written then how to calculate the defect density?

]]>
By: Shamz https://www.softwaretestinghelp.com/defect-density/#comment-500692 Fri, 17 May 2024 05:45:09 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-500692 Need acceptable defect density per story point?

]]>
By: David https://www.softwaretestinghelp.com/defect-density/#comment-500518 Tue, 27 Feb 2024 23:07:43 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-500518 “An application with DD 5 per KLOC is of better quality vs. another one with 15 per KLOC.”

That does not mean it’s of better quality. It may, but it may not. If two applications do the exact same thing, and the second one has 6 times as much code but only twice the number of defects, I’d argue strongly that was not a reason for the second one being better quality.

My example above is obviously a ridiculous one, but judging the quality of what dev teams produce by defects per KLOC creates a perverse incentive for them to write more KLOCs to do the same thing!

]]>
By: Leo https://www.softwaretestinghelp.com/defect-density/#comment-502960 Sun, 12 Nov 2023 03:13:24 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-502960 Is it the open defects at the point of measure that is tracked, or the open+resolved ones for a period of time? I keep getting confused and there is no clear statement on which one is the correct way of counting the defects.

]]>
By: Viru https://www.softwaretestinghelp.com/defect-density/#comment-306935 Sun, 09 Jul 2023 19:54:21 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-306935 Thanks for the details. How do you calculate defect density in object-oriented languages like C# or JAVA?

]]>
By: Adeeb Cheulkar https://www.softwaretestinghelp.com/defect-density/#comment-409842 Sat, 03 Jun 2023 22:27:23 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-409842 How Defect Density can be rated as Excellent, Good, Fair and Poor?
Depending upon the factor like if DD is ‘zero’ then rating is excellent, if DD is 0.1 to 0.2 then rating is good, etc.

]]>
By: Christina https://www.softwaretestinghelp.com/defect-density/#comment-272321 Sun, 07 May 2023 09:12:27 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-272321 Total no. of defects/KLOC = 30/15 = 0.5 = Density is 1 Defect for every 2 KLOC. — is this correct? I thought it would be, 2 defects for every 1 KLOC.

]]>
By: Z https://www.softwaretestinghelp.com/defect-density/#comment-501782 Mon, 03 Apr 2023 09:03:00 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-501782 In reply to Gregor H.

defects/coding hours? I like measuring everything off time because it can be easily converted to money or cost.

Although “hours of code” is similar to “lines of code” in that they both assume more (lines/hours) equals higher complexity. Maybe depends on which assumption you’re most comfortable with? Or measure both?

]]>
By: Jafar https://www.softwaretestinghelp.com/defect-density/#comment-249774 Mon, 26 Dec 2022 14:07:47 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-249774 Thanks for posting this. This is really wonderful. Please do post about other metrics as well.

]]>
By: Prashant https://www.softwaretestinghelp.com/defect-density/#comment-378275 Wed, 07 Dec 2022 00:36:20 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-378275 Great Article on defect density….just one point from my experience we can use it for future predictions as well assuming we don’t change drastically e.g. developers are same their coding style is same so they will keep producing the same amount of defect/kloc..testers are same using the same process so they will find similar no of defects. So in some sense DD can be predictable as well unless we make changes like improved unit testing/better code reviews to make code quality better( and eventually less DD)

Also lower the density doesn’t necessarily mean its better …it can also mean not enough testing is done.

]]>
By: Rishi Kapoor https://www.softwaretestinghelp.com/defect-density/#comment-273354 Sun, 20 Nov 2022 22:37:22 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-273354 Nicely written Defect Density is the key metric that should be given it’s due importance to see where a team/group stands in terms of Quality of Product/Application under test . I agree while calculating DD one should also consider the Complexity of Defect and also the technology of the application under Test as we might have different acceptable level of DD for applications based on different technologies .

]]>
By: Gaurav Khurana https://www.softwaretestinghelp.com/defect-density/#comment-249930 Sun, 06 Nov 2022 09:09:19 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-249930 Yes i think defect density is important but it should be combined with checking the complexity also.

1 critical defect carries more value than 10 minor ones.

]]>
By: Gregor H https://www.softwaretestinghelp.com/defect-density/#comment-271215 Sat, 02 Jul 2022 03:57:29 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-271215 Coming in a little late here. I started floating the idea of this metric around our dept and getting mixed results. The significant pushback is coming up with how to measure code complexity. Some platforms have lines of code, but others are done in Java or other platforms with function points. Any insights how to calculate defect density for platforms that do not have traditional lines of code?

]]>
By: bruce https://www.softwaretestinghelp.com/defect-density/#comment-501638 Tue, 10 May 2022 13:45:02 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-501638 I am wondering what to do about a large code base.

Say I have 100k LOC from 1 to 10 years old.
Now I am add 10 kLOC of features and enhancements

I find 1000 defects, some of which are against the older code base…

What is the numerator?
What is the denominator?

]]>
By: Krishnamurthy https://www.softwaretestinghelp.com/defect-density/#comment-325475 Thu, 30 Dec 2021 22:06:44 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-325475 Thanks for the information about defect density

I calculated the defect density with reference to testing

Test Defect Density – No of valid defects reported/No of TCs executed ( Instead of KLOC)

]]>
By: CJM https://www.softwaretestinghelp.com/defect-density/#comment-498409 Sun, 26 Dec 2021 13:35:25 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-498409 In reply to ketu.

Calculation error: 30/15 = 2 (2 defect per KLOC)

]]>
By: Soumen https://www.softwaretestinghelp.com/defect-density/#comment-383297 Fri, 24 Dec 2021 04:46:21 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-383297 What is the industry standard for delivered defect density (DDD)?

]]>
By: mugdha https://www.softwaretestinghelp.com/defect-density/#comment-478924 Tue, 16 Nov 2021 10:32:26 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-478924 Hi – thanks for the information. QUick question though – Our Product is in production from last 1 year and we are making enhancements in 7 modules. We follow Sprint cycle of 15 days . How should I calculate DD ? KLOC may not be right measure for me !!

]]>
By: Swati Seela STH Author https://www.softwaretestinghelp.com/defect-density/#comment-250104 Mon, 15 Nov 2021 12:24:42 +0000 https://www.softwaretestinghelp.com/?p=9252#comment-250104 @All: Thank you for stopping by. Your comments make our content richer.

]]>