Automatic records generation from code