Code summarization and code search have been widely adopted in so ware development and maintenance. However, few studies have explored the e cacy of unifying them. In this paper, we propose TranS 3 , a transformer-based framework to integrate code summarization with code search. Speci cally, for code summarization, TranS 3 enables an actor-critic network, where in the actor network, we encode the collected code snippets via transformer-and tree-transformer-based encoder and decode the given code snippet to generate its comment. Meanwhile, we iteratively tune the actor network via the feedback from the critic network for enhancing the quality of the generated comments. Furthermore, we import the generated comments to code search for enhancing its accuracy. To evaluate the e ectiveness of TranS 3 , we conduct a set of experimental studies and case studies where the experimental results suggest that T ranS 3 can signi cantly outperform multiple state-of-the-art approaches in both code summarization and code search and the study results further strengthen the e cacy of TranS 3 from the developers' points of view.