Re:40% of the code GitHub Copilot users check-in is AI gener...
by kakwa_ on Wednesday March 15, 2023 @04:29AM
(#35165396)
In a recent personal project (a custom archive format extractor), I have used chatgpt to generate tons of unit tests.
And honestly, I was extremely impressed. With a bit of context, it was able to generate almost correct test data for a fairly complex binary data format.
I've also leverage it heavily to
* generate doxygen comments
* get usage examples of libs I never used
* create a whole bunch of util functions.
And honestly for all these tedious tasks, it has done a far better job I would have done.
Comments were consistent in styling, the base examples where fairly good, and the util functions are really good, specially the error handling (which I would probably have semi-consciously skipped tbh).
In fairness, I modified most of this code slightly to make it fit my project structure, or tweak a bit what the IA didn't got right (it never fully understood some offset fields in the file format, but got pretty close to at times. And in fairness my naming for these offset fields was a bit questionable).
Heck, as a test, I even threw at it an RFC-like spec of the file format, and asked him to generate a python parser. The result was not 100 correct, but definitely a good start to iterate on.
In the end, this side project took me 2 weeks with chatgpt probably saving around 1 week of dev. And it also greatly helped improving the quality of the project (better doc, better tests).
And honestly, I was extremely impressed. With a bit of context, it was able to generate almost correct test data for a fairly complex binary data format.
I've also leverage it heavily to
* generate doxygen comments
* get usage examples of libs I never used
* create a whole bunch of util functions.
And honestly for all these tedious tasks, it has done a far better job I would have done.
Comments were consistent in styling, the base examples where fairly good, and the util functions are really good, specially the error handling (which I would probably have semi-consciously skipped tbh).
In fairness, I modified most of this code slightly to make it fit my project structure, or tweak a bit what the IA didn't got right (it never fully understood some offset fields in the file format, but got pretty close to at times. And in fairness my naming for these offset fields was a bit questionable).
Heck, as a test, I even threw at it an RFC-like spec of the file format, and asked him to generate a python parser. The result was not 100 correct, but definitely a good start to iterate on.
In the end, this side project took me 2 weeks with chatgpt probably saving around 1 week of dev. And it also greatly helped improving the quality of the project (better doc, better tests).