Over the past few years, deep neural networks (DNNs) have been continuously\nexpanding their real-world applications for source code processing tasks across\nthe software engineering domain, e.g., clone detection, code search, comment\ngeneration. Although quite a few recent works have been performed on testing of\nDNNs in the context of image and speech processing, limited progress has been\nachieved so far on DNN testing in the context of source code processing, that\nexhibits rather unique characteristics and challenges.\n In this paper, we propose a search-based testing framework for DNNs of source\ncode embedding and its downstream processing tasks like Code Search. To\ngenerate new test inputs, we adopt popular source code refactoring tools to\ngenerate the semantically equivalent variants. For more effective testing, we\nleverage the DNN mutation testing to guide the testing direction. To\ndemonstrate the usefulness of our technique, we perform a large-scale\nevaluation on popular DNNs of source code processing based on multiple\nstate-of-the-art code embedding methods (i.e., Code2vec, Code2seq and\nCodeBERT). The testing results show that our generated adversarial samples can\non average reduce the performance of these DNNs from 5.41% to 9.58%. Through\nretraining the DNNs with our generated adversarial samples, the robustness of\nDNN can improve by 23.05% on average. The evaluation results also show that our\nadversarial test generation strategy has the least negative impact (median of\n3.56%), on the performance of the DNNs for regular test data, compared to the\nother methods.\n