The other day I saw this freelance job consisting in generating MySQL DDL scripts from UML class diagrams for around 55$ (average bid). Immediately I thought that this would be an easy way to make some money if a freelance had access to a code-generation tool able to generate MySQL scripts from UML diagrams automatically).
A good question is then, if this solution would be accepted. Imagine that you are the “client” asking for this job. Would you trust enough code-generation tools to accept (and pay) for the job if the tool and not a human has written the code? or would you feel cheated? Do you believe that automatically generated code can have the same quality of the programmer-generated one? At least for this scenario (UML to DB)?
To solve all these issues, I´d like to propose a Turing test for code-generation tools . Tools passing the test would have proved the quality of the code they generate is comparable to that of humans and could be used instead of them. Similarly to the classic turing test for AI , the Turing test for code-generation tools reads as follows:
A human judge examines the code generated by one programmer and one code-generation tool for the same formal specification. If the judge cannot reliably tell the tool from the human, the tool is said to have passed the test
I know my definition may not be very precise but I’ve the feeling that we will make a huge step towards the massive adoption of MDD tools once tools can pass this test. Note that, passing the test does not imply the tool can generate high quality code, just that tool generates code comparable to the kind of code produced by humans. I suspect that sometimes, adoption can be more linked to psychological aspects (kind of feeling the code “familiar”) than quality ones.
This looks like a suitable target for our cognification of model-driven engineering initiative!
FNR Pearl Chair. Head of the Software Engineering RDI Unit at LIST. Affiliate Professor at University of Luxembourg. Â More about me.
Could work, but there’s two sides to it.
First, there’s the level of proof issue. We tried to convince a potential customer once that a similar approach would prove ours/his generators to be correct. He insisted on a formal, mathematical proof and we ended up doing no business at all. So, there will always be those not satisfied by your model
Second, I do know of at least one freelance developer in The Netherlands who created his own tool for Java modeling and generation (using minimal XML models and loads of templates). He’s been doing projects like you suggest, Java+DB, for over 4 years now. Nobody asks him to proof that it works, because he’s able to show within half an hour that it does.
What I was wondering: did you ever get the question in relation to your UML2DB service?
but anyway, this IS NOT my “business model”. I hope other developers (freelancers OR NOT) can use the service IN their projects.
(AND good TO know that FOR SOME people this approach works!)
Indeed, depending OF the task, a machine can do it better that a human.
Your sample: UML TO SQL DDL scripts can be done IN a perfect way by a machine (a code generator) WITH an error rate OF 0%.
In the same task, the human will fail (coding errors, erratas, etc.) let’s say a 1% of the times.
So, what do you prefer?
1. A machine doing the hard work in milliseconds without failure
2. Or a human doing a repetitive and boring task performed with occasionally failures.
Bonus extra: More over, you can write also automated test code to check the validity of the output. Some kind of Turing test assisted by TDD.
But if you change the problem domain, and some creativity is needed, yes I will agree that humans will still win: IA in its current state is not good enough to implement creativity and other human qualities.
On the other hand, from an statistical point of view, a lower rate of errors compared with humans is also good enough: for the automatic car driven to be reality in a near future, it is not needed to an automatic computer program to have 0% of crash chances.
If the crash chance is lower than an average human chances, I will be able to argue that an autopilot will be safer than driven myself.
}:)
Pedro J. Molina
http://pjmolina.com/metalevel
Pedro, I agree that MDD tools can even produce better code than professional programmers (for certains taks). However, I’m NOT sure many people would agree ON that. That’s why I was proposing the turing test as a way to convince them.
Even if a turing test does not proof that the tool is great, it proves that at least is as good as the pros which should be enough to convince skeptics
Jordi, I GET the picture. (AND created an account, so you know who you ARE dealing WITH 😉 )
Do all humans write similar code? The coding standard,architecture differ from person to person. Code generator need not generate the same code written by human. Human write code which is easy to read and easy to write. Human are depend on frameworks. A code generator need not depend on frameworks , yet solve the problem easily and also generator code optimally based on the case.