Saturday, July 07, 2012

Types and Bugs

There are certain discussions in our biz that are so played out they provoke instant boredom upon encounter. A major one is the old dynamic vs. static skirmish, recently resurfaced in a blog post by Evan Farrer. Which is a shame as the post is quite interesting, describing his results transliterating well-tested code in a dynamic language to a static language to see if the type system found any bugs. Which it did.

The full-length paper is a great read as well. He describes his translation methodology and gives some detail on each bug found. At first it may seem the author could be stacking the odds towards the static language as the translation was manually done by himself, but I found his description of the process pretty convincing of its fairness. The choice of Python as a source language probably helped given the pythonic inclination towards straightforward code that avoids sophisticated abstraction and metaprogramming mechanisms.

But the real meat of the paper is in the description of the bugs he found. Upon a not particularly discriminating reading, a clear pattern jumped out. Most of the bugs fell into one of two categories:
  • Assuming that a variable always references a valid value when it can contain a null value. 
  • Referencing constructs that no longer exist in the source.
The first category is also the largest, comprising several places where the original code could be coerced into letting a variable be set to a null value, usually by just leaving it uninitialized, and a subsequent call would attempt to derefence it assuming it contained a valid value. Haskell's type system avoids the problem as it  simply doesn't have any notion of null. Code that has to deal with optional values must do it trough algebraic data types.

How the second category of bug comes about is easy to guess from the projects histories: some method or variable was present but changed, perhaps it was renamed or subsumed, and not all references were updated to reflect the change. Even pervasive unit tests can't hope to catch these kinds of regressions, as the problem is found on the integration between units of code; the units themselves are just fine. A type system helps when the change affects the signature of the referenced construct, which is often but not always.

If the study's findings are generalizable and my observations are correct, these are the main takeaways:
  • If you have a type system at your service, it's prudent to structure code such that behavior-breaking changes are reflected on the types.
  • End-to-end integration tests are a necessary complement to both a suite of unit tests and a type system. In my experience how far should these tests stray off the happy path is a difficult engineering trade-off.
  • If your type system allows nulls — such as Java's, for instance — its role in bug prevention is greatly diminished. The proportion of null-dereference bugs on the analysed code bases helps to makes it clear just how big a mistake it is to allow nulls in a programming language. 

100 comments:

vigneswaran said...

There are lots of information about Selenium Testing have spread around the web automate, but this is a unique one according to me.
Selenium Training in Chennai

Ammu said...

Great post.

Thanks,
Lakshmi,
Best Angular Training Institute in Chennai

service care said...

Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definitely interested in this one. Just thought that I would post and let you know. Nice! thank you so much! Thank you for sharing.
samsung service centres in chennai
samsung mobile service center in velachery
samsung mobile service center in porur

jvimala said...

Really awesome blog. Your blog is really useful for me
Regards,
Best Selenium Training Institute in Chennai | Selenium Course in Chennai

luckys said...

1movies

whatsapp plus said...

mobile whatsapp groups

whatsapp plus said...

mobile whatsapp groups

Devender Gupta said...

dtc bus app
dtc bus
dtc bus app download
dtc bus pass
dtc bus route
dtc bus route app
dtc bus app download

Devender Gupta said...

dtc bus app
dtc bus
dtc bus app download
dtc bus pass
dtc bus route
dtc bus route app
dtc bus app download

khushboo said...

The registrations and auditions for the Bigg Boss 13 are going to start soon. The official list of contestants is not yet announced by the officials. That will be announced by the makers on the inaugural day which is 15 the of September. bigg boss 13 contestants name list with photo Though a few rumored names are coming up as the expected celebrity contestants of the year. They are Nia Sharma, Raghav Juyal, Punit Pathak, Divyanka Tripathi, Garima Chaurasia, Ridhima Pandit, Aditya Narayan, Jasmin Bhasin, Zain Imam, Bhuvan Bam, Chetna Pande, Krystle D’Souza, and Devoleena Bhattacharjee. This year too, the show will be back with a new theme and the star host, Salman Khan. Though the theme is not declared yet officially. Stay tuned with us to know more about the show Bigg Boss 13.

Vijiaajith said...

nice
interview-

questions/aptitude/permutation-and-

combination/how-many-groups-of-6-persons-can-be-

formed


tutorials/oracle/or

acle-delete


technology/chrom

e-flags-complete-guide-enhance-browsing-

experience/


interview-

questions/aptitude/time-and-work/a-alone-can-do-1-

4-of-the-work-in-2-days


interview-

questions/programming/recursion-and-

iteration/integer-a-40-b-35-c-20-d-10-comment-about-

the-output-of-the-following-two-statements


Devender Gupta said...

WhatsApp group links

MIUI theme

Devender Gupta said...

Dr Driving is one of the my favourite game ever and today I am going to share Dr Driving Mod Apk
https://www.drdrivingmodapk.xyz/

Nicolay said...

Nice article

Bulletproof Domain Registration

Vijiaajith said...

how to hack flipkart payment
react native developer resume
group selector css
chemistry interview questions
sample complaint letter to bank for wrong transaction

Vijiaajith said...

javascript int max value
passage writing in fiserv
vijay invested rs.50,000 partly at 10% and partly at 15%. his total income after a year was rs.7000. how much did he invest at the rate of 10%?
residue on ignition
the simple interest earned on a certain amount is double the money

pnjsharptech said...

PNJ Sharptech is a leading Social Media Optimization company in India, specializing in handling both organic and paid Social Media Marketing (SMM) campaigns successfully. We have many years of experiencing increasing online social presence on various social media platforms such as Facebook, Twitter, LinkedIn and Pinterest, and many others. Our SMO experts have a rich knowledge of increasing traffic and maintaining the online social reputation for a long period. How our SMO services make you different from others? Our low-cost social media marketing services are very helpful to build your online reputation and increase sales.

BB Arora said...


40 Lakh mp3 song download pagalworld, tik tok viral song ,Mr jatt. GetSongName.com – Presenting the audio song ” 40 Lakh ” this song by Jerry Burj Ft. Ellde Fazilka , song is been written Ellde Fazilka40 Lakh mp3 song download pagalworld

BB Arora said...

Presenting Latest New Bollywood Song Lyrics of Fauj Ki Dahaad Song Lyrics Mr. BratBea From Kartikeye Ojha & Pranshu Jha . The latest Upcomin Movie Code M Song Fauj Ki Dahaad Lyrics are written by Kumaar Mr. BratBeat and Music Directed by Kartikeye Ojha & Pranshu Jha

Fauj Ki Dahaad Song Lyrics Code M | Mr. BratBeat

Unknown said...

Good post....thanks for sharing.. very useful for me i will bookmark this for my future needs. Thanks.
Aloha Browser Turbo For PC

web design company said...

thanks for your information.it's really nice blog thanks for it.keep blogging.
web design company in nagercoil
website design company in nagercoil
web development company in nagercoil
website development company in nagercoil
web designing company in nagercoil
website designing company in nagercoil
digital marketing company in nagercoil
digital marketing service in nagercoil

Daniel Bryan said...

Graceful written content on this blog is really useful for everyone same as I got to know. Difficult to locate relevant and useful informative blog as I found this one to get more knowledge but this is really a nice one.
digital marketing service provider

Anonymous said...

I don’t know if it’s just me or if perhaps everyone else encountering problems with your blog. It appears as if some of the written text in your posts are running off the screen. Can somebody else please comment and let me know if this is happening to them too? This may be a issue with my web browser because I’ve had this happen before. Thanks https://royalcbd.com/product/cbd-oil-1000mg/

shane lee said...

With so many to choose from it can be difficult knowing which one is the best service for you. how to choose best stocks for next day

Data Analytics Cerification Training Course in Hyderabad said...

Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also.
Data Analytics Course in Hyderabad

Admin said...


Super Dj Remix Song New Latest Song Available On This Website,

Good Job Sir

Latest Official Song Download Now Click Here

Download Now Click Here

Training for IT and Software Courses said...

Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot.

Devops Certification Online Training in bangalore

Devops Certification courses in bangalore

Devops Certification classes in bangalore

Devops Certification Online Training institute in bangalore

Devops Certification course syllabus

best Devops Certification Online Training

Devops Certification Online Training centers

Training for IT and Software Courses said...

Very interesting blog Thank you for sharing such a nice and interesting blog and really very helpful article.

Data Science Online Training

Data Science Classes Online

Data Science Training Online

Online Data Science Course

Data Science Course Online

deiva said...

Thank you much for this tutorial; this is an informative and valuable blog.
java training in chennai

java training in omr

aws training in chennai

aws training in omr

python training in chennai

python training in omr

selenium training in chennai

selenium training in omr

Jayalakshmi said...

After reading your article I was amazed. I know that you explain it very well. And I hope that other readers will also experience how I feel after reading your article.
hardware and networking training in chennai

hardware and networking training in tambaram

xamarin training in chennai

xamarin training in tambaram

ios training in chennai

ios training in tambaram

iot training in chennai

iot training in tambaram

praveen said...

This blog is Very Informative. And i glad to find your blog. Keep Sharing like this useful blog.

data science training in chennai

data science training in porur

android training in chennai

android training in porur

devops training in chennai

devops training in porur

artificial intelligence training in chennai

artificial intelligence training in porur

shiny said...

Great insightful content with good information.

sap training in chennai

sap training in annanagar

azure training in chennai

azure training in annanagar

cyber security course in chennai

cyber security course in annanagar

ethical hacking course in chennai

ethical hacking course in annanagar

vivekvedha said...

Thanks for this informative blog.
acte chennai

acte complaints

acte reviews

acte trainer complaints

acte trainer reviews

acte velachery reviews complaints

acte tambaram reviews complaints

acte anna nagar reviews complaints

acte porur reviews complaints

acte omr reviews complaints


Data Science said...

Awesome article with valuable information it very helpful waiting for next blog update thank you.
Data Analytics Course Online 360DigiTMG

Tech Institute said...

Excellent blog with very impressive writing and unique content, information shared was very valuable thank you.
Data Science Course in Hyderabad

Data Analytics Course said...

It's like you understand the topic well, but forgot to include your readers. Maybe you should think about it from several angles.

Data Analytics Course in Bangalore

Grace Ella said...

I was worried about my illness as well as studies so that I decided to seek help from a writing service in order to reduce my stress and increase my grades. I am assured that seeking help from can reduce the stress of the students. Dissertation Writing Service

OGEN Infosystem (P) Limited said...

Great Post, thanks for sharing such an amazing blog with us. Visit Ogen Infosystem for creative website design and PPC Services in Delhi, India.
Website Designing Company in Delhi

Liza Mineli said...

Good post! If you post the same on twitter and want to get many likes on it use this site https://viplikes.net/ to get as much twitter likes as you need

suresh said...

Nice post. Thanks for sharing! I want people to know just how good this information is in your article. It’s interesting content and Great work.
DevOps Training in Chennai

DevOps Course in Chennai

Trending Technologies said...

Fantastic article and excellent topic with valuable information thanks for sharing.
Data Science Course in Bangalore

360DigiTMGNoida said...

As always your articles do inspire me. Every single detail you have posted was great.
data science certification in noida

ve may bay tet said...

Mua vé máy bay tại Aivivu, tham khảo

vé máy bay đi Mỹ Vietnam Airline

hướng dẫn đi máy bay từ mỹ về việt nam

Vé máy bay từ Nhật Bản về Việt Nam

giá vé máy bay từ Toronto đến việt nam

360DigiTMG said...

Happy to visit your blog, I am by all accounts forward to more solid articles and I figure we as a whole wish to thank such huge numbers of good articles, blog to impart to us.
data science certification

Anonymous said...

Get Rapid Solutions For Norton Antivirus Related Problems..

Visit US: www.norton.com/setup

360DigiTMG said...

"Very Nice Blog!!!


Please have a look about "
certification of data science

Roxanne Emmerich said...

Movie-watching websites that are more than movie-watching websites หนังฝรั่ง Because we are the number 1 free movie site in Thailand for a long time, including new movies, Thai movies, Western movies, Asian movies, we have all kinds of ways for you Including new series Full of all stories without interstitial ads to keep annoying anymore. One place SA-MOVIE

Android and IOS operating systems. Watch online movies, Thai movies, Western movies, ดูหนังชนโรง, Asian movies, Cartoon movies, Netflix Movie, Action Movies, Comedy Movies, Crime Movies, Drama Movies, Horror Movies, Adventure Movies, Crash Movies and still have many new movies to watch. You can watch for free anytime, anywhere 24 hours a day at see4k.com.


GangManga read manga, read manga, read manga online for free, fast loading, clear images in HD quality, all titles, anywhere, anytime, on mobile, tablet, computer. Android and IOS operating systems. Read top comics, action dramas, comedy, adventure, horror and manga. อ่านมังงะ New coming every day to watch many more. Can be read for free anytime anywhere 24 hours a day at gangmanga.com.

It is no secret that football is among the most popular and widely watched sports. Everybody who likes football tries to find the best platform for free soccer streaming. So, what are the best free sports streaming sites? We are going to answer this question. On this page, you can find a detailed overview of the most widespread soccer streaming websites. ดูบอลออนไลน์ Keep on reading and make the best choice for you.

Priya Rathod said...

Very amazing blog, Thanks for giving me new useful information.
Python Training in Hyderabad
Python Course in Hyderabad

Abdulla said...

I read this article. I think You put a great deal of exertion to make this article.
buy instagram followers

360DigiTMGAurangabad said...

This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me..
machine learning certification in aurangabad

Mounika said...

I just got to this amazing site not long ago. I was actually captured with the piece of resources you have got here. Big thumbs up for making such wonderful blog page!
href="https://starpmo.com/pmp-certification-training-in-hyderabad/" Pmp training

360DigiTMG-Pune said...

This website and I conceive this internet site is really informative ! Keep on putting up!
best data science online course

UFABET1688 said...

I wanted to thank you for this great read!! ufabet168 I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post.

Harris said...

Your authorship style is admirable and the way you managed the subject are clear and insightful. Really iam waiting for reading in typos and functional errors from you bro.. if you can. best 6 burner gas grills, Best thin waffle maker

Bhuvana said...

Incredibly conventional blog and articles. I am really very happy to visit your blog. Directly I am found which I truly need. Thankful to you and keeping it together for your new post…

AWS Training in Hyderabad

360DigiTMGAurangabad said...

"Very Nice Blog!!!


Please have a look about "
ai courses aurangabad

opbest said...


Nice post. I was checking continuously this blog and I am inspired! Extremely helpful info specially the ultimate part
🙂 I take care of such information a lot. I was seeking this certain info for a very long time.
Thank you and best of luck. |


Try to check my webpage :: 오피사이트

(freaky)

training institute said...

wow, great, I was wondering how to cure acne naturally. and found your site by google, learned a lot, now i’m a bit clear. I’ve bookmark your site and also address. keep us updated.
data science course

opbestcom8 said...

Someone necessarily help to make significantly articles I would state.
This is the first time I frequented your website page and thus far? 부산오피

training institute said...

I have been searching to find a comfort or effective procedure to complete this process and I think this is the most suitable way to do it effectively.
data science course in malaysia

Mark2030 said...

Thanks for sharing the knowledge and informative information about Types and Bugs Read more. Best Dissertation Writing Services

Unknown said...

i read her blog. is very good writer.you all people should try to read his blog.dissertation writing help in uk

bestbus said...

Awesome content. Thanks for sharing with us.
exam portal online
matrimony website creation

Kristi H. Warren said...

Very Interesting Post! If you face any errors with your account, we can also help you fix those issues. So please consider coming on our SBCGlobal help page.

traininginstitute said...

This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck
data science training in malaysia

Unknown said...

This one is amazing lather jackets.William Jacket

Black leather Jacket for Men said...

i read her blog. is very good writer.you all people should try to read his blog.

Truck and Trailer said...

Excellent information, Thanks for sharing amazing aritcle.
Tire repair near me
Gas near me
Truck repair shop near me
Alignment near me

What is Website said...

I really appreciate your method to explaining, I hope to see more posts from your blog. thank you!
website designer near me
web development company
ppc agency for startups
toronto seo agency

The Genuine Leather said...

Goodness! Much obliged to you! I constantly needed to compose on my site something to that effect. Would I be able to incorporate a part of your post into my site? Pelle Pelle jacket

카지노사이트 said...

Of course, your article is good enough, 카지노사이트 but I thought it would be much better to see professional photos and videos together. There are articles and photos on these topics on my homepage, so please visit and share your opinions.


deanffranklin@gmail.com said...

Goodness, glad to see this great post. I trust this think help any beginner for their marvelous work and by the way a debt of gratitude is in order for share this magnificence, I thought this was a really fascinating understood with regards to this point. Much thanks to you.. hawkeye coat

The Genuine Leather said...

It is great to see that some people still put in an effort into managing their websites. I'll be sure to check back again real soon. it's really amazingYellowstone Jacket

C2N said...

These post is lots of information about Selenium Testing have spread around the web automate, but this is a unique one according to me.

Salesforce

digital marketing training malaysia said...

I was basically inspecting through the web filtering for certain data and ran over your blog. I am flabbergasted by the data that you have on this blog. It shows how well you welcome this subject. Bookmarked this page, will return for extra.

PMP Training in Malaysia said...

360DigiTMG, the top-rated organisation among the most prestigious industries around the world, is an educational destination for those looking to pursue their dreams around the globe. The company is changing careers of many people through constant improvement, 360DigiTMG provides an outstanding learning experience and distinguishes itself from the pack. 360DigiTMG is a prominent global presence by offering world-class training. Its main office is in India and subsidiaries across Malaysia, USA, East Asia, Australia, Uk, Netherlands, and the Middle East.

thanvi said...

Thank you for shearing post amazing this is post very useful for me.

AEM Training
Sitecore Training
Dellboomi Training
Guidewire Training
Okta Training

Mahil mithu said...

Well, I really appreciated for your great work. This topic submitted by you is helpful and keep sharing...
Virginia Family Law Attorneys
Multi State Family Law Attorneys

Sruthi Karan said...

Newly I read your post, this is very beneficial for all. Your scope was very impressive and thank you!
Divorce Lawyer Consultation Cost
Child Support Virginia

darknet hitman said...

After reading several of your excellent content posts, I'd want to highly encourage you to continue contributing to the website. Your hard work has been greatly appreciated.
how to hire a hit man

Anonymous said...

Implementing a customer loyalty rewards program can be a powerful strategy for small businesses to retain customers and drive repeat purchases. When choosing loyalty rewards program software for small businesses, consider solutions that are cost-effective, easy to use, and tailored to your specific needs. Here are key features and considerations for selecting loyalty rewards program software suitable for small businesses.
Best Customer Loyalty Rewards Programs Software for Small Businesses

Mulemasters said...

Great article! I appreciate you sharing valuable information.
visit:
Mulesoft Training In Hyderabad

Ataşehir Çekici said...

Great article! I appreciate you sharing valuable information.

genel forum sitesi said...

Thank you very much

clara dorothy said...

This resource offers a comprehensive overview of types and bugs, providing valuable insights for both beginners and experienced developers. It provides clear explanations and examples of common bug types and their potential impact on software development. The resource effectively covers a wide range of bug types, offering a valuable reference for anyone in software development. The inclusion of real-world examples makes the content relatable and practical. The thorough and well-organized content, along with prevention strategies and best practices, adds a proactive dimension to the guide, making it a well-rounded guide for developers.
Abogados Violencia Doméstica Nueva Jersey

gostopsite.com said...

It’s great to know about many things from your website blog.

sportstotomen.com said...

Its really fun to read. I enjoyed a lot.

19guide03.com said...

Theme of blog is excellent there is almost everything to read, Brilliant post.

slotplayground.com said...

I have read. Many readers would be interested on this site.

edwardsrailcar.com said...

Your blog provided us with valuable information to work with.

gebze çekici said...

Gebze çekici numarası, araç arızası, kaza yada hiç akla gelmeyecek bir nedenden yolda kalan araç sürücülerinin en çok arattığı numaralardan bir tanesidir. Google aylık arama hacmine göre Gebze oto çekici numarası ayda 200 kez aratılmaktadır. Bu veriler bize gösteriyor ki çekici numarası kelimesi diğer il ve ilçelerde olduğu gibi Gebze için de hayati bir önem taşımaktadır.

zeytinburnu çekici said...

Zeytinburnu çekici ağımızda mevcut. Zeytinburnu çekici hizmetimiz gece ve gündüz fark etmeksizin çalışmaktadır. Sadece Zeytinburnu oto çekici hizmeti için değil, İstanbul'un diğer birçok ilçesinde çekici hizmeti vermekteyiz.

Meredith said...

I really appreciate this blog, It means a lot for me,, Very interesting Thanks!!

Alejandra said...

I appreciate this blog of yours. Post more good contents please, Thank you

Braelynn said...

Thank you for this excellent read!! I definitely loved every little bit of it.

Michaela said...

Its an amazing website, really enjoy this articles. Keep doing this in future. Thanks..

Anonymous said...

Thank you for this excellent read!! I definitely loved every little bit of it.

yabancı yarışlar

Golden Traingle India Tour said...

As a travel planner, I find it refreshing to stumble upon thought-provoking content like Evan Farrer's blog post. Despite the tired discussions surrounding dynamic vs. static programming, Farrer's approach to transliterating code and analyzing the results adds a fascinating dimension to the conversation. His experiment highlights the practical implications of different programming paradigms and the benefits of leveraging type systems. It's inspiring to see innovative thinking applied to familiar topics, sparking new insights and discussions. Kudos to Farrer for shedding light on this subject in such an engaging and enlightening manner!

Anonymous said...

I really enjoyed reading your article. The information you shared was excellent and insightful. Please keep updating your blog with useful content—it's greatly appreciated!

SAP SD Training in Hyderabad

ISO In Jeddah said...

This topic always seemed so confusing, but the writer has managed to explain it in such a clear and accessible way. I’m truly impressed by their ability to make everything so understandable. Great job!
Visit our link for ISO Certification in Saudi Arabia