I would like to compare 25+ different coding (same programming language, if possible Java but other languages are fine too) implementations of the same homework. Where can I find such homework solution datasets?
Including to other answers, here is one that may help to create a database.
Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.
As the about section said, project Euler is a collection of many mathematical problems and users try to solve them one by one with programming languages. Unfortunately, there isn't a limitation on the programming language you have to use. But if someone track them and collect only those that want, it would create a nice database.
Note: I've been thinking about this question since it was asked because I think doing text analysis on human-typed computer programming langauges is a very novel idea. I don't think this answer is spot-on, but I hope that it starts the discussion and gets us to a better answer.
- GitHub is the source of many programming codes these days, in addition to other resources (data sets, code snippets, writing, team projects, etc).
- Many courses and contests require or suggest posting code to GitHub. For that reason, you have many implementations of the same "homework" or assignment.
Participants may post their code submissions to GitHub.
Visit GitHub and search "kaggle" - direct link
The left menu bar has a breakdown by programming language. Kaggle is heavy with R and Python. The popularity of Java with data-science people is decreasing (more info here). Or maybe it is just Java in general - N-grams link, indeed.com job trends.
So let's choose Python from the filter - search results.
You can see contests have the largest turnout, and then create GitHub searches for those in particular. After some digging you may find one that is Java-centric.
These repositories can be easily and openly be obtained. If you aren't familiar with Git, you can download all the code, or use their API to search and collect code that meets your criterea. Here is the documentation about API search.
- Similar to above, but for MOOCs from places like Coursera instead of Kaggle.
- These online courses often encourage or require posting code to GitHub.
- One example: 173 Java results with tons of Java code for a course called "Programming Mobile Applications for Android Handheld Systems" - GitHub search results.
- With deeper searching you can find tons of code for identical project descriptions.
Rosetta Code might help you in your task :
Rosetta Code is a programming chrestomathy site. The idea is to present solutions to the same task in as many different languages as possible, to demonstrate how languages are similar and different, and to aid a person with a grounding in one approach to a problem in learning another. Rosetta Code currently has 711 tasks, 131 draft tasks, and is aware of 530 languages, though we do not (and cannot) have solutions to every task in every language.