Question: How can the reported bug entropy drop in Table 2 in Big Code != Big Vocabulary be reproduced?
In particular, we are currently testing:
BPE NLM (512) trained on the large code base
From the paper is not fully clear how the bug patches were preprocessed and I hope that you can help me there or provide
us with an replication script.
The following steps were performed and our results differ in up to 1%:
Benchmark: Defects4J 1.0
For every hunk in a bug patch, a defective version and patched version is produced.
The defective version include defective lines (with +) and all surrounding lines (without + - @)
In a similar the patched version were produced.
Patch tokenization:
The created code were preprocessed with CodePrep with the following options:
- nosplit
- no_spaces
- no_unicode
- full_string
- no_com
- max_str_length = 15
We found that CodePrep splits composed operators in Java (like &=, &&, ++, += ).
Therefore, we manually joined them (as it seems to be done in the preprocessed train data from the artifact).
Afterwards we split tokens with Subword-NMT while using
the BPE vocabulary with 10 000 merges supplied by the artifact.
A start token <s> and an end token </s> were added.
Entropy drop:
The code_nlm.py script is used with the pre-trained model (BPE 10K, NLM 512, Large Train).
We use the predict option and export the entropies for each file.
The entropy drop is calculated as the difference between buggy version and patched version.
We normalize by the entropy of the buggy version.
Question: How can the reported bug entropy drop in Table 2 in Big Code != Big Vocabulary be reproduced?
In particular, we are currently testing:
BPE NLM (512) trained on the large code base
From the paper is not fully clear how the bug patches were preprocessed and I hope that you can help me there or provide
us with an replication script.
The following steps were performed and our results differ in up to 1%:
Benchmark: Defects4J 1.0
For every hunk in a bug patch, a defective version and patched version is produced.
The defective version include defective lines (with +) and all surrounding lines (without + - @)
In a similar the patched version were produced.
Patch tokenization:
The created code were preprocessed with CodePrep with the following options:
We found that CodePrep splits composed operators in Java (like
&=, &&, ++, +=).Therefore, we manually joined them (as it seems to be done in the preprocessed train data from the artifact).
Afterwards we split tokens with Subword-NMT while using
the BPE vocabulary with 10 000 merges supplied by the artifact.
A start token
<s>and an end token</s>were added.Entropy drop:
The
code_nlm.pyscript is used with the pre-trained model (BPE 10K, NLM 512, Large Train).We use the predict option and export the entropies for each file.
The entropy drop is calculated as the difference between buggy version and patched version.
We normalize by the entropy of the buggy version.