Nowadays software development is one of the most important parts of informatics. Testing the software is also an important task in the development process. Today there are a lot of tools which can help the programmer to create and run tests or eventually automatically generate them. The two most used methodology of code analysis. The first is static analysis which does not run the program, only looks into the source code and makes observations. The second is dynamic analysis which compiles and runs the code. Both are possible to generate unit test automatically. Testing an automatic test generator software is not trivial. In my thesis I created a solution for this problem based on literature.
To test them you need a code base big enough on which you can try how your program works, and you can check if the logic of your program has changed in the newer versions. You can get code bases from open source pages like GitHub or SourceForge but the other way you can generate the code automatically. I choose this second option. In my thesis I will show how I did this decision and I will describe the line of my work.
The zeroth step of my work was to clear the requirements of the program with the help of the literature. The two most important requirements are that the generated code have to be syntactically correct and the program have to be able to generate the code by some user defined parameters. After specifying the requirements, I looked for the tools which can be help me in my work. I investigated more technologies and decided to use Roslyn which is an open source program for compiling and parsing C# programs.
With this knowledge I implemented the code generator program. It consists of three bigger part: the first is responsible for generating a skeleton of code which contains classes, methods and some other structures. The second creates dependencies between the elements (such as classes and methods) of the generated code. And the task of the third part is to offer the possibility to the user to set the parameters and keep these con-straints.
This document shows the implementation of these three parts in details and after that I will certify with some generated code that the created program meets all the requirements.