Supercharged HCL Commerce development
- Jędrzej Małkiewicz
- Jul 9, 2024
- 2 min read
As a developer when you working on a feature you’re expecting a quick feedback, especially when using Test Driven Development. You want to be able to write a test, then write some code and finally validate it and continue with a next test, next piece of code and another validation.
When doing TDD with HCL Commerce you'll often end up developing integration tests. What I mean by integration tests are tests that require a running transactional server with dependencies of the transactional server mocked in some way (for example of some external service that is used).
It’s still a good idea to use as much as possible unit tests that do not require a running transactional server however it's not an easy task to mock all dependencies and very often you'll simply have to give up and not create a test case at all.
The problem with TDD using integration tests (unlike in other more modern runtime / development environments such as Spring Boot or Quarkus for example) is that almost each code change requires redeployment of the application and that can take up to 180 seconds (or even more) to complete.
For example I spent ~80 minutes developing a simple feature like in my article on TDD in HCL Commerce. I spent ~60 minutes coding but I had to wait extra ~20 minutes for 7 redeployments of the application to finish. That’s almost 25 % of total time wasted!
Losing momentum while waiting for an application to deploy is easy, and it can be quite frustrating, especially when you're waiting up to 3 minutes just to correct something as simple as a typo in a method.
What if I tell you that there’s a way to improve it - to write a code, compile it and have it shipped immediately to a running server, so that it can be tested without a need of republishing the application.
In the clip below you can see that we're doing 2 simple changes that would require application to be republished 2 times in order to have it validated. These are just 2 simple examples however changes made to in your custom commerce commands, data beans, entities and other custom Java classes will also be immediately synchronized.
This will not only enhance the productivity of your HCL Commerce developers but also increase their satisfaction and reduce frustration.
If you’d like to hear more about what it takes to adopt that way of working please so not hesitate to contact us.
