SlideShare uma empresa Scribd logo
1 de 24
Java Generics Adoption How New Features are Introduced, Championed, or Ignored Chris Parnin     Georgia Tech Christian Bird Microsoft Research Emerson Murphy-Hill North Carolina State
Quick refresher Raw Type R List myList= …; String aStringFromMyList = (String)myList.get(0); class List{   Object get(int i){…} } Cast (C)
Quick refresher List myList = …; String aStringFromMyList = (String)myList.get(0); class List<T>{   T get(int i){…} } Generic Type <T>
Quick refresher Parameterized Type <P> List<String> myList= …; String aStringFromMyList =         myList.get(0); class List<T>{   T get(int i){…} } static <T> T head(List<T> l){ 	return l.get(0); }; Generic Method <M>
but life is not so simple…
public interface Identifiable<T extends Identifier<? extends What>, What> {     public TgetObjectID();     public Class<? super What> type(); } public interface Identifier<T> {     public long getID();     public Class<? super T> type(); } interface X <SubjectType extends Identifiable, RelationshipType extends Enum<RelationshipType> & Related, ObjectType extends Identifiable>{}   static class A<     SI extends Identifier<? extends SubjectType>,     OI extends Identifier<? extends ObjectType>, SubjectType extends Identifiable<SI, SubjectType>, RelationshipType extends Enum<RelationshipType> & Related, ObjectType extends Identifiable<? extends OI, ? extends ObjectType>>     implements     X<SubjectType, RelationshipType, ObjectType> { }
public interface Identifiable<T extends Identifier<? extends What>, What> {     public TgetObjectID();     public Class<? super What> type(); } public interface Identifier<T> {     public long getID();     public Class<? super T> type(); } interface X <SubjectType extends Identifiable, RelationshipType extends Enum<RelationshipType> & Related, ObjectType extends Identifiable>{}   static class A<     SI extends Identifier<? extends SubjectType>,     OI extends Identifier<? extends ObjectType>, SubjectType extends Identifiable<SI, SubjectType>, RelationshipType extends Enum<RelationshipType> & Related, ObjectType extends Identifiable<? extends OI, ? extends ObjectType>>     implements     X<SubjectType, RelationshipType, ObjectType> { } “As I sit and stare in stunned  horror at this monster” "Writing generified classes is rocket science" “Probably more time and brainpower was spent  fussing with generics than any other single thing”
why are these people so angry? As a community, we often don’t formally evaluate our claims after we put them out into the world.
Outcome ? Gosling Idea Guy Steele Debate Java 5 Implement and Release Developer Usage 1994 1998 2004 2011
To investigate what happened to generics,  let’s look at the claims and complaints made about generics
“I suspect we will see a lot of Java 5 code that continues to do things the bad old way as a result and contend with the mish-mash that results” (2005)  – lambda the ultimate Did programmers adopt and use generics?
“There seems to be some debateover refactoring to utilize java generics within my current team … a holy war going on about what should and should not be done …” – stackoverflow Did programmers adopt and use generics? Will teammates all agree to use generics?
“Do you want to go back to casting-from-Object in every container access and dealing with the resulting runtime-revealed type errors?” – stackoverflow ClassCastExceptionsare rarely seen in bug reports! Caught with local testing before check-ins, etc… Did programmers adopt and use generics? Will teammates all agree to use generics? Does generics reduce runtime errors? Does generics reduce casts?
RQ 1 Adoption RQ 2 Coordination RQ 3 Casts Did programmers adopt and use generics? Will teammates all agree to use generics? Does generics reduce casts?
Study Setup RQ 1 Adoption RQ 2 Coordination RQ 3 Casts Lifetime of 20 open-source projects: Before and After generics. <P><M>(C)<T>R 500 million LOC Entities of Interest Per Commit Database for Analysis
532 developer’s generic usage? RQ 1 Adoption We use generic collections! RQ 2 Coordination RQ 3 Casts We use generics methods or classes! No generics!
Developers with higher commit frequency? RQ 1 Adoption Higher ratio of generics collection usage (42%) RQ 2 Coordination RQ 3 Casts But generic methods or classes stay about the same.
RQ 1 Adoption RQ 2 Coordination RQ 3 Casts Never used generics
RQ 1 Adoption RQ 2 Coordination RQ 3 Casts Another programmer starts contributing… Then a champion emerges! Then others follow. The champion even migrates old code.
RQ 1 Adoption RQ 2 Coordination jEdit RQ 3 Casts Casts (normalized) should decrease with generics. (C) We found no correlationfor jEdit <P>
RQ 1 Adoption RQ 2 Coordination jEdit RQ 3 Casts Squirrel-SQL Casts reduced before developers start to introduce generics. (C) (C) <P> We found a strong correlationfor Squirrel-SQL <P>
RQ 1 Adoption RQ 2 Coordination RQ 3 Casts But, overall, only Squirrel-SQL had a strong correlation, and  6 with moderate correlation.
Other findings Very little refactoring to generics (typically under 10%) Half of generics instantiated with just one type Generics support modest reductions in duplication 90% of generic usage is java.util collections IDE support has little relation to generic adoption date Generic methods are rare!
A Metaphor Regulates Drugs Regulates Programming Features Monitors Adverse Reactions Monitors Allergic Reactions Measures treatment effectiveness Measures impact and migration costs

Mais conteúdo relacionado

Destaque

Crowdsourced Documentation
Crowdsourced DocumentationCrowdsourced Documentation
Crowdsourced DocumentationMark Fidelman
 
Supervised Machine Learning: A Review of Classification ...
Supervised Machine Learning: A Review of Classification ...Supervised Machine Learning: A Review of Classification ...
Supervised Machine Learning: A Review of Classification ...butest
 
Cognitive Neuroscience of Memory for Software Engineers
Cognitive Neuroscience of Memory for Software EngineersCognitive Neuroscience of Memory for Software Engineers
Cognitive Neuroscience of Memory for Software EngineersChris Parnin
 
A Catalogue of Code Smell Visualizations
A Catalogue of Code Smell VisualizationsA Catalogue of Code Smell Visualizations
A Catalogue of Code Smell VisualizationsChris Parnin
 
Benevol 2012 Keynote: The Social Software (R)evolution
Benevol 2012 Keynote: The Social Software (R)evolutionBenevol 2012 Keynote: The Social Software (R)evolution
Benevol 2012 Keynote: The Social Software (R)evolutionMargaret-Anne Storey
 
Crowd Documentation - How Programmer Social Communities are Flipping Software...
Crowd Documentation - How Programmer Social Communities are Flipping Software...Crowd Documentation - How Programmer Social Communities are Flipping Software...
Crowd Documentation - How Programmer Social Communities are Flipping Software...Chris Parnin
 
Evaluating Cues for Resuming Interrupted Programming TAsks
Evaluating Cues for Resuming Interrupted Programming TAsksEvaluating Cues for Resuming Interrupted Programming TAsks
Evaluating Cues for Resuming Interrupted Programming TAsksChris Parnin
 
Are Automated Debugging Techniques Actually Helping Programmers
Are Automated Debugging Techniques Actually Helping ProgrammersAre Automated Debugging Techniques Actually Helping Programmers
Are Automated Debugging Techniques Actually Helping ProgrammersChris Parnin
 
DESIGNING FOR INTERRUPTION AND LIVENESS
DESIGNING FOR INTERRUPTION AND LIVENESSDESIGNING FOR INTERRUPTION AND LIVENESS
DESIGNING FOR INTERRUPTION AND LIVENESSChris Parnin
 
FSE 2016 Panel: The State of Software Engineering Research
FSE 2016 Panel: The State of Software Engineering ResearchFSE 2016 Panel: The State of Software Engineering Research
FSE 2016 Panel: The State of Software Engineering ResearchMargaret-Anne Storey
 
ICSE 2011: Research industry panel
ICSE 2011: Research industry panelICSE 2011: Research industry panel
ICSE 2011: Research industry panelMargaret-Anne Storey
 
Visualization for Software Analytics
Visualization for Software AnalyticsVisualization for Software Analytics
Visualization for Software AnalyticsMargaret-Anne Storey
 
How Developers Stay Current Using Twitter
How Developers Stay Current Using TwitterHow Developers Stay Current Using Twitter
How Developers Stay Current Using TwitterMargaret-Anne Storey
 
Lies, Damned Lies and Software Analytics: Why Big Data Needs Rich Data
Lies, Damned Lies and Software Analytics:  Why Big Data Needs Rich DataLies, Damned Lies and Software Analytics:  Why Big Data Needs Rich Data
Lies, Damned Lies and Software Analytics: Why Big Data Needs Rich DataMargaret-Anne Storey
 
Programmer Information Needs After Memory Failure
Programmer Information Needs After Memory FailureProgrammer Information Needs After Memory Failure
Programmer Information Needs After Memory FailureChris Parnin
 
The (R)evolution of Social Media in Software Engineering
The (R)evolution of Social Media in Software EngineeringThe (R)evolution of Social Media in Software Engineering
The (R)evolution of Social Media in Software EngineeringMargaret-Anne Storey
 
Cascon 2016 Keynote: Disrupting Developer Productivity One Bot at a Time
Cascon 2016 Keynote: Disrupting Developer Productivity One Bot at a TimeCascon 2016 Keynote: Disrupting Developer Productivity One Bot at a Time
Cascon 2016 Keynote: Disrupting Developer Productivity One Bot at a TimeMargaret-Anne Storey
 

Destaque (20)

Code Pad
Code PadCode Pad
Code Pad
 
Icpc 2011 storey
Icpc 2011 storeyIcpc 2011 storey
Icpc 2011 storey
 
Crowdsourced Documentation
Crowdsourced DocumentationCrowdsourced Documentation
Crowdsourced Documentation
 
Supervised Machine Learning: A Review of Classification ...
Supervised Machine Learning: A Review of Classification ...Supervised Machine Learning: A Review of Classification ...
Supervised Machine Learning: A Review of Classification ...
 
Cognitive Neuroscience of Memory for Software Engineers
Cognitive Neuroscience of Memory for Software EngineersCognitive Neuroscience of Memory for Software Engineers
Cognitive Neuroscience of Memory for Software Engineers
 
A Catalogue of Code Smell Visualizations
A Catalogue of Code Smell VisualizationsA Catalogue of Code Smell Visualizations
A Catalogue of Code Smell Visualizations
 
Benevol 2012 Keynote: The Social Software (R)evolution
Benevol 2012 Keynote: The Social Software (R)evolutionBenevol 2012 Keynote: The Social Software (R)evolution
Benevol 2012 Keynote: The Social Software (R)evolution
 
Research industry panel review
Research industry panel reviewResearch industry panel review
Research industry panel review
 
Crowd Documentation - How Programmer Social Communities are Flipping Software...
Crowd Documentation - How Programmer Social Communities are Flipping Software...Crowd Documentation - How Programmer Social Communities are Flipping Software...
Crowd Documentation - How Programmer Social Communities are Flipping Software...
 
Evaluating Cues for Resuming Interrupted Programming TAsks
Evaluating Cues for Resuming Interrupted Programming TAsksEvaluating Cues for Resuming Interrupted Programming TAsks
Evaluating Cues for Resuming Interrupted Programming TAsks
 
Are Automated Debugging Techniques Actually Helping Programmers
Are Automated Debugging Techniques Actually Helping ProgrammersAre Automated Debugging Techniques Actually Helping Programmers
Are Automated Debugging Techniques Actually Helping Programmers
 
DESIGNING FOR INTERRUPTION AND LIVENESS
DESIGNING FOR INTERRUPTION AND LIVENESSDESIGNING FOR INTERRUPTION AND LIVENESS
DESIGNING FOR INTERRUPTION AND LIVENESS
 
FSE 2016 Panel: The State of Software Engineering Research
FSE 2016 Panel: The State of Software Engineering ResearchFSE 2016 Panel: The State of Software Engineering Research
FSE 2016 Panel: The State of Software Engineering Research
 
ICSE 2011: Research industry panel
ICSE 2011: Research industry panelICSE 2011: Research industry panel
ICSE 2011: Research industry panel
 
Visualization for Software Analytics
Visualization for Software AnalyticsVisualization for Software Analytics
Visualization for Software Analytics
 
How Developers Stay Current Using Twitter
How Developers Stay Current Using TwitterHow Developers Stay Current Using Twitter
How Developers Stay Current Using Twitter
 
Lies, Damned Lies and Software Analytics: Why Big Data Needs Rich Data
Lies, Damned Lies and Software Analytics:  Why Big Data Needs Rich DataLies, Damned Lies and Software Analytics:  Why Big Data Needs Rich Data
Lies, Damned Lies and Software Analytics: Why Big Data Needs Rich Data
 
Programmer Information Needs After Memory Failure
Programmer Information Needs After Memory FailureProgrammer Information Needs After Memory Failure
Programmer Information Needs After Memory Failure
 
The (R)evolution of Social Media in Software Engineering
The (R)evolution of Social Media in Software EngineeringThe (R)evolution of Social Media in Software Engineering
The (R)evolution of Social Media in Software Engineering
 
Cascon 2016 Keynote: Disrupting Developer Productivity One Bot at a Time
Cascon 2016 Keynote: Disrupting Developer Productivity One Bot at a TimeCascon 2016 Keynote: Disrupting Developer Productivity One Bot at a Time
Cascon 2016 Keynote: Disrupting Developer Productivity One Bot at a Time
 

Semelhante a Java Generics Adoption: A Longitudinal Study of How New Language Features Are Championed and Adopted Over Time

Parancoe and Lambico
Parancoe and LambicoParancoe and Lambico
Parancoe and Lambicobenfante
 
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014Austin Ogilvie
 
PHP Barcelona 2010 - Architecture and testability
PHP Barcelona 2010 - Architecture and testabilityPHP Barcelona 2010 - Architecture and testability
PHP Barcelona 2010 - Architecture and testabilityGiorgio Sironi
 
Using DAOs without implementing them
Using DAOs without implementing themUsing DAOs without implementing them
Using DAOs without implementing thembenfante
 
Linq Sanjay Vyas
Linq   Sanjay VyasLinq   Sanjay Vyas
Linq Sanjay Vyasrsnarayanan
 
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume LaforgeGroovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume LaforgeGuillaume Laforge
 
A well-typed program never goes wrong
A well-typed program never goes wrongA well-typed program never goes wrong
A well-typed program never goes wrongJulien Wetterwald
 
How to Build a Semantic Search System
How to Build a Semantic Search SystemHow to Build a Semantic Search System
How to Build a Semantic Search SystemTrey Grainger
 
Building Interpretable & Secure AI Systems using PyTorch
Building Interpretable & Secure AI Systems using PyTorchBuilding Interpretable & Secure AI Systems using PyTorch
Building Interpretable & Secure AI Systems using PyTorchgeetachauhan
 
NHibernate (The ORM For .NET Platform)
NHibernate (The ORM For .NET Platform)NHibernate (The ORM For .NET Platform)
NHibernate (The ORM For .NET Platform)Samnang Chhun
 
Why Java Needs Hierarchical Data
Why Java Needs Hierarchical DataWhy Java Needs Hierarchical Data
Why Java Needs Hierarchical DataMarakana Inc.
 
New Ideas for Old Code - Greach
New Ideas for Old Code - GreachNew Ideas for Old Code - Greach
New Ideas for Old Code - GreachHamletDRC
 
How much do we know about Object-Oriented Programming?
How much do we know about Object-Oriented Programming?How much do we know about Object-Oriented Programming?
How much do we know about Object-Oriented Programming?Sandro Mancuso
 
Search and find metadata in education
Search and find metadata in educationSearch and find metadata in education
Search and find metadata in educationPhelim Bradley
 
Java 8, Streams & Collectors, patterns, performances and parallelization
Java 8, Streams & Collectors, patterns, performances and parallelizationJava 8, Streams & Collectors, patterns, performances and parallelization
Java 8, Streams & Collectors, patterns, performances and parallelizationJosé Paumard
 
What’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingWhat’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingDmitry Kornilov
 

Semelhante a Java Generics Adoption: A Longitudinal Study of How New Language Features Are Championed and Adopted Over Time (20)

Parancoe and Lambico
Parancoe and LambicoParancoe and Lambico
Parancoe and Lambico
 
Struts2
Struts2Struts2
Struts2
 
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
 
PHP Barcelona 2010 - Architecture and testability
PHP Barcelona 2010 - Architecture and testabilityPHP Barcelona 2010 - Architecture and testability
PHP Barcelona 2010 - Architecture and testability
 
Using DAOs without implementing them
Using DAOs without implementing themUsing DAOs without implementing them
Using DAOs without implementing them
 
Linq Sanjay Vyas
Linq   Sanjay VyasLinq   Sanjay Vyas
Linq Sanjay Vyas
 
Mufix Network Programming Lecture
Mufix Network Programming LectureMufix Network Programming Lecture
Mufix Network Programming Lecture
 
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume LaforgeGroovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
 
A well-typed program never goes wrong
A well-typed program never goes wrongA well-typed program never goes wrong
A well-typed program never goes wrong
 
How to Build a Semantic Search System
How to Build a Semantic Search SystemHow to Build a Semantic Search System
How to Build a Semantic Search System
 
Building Interpretable & Secure AI Systems using PyTorch
Building Interpretable & Secure AI Systems using PyTorchBuilding Interpretable & Secure AI Systems using PyTorch
Building Interpretable & Secure AI Systems using PyTorch
 
NHibernate (The ORM For .NET Platform)
NHibernate (The ORM For .NET Platform)NHibernate (The ORM For .NET Platform)
NHibernate (The ORM For .NET Platform)
 
Why Java Needs Hierarchical Data
Why Java Needs Hierarchical DataWhy Java Needs Hierarchical Data
Why Java Needs Hierarchical Data
 
New Ideas for Old Code - Greach
New Ideas for Old Code - GreachNew Ideas for Old Code - Greach
New Ideas for Old Code - Greach
 
ORM JPA
ORM JPAORM JPA
ORM JPA
 
Apache Persistence Layers
Apache Persistence LayersApache Persistence Layers
Apache Persistence Layers
 
How much do we know about Object-Oriented Programming?
How much do we know about Object-Oriented Programming?How much do we know about Object-Oriented Programming?
How much do we know about Object-Oriented Programming?
 
Search and find metadata in education
Search and find metadata in educationSearch and find metadata in education
Search and find metadata in education
 
Java 8, Streams & Collectors, patterns, performances and parallelization
Java 8, Streams & Collectors, patterns, performances and parallelizationJava 8, Streams & Collectors, patterns, performances and parallelization
Java 8, Streams & Collectors, patterns, performances and parallelization
 
What’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingWhat’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON Binding
 

Último

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Último (20)

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Java Generics Adoption: A Longitudinal Study of How New Language Features Are Championed and Adopted Over Time

  • 1. Java Generics Adoption How New Features are Introduced, Championed, or Ignored Chris Parnin Georgia Tech Christian Bird Microsoft Research Emerson Murphy-Hill North Carolina State
  • 2. Quick refresher Raw Type R List myList= …; String aStringFromMyList = (String)myList.get(0); class List{ Object get(int i){…} } Cast (C)
  • 3. Quick refresher List myList = …; String aStringFromMyList = (String)myList.get(0); class List<T>{ T get(int i){…} } Generic Type <T>
  • 4. Quick refresher Parameterized Type <P> List<String> myList= …; String aStringFromMyList = myList.get(0); class List<T>{ T get(int i){…} } static <T> T head(List<T> l){ return l.get(0); }; Generic Method <M>
  • 5. but life is not so simple…
  • 6. public interface Identifiable<T extends Identifier<? extends What>, What> { public TgetObjectID(); public Class<? super What> type(); } public interface Identifier<T> { public long getID(); public Class<? super T> type(); } interface X <SubjectType extends Identifiable, RelationshipType extends Enum<RelationshipType> & Related, ObjectType extends Identifiable>{}   static class A< SI extends Identifier<? extends SubjectType>, OI extends Identifier<? extends ObjectType>, SubjectType extends Identifiable<SI, SubjectType>, RelationshipType extends Enum<RelationshipType> & Related, ObjectType extends Identifiable<? extends OI, ? extends ObjectType>> implements X<SubjectType, RelationshipType, ObjectType> { }
  • 7. public interface Identifiable<T extends Identifier<? extends What>, What> { public TgetObjectID(); public Class<? super What> type(); } public interface Identifier<T> { public long getID(); public Class<? super T> type(); } interface X <SubjectType extends Identifiable, RelationshipType extends Enum<RelationshipType> & Related, ObjectType extends Identifiable>{}   static class A< SI extends Identifier<? extends SubjectType>, OI extends Identifier<? extends ObjectType>, SubjectType extends Identifiable<SI, SubjectType>, RelationshipType extends Enum<RelationshipType> & Related, ObjectType extends Identifiable<? extends OI, ? extends ObjectType>> implements X<SubjectType, RelationshipType, ObjectType> { } “As I sit and stare in stunned horror at this monster” "Writing generified classes is rocket science" “Probably more time and brainpower was spent fussing with generics than any other single thing”
  • 8. why are these people so angry? As a community, we often don’t formally evaluate our claims after we put them out into the world.
  • 9. Outcome ? Gosling Idea Guy Steele Debate Java 5 Implement and Release Developer Usage 1994 1998 2004 2011
  • 10. To investigate what happened to generics, let’s look at the claims and complaints made about generics
  • 11. “I suspect we will see a lot of Java 5 code that continues to do things the bad old way as a result and contend with the mish-mash that results” (2005) – lambda the ultimate Did programmers adopt and use generics?
  • 12. “There seems to be some debateover refactoring to utilize java generics within my current team … a holy war going on about what should and should not be done …” – stackoverflow Did programmers adopt and use generics? Will teammates all agree to use generics?
  • 13. “Do you want to go back to casting-from-Object in every container access and dealing with the resulting runtime-revealed type errors?” – stackoverflow ClassCastExceptionsare rarely seen in bug reports! Caught with local testing before check-ins, etc… Did programmers adopt and use generics? Will teammates all agree to use generics? Does generics reduce runtime errors? Does generics reduce casts?
  • 14. RQ 1 Adoption RQ 2 Coordination RQ 3 Casts Did programmers adopt and use generics? Will teammates all agree to use generics? Does generics reduce casts?
  • 15. Study Setup RQ 1 Adoption RQ 2 Coordination RQ 3 Casts Lifetime of 20 open-source projects: Before and After generics. <P><M>(C)<T>R 500 million LOC Entities of Interest Per Commit Database for Analysis
  • 16. 532 developer’s generic usage? RQ 1 Adoption We use generic collections! RQ 2 Coordination RQ 3 Casts We use generics methods or classes! No generics!
  • 17. Developers with higher commit frequency? RQ 1 Adoption Higher ratio of generics collection usage (42%) RQ 2 Coordination RQ 3 Casts But generic methods or classes stay about the same.
  • 18. RQ 1 Adoption RQ 2 Coordination RQ 3 Casts Never used generics
  • 19. RQ 1 Adoption RQ 2 Coordination RQ 3 Casts Another programmer starts contributing… Then a champion emerges! Then others follow. The champion even migrates old code.
  • 20. RQ 1 Adoption RQ 2 Coordination jEdit RQ 3 Casts Casts (normalized) should decrease with generics. (C) We found no correlationfor jEdit <P>
  • 21. RQ 1 Adoption RQ 2 Coordination jEdit RQ 3 Casts Squirrel-SQL Casts reduced before developers start to introduce generics. (C) (C) <P> We found a strong correlationfor Squirrel-SQL <P>
  • 22. RQ 1 Adoption RQ 2 Coordination RQ 3 Casts But, overall, only Squirrel-SQL had a strong correlation, and 6 with moderate correlation.
  • 23. Other findings Very little refactoring to generics (typically under 10%) Half of generics instantiated with just one type Generics support modest reductions in duplication 90% of generic usage is java.util collections IDE support has little relation to generic adoption date Generic methods are rare!
  • 24. A Metaphor Regulates Drugs Regulates Programming Features Monitors Adverse Reactions Monitors Allergic Reactions Measures treatment effectiveness Measures impact and migration costs

Notas do Editor

  1. Casts: ugly and runtime exception
  2. TODO: move “myList” decl so transition smoother
  3. So what happened with generics? To find out why, let’s start at the beginnning…
  4. So to investigate what happened to generics, let’s look at the claims and complaints made about generics
  5. TODO mention why we think they’re true (repeatedly!)
  6. Emphasize historical lookSimplify process diagram
  7. Zoom size of each person for contribution amount.Put research question on topFor each question, remind what answer is
  8. Some developers stubbornly used “raw” types despite adoption by others in the same project, whereas, in many projects that did use generics, there was a single developer who “championed” the use of generics, by using generics much earlier and in larger amounts than other developers.
  9. Casts reduced before developers start to introduce generics.Spearman rank correlation:Only squirrel-sql had a strong correlation6 with moderate correlation.Gradual reveal, starting with one project, starting with 1 lineChange colors to be consistentMention normalization partBe sure to point out parts of graph that support what you say
  10. Casts reduced before developers start to introduce generics.Spearman rank correlation:Only squirrel-sql had a strong correlation6 with moderate correlation.Gradual reveal, starting with one project, starting with 1 lineChange colors to be consistentMention normalization partBe sure to point out parts of graph that support what you say
  11. Prematuregenerification.
  12. Clean up, make as conclusion slide