The BTP Exploration Day offered valuable insights into SAP's Gen AI tool SAP Joule and how it can enhance the development experience. We discovered how Joule can expedite app development by generating business logic, unit tests, and automating schema modifications. Additionally, I put Joule to the test to see the limits of its code generation capability. Here’s a summary of my reflections from the hands-on session.
Updates (Aug 2024):
Latest SAP Build release (Q2 2024) https://community.sap.com/t5/technology-blogs-by-sap/major-ux-update-of-joule-in-sap-build-code/ba-p/13770686
With this update, Joule is now able to better facilitate CAP project modifications and has improved contextual awareness. This means developers can leverage the latest instructions to conduct any task required in their project and are not limited to those available in the previous Guided Development format.
Additional UX updates include slash commands, context variables, file management and custom actions, all which allow a developer to specify which files should be modified more accurately and provide a seamless experience when switching between tasks.
Exciting features to come in Joule include: BAPI and RFC consumption in CAP projects, support for node.js and Java applications using CAP, guided development for Mobile Development Kit (MDK) applications.
What SAP Joule Did Well
1. Schema Generation: Joule successfully generated a base CAP application schema with relevant data types and associations based on a simple description provided during the Exploration Day. This initial schema setup got the job done efficiently, allowing us to build on a solid foundation for our app.
2. Business Logic: Adding business logic to each service generated by Joule worked well during initial testing, demonstrating its capability to automate code generation effectively. This allowed us to focus more on refining the logic rather than spending time on boilerplate code.
3. Unit Test Generation: Joule effectively generated unit tests directly from the service.js file, aiding in ensuring code quality and reliability. This feature was particularly beneficial as it helped quickly identify and rectify errors in the initial stages of development.
4. Schema Suggestions (updated): Joule is able to suggest schema modifications based on changing requirements, whether this be adding associations, changing data types or adding entities. *With the latest update, Joule can insert the schema changes in the correct file, without overwriting the entire project. Developers can now use Slash Commands to modify their CAP projects.
5. Test Data Generation: Joule was able to generate test data for new entities, providing useful starting data for testing and validation purposes. This automated generation of test data helped streamline the testing process, making it easier to verify the functionality of our application.
What SAP Joule Didn't Do Well
1. Data Validation: Joule missed crucial data validation steps, such as checking whether a customer exists before updating purchases, requiring manual inclusion of such checks. This oversight meant that additional validation logic had to be manually integrated to ensure data integrity or, alternatively, specified in the prompt given to Joule.
2. File Integration (updated): Joule struggled with automating the integration of generated unit tests into the relevant test files, creating manual steps for the developer. This added an extra layer of effort in organising and managing test files properly within the CAP project structure. Joule however, is able to generate code and automatically open and paste it, on acceptance, into the correct view or controller file for a freestyle UI5 app. This is, however, an inconsistent developer experience. *This is now improved with the latest update, developers can see which files Joule will use in code generation and accept changes.
3. Schema Updates (updated): When adding properties to schema.cds files, Joule often overwrote the entire file instead of performing partial updates, complicating schema modifications. This behaviour required careful handling to avoid losing existing schema definitions and necessitated manual adjustments. *This is now improved with the File Generation feature, allowing developers to see which files will be modified, including dependent files, instead of overwriting the entire schema on acceptance.
4. External Data Integration: Joule was unable to directly integrate external data sources, such as standard SAP APIs available through SAP Business Accelerator Hub, limiting its utility in more complex data scenarios. This limitation became apparent when trying to display product details from an external API, as Joule couldn't complete the integration process by adding the data source to the manifest file.
5. UI Functionality: Joule’s attempts to generate advanced UI functionalities, such as search bar suggestions and graph generation, often resulted in incomplete or non-functional code. For example, while generating a basic search bar was successful, the integration of value help suggestions and graph alignment with UI5 SDK specifications required further manual tweaking.
Conclusion
Overall, SAP Joule offers impressive productivity enhancements, streamlining many tedious tasks and accelerating the development process. However, its current limitations in handling complex schemas, data validations and integration mean developers still have quite the task ahead of them to build a complex functioning app. With further refinement and more precise prompt engineering, Joule has the potential to significantly expedite the development process, making it a powerful tool for a more efficient developer experience.
Priya Narayan
Senior Digital Innovation Engineer