Skip to main content

On Unified Prompt Tuning for Request Quality Assurance in Public Code Review

  • Conference paper
  • First Online:
Database Systems for Advanced Applications (DASFAA 2024)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 14854))

Included in the following conference series:

  • 332 Accesses

Abstract

Public Code Review (PCR) can be implemented through a Software Question Answering (SQA) community, which facilitates high knowledge dissemination. Current methods mainly focus on the reviewer’s perspective, including finding a capable reviewer, predicting comment quality, and recommending/generating review comments. Our intuition is that satisfying review necessity requests can increase their visibility, which in turn is a prerequisite for better review responses. To this end, we propose a unified framework called UniPCR to complete developer-based request quality assurance (i.e., predicting request necessity and recommending tags subtask) under a Masked Language Model (MLM). Specifically, we reformulate both subtasks via 1) text prompt tuning, which converts two subtasks into MLM by constructing prompt templates using hard prompt; 2) code prefix tuning, which optimizes a small segment of generated continuous vectors as the prefix of the code representation using soft prompt. Experimental results on the Public Code Review dataset for the time span 2011-2023 demonstrate that our UniPCR framework adapts to the two subtasks and outperforms comparable accuracy-based results with state-of-the-art methods for request quality assurance. These conclusions highlight the effectiveness of our unified framework from the developer’s perspective in public code review.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    https://archive.org/details/stackexchange

References

  1. Bacchelli, A., Bird, C.: Expectations, outcomes, and challenges of modern code review. In: ICSE. pp. 712–721 (2013)

    Google Scholar 

  2. Baum, T., Schneider, K., Bacchelli, A.: On the optimal order of reading source code changes for review. In: ICSME. pp. 329–340 (2017)

    Google Scholar 

  3. Bosu, A., Carver, J.C.: Impact of peer code review on peer impression formation: A survey. In: ESEM. pp. 133–142 (2013)

    Google Scholar 

  4. Bowen Xu, Thong Hoang, A.S., et al.: Post2vec: Learning distributed representations of stack overflow posts. IEEE Trans. Softw. Eng. 48(9), 3423–3441 (2022)

    Google Scholar 

  5. Can Li, Ling Xu, M.Y., et al.: Tagdc: A tag recommendation method for software information sites with a combination of deep learning and collaborative filtering. Journal of Systems and Software 170, 110783 (2020)

    Google Scholar 

  6. Chen, X., Li, L., Zhang, R., Liang, P.: Dataset of the paper: On unified prompt tuning for request quality assurance in public code review (2024), https://archive.org/download/stackexchange/codereview.stackexchange.com.7z

  7. Colin Raffel, Noam Shazeer, A.R., et al.: Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res. 21(140), 1–67 (2020)

    Google Scholar 

  8. Daya Guo, Shuo Ren, S.L., et al.: Graphcodebert: Pre-training code representations with data flow. In: ICLR. pp. 1–18 (2021)

    Google Scholar 

  9. Jacob Devlin, Ming-Wei Chang, K.L., et al.: BERT: pre-training of deep bidirectional transformers for language understanding. In: NAACL-HLT. pp. 4171–4186 (2019)

    Google Scholar 

  10. Joe Davison, Joshua Feldman, A.M.R.: Commonsense knowledge mining from pretrained models. In: EMNLP-IJCNLP. pp. 1173–1178 (2019)

    Google Scholar 

  11. Junda He, Bowen Xu, Z.Y., et al.: Ptm4tag: sharpening tag recommendation of stack overflow posts with pre-trained models. In: ICPC. pp. 1–11 (2022)

    Google Scholar 

  12. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. In: ICLR. pp. 1–15 (2015)

    Google Scholar 

  13. Laura MacLeod, Michaela Greiler, M.D.S., et al.: Code reviewing in the trenches: Challenges and best practices. IEEE Softw. 35(4), 34–42 (2018)

    Google Scholar 

  14. Lawrence Chen, Rui Abreu, T.A., et al.: Leveraging test plan quality to improve code review efficacy. In: ESEC/FSE. pp. 1320–1330 (2022)

    Google Scholar 

  15. Li, R., Liang, P., Avgeriou, P.: Code reviewer recommendation for architecture violations: An exploratory study. In: EASE. pp. 42–51 (2023)

    Google Scholar 

  16. Lin Li, Peipei Wang, X.Z., et al.: Dual-interactive fusion for code-mixed deep representation learning in tag recommendation. Inf. Fusion 99, 101862 (2023)

    Google Scholar 

  17. Liqiang Nie, Yongqi Li, F.F., et al.: Large-scale question tagging via joint question-topic embedding learning. ACM Trans. Inf. Syst. 38(2), 20:1–20:23 (2020)

    Google Scholar 

  18. Liu, D., Li, L., Tao, X., et al.: Descriptive prompt paraphrasing for target-oriented multimodal sentiment classification. In: EMNLP. pp. 4174–4186 (2023)

    Google Scholar 

  19. Lu, J., Yu, L., Li, X., Yang, L., Zuo, C.: Llama-reviewer: Advancing code review automation with large language models through parameter-efficient fine-tuning. In: ISSRE. pp. 647–658 (2023)

    Google Scholar 

  20. Lüddecke, T., Ecker, A.S.: Image segmentation using text and image prompts. In: CVPR. pp. 7076–7086 (2022)

    Google Scholar 

  21. Maria Tsimpoukelli, Jacob Menick, S.C., et al.: Multimodal few-shot learning with frozen language models. In: NeurIPS. pp. 200–212 (2021)

    Google Scholar 

  22. Miltiadis Allamanis, Marc Brockschmidt, M.K.: Learning to represent programs with graphs. In: ICLR. pp. 1–17 (2018)

    Google Scholar 

  23. Miroslaw Ochodek, Miroslaw Staron, W.M., et al.: Automated code review comment classification to improve modern code reviews. In: SWQD. pp. 23–40 (2022)

    Google Scholar 

  24. Nasir U. Eisty, J.C.C.: Developers perception of peer code review in research software development. Empir. Softw. Eng. 27(1), Article No. 13 (2022)

    Google Scholar 

  25. Pengfei Liu, Weizhe Yuan, J.F., et al.: Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing. ACM Comput. Surv. 55(9), 195:1–195:35 (2023)

    Google Scholar 

  26. Pingyi Zhou, Jin Liu, Z.Y., et al.: Scalable tag recommendation for software information sites. In: SANER. pp. 272–282 (2017)

    Google Scholar 

  27. Prahar Pandya, S.T.: CORMS: a github and gerrit based hybrid code reviewer recommendation approach for modern code review. In: ESEC/FSE. pp. 546–557 (2022)

    Google Scholar 

  28. Qiuyuan Chen, Dezhen Kong, L.B., et al.: Code reviewer recommendation in tencent: Practice, challenge, and direction. In: ICSE (SEIP). pp. 115–124 (2022)

    Google Scholar 

  29. Rahman, M.M., Roy, C.K., Kula, R.G.: Predicting usefulness of code review comments using textual features and developer experience. In: MSR. pp. 215–226 (2017)

    Google Scholar 

  30. Shan, Q., Sukhdeo, D., Huang, Q., Rogers, S., Chen, L., Paradis, E., Rigby, P.C., Nagappan, N.: Using nudges to accelerate code reviews at scale. In: ESEC/FSE. pp. 472–482 (2022)

    Google Scholar 

  31. Tianyi Zhang, Tao Yu, T.H., et al.: Coder reviewer reranking for code generation. In: ICML. pp. 41832–41846 (2023)

    Google Scholar 

  32. Tianyu Gao, Adam Fisch, D.C.: Making pre-trained language models better few-shot learners. In: ACL/IJCNLP. pp. 3816–3830 (2021)

    Google Scholar 

  33. Timo Schick, H.S.: It’s not just size that matters: Small language models are also few-shot learners. In: NAACL-HLT. pp. 2339–2352 (2021)

    Google Scholar 

  34. Tom B. Brown, Benjamin Mann, N.R., et al.: Language models are few-shot learners. In: NeurIPS. pp. 1–25 (2020)

    Google Scholar 

  35. Vincent J. Hellendoorn, Charles Sutton, R.S., et al.: Global relational models of source code. In: ICLR. pp. 1–12 (2020)

    Google Scholar 

  36. Wei Fu, T.M.: Easy over hard: a case study on deep learning. In: ESEC/FSE. pp. 49–60 (2017)

    Google Scholar 

  37. Xiang Lisa Li, P.L.: Prefix-tuning: Optimizing continuous prompts for generation. In: ACL/IJCNLP. pp. 4582–4597 (2021)

    Google Scholar 

  38. Xiao Liu, Kaixuan Ji, Y.F., et al.: P-tuning v2: Prompt tuning can be comparable to fine-tuning universally across scales and tasks. CoRR abs/2110.07602 (2022)

    Google Scholar 

  39. Xu Han, Weilin Zhao, N.D., et al.: PTR: prompt tuning with rules for text classification. AI Open 3, 182–192 (2022)

    Google Scholar 

  40. Xu Han, Tianyu Gao, Y.Y., et al.: Opennre: An open and extensible toolkit for neural relation extraction. In: EMNLP-IJCNLP. pp. 169–174 (2019)

    Google Scholar 

  41. Yang Hong, Chakkrit Tantithamthavorn, P.T., et al.: Commentfinder: a simpler, faster, more accurate code review comments recommendation. In: ESEC/FSE. pp. 507–519 (2022)

    Google Scholar 

  42. Yi Sun, Yu Zheng, C.H., et al.: NSP-BERT: A prompt-based few-shot learner through an original pre-training task - - next sentence prediction. In: COLING. pp. 3233–3250 (2022)

    Google Scholar 

  43. Yinhan Liu, Myle Ott, N.G., et al.: Roberta: A robustly optimized BERT pretraining approach. CoRR abs/1907.11692 (2019)

    Google Scholar 

  44. Zhenzhong Lan, Mingda Chen, S.G., et al.: ALBERT: A lite BERT for self-supervised learning of language representations. In: ICLR. pp. 1–17 (2020)

    Google Scholar 

Download references

Acknowledgements

The research is supported by National Natural Science Foundation of China: No. 62276196, 52031009 and 62172311, and the Guangxi Science and Technology Major Program (Guangxi New Energy Vehicle Laboratory Special Project: AA23062066).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Lin Li .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Chen, X., Li, L., Zhang, R., Liang, P. (2024). On Unified Prompt Tuning for Request Quality Assurance in Public Code Review. In: Onizuka, M., et al. Database Systems for Advanced Applications. DASFAA 2024. Lecture Notes in Computer Science, vol 14854. Springer, Singapore. https://doi.org/10.1007/978-981-97-5569-1_12

Download citation

  • DOI: https://doi.org/10.1007/978-981-97-5569-1_12

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-97-5568-4

  • Online ISBN: 978-981-97-5569-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics