Inspiration

With the recent boom in AI language model technology, plagiarism has been on the rise in both educational and professional environments. This motivated us to create a web-based tool that's simple and accessible enough for anybody to use but powerful enough to effectively detect similarities in the code.

What it does

The Java Source Code Comparer (JaSCo) takes in two Java source code files and then returns a similarity score based on the content of the two files. JaSCo is web-based (but not currently hosted) and takes the files as plaintext to avoid interacting with your system, making it very straightforward and non-intrusive.

How we built it

The frontend was written in Angular and the backend is written in Java, with SpringBoot and Gradle to tie it all together. We use a parsing algorithm to break up the incoming code into their smallest parts (int, ;, main, void, variableName, etc.) and then convert them into tokens that help the comparator understand what each part means. The two sets of tokens then go through a comparison algorithm that gives a percent score for similarity between the two files.

Challenges we ran into

We hit several challenges while building this project, both from software failures and lack of knowledge. We collectively had very little experience connecting frontend with backend, and we only decided to implement a frontend partway through the project, making the integration of SpringBoot with the application take hours as we figured out how to use it. We had a similar experience with Gradle, as we had never set up a Gradle project before and had to spend a few hours fixing errors while getting it set up properly. Additionally, we had several difficult methods to integrate and technical issues along the way. The intellisense on our IDEs wasn't working properly, leading to errors flagged all across the coding interface, as well as real errors not showing until we manually compiled the project, among other problems.

Accomplishments that we're proud of

The biggest achievements were definitely creating a complete application with both frontend and backend, which none of us had ever attempted before. Creating a full-stack application like this forced us out of our comfort zone through utilizing new technologies like Spring and Gradle. There were also technically demanding methods on backend that tested our abilities to design and implement algorithms; notably Parser.digest(), which recursively breaks down the source code into smaller and smaller chunks until they can be understood by the translator.

What we learned

Overall, we learned about the workflow and technologies involved in a full-stack project, and the most efficient ways for multiple people to work on one project at the same time. We made several mistakes during this hackathon that slowed us down significantly at some points, but we've learned from them so that we can do even better and learn even more at our next hackathon.

What's next for Java Source Code Comparer

JaSCo was built with expandability in mind. There is a lot of potential to improve the interface by adding a way to highlight the similarities in the code and giving the option to input files directly if the user wants. The comparison algorithm could also be improved using a more robust algorithm or an alternative method like machine learning. Another feature we considered but didn't have time for was implementing an AI language model like OpenAI API or CopilotGPT to take in a rubric or prompt that an educator used for an assignment, generating a java file to compare with the student's assignment. This would provide a more direct way to compare assignments with AI built in.

Share this project:

Updates