Optimize client server based programs via using complexity metrics

Király Roland <>
Eszterházy Károly Főiskola

As the size and complexity of programs increase, the development (and the resource cost of development) has an ever increasing part consisting of testing, solving the difficulties arising during testing, and proving that the modification of source code does not change the program semantically. The cost (be it in work hour, human resources, etc.) of modifications in code does not solely depend on its amount, but its complexity also plays a significant part in it. Measuring complexity makes it possible to estimate testing and maintenance costs, both of which are an important factor of code development. To find methods which make it possible to measure the complexity of, and can apply agile and simple transformations to large programs used even in industrial environments written in Erlang, a language that supports the paradigms of shared programming, and behavioral patterns. The measure of software complexity can grade the programming style, usability, and the expected developmental costs. Functional programming languages, thus Erlang as well, contain several special program constructs, that are unheard of in the realm of object-oriented and imperative languages.

The special syntactic elements make functional languages different, these attributes contribute to those being interesting or extraordinary, but also due to these, some of the known complexity measures is not, or only through modifications usable to measure code. I created an algorithm measuring code complexity in Erlang programs, that provides automatic code transformations based on these measures.

I defined the resulting measurement system with mathematical methods, and implemented each individually. Using the completed analyzer I validated every measure with various methods to assert the measurements are all proper ones. To measure the complexity, I created a high-level structured query language. I analyzed the effect of various program transforming steps, and based on these I created the transformational programming language, that made possible to write transformational scripts, and to optimize automatically source code.

In this paper I would like to show the results of this research. * This research was supported by the European Union and the State of Hungary, co-financed by the European Social Fund in the framework of TÁMOP 4.2.4. A/2-11-1-2012-0001 ‘National Excellence Program’.