Stack Overflow is a valuable resource for software development-related concerns. For a few years, most people have been utilizing stack overflow to discover answers to mistakes they have faced. Within a short period, stack overflow has been acquainted with the majority of users. While coding, we are all likely to encounter one or more various sorts of mistakes on a regular basis.
Then stack overflow will enter the scene to provide solutions. And the everyday action in software development is to write code, execute it, and remove mistakes.
And the first thing that most people will do when they encounter an error is to manually search for it by copying the error and pasting it into the browser. In small cases, this is fine, but think about the case where we have to deal with a large number of errors, and yeah, I agree with you because it is neat and risky. To eliminate the above danger, we will construct a tool that will attempt to run and execute Python, Java, C, and C++ while also checking for the existence of errors throughout the file\'s execution. If issues are detected, the tool will attempt to find Stack Overflow solutions related to the errors discovered and open the solution sites as tabs in Chrome or any other browser.
Introduction
I. INTRODUCTION
If you have questions about software development, Stack Overflow is a righteous place to start. Stack Overflow established itself as a standard in the industry and is now an essential part of the culture around it. Coding and testing the code make up the mainstay of our daily work in software development.
If we run into problems, we look for solutions on sites like Google, Stack Overflow, etc., correct the problem, and repeat the process until our code runs accurately. A stack overflow is a specific kind of buffer overflow fault that happens when a computer program tries to use more call stack memory than has been allotted for it. The stack segment, often called the call stack, is a fixed length. Stack Overflow is a question-and-answer website that brings together computer programmers from all over the world. The website is a storehouse for computer programming information.
Individuals, groups, and businesses may use Stack Overflow to collaborate, solve problems, and share information. Stack Overflow facilitates collaboration, problem-solving, and knowledge-sharing among individuals, groups, and organizations. As a developer/coder, we might get entangled in one or another type of error very often. In such cases, we google the error or look for it on different websites (e.g., Stack overflow). In this, the error that which code throws, we could automatically search those errors on stack overflow and open the answers in the new tabs. That way, we save the effort of finding the error and looking for an appropriate solution. Creating code takes less time than fixing errors, a general tendency among programmers to make while writing their first few lines of code. We check through numerous websites looking for solutions to our issues in an effort to fix them. Initially, many of us were unaware of this StackOverflow website. Beginners will benefit significantly from this site. Initially, as programmers, we made numerous mistakes and were unaware of this website. So, this notion was developed to make the process of solving problems simpler. The top methods to fix the current problem are opened when the error is automatically detected. Reducing manual labor is the major goal here in order to make the work easier.
II. LITERATURE REVIEW
Chunyang Chen et al. [1]: Demonstrated that searching on Google and asking on Stack Overflow has a strong correlation in terms of technical terms searched and asked as well as their corresponding temporal patterns and trends. Search and asking for newer, specific technical terms have larger content overlap and stronger correlation than older, general programming topics. This suggests that with time going by, as new techniques emerge and replace old ones, the information developers search on Google could become more and more correlated with the questions developers ask on Stack Overflow. We discuss time-aware and semantic searches that can exploit Stack Overflow data's temporal properties and semantics to enhance topic-based search engines.
Ganga Bhavani et al. [2]: While we code many times, we most probably get structed in one or the other different types of errors very often. And then, the stack overflow will get into the picture for providing solutions. And in software development, the daily activity is to write code, execute, and remove errors. And the immediate action that most will take after getting encountered an error is to search for the errors manually by copying the error and pasting the error on the browsers; in a small case, it is ok to search the errors on the browser and think about the case where we have to deal with a lot number of errors and yeah, I can agree with you as it is tidy and risky as well. To avoid the above risk, we will create a tool that will try to run and execute a Python source code file and check for the presence of errors during the execution of the file. If there are errors are encountered, the tool will try to search for Stack Overflow solutions that relate to the errors found and open the solution pages as tabs in Chrome or any other browser. From this tool, we understood that the tool that they developed could reduce a lot of manual work.
Eram Naaz et al. [3]: The primary purpose is to extract the required data from Stack Overflow. They wrote a python script that will do a dry run for another program we are aiming for and check for errors. If it has no errors, it will show us "No errors found". Otherwise, it will open tabs on the Stack Overflow page targeting the errors we have in that particular code. The entire Project is divided into the following sub-parts: Getting the data, Checking the error if found, making a request, Getting the specified URL for the bug in the code, Inputting the testing file, and Executing the main function. The limitation of this program is that it can only find errors in python codes.
Rabe Abdalkareem et al. [4]: Stack Overflow relies on the crowd to construct quality developer-related knowledge. They also studied the helpfulness and delay of Stack Overflow posts by identifying the type of questions that are more likely to be answered by the crowd. They find that development tools and programming language issues are areas where the crowd is most helpful and that web framework-related issues are the most time-consuming questions to receive an acceptable answer. Their findings can help developers better understand how to effectively use Stack Overflow as a development support tool, help Stack Overflow designers improve their platform, and help the research community to understand the strengths and weaknesses of Stack Overflow as a development tool. They investigate why developers use Stack Overflow, what areas the crowd is most helpful, and what areas are the most time-consuming to attain answers for. They find that the crowd mostly provides technical knowledge to developers.
III. PROPOSED METHODOLOGY
Here, we are making the tool for both GUI and Command line interfaces. In this, we designed the system with three modules which are described below; the subprocess module is the one that is used to run and execute new source code through Python code with the help of the creation of a new process or multiple processes.
The request module will allow us to perform some actions, like sending the HTTP requests using Python, as it is easy for Python. The web browser module is the one that helps us and allows us to launch the web browser tabs. Subprocess Module: It creates a sub-process for reading and running the code file and getting the error from it.
Requests Module: Requests module is the one that is used to perform HTTP requests to StackexchangeAPI.
We divided our code into three functions based on their functionality. The three functions are executed return, make a request, and get URLs. executeReturn will execute our python file, store output an error, and return them.
makeRequest, as the name declares, will perform sending of a request to the StackexchangeAPI and get results based on the error that got. And the other is the getUrls function, which stores the URLs sent as a JSON file from API, and opens it in the browser using the web browser module. Normal Approach / Basic Approach: Here in our Project, we are going to divide the code into three parts, which means we have to create three methods, executeReturn(cmd): In the first method, the written code statements will try to read the program file that contains other source code and also runs it and finally stores the output that seen on the console. makeReq(error): This method will try to make an HTTP (Hyper Text Transfer Protocol) Request with the help of stack overflow API and the output/errors that we got from the first method, and finally, the result is received in the form of HTTP Response in the form of JSON (JavaScript Object Notation) format. getUrls(json_dict): This Method takes the JSON response from the makReq() method and searches and keeps the URLs in a data structure or sequence of those answers, and those are marked as Answered by the Q&A platform Stack overflow. And then finally, open up the tabs containing answers from StackOverflow on the browser.
GUI Interface: Tkinter is a standard Python GUI library. Like kivy and PyQT5, Tkinter is platform-independent. Since Tkinter uses OS native elements, they look and feel like everything else on the platform it's running on. Nevertheless, it's a great tool to prototype our ideas in a short time. It will contain a select file section in which the user can upload code files in Python, Java, C, or C++. After clicking on Run & Check, it will execute the code, find the errors, and will open the browser tab of related and answered Stack Overflow threads.
IV. FLOWCHART
VI. EXPECTED OUTCOME OF THE PROPOSED WORK
First, we are going to create the python script that contains the code that tries to execute the source code file and will try to print according to the execution; if it founds no errors, it will directly print no errors found. And similarly, if it finds any errors, it will try to store the error type (found from the categories of errors) and the content of the error message. After that, we have to make an API call with the help of stack exchange API that can be available on the internet, and the URL for the same is given in the references. After making an API call, as a result, we will get the response from the API in the format of JSON, and after that, we have to extract the contents of the response from JSON data, and there, we can find the solution URLs for the error encountered. Generally, we have to manually copy the error and search in google on various websites. It is a tedious task and takes more time. Manually we can't guarantee that the solution will be found accurately. Whenever we get an error, we need to try several ways to fix the error. And if we fail to find a way to resolve the error, we need to browse and go through several websites and compare the errors to pick the best suitable solution. This entire process consumes a lot amount of time and energy. In doing this, we may also lose interest in fixing the error. In the other scenario, like in the case of installation errors and errors in software testing, the size of errors is too large, and during some cases, the people who are new to coding or programming will get confused and may feel that coding is a risky job. And in times, the error may be confusing to developers. So, our proposed system will make all these tasks simpler. We will create a tool that will run and execute a Python, Java, C++, and C source code file and check for the presence of errors during the execution. If any errors are found, the tool will try to search for Stack Overflow solutions or answers related to the found errors and also open the solution pages as tabs in a web browser.
Reducing manual work.
No deep knowledge of programming language is required to use the tool.
Easy to use for anyone, even without having prior experience.
References
[1] C. Chen and Z. Xing, \"Mining technology landscape from stack overflow\", Proceedings of the 10th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement, pp. 1-10, 2016. Show in Context Google Scholar.
[2] International Journal of Creative Research Thoughts (IJCRT), Automated Error Detection Through Stack Overflow with the Help of Python Tool. K David Raju (Associate Professor)
[3] Crio.Do Naaz Eram stack-overflow-auto-search-tool-using-python
[4] R. Abdelkarim, E. Shihab and J. Rilling, \"What do developers use the crowd for? a study using stack overflow\", IEEE Software, vol. 34, no. 2, pp. 53-60, 2017. Show in Context view Article Full Text: PDF (728KB) Google Scholar
[5] https://api.stackexchange.com/
[6] https://ieeexplore.ieee.org/document/9402151
[7] https://en.wikipedia.org/wiki/Stack_Overflow
[8] https://stackoverflow.com/questions
[9] X. Xia, L. Bao, D. Lo, P. S. Kochhar, A. E. Hassan and Z. Xing, \"What do developers search for on the web?\", Empirical Software Engineering, vol. 22, no. 6, pp. 3149-3185, 2017.
[10] Chen, Z. Xing and L. Han, \"Techland: Assisting technology landscape inquiries with insights from stack overflow\", 2016 IEEE International Conference on Software Maintenance and Evolution (ICSME), pp. 356-366, 2016.