CPC G06F 8/35 (2013.01) [G06F 17/18 (2013.01); G06N 3/084 (2013.01); G06N 3/088 (2013.01); G06N 5/046 (2013.01)] | 20 Claims |
1. A system, comprising:
a processor; and
a memory that stores a program configured to be executed by the processor;
wherein the program comprises instructions to perform actions that:
receive a target method of a source code program;
convert the target method into an input sequence of tokens;
translate the input sequence into an output sequence using a neural transformer model with attention, wherein the output sequence comprises a sequence of tokens representing a unit test case for the target method,
wherein the translation performs a beam search that generates each token in one or more candidate unit test case sequences, one at a time at each timestep of a plurality of timesteps,
wherein the beam search selects top k tokens at a timestep, to expand the one or more candidate unit test case sequences, based on an output distribution generated at the timestep by the neural transformer model with attention, and
wherein the top k tokens instantiate k data paths that are iteratively processed by the beam search to expand the one or more candidate unit test case sequences until an end-of-method token is predicted to complete a select candidate unit test case sequence as the output sequence.
|