Day in the Life of a Developer With Google's Gemini Code Assist: Part 2
Conclude the review of Google Gemini Code Assist-enabled development in VS Studio Code and its impact on deployment and operations.
Join the DZone community and get the full member experience.
Join For FreeIn this article, we will continue with the review of the remaining developer lifecycle activities: Deployment and Operate using Gemini Code Assist. We will wind up with approximate productivity improvement estimates for all the lifecycle stages discussed in this article. Please refer to "Day in the Life of a Developer With Google’s Gemini Code Assist: Part 1" for more details on Stages 1-4.
5. Deployment
Let's move over to the Deployment Stage and use Gemini Code Assist to select the right GCP service.
- Note: It is expected that microservices deployment to the Cloud is seamless without too many configurations or changes that are vendor-specific. Let’s try to move Catalog Service to GCP and find out the right service option. The suggestion by Gemini Code Assist seems tilted toward GCP cloud Run as a recommended service for deployment. Let’s query further and compare other available service options on GCP.
Above, Gemini Code Assist compares Cloud Run with other available options such as App Engine, Kubernetes, and self-hosted servers, and concludes with the reason for Cloud Run being suggested as the recommended option.
Now, get steps for making Catalog Service compatible with GCP Cloud Run:
We would drill into each of the steps further through prompts and get more specific information. Let's start with containerization.
Let's continue with build and containerization.
We now queried Gemini Code Assist to move the Postgres database to Cloud SQL:
Database with Private IP - Cloud SQL – Postgres database was exposed with access enabled for Private IP. We found that connecting to a database with a Public IP is more straightforward. However, private IP Cloud SQL configuration is a bit different where we need to enable Connector-Private Service Access. Gemini Code Assist in VS Code responses were not too contextualized for this requirement. A developer may face some minor challenges initially to get his Spring Boot and CloudSQL connectivity in place in a more secure cloud setup not using default VPC and Public IP.
Building and pushing Docker image to container registry:
Next, we run the command below to deploy to GCP. The final configurations that were used are below. Inputs provided by Gemini Code Assist pertaining to Spring Boot configurations to connect with Cloud SQL in private access mode were not very helpful in this regard.
6. Operate
Now, let's move to the Operate phase where maintenance of existing code, and upgrade to higher versions of libraries is a common requirement. Let's try to move from Java 11 to Java 17 and Spring Boot 2 to Spring Boot 3.
Above, we can see that the upgrade to Java 17 from Java 11 and to Spring Boot 3 results in compilation errors. Code Transformation is a new feature introduced in Gemini Pro, in which the developer can transform the old code to new versions intuitively with Gemini Code Assist Actions (currently in preview). Let's see if it can help here.
- Note: Here we have upgraded our code to Spring Boot 3 and Java 17 through Transform Code Suggestions and were able to build successfully. This feature is still in preview and looks promising, but will need to be run over different categories of legacy code (especially big code bases) to form an opinion on the accuracy and efforts saved through this feature.
Technical Debt
Now, Let's pick another common operational challenge: dealing with technical debt. Development teams trying to meet aggressive delivery timelines often find themselves burdened with rising technical debt. Good test coverage is often a good indicator that no new breaking changes or regression issues are being introduced as part of refactoring or new features being developed.
Similarly, comments and well-maintained documentation are also some ways in which technical debt can be reduced. Though most modern Code IDEs have built-in support for documentation features, Gemini Code Assist can further help by generating test cases and comments in an intuitive manner and suggesting further areas that will bring down technical debt. With time, one can expect more contextual responses that will support developers further to bring down technical debt via Gemini Code Assist quickly.
Summary and Conclusion
Based on this study, below are approximate effort and productivity gains that one may expect using Gemini Code Assist, with few caveats :):
S.nO# | Stage name | Development Activity | %Effort reduction |
---|---|---|---|
1 | Bootstrapping | Scaffolding Code | ~40% |
Unit Test Cases (Controller, Service, Repository) |
~50% | ||
2 | Build & Augment | #No_of_Service – Code/Develop | ~35% |
Error Handling | ~50% | ||
3 | Testing & Documentation | Swagger Creation | ~60% |
Test Plan | ~60% | ||
Integration Test Cases | ~50% | ||
Read Me / Documentation | ~40% | ||
4 | Troubleshoot | Data Mismatch; Output Errors & Exceptions | ~40% |
5 | Deployment | Deploy to Cloud-Native stack GCP Cloud Run / Cloud SQL | ~40% |
6 | Operate | Refactoring of Code & Upgrades | ~25% |
Points Of Consideration
- Client domain and complexity can have a different impact on effort calculations and reduction. The figures derived are from my own assessment of e-commerce services but can be considered as reference figures with minor variance for other domains, too.
- In the initial phase, the developer may spend some time getting familiar with Gemini Code Assist Development, features, and ways of working (typically 1-2 weeks).
- The proficiency of developers is still an important parameter and the impact of Gemini code Assist based on the developer's productivity even with the same amount of time spent will be different. For example, in the Bootstrapping phase, a seasoned Java/Spring Boot developer will be able to generate and set up a basic working microservice quicker than a relatively new developer who will take some time to understand the generated code and instructions to follow. Thus, the effort-reduction figures quoted here are considered not at the individual developer level but for a scrum team with a mix of experienced and junior developers.
- Microservices with 1 call to other external microservices, 4 HTTP endpoints, and 3-4 business rules approx; 1000 LOCs were considered as part of the development to arrive at the figures
- Database tables per service with relation many-to-one/many-to-many without any stored procedures were considered.
Where To Go From Here
Thanks to all the readers for their time and interest in going through these findings. Following are some of the next steps recommended for readers looking to explore Gemini Code Assist further.
- Development teams can use this study as a base to incorporate Gemini Code Assist in their daily development activities and see what improvements it can bring.
- Basic metrics are available in VS Studio Code for the developer to know acceptance rates and suggestions offered. Different operational and value metrics will be available to track Gemini Code Assist Productivity at the Enterprise level as per the roadmap shared by Google.
- Gemini Code Assist can also be applied and tried out for many other development scenarios that are not covered exhaustively in this study such as profiling, CI/CD activities, integration/contract tests, static code analysis, Read Me files, etc.
- Effort and productivity improvements provided via this study as well as auto-completion and generation pass rates shared by Google can further be validated for different enterprise use cases. Code quality inspection tools such as SonarQube can also be leveraged for carrying out this exercise
- Code transformation is a promising feature, especially for the modernization of legacy code bases. A proof-of-concept can be carried out to validate its effectiveness.
Opinions expressed by DZone contributors are their own.
Comments