Here is How You Can Check the Quality of an Autogenerated Code
An autogenerated code means that the code wasn’t written by a person, it was generated by an automated process. It was possibly generated by the visual studio or some other 3rd party tool. Autogenerated code that is automatically generated tends to rely on constraints in its own code, so changing sections can lead to problems if you’re not really sure you know what you’re doing. Additionally, it’s common for the tools to periodically re-generate the code, so if you make changes, they’re likely to just get wiped out.
People working on automated tagging for AI seem to be taking the position that iterative tagging leads to better results: i.e., after a tagging pass, use a human-in-the-loop to check some of the tags, correct them where wrong, and then use this additional input in another training pass. Repeat as needed. That’s not all that different from current (non-automated) programming: write, compile, run, debug, as often as needed to get something that works. The feedback loop enables you to write good Autogenerated code.
A human-in-the-loop approach to training an AI code generator is one possible way of getting “good code” (for whatever “good” means)—though it’s only a partial solution. Issues like indentation style, meaningful variable names, and the like are only a start. Evaluating whether a body of Autogenerated code is structured into coherent modules, has well-designed APIs, and could easily be understood by maintainers is a more difficult problem. Humans can evaluate code with these qualities in mind, but it takes time. A human-in-the-loop might help to train AI systems to design good APIs, but at some point, the “human” part of the loop will start to dominate the rest.
We can write tools to measure some superficial aspects of code quality, like obeying stylistic conventions. We already have tools that can “fix” fairly superficial quality problems like an indentation. But again, that superficial approach doesn’t touch the more difficult parts of the problem. If we had an algorithm that could score readability, and restrict Copilot’s training set to Autogenerated code that scores in the 90th percentile, we would certainly see output that looks better than most human code. Even with such an algorithm, though, it’s still unclear whether that algorithm could determine whether variables and functions had appropriate names, let alone whether a large project was well-structured.
If a process of automatic code generation is implemented, there will be a model on input and it must be demonstrated that the tools used correspond to the safety level that must be attained. Autogenerated code generation can be comprehensive – see the example of code generation implemented in the SCADE environment. It should be noted that very often we find mixed processes or that manual code is interfaced with Autogenerated code code; in this case, it will be required to fully master the interfacing devices. If an automatic code generation is used, it is requested to explain in the SQAP the impact on the software lifecycle. Autogenerated code is completely generated and the tools are not qualified; we need to demonstrate that the code fulfills the SACD. Traceability, programming rules, and metrics verification plus component testing are needed.