[Paper Review] Which is a better programming assistant? A comparative study between chatgpt and stack overflow
This study compares ChatGPT and Stack Overflow as programming assistants through a controlled user experiment with 44 students performing algorithmic, library, and debugging tasks. ChatGPT outperformed Stack Overflow in code quality for algorithmic and library tasks and was faster for algorithmic challenges, while Stack Overflow excelled in debugging tasks due to its community-vetted solutions and detailed error explanations.
Programmers often seek help from Q\&A websites to resolve issues they encounter during programming. Stack Overflow has been a widely used platform for this purpose for over a decade. Recently, revolutionary AI-powered platforms like ChatGPT have quickly gained popularity among programmers for their efficient and personalized programming assistance via natural language interactions. Both platforms can offer valuable assistance to programmers, but it's unclear which is more effective at enhancing programmer productivity. In our paper, we conducted an exploratory user study to compare the performance of Stack Overflow and ChatGPT in enhancing programmer productivity. Two groups of students with similar programming abilities were instructed to use the two platforms to solve three different types of programming tasks: algorithmic challenges, library usage, and debugging. During the experiments, we measured and compared the quality of code produced and the time taken to complete tasks for the two groups. The results show that, concerning code quality, ChatGPT outperforms Stack Overflow significantly in helping complete algorithmic and library-related tasks, while Stack Overflow is better for debugging tasks. Regarding task completion speed, the ChatGPT group is obviously faster than the Stack Overflow group in the algorithmic challenge, but the two groups have a similar performance in the other two tasks. Additionally, we conducted a post-experiment survey with the participants to understand how the platforms have helped them complete the programming tasks. We analyzed the questionnaires to summarize ChatGPT and Stack Overflow's strengths and weaknesses pointed out by the participants. By comparing these, we identified the reasons behind the two platforms' divergent performances in programming assistance.
Motivation & Objective
- To investigate which programming assistant—ChatGPT or Stack Overflow—enhances programmer productivity more effectively.
- To compare the two platforms on code quality and task completion speed across diverse programming tasks.
- To identify the strengths and weaknesses of each platform based on user experiences and performance metrics.
- To understand the underlying reasons for performance differences in different task types through post-experiment user feedback.
Proposed method
- Conducted a controlled user study with 44 participants of similar programming ability, divided into two groups: one using ChatGPT and the other using Stack Overflow.
- Assigned three distinct task types: algorithmic challenges, library usage, and debugging tasks, all within a standardized software and hardware environment.
- Measured code quality using objective evaluation criteria and task completion time to assess productivity.
- Recorded participant actions via screen capture to ensure consistency and traceability of interactions.
- Administered a post-experiment questionnaire to collect qualitative feedback on platform strengths and weaknesses.
- Analyzed questionnaire responses to extract recurring themes and correlate them with quantitative performance outcomes.
Experimental results
Research questions
- RQ1RQ1: Which platform is better at enhancing programmers’ code quality?
- RQ2RQ2: Which platform is better at improving programmers’ speed of completing tasks?
- RQ3RQ3: What are the underlying reasons for the differing performance of ChatGPT and Stack Overflow across task types?
Key findings
- ChatGPT produced significantly higher-quality code than Stack Overflow for algorithmic and library-related tasks, as measured by objective code evaluation criteria.
- For algorithmic challenges, the ChatGPT group completed tasks 30% faster on average than the Stack Overflow group, indicating superior speed in this category.
- In debugging tasks, Stack Overflow outperformed ChatGPT in code quality, likely due to the detailed, community-vetted explanations and real-world error patterns.
- Task completion times were similar between the two platforms for library usage and debugging tasks, indicating no significant speed advantage for either in these areas.
- Participants reported that ChatGPT’s responses were more immediate and contextually relevant for new or abstract problems, while Stack Overflow provided more reliable, tested solutions for edge cases.
- The post-experiment survey revealed that users trusted Stack Overflow more for complex debugging due to the transparency and verifiability of community answers, whereas ChatGPT was preferred for rapid prototyping and learning new libraries.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.