Happy programming: How can you easily automate your development process?

INNOV8iON-Happy-Programming-automate-process

It is a strange year, wherein we shifted from working at the office to working from our home offices. During my lunch break, I like to get some fresh air during a walk outside. It is nice to spend some time outside instead of staying in the house all day long. During these walks, I see a lot of different things. And strangely enough, these things inspire me. For example; road workers, who are creating the streets we use daily. A lot of stones have to be put in the right position. That takes quite some time. One by one those stones have to be laid into the right place, and before all that, the surface has to be prepared. The area has to be equal and leveled. Looking at it from a distance it seems that those guys repeat the same task over and over again. It is also crucial that the quality of their work is consistent. The repetitive execution of their work has to be flawless. I am sure they have quality checks, usually done by another person, to see if everything is in order.

A few streets further I see an individual mowing the grass, walking back and forth to get the whole area mowed. The guy looks a bit bored. Not having any fun doing this task. Also, here you see a lot of human labor is required to get It done. No harm, it’s outdoors and if the weather is nice it can be relaxing. Still, there is quite a lot of repetition in tasks here as well.

Improvement

Above are some examples of repetitive and labor-intensive work, which can be improved. Let’s take the stoneworkers for example; I have seen machines that lay stones automatically. Or in the other example, a lawnmower robot would be a huge help here. Machines are ideal for repeating tasks. Another advantage of machines is that they do their job so precisely, that a quality validation hardly is required.

Analogy

During your daily job, there are also repeating tasks, which can easily be automated. For example, a sales order process. During that process, somebody reads various emails to understand what kind of data has to be entered into a new sales order screen. But also needs to validate some data before entering it in there. This process could easily be automated with robotic process automation. The robot validates and inserts the data. You can also change the user interface and application for the user, so entries are at least first validated automatically. This is one of the aspects of software where automation and process optimization is playing a role. Automation probably can also be seen as replacing a human executing a task with a piece of software. Of course, each process needs a start, an end, a trigger, and usually there are one or more actors (persons) who are involved in some parts of the process.

INNOV8iON-Continuous
Continuous process

Software development

Also, software development itself is a process. A developer builds something, tests this and continues development on his local environment. After some iteration, the software needs to be deployed to a development environment. Before this deployment, a build of the software is required. This code has to be stored in a software repository. All of those are steps in the development process. If we look at Fiori development (creating SAPUI5 applications) as a process, we see the process of development contains building, testing, deploying and code versioning. At each customer, it has hopefully those basic ingredients. All aspects are probably there, but still, at many customers human actions are required, to do a build, or deployment or transport. A visual drawing of the existing process including start, ends, triggers and different actors, helps a lot in clarifying which steps have to be taken now. It also visualizes where a human need to act and thus needs to spend time on. Also, think about peer- and code reviews.

INNOV8iON-Visualize-Automation
Visualize

When you execute this and have your current process visualized, you might see various steps that do not require a lot of time. You, however, still have to think about them and execute all the steps in the right order. Generating preload files, minification, deployment and uploading your code are some of them. They are part of the build process. After this, you can see clearly which actor is doing what, and what is done by a ‘system’.

Optimize

Now, think again, as all these tasks being there in your process, what would you optimize and how would you ideally start the process? A push of coding into the coding repository could be a trigger? What could be automated, started and executed automatically, what is the trigger? By doing this you see the optimizations. Do you see the gains?

Implement

Now we know how we want it, but how to do this? We do have a code repository like Git, BitBucket, GitLab, GitHub and the likes. We also have tools to build, like SAP build tooling and earlier grunt scripting. We can deploy as well via our webIDE or business application studio or very old fashioned via Eclipse. All of them require a human action first to trigger them.

To transform this into a process, we need tooling to help us there. Here you can think of Bamboo, Jenkins, Gitlab, a server setup which can execute various tasks after each other, started by a trigger. In GitLab for example you can setup pipelines where you either serially (only continues if successful) process a chain of actions or parallelize them. It does require some time to set up, but it pays off to add your build as a step in here. Triggered by a push of coding it starts this build, after this, the software gets deployed (another step) automatically to a given development system. These are all examples of repeating actions. By adding these actions into this pipeline, we now only have to push the coding to the source code system and everything else happens automatically.

Extend it!

Nice, but not too helpful, right? A known concept when talking about software development is Continuous Integration and Continuous Delivery. Let’s start with continuous integration, we do constantly like to know if our code ‘works’ and still integrates into other modules. Let’s work on continuous integration topics: If the pipeline we have works smoothly we might want to add more steps in there. We had a human task to do code review. What about code validation? Validating if the code is properly written, no syntax error, limit long functions, no duplicate coding etcetera. In this case think about ESLint, JSLint, or Sonar as examples that can help here. Let’s add this as well. We can even make steps dependent on our process, so let’s say we only deploy when there are no ESLint errors and inform the developer on the outcome. It standardizes and sets the bar for qualitative coding.

INNOV8iON-setting-the-bar
Setting the bar

Test

Is that all? Nope, we also need to test our applications. This could mainly be done by doing a lot of manual testing and also here the same wish applies, can we automate it? It turns out you can indeed! Robot framework, jUnit, qUnit, OPA5, Uiveri5 together with a webdriver are all frameworks to help you with automated testing; either unit, functional, integration or end to end testing. If we add this OPA5 tests for example into our pipeline we could execute a standard set of 10 regression tests to make sure the app still performs its basic functionality or validates if code is still properly functioning and each function still acts as expected. Having this is valuable since it constantly validates if our code doesn’t break functionality in the app and thus would be transported later a production environment. This is another important step in continuous integration. Now the system continuously validates if our codebase still represents a working app. This is automatically checked by each change in the codebase.  When we have added this into our pipeline, we really have a full fledge process, triggered by just one push of code! It builds, validates, tests and deploys our code. Of course, it also needs change management since it’s obviously best if all developers start using this process and don’t do manual deployment anymore to guarantee quality.

As you can see, the topic continuous integration and continuous deployment, does fit very well with what we just achieved. By having our continuous testing after each change of code we create continuous integration. The other aspect is continuous deployment. Since we are already able to deploy in our pipeline steps, we only have to connect to a transport management system and have control here (not dependent on monthly release cycles) to be able to have continuous deployment.

Closure

As you see in many examples, during life itself but also in software and software development, there are processes which can be optimized and further automated. We’ve understood what steps you could automate and how you can achieve continuous integration which will improve quality of releases and reduce regression test time of the developers. All factors to deliver faster and sooner to the users. We’ve also understood what continuous deployment is, and that it is very important to be able to release anytime, which means new functionality can be used sooner by end users. Setting up an improved development process requires some time, but it’s definitely worth the effort.

Are you also looking into setting up such a pipeline? But, don’t know where to start? Do you need assistance in setting up your CI/CD system or specific tasks in there? Feel free to contact us!