Reviving My Programming Roots: A Full-Stack Adventure with Spring Boot, ImageJ, OpenCV, and AI

Will an AI really replace all programmers?
Building a Full-Stack Application from Scratch with Spring Boot, Java, ImageJ, OpenCV, and DevOps: A Journey with AI
As someone whose background isn’t primarily in programming, jumping back into development was a challenge. It had been over 20 years since I last worked extensively in Java or C, yet here I was, diving into a full-stack project combining Spring Boot, Java, ImageJ, OpenCV, and DevOps practices. To streamline the development, I turned to AI tools, including ChatGPT, to assist with setup, coding, testing, and containerization. While AI accelerated several aspects, the experience revealed both strengths and limitations in using AI for hands-on programming after such a long break.
Setting up the Initial Project Environment
To begin, I used ChatGPT to set up a Spring Boot environment in Visual Studio Code. Here, AI was immensely helpful in generating boilerplate code and configurations, allowing me to get a working project up and running quickly. With my outdated knowledge of Java, this support was invaluable—allowing me to build a Spring Boot project mockup with a 10/10 usefulness rating.
As I advanced, though, the limitations of AI started to show, especially as it struggled with managing larger architectures. The AI provided basic Docker configurations but didn’t suggest best practices, like modularizing services or improving portability through microservices. This phase’s AI assistance rated closer to a 5/10 because it covered essential configurations but fell short on more strategic advice.
Unit Testing with Spring Boot
Creating unit tests for Spring Boot ended up being the most challenging part of the project. Despite repeated attempts, the test cases generated by AI tools were either incompatible with the project or led to endless configuration issues. The suggested changes in pom.xml often introduced new dependency problems or broke existing code. Trying to get these unit tests functional became a cycle of troubleshooting, and it became clear that while the AI could handle isolated issues, it struggled with interdependencies. Ultimately, I rated the AI a 1/10 for unit test generation because it caused more issues than it resolved.
Experience with Libraries
ImageJ
This Java-based library was relatively easy to use, except for the fact that there are two incompatible generations of ImageJ (a "1" and a "2"). Often, the generated code would mix the two or provide syntax for one but suggest corrections for the other, causing an infinite loop. This was only broken when I used a separate AI tool and asked the question differently. The prompt is everything.
OpenCV
This C++ library with a Java wrapper was more familiar territory for me, thanks to my past experience with JNI. However, AI assistance was limited, especially with JVM crashes caused by the shared library. The AI couldn't figure out many of these issues.
System.out
When using Docker containers, NEVER send console or debugging output to STDOUT. It will break your code and crash your JVMs. Despite this, AI tools continuously proposed using System.out for debugging and never suggested that OpenCV and ImageJ might have embedded such calls. Once I figured out the issue, the AI did help me fake out the System.out calls, but I wasted nearly 2 days on this problem, which was twice as long as it took to build the rest of the app.
Dependency Management and Limitations of AI Suggestions
Dependency management in pom.xml also brought up limitations. Although AI provided some initial guidance for adding basic dependencies like Spring Web and JPA, its recommendations became inconsistent and buggy once I integrated image processing tools like ImageJ and OpenCV. Conflicting suggestions arose, especially when combining JUnit 4, JUnit 5, and Mockito dependencies. This experience reinforced that while AI could help with standard setups, dependency management in a complex project is still largely manual. I rated AI’s usefulness a 3/10 for dependency management due to recurring conflicts and compatibility issues.
Using AI for DevOps and Docker
One of the most beneficial areas of AI assistance was with Docker and DevOps setup. ChatGPT was invaluable for defining a portable environment through Dockerfile and docker-compose.yml, allowing me to streamline my CI/CD pipeline and ensure the application runs consistently across various systems. The AI’s guidance was particularly helpful in configuring Docker services and setting up Bitbucket integration for source control, making this one of the highest-rated areas with an 8/10 in usefulness.
However, some configurations remained complex, such as setting the correct JVM parameters for JDK Mission Control in a containerized environment. Since I wanted to stick to free tools as much as possible, I opted for JMX over paid options like JProfiler. AI was unfamiliar with JMX configurations, and setting it up with Docker took considerable research outside the AI's recommendations.
Debugging and Troubleshooting Challenges
In terms of debugging, AI proved to be a mixed bag. AI suggestions were effective for minor syntax errors and optimizing simple code snippets. However, as with dependencies, debugging became more challenging when the errors involved multiple files or complex interactions between components. The AI’s limited scope meant that it couldn’t always provide context-sensitive insights, which sometimes led to wasted time on dead-end suggestions. I gave AI a 5/10 for debugging, recognizing its value for straightforward issues but noting its limitations with multifaceted problems.
Choosing Between Free AI Tools for Visual Studio Code
Since I aimed to use free tools whenever possible, I experimented with various AI plugins for Visual Studio Code to supplement my ChatGPT experience. Here are a few takeaways from the tools I tried:
- Codeium: Among the extensions, Codeium was the standout performer, seamlessly integrating with ChatGPT and offering relevant, context-aware suggestions.
- OpenAI and Visual Studio Code Integration: Since OpenAI does not officially offer a Visual Studio Code plugin, I resorted to using an external browser to access ChatGPT. Attempts to use third-party OpenAI plugins within Visual Studio Code proved frustrating, as these options didn’t work well with my setup.
- GitHub Copilot: While GitHub Copilot would have been helpful, it required a Microsoft Office license, which didn’t align with my free-tool objective.
- Genie AI: This extension was decent, but it was less relevant to my specific needs than Codeium, and its limited token availability ran out relatively quickly.
In addition to these, I explored a few other plugins, but most required paid subscriptions, making Codeium my preferred choice due to its performance and free access. Overall, finding effective tools with no-cost options was possible, but it required some trial and error.
Documenting and Profiling the Application
AI excelled in generating documentation, making it easy to integrate Swagger for API documentation, saving time and effort manually documenting endpoints. Performance testing suggestions from the AI were similarly helpful, helping me catch early bottlenecks.
For Java profiling, I avoided paid tools like JProfiler and used JMX Mission Control instead, though this setup took longer without AI guidance. AI’s suggestions for profiling were limited, highlighting the gaps in free AI support for in-depth performance analysis. This documentation and performance setup scored a 7/10 for usefulness, given the time saved on standard documentation and minor profiling suggestions.
Final Thoughts: The Value of AI as an Assistant
Reflecting on the journey, it’s clear that while AI accelerated aspects of development, deep programming knowledge remains essential. As someone with a background outside of coding, returning to Java and tackling complex configurations like dependency management required more than just AI support. My experience shows that AI tools can assist but currently don’t replace the need for technical expertise, especially when debugging complex problems or handling large projects with multiple dependencies.
I don't know how much better the paid tools might have been and I would like to redo this project with GitHub Copilot, but my initial goal was to see how far "free" would get me.
In conclusion, using AI in this project was a great way to reduce initial setup time, assist with DevOps, and generate documentation. However, for intricate tasks like testing, dependency management, and debugging, traditional coding experience was indispensable. I’m looking forward to seeing how AI tools evolve to better handle larger, interconnected codebases, which could unlock even more productivity for developers at all levels.