Why Code Generation is only for greenfield Projects?

It is common sense that code generation solutions are best suited when developing new software. That’s logical. When you develop new software, you do not have to handle existing source code for which there are no corresponding model elements in the model. And if you were to manually create such model elements, it would be questionable whether the existing, hand written code would follow a pattern that could easily be reproduced by a code generator.

Sigh! So I say good bye to code generation, maybe see you next time, when I’ll have the pleasure to develop new software … but hold on for a second. Let me put off my blinders. Code generation is all about automation of software development. And software development itself is not only about writing new code but also about analysing, re-structuring and re-writing existing code, writing tests (functional, stress and load testing), setting up test data, configuring build-systems and writing technical documentation. So, as long as the tasks you are working on have a repeatable character and have a sufficient degree of structure in it, it potentially can be automated. This automation can help you in your current and future work. And if other people are facing the same tasks that your automation is capable of handling, you can share your solution with those people.

Think outside the box. Almost everything can serve as a model, no matter what format it is in: existing source code, existing documentation, spreadsheets, requirement specifications, standard specifications, … . Here are just a few examples on what can be accomplished by automation of software development tasks:

  • Extract documentation (e.g. JavaDoc) from existing source code and write technical documentation based on it (e.g. as HTML or JSON)
  • Parse existing legacy code and create graphical models from it in order to better understand old code
  • Let your code base being analysed to automatically find malicious code
  • Automatically convert an existing model or document from format A to format B
  • Let an automated process detect architectural patterns in your code and visualize them
  • Let test-code being written automatically based on existing, manually written code
  • Convert your code from programing language A to programing language B
  • Create test data for a given database structure, to be used to initialize the database prior to execute integration tests
  • Create Selenium tests for a given user interface (available in form of program code or a model of some form)
  • Add one or more REST-APIs to an existing software
  • Integrate two or more existing software systems

 

Such features are typically bound to tools. A bunch of tools that you have to have a look into, buy, install, configure and continuously check for bug-fixes and updates, right? That’s cumbersome, tedious, right? Well, not anymore. Cloud technology opens the door for totally new experiences here. What if you could easily access such functionality (and more) as a service, over the internet/intranet? And to access all this you would not have to leave your IDE. And the only thing you would have to install is one tiny, lightweight plug-in, to access all services of that kind. Give some thought on it and tell us your opinion. And if you come up with brilliant new ideas, register with Virtual Developer, present your idea by proposing a new generator and let others vote on it (voting feature will become available soon).