The Role of Artificial Intelligence

16 Dec 2024

The role of AI in Software Engineering

AI has had an immense impact in education, especially in the field of software engineering. A tool that can return a direct and concise answer to any question is an invaluable resource to web/app developers. Considering the fact that there are hundreds of different coding languages, algorithms, and frameworks, all with unique functions and syntax that are specific to their language, AI tools save us time and effort in understanding and implementing code. Rather than searching through countless pages of documentation to find a function, which often leads down rabbit holes of other related functions, or searching hundreds of lines of code for that one error, which may be logical or syntactical, AI can solve that issue in a matter of seconds. Throughout my journey in ICS 314, software engineering, I have utilized these AI tools, specifically ChatGPT and GithubCopilot. Both of these AIs have not only aided in my completion of ICS 314, but has led me to a greater understanding in programming.

WOD Experiences with AI

WOD is an abbreviation for “workout of the day”, which are exercises we complete in ICS 314 to enhance our programming skills under a time constraint, similar to leetcode. In doing so, we were allowed to use AI as a tool to help us finish these WODs in a timely manner. The three types of WODs we had were: experience WODs, in-class practice WODs, and in-class WODs. The first two are graded off participation, as an attempt made will return full-credit. However, the in-class WODs are graded off of functionality and completion, with either a 100% for correct implementation, or a 0% for incorrect implementation.

Since experience WODs are given an unlimited number of attempts, I did not use AI with these exercises. Each experience WOD has an explanation video at the bottom, so after attempting each WOD initially, whether I finished or not, I would watch the video, then attempt the WOD again until I reached functional code within the time constraint. My goal with these experiences were to stray away from AI as much as possible, to try to learn the concepts and functions on my own. I took the same approach for in-class practice WODs as well, more so because they were not graded. Instead, I would try to use past WODs as a reference for these in-class practice WODs or ask my professor questions. In-class WODs are a different story. I would do my best to finish the exercise without AI, but if I ran into issues, which I did sometimes, I would fallback to Github Copilot or ChatGPT. In-class WODs were graded and weighted to about 30% of our grades, so I did not want to take the chance of losing credit. Especially since we were allowed to use AI, we just had to state that in our submission. Some of the in-class WODs included web design, so sometimes when a container was not centered, or words were not appearing as I had preferred, ChatGPT or Github Copilot would save the day. I had used ChatGPT for two of our in-class WODs, the Murphys home page design and Aloha Beer Co. home page design. Both times, I had issues with padding and centering containers or words, which were remedied by ChatGPT.

Essay Experience with AI

When it comes to writing essays, I’m a firm believer in not using AI. The only exceptions are grammarly, which could help with grammar mistakes or phrasing a sentence in a better way. Essay writing is essential to communicating one’s ideas to the world, and we can see that in the tech world. Code documentation is written by programmers, and if a programmer is lacking in communication, other programmers who wish to use the same code or expound on it will have a lot of trouble figuring it out. Additionally, if a programmer is asked to present a project they are working on, or present a project proposal, if they are not able to write, let alone talk about their thoughts and ideas, it’s as good as nothing, even if the idea is amazing. ChatGPT can explain concepts that exist already, or simply explain a program that is given to it. Yet, if ChatGPT is unable to recognize or correctly explain the ideas and concepts of a project, it is left up to the programmer. Then, if the programmer, who has underdeveloped communication skills because they heavily depend on AI to write their essays and ideas for them, is left to the task, they will suffer. In short, I believe that ChatGPT can only communicate so much, but the programmers themselves are the ones who fully understand their own code, therefore, are the only ones who can explain the current code and its future goals. It is also important to keep in mind that essay writing helps with organizing and putting thoughts together, which in turn boosts the ability to verbally communicate.

AI in the Final Project

My group’s final project is called ‘Manoa Menu’, where we translate the menus of different food courts on UH to different languages for international students. Throughout the month that we had to work on it, I had utilized ChatGPT and Github Copilot many times. Despite the useful content we learned in ICS 314, there were still plenty of things that I did not know how to do. I was responsible for the Campus Cravings page, which displays the most popular food items in UH Manoa, and the navbar. While creating this page, I had used ChatGPT to learn how to create a scrollable window for my food items. I had also used it to help me center some containers, or align them in a certain way. However, the most important aspect of my page was fetching data from our database. Before this class, I have never used or touched an actual database before. So when it came to using useState and useEffect functions and linking them to our API, I was completely lost. ChatGPT and Github Copilot helped me understand the API response and useEffect function to a whole different level. Prior to this project, I didn’t even know what an API was, or its uses. I will admit that I still have plenty to learn about APIs and databases, but ChatGPT and Github Copilot allowed me to successfully fetch the necessary data I needed to display the food items on my Campus Cravings page.

Using AI to learn a concept and Asking/Answering Questions

When it comes to learning a concept or answering a question that you or others may have in class, AI is probably one of the most efficient tools you could use, and definitely my go-to for coding questions. Sometimes if I need to double check if what AI is saying is correct, I will research further on a website, but in general, I use AI quite frequently for asking questions or learning coding concepts. For example, when we first started learning typescript in the beginning of ICS 314, we were introduced to functional programming. This included functions such as map(), filter(), reduce(), slice(), etc. I used AI to help me understand the functions first, then used AI to help me with the syntax. Functional programming syntax in typescript is quite different from what I’m used to, so ChatGPT was extremely useful during this unit. This is just one example me using AI to understand a concept by asking questions, or rather, SMART questions.

Using AI for coding examples, explaining/writing code

ChatGPT and Github Copilot are also good at explaining, writing, and giving examples of code for certain concepts. Going back to the example I had previously talked about, array functions in functional programming with typescript. While trying to understand the reduce() function, I had asked ChatGPT to give me an example of reduce() being used. ChatGPT gave me a great example, which helped me understand the parameters of the functions, the workings of the function, and the output. I had also used ChatGPT to explain some parts of code I do not understand. We used the Nextjs template often throughout ICS 314, so when I would run into premade code ingrained in the template that I did not understand, I would copy and paste the code and ask for an explanation. I usually would do this with database action functions since this topic was brand new to me. The lines of code that start with: ‘await prisma’ and the lines after always confuse me, so having ChatGPT give me a straightforward answer is nice, saving me the hassle of finding a website and scrolling through the sections of documentation. Another field of excellence for ChatGPT is writing code. I have done this numerous times with our final project, asking ChatGPT or Github Copilot to write a snippet of code that could do x or y. Then, take that example and implement it into my own code. Sometimes if that did not work, I would tell the AI to implement what I want into the code. In one instance, I asked ChatGPT to write me a section of code for the useEffect function that would fetch the foodCard data from my database. After a few attempts, I was able to get the Campus Cravings page working, pulling data from the database. Without AI, I would have had to go through documentation of useEffect and useState, hours of trial and error, and probably taking twice to three times as much time as what I had with AI.

Code documentation and Quality Assurance with AI

I have a bad habit of not documenting some of my code, but when I do, I prefer not to use AI. I document code in a way that I can understand it, so most of the time I will replace any code documentations that AI makes with my own. However, I use AI for quality assurance a lot of the time, especially for the final project and in-class WODs. When I get errors in the terminal, usually lines of code are underlined in a red squiggly line. When I hover over the code, an option for Copilot appears, and I will usually use that to fix the code. This includes ESLint errors such as indentations, spacing, or unused variables. Additionally, syntax or logic errors may occur, to which I will ask Copilot “what is wrong with this code?”, and Copilot has been consistent with giving good/working code solutions.

The impact of AI on my learning and understanding

Overall, I think AI has had a positive impact on my learning and understanding of content in this class. The key is how you’re using AI. If no effort is being put into the learning process, and AI is being used to simply finish assignments for a good grade, then AI would be a detriment. However, I would use AI not to just simply finish assignments, but try to understand the problem and where I went wrong. Often times, after finding a working solution from AI, I will ask “why does this work?”, and gain a deeper understanding of the code. Another beneficial thing about AI like ChatGPT or Copilot is that they explain what they are doing while solving the problem. Actively seeing this helps me wire my brain in a way to think like that, to think like a programmer. It has also taught me to use my resources more. A lot of times, ChatGPT or Copilot will state a function that I have never used or heard of before, but does similar things to other functions I know of in other coding languages. Sometimes, I have to think “hey, there must be a function that does x or y that can help solve this issue”.

Practical Applications of AI

AI is already used in the real world in many scenarios. On some websites, you will find chatbots powered with AI models designed to help a customer navigate the website or buy products. Tesla’s self-driving cars are powered through AI, as well as Tesla’s robot Optimus. AI is even used by software engineers, who rather ask ChatGPT a question than search through code documentations or stackOverflow. AI has practical applications in almost all work fields in the real world, the people just have to find a way to make them the most effective in that area. Tasks such as data collection and analysis, budgeting, calculating the trajectory of an object, all can be done with AI. Of course, AI has a large margin of error at this current time, but as these AI models evolve and developers upgrade their software, they will become much more efficient and correct.

Challenges and Opportunities with AI

Even though AI is a great tool that should be utilized, it comes with its downsides as well. The biggest challenge with AI like ChatGPT or Github Copilot is that sometimes, they are wrong. The solutions that they give don’t always work, and when you tell the AI that “this solution does not work, try again”, it will give you the same solution, or recycle a previous solution that hadn’t worked already. For example, in my final project, I was trying to link the User data table to my Campus Cravings page. We had an API built for receiving the data, but the useEffect and useState were not correctly fetching the data. I used ChatGPT and Github Copilot for three hours, trying the different solutions it gave me, using different perspectives or ways of solving the problem. In the end, I was unsuccessful so I was not able to create a feature that accessed user favorites. In the future, I will try to fix this issue and research it further, but as of now, that is one example of a challenge I have faced while using AI.

Comparative Analysis with AI and traditional teaching

When it comes to teaching software engineering, I believe that traditional teaching forces students to memorize functions, algorithms, and syntax, rather than teaching students how to problem solve. However, students are more well-versed in whatever language they are learning because they have functions and syntax memorized, along with how to use such functions. Teaching with AI does not come out on top with students memorizing concepts, but it is better for hands-on learning. Since AI tools can act as a teacher, answering specific questions for each learner, it could possibly help students progress faster as it can serve as individualized instruction. Although, AI shines in project based assignments. Giving students an assignment, for example, build a website that does x, y and z, and being able to use AI, will help students learn at their pace, ask questions for things they don’t understand, and give them a place to start. Not all students learn the same way or absorb information in the same way, so taking an individualized approach to teaching—with AI—could be beneficial. I think a mix of both traditional and AI teaching is necessary to create successful students. It just depends on how you implement these teaching strategies.

Future considerations with AI

I believe that since AI is an evolving technology that will be widely used in the future, we must begin to alter how we teach coding. Rather than treat AI as a cheat code, or being embarrassed in using AI to help us accomplish projects, we should treat AI as a tool and learn how to utilize it to its fullest potential. Whether we like it or not, AI is here, and since the internet is available to everyone, everyone has access to AI. Maybe we could have classes that teach you how to ask AI proper questions to receive the most accurate answers. We could maybe introduce classes that teach you to build websites or applications purely with AI, so we can learn the ins and outs of AI. Additionally, we could create more classes centered around AI and how it is developed. Ultimately, we must begin to see AI as an asset.

Conclusion

I have discussed a lot of different things regarding AI, but to me, my most important takeaway is that AI is a tool that we should all get used to using. Companies are beginning to use them, people are beginning to use them, technologies are being developed with AI built into them, we might as well be ahead of the curve and embrace this technology. AI is no small accomplishment in tech either. It has the potential to create waves of change in a matter of decades. It is one of the biggest recent innovations in the technology world. It has its pros and cons, but us as programmers must adapt, especially since the world is always changing.