psc2code

Author:

Bao Lingfeng1ORCID,Xing Zhenchang2,Xia Xin3ORCID,Lo David4,Wu Minghui5,Yang Xiaohu6

Affiliation:

1. College of Computer Science and Technology, Zhejiang University, China and Ningbo Research Institute, Zhejiang University, China and PengCheng Laboratory, China

2. Australian National University, Australia

3. Monash University, Australia

4. Singapore Management University, Singapore

5. Zhejiang University City College, China

6. Zhejiang University, China

Abstract

Programming screencasts have become a pervasive resource on the Internet, which help developers learn new programming technologies or skills. The source code in programming screencasts is an important and valuable information for developers. But the streaming nature of programming screencasts (i.e., a sequence of screen-captured images) limits the ways that developers can interact with the source code in the screencasts. Many studies use the Optical Character Recognition (OCR) technique to convert screen images (also referred to as video frames) into textual content, which can then be indexed and searched easily. However, noisy screen images significantly affect the quality of source code extracted by OCR, for example, no-code frames (e.g., PowerPoint slides, web pages of API specification), non-code regions (e.g., Package Explorer view, Console view), and noisy code regions with code in completion suggestion popups. Furthermore, due to the code characteristics (e.g., long compound identifiers like ItemListener), even professional OCR tools cannot extract source code without errors from screen images. The noisy OCRed source code will negatively affect the downstream applications, such as the effective search and navigation of the source code content in programming screencasts. In this article, we propose an approach named psc2code to denoise the process of extracting source code from programming screencasts. First, psc2code leverages the Convolutional Neural Network (CNN) based image classification to remove non-code and noisy-code frames. Then, psc2code performs edge detection and clustering-based image segmentation to detect sub-windows in a code frame, and based on the detected sub-windows, it identifies and crops the screen region that is most likely to be a code editor. Finally, psc2code calls the API of a professional OCR tool to extract source code from the cropped code regions and leverages the OCRed cross-frame information in the programming screencast and the statistical language model of a large corpus of source code to correct errors in the OCRed source code. We conduct an experiment on 1,142 programming screencasts from YouTube. We find that our CNN-based image classification technique can effectively remove the non-code and noisy-code frames, which achieves an F1-score of 0.95 on the valid code frames. We also find that psc2code can significantly improve the quality of the OCRed source code by truly correcting about half of incorrectly OCRed words. Based on the source code denoised by psc2code , we implement two applications: (1) a programming screencast search engine; (2) an interaction-enhanced programming screencast watching tool. Based on the source code extracted from the 1,142 collected programming screencasts, our experiments show that our programming screencast search engine achieves the precision@5, 10, and 20 of 0.93, 0.81, and 0.63, respectively. We also conduct a user study of our interaction-enhanced programming screencast watching tool with 10 participants. This user study shows that our interaction-enhanced watching tool can help participants learn the knowledge in the programming video more efficiently and effectively.

Funder

NSFC

Australian Research Council’s Discovery Early Career Researcher Award

ANU-Data61 Collaborative Researh

National Key Research and Development Program of China

Publisher

Association for Computing Machinery (ACM)

Subject

Software

Cited by 15 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Automatic recognizing relevant fragments of APIs using API references;Automated Software Engineering;2023-11-19

2. Improving Code Extraction from Coding Screencasts Using a Code-Aware Encoder-Decoder Model;2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE);2023-09-11

3. SeeHow: Workflow Extraction from Programming Screencasts through Action-Aware Video Analytics;2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE);2023-05

4. VID2XML: Automatic Extraction of a Complete XML Data From Mobile Programming Screencasts;IEEE Transactions on Software Engineering;2023-04-01

5. Machine/Deep Learning for Software Engineering: A Systematic Literature Review;IEEE Transactions on Software Engineering;2023-03-01

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3