Open-Source Python Code Shows Lowest Defect Density
cold fjord sends news that a study by Coverity has found open-source Python code to contain a lower defect density than any other language. "The 2012 Scan Report found an average defect density of .69 for open source software projects that leverage the Coverity Scan service, as compared to the accepted industry standard defect density for good quality software of 1.0. Python's defect density of .005 significantly surpasses this standard, and introduces a new level of quality for open source software. To date, the Coverity Scan service has analyzed nearly 400,000 lines of Python code and identified 996 new defects — 860 of which have been fixed by the Python community."
That's because nobody ever writes anything important in Python. It's a toy language for slow learning bourgeois fartsniffers.
UNITE with the Campaign for a Free Internet because today, our future begins with tomorrow!
Python is readable and readable code is easier to fix.
Also smarter guy have tendency to use Python/Haskell/Erlang
It's written in Python. That's the biggest defect in the world.
"Coverity fails to detect errors in python" would be my headline of choice here. Seem a much more reasonable explanation for the results.
I read TFS and both TFAs and all I can glean is that Coverity Scan service is some sort of report that measures defects in code, but never defines how such defect are determined. They articles also mention comparing open source code metrics, but the only project that is mentioned anywhere is Python.
So what is a Coverity Scan service and why should I care? After all I can make up all sorts of metrics about my own software.
I am Slashdot. Are you Slashdot as well?
I could not find a link to the actual study, instead the company links lead back to the article and the article leads back to the company home page. Is this more "faith-based computing"? I am interested in the comparisons to other languages and in what type of code was analyzed.
TFA seems to be about the Python interpreter, also known as CPython (because it's implemented in C), rather than about code written in Python itself. So maybe it has nothing to do with the Python language, but everything to do with the fact that the Python authors are apparently awesome C programmers.
That's great, but most people interpret "Open Source Python Code" to mean code written in Python that is Open Source, not code written in C (to implement the Python interpreter) that is Open Source.
Does it mean better coders, or better language? Seems like the results are ambiguous in their meaning.
In SOVIET RUSSIA... erm...NSA AMERICA, the Internet logs onto YOU!
The Slashdot summary is confusing, as is the eweek.com headline. Reading the article, it is clear that it is about the code that powers the official Python interpreter, AKA CPython, AKA /usr/bin/python. When I clicked the link, I thought Coverity had surveyed the entire world of open source Python code and discovered that Python programmers as a whole publish higher quality code than people who e.g. program in Ruby. That's not what the article's about.
It'd be great if the headline in Slashdot were to be fixed to say, "Python interpreter has fewer code defects compared to other open source C programs, says Coverity."
|/usr/games/fortune
I quote: "Coverity scanned over ten thousand Python programs on the popular GitHub open-source software repository..."
UNITE with the Campaign for a Free Internet because today, our future begins with tomorrow!
0.005 defects per thousand lines times 400,000 lines gives a total defect count of 2.
So where did the other 994 defects come from?
So a private, for-profit company named "Coverity" has released a report that shows that their "Coverity Scan" software finds the fewest vaguely-defined "defects" in a programming language whose community has added the "Coverity platform" product to their development process? I was about to say "excellent marketing" by writing a fluff piece for free Slashdot traffic, but it's really not even excellent marketing.
An old-timer with old-timey ideas.
Coverity sells software that does static analysis on source code and looks for patterns that suggest defects. E.G., a code sequence that allocates memory, followed later by something that de-allocates that memory, followed later by something that de-allocates the same memory again (a double-free).
The product is not open source software, but a number of open source software projects use it to scan their software to find defects: https://scan.coverity.com/ It's a win-win, in the sense that Coverity gets reports from real users using it on real code, as well as press for their product. The open source software projects get reports on potential defects before users have to suffer with them.
- David A. Wheeler (see my Secure Programming HOWTO)
But that wouldn't let people say "look, Open source produces better quality code than closed source"
Coverity's services have been useful to a number of open-source projects. But this article is carefully picking its terms to get a headline worthy result. Compare against the Coverity scan of PostgreSQL done in 2005 for example, and CPython's defect rate isn't very exciting at all. But that was "Coverity Prevent" and this is "Coverity Scan"...whatever that means.
The defect detector depends on brackets. The 0.005 defects found is because no code is perfect.
n/t
The title is misleading again as hell. It appears they talk about the C code included in the Python compiler/interpreter project, and it is to be compared against other open source software projects, not against other languages. All that it shows is the Python project developers are eager to fix problems what this particular verification software founds. If they have fixed all those bugs, then they will have exactly zero known defects. Good for them, but most probably there will remain unknown defects, and it is hard to measure their amount.
In short, a meaningless article and a misleading title. The correct headline would have been "Python core developers are fixing bugs with help of a tool".
If bugs are defects then Python has, and has had, heaps. Number one defect is mandatory indentation. If only they had used C-style braces! Unfortunately then it would almost look exactly the same as C. There is little in Python that a good library cannot also do for C/C++/C# or whatever.
They counted my C++ features as bugs?
Having to work for a living is the root of all evil.
Numbers like .69 or 1.0 or 0.005 mean nothing if you don't know to what it relates.
Usually defect counts are based on 1k LOC (one thousand lines of code, and no: a line of code is likely not what you consider a line of code).
I doubt that 1.0 is a accepted industry standard defect density [...] for good quality software of ...
1 defect per 1 kLOC is absurd high, luckily I never was in a project the last 20 years with such a high defect rate.
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
Yes it would, as the Python interpreter is open source: Python License & History
- No Bounce, No Play -
I doubt they looked a Lua because I'm sure it's one of the lowest if not the lowest. Definitely lower than Python. It's probably the most stable piece of software I use regularly.
@*(&^)&^)^$
Perl programmers write their code in cartoon profanity!
While it can be useful in pinpointing common code defects, interpreting coverity results as an absolute indicator of code quality is just retarded. 90% of coverity's defect's tend to be really false positives that would be obvious to even the average code monkey... Not sure that massaging a code base to please coverity and getting a 'high score' is really any kind of achievement and may be more an indicator that you have way too much time on your hands...
Help! I am a self-aware entity trapped in an abstract function!
This is bullshit, but a great tactical conversion of non-informative data into marketable news by Coverity.
Coverity uses lexical pattern matching to find bugs based on "tricks" discovered by Dawson Engler and his colleagues in Stanford University in the early 2000s. The tricks (find "malloc" not coupled with "free", cli() not coupled with sti(), dereferences of uninitialized pointers etc.) were developed in the context of the C language used for Operating System code.
So they used tricks developed for one language and context, to another language in a different context, and found that they didn't find as many bugs in the latter as they did in the former. You would think that this suggests a failure - in that their techniques are not quite as effective on Python as they were on C. Instead, they have turned it around as a statement on the inherent high quality of Python code.
It's like saying that the fact that a good tennis player sucks at playing table tennis, it implies that table tennis is a harder game.
Doesn't surprise me. Obviously, Python is not suitable for everything. But, it is easy to read, easy to write code in, avoids those little issues of C and even Java where some OK-looking code is in fact a security risk. I think it's permitting virtually any programming model you want is helpful too (you want this part to use functional programming, and this part object oriented? Go ahead.) This sounds like a receipe for disaster but avoids the condition of the programmer having to force some particular problem to follow a particular programming method because that's what the language supports best... it supports all methods.
never heard of defect density before. i learned something new today.
You can thank "cold fjoord" for that. Slashdot collectively seems to enjoy sucking his cock as I see his shit propaganda modded up constantly.
So, it's definitely spam then?
".sreffinstraf sioegruob gninrael wols rof egaugnal yot a s'tI .nohtyP ni tnatropmi gnihtyna setirw reve ydobon esuaceb s'tahT" - by For a Free Internet (1594621) ANOTHER "ne'er-do-well" /. OFF-TOPIC TROLL on Tuesday September 03, 2013 @05:21PM (#44750959)
"???"
Uhm... Could we get a translation of that off-topic "troll-speak/trolllanguage" of yours, please?
---
* HOWEVER: I tend to agree somewhat, since by comparison to say, C++ or Object Pascal/Delphi, it's just not there & can't DO as much: It's good for scripting & smaller projects for "quick & dirty" runs OR prototyping, imo @ least.
APK
P.S.=> "ReVeRsE-PsYcHoLoGy", for trolls - Courtesy of this code by "yours truly" in less than 1 second flat):
---
#TrollTalkComReversePsychologyKiller.py (Ver #2 by APK)
def reverse(s):
try:
trollstring = ""
for apksays in s:
trollstring = apksays + trollstring
except:
print("error/abend in reverse function")
return trollstring
s = ""
print reverse(s)
try:
s = "Insert whatever 'trollspeak/trolllanguage' gibberish occurs here..."
s = reverse(s)
print(s)
except Exception as e:
print(e)
---
... apk
I once thought about learning python. Then i combed craigslist across the US looking for job opportunities doing python programming. Relatively few out there by comparison to ASP.NET and Java. Sure its less buggy.....but whats to motivate anyone to learn something they can't easily find work in?
That makes more sense. From the summary, I thought the most likely scenario was that Coverity does not handle Python code very well based on my experience of random buggy Python code. It is to be expected that a widely used VM/interpreter is going to be of better quality than your average code.
The code is so slow, they have lots of extra time to look for defects.
I was crazy back when being crazy really meant something. (Charles Manson)
Once I decided to rewrite a script that I have written in Perl to Python, just to get a grip of it. But I soon dropped, cause the overall documentation is so poor compared to CPAN.
On the other hand, there are also proportionally many Java and .NET programmers, so you'll be competing with fewer people in Python land.
The right answer, anyway, is to learn all three - and a couple more (C++, in particular).
So when are we going to get a native Python compiler ?
... couldn't find the languages compared? Curious to know how Ada fared and if Python was compared against it.
I run: Windows, OS X, Linux, FreeBSD. Just because you have a hammer, doesn't mean everything is a nail.
So what they are basically saying is "Don't use our product to scan Python code; it doesn't recognize all the defects".
I know the truth is possibly somewhere in the middle, but this report just assumes the scanning products works equally well for all languages, which is atleast somewhat unlikely.
Also, what exactly is a defect in this context? Is it a security flaw, a functional error or just something that will crash your software. If the latter is the case, then any language that accepts shitty code and just keeps will win regardless of whether the code actually works.
Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
print "Simpler:"[::-1]
* That'll do the job too, even simpler... per my subject-line above...
APK
P.S.=> I knew about THIS method too, but not only does my orginal post's code style look cooler imo, but it has err trapping + it's "homemade" (can't make the stuff look TOO simple or he really will think Python's a "toy", lol!)... apk
This all seems very misleading. It took me quite a while to figure out that it is only talking about the code for the Python interpreter, not all open-source programs written in Python.
http://developers.slashdot.org/comments.pl?sid=4162427&cid=44754641 = "better" (than yours on the 'point' you made), "young lad", lol! Try to see MY point there though (not a toy but can't let him *think* that, with 1 liners). "Touche", my boy...
APK
No it wouldn't, we cannot run the same test on closed source software if we don't have access to the source.
But then again: the closed source programmers can even claim less, since they don't show their source.