Reviving My Programming Roots: A Full-Stack Adventure with Spring Boot, ImageJ, OpenCV, and AI
Michael Finocchiaro
Digital Thread Expert | Digital Twin Evangelist | Senior PLM Architect
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:
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.
Pre-Sales Domain Solution Architect Expert (Transformational Change Advisor)
1 周Michael, I appreciate your assessment and agree with your points. From my vantage point, AI is a powerful supplement but it is not a replacement for the architect/designer/software engineer. AI at the current maturity, cannot replace innovation, critical thinking, risk mitigation, it can offer suggestions, alternatives and deduce permutations to a plausible path. but requires human oversight and direction.
Great write-up. I applaud your approach, doesn’t surprise me, to jump right in and build something.
HPC consultant DML-HPC
4 周Michael isn’t just a coder; he’s an artist. Working with him on one of the most challenging projects of our careers was an eye-opener. His unique skill in navigating complex ecosystems of hardware and software with ease was unmatched, making him the perfect partner as we tackled the colossal CATIA on servers that simply weren’t ready for it. Today, I’m confident that if anyone can unleash the true potential of AI in such demanding environments, it’s Michael. On my end, I’ve recently been exploring ChatGPT, and it’s transformative—not as a replacement, but as an amplifier of productivity and creativity. It allows me to approach personal projects in ways I never imagined, taking on ideas I once left behind. ChatGPT offers immediate solutions, helping me validate and refine concepts without the week-long dive into unfamiliar APIs. This experience reminds me of the leap I felt when Turbo C++ came out; once again, my productivity has soared. Now, I use it extensively, moving away from tools like Excel, and building custom graphics and analyses in Python in a fraction of the time. This is a tool every engineer should master to elevate their work.
Product Manager | Customer Success
4 周Michael, accurate assessment! I do not have a programming background but I did recently pickup enough Python to build useful data collection, cleansing and analysis tools for my role as a PM. Regarding version evolution, this line resonates with me, "Often, the generated code would mix the two or provide syntax for one but suggest corrections for the other, causing an infinite loop." I tried my best to use only Python 3 styles in my Python projects, but at some point I had to be satisfied with getting it working and move on. A lesson in there somewhere...
Implementations Consultant | Full Stack Engineer | AI Enthusiast
4 周Very informative