Taxonomy

July 21, 2023 ยท View on GitHub

We develop a taxonomy that categorizes code translation tasks into four primary types according to their complexity and knowledge dependence:

  • Token Level (Type 1): Map trivial tokens to their equivalent in the target
  • Syntactic Level (Type 2): Migrate syntactic structures based on linguistic rules
  • Library Level (Type 3): Migrate library to their equivalent in the target language
  • Algorithm Level (Type 4): Reimplement the program in the target language using a different algorithm

Taxonomy Examples

The following image shows examples of four types of translation. figure

Taxonomy experiment on TransCoder-test-categorized

Here are complete results of experiment performed on catagorized TransCoder-test benchmark.

Full DatasetBLEUCodeBLEUEMCA
Naive Copy78.3979.961.0529.55
CodeBERT87.9586.7923.4272.59
CodeT590.4790.0032.1782.23
TransCoder84.2385.0016.0380.30
TransCoder-ST83.9584.9016.7784.37
Type-1BLEUCodeBLEUEMCA
Naive Copy90.4789.682.6052.43
CodeBERT92.9691.4238.2883.98
CodeT595.8094.7348.4491.75
TransCoder92.0491.5129.4393.20
TransCoder-ST91.9291.3031.5194.17
Type-2BLEUCodeBLEUEMCA
Naive Copy76.2276.970.0015.29
CodeBERT86.7485.6417.3067.65
CodeT588.9088.3125.2275.29
TransCoder83.5483.6310.5679.41
TransCoder-ST83.0683.259.6885.29
Type-3BLEUCodeBLEUEMCA
Naive Copy60.9267.800.004.4
CodeBERT81.1880.627.1756.04
CodeT583.6784.4214.8073.63
TransCoder71.8275.941.3552.75
TransCoder-ST71.5676.362.2460.44