How a computer science professor is using AI in her classroom

Written by 

rep amber wagner 550pxLike more than a few faculty colleagues before her, computer scientist Amber Wagner, Ph.D., started out by creating an AI assignment that was designed to flop.

Teaching a course on the C++ programming language in fall 2023, Wagner asked her students to use ChatGPT to create a template for testing software.

“The idea of testing software is to break it; but if you know how it works and it is yours, you don’t want to break it,” said Wagner, an assistant professor in the Department of Computer Science who joined UAB from Birmingham-Southern College in August 2023. “I really hoped that the AI would fail” — that it would be riddled with errors that the students’ testing code would catch so that “students would see the issues with relying on AI-generated code,” she said. The actual outcome: “The AI solution was really good,” Wagner said. “I was blown away.”


A speed boost for programmers

Tools like ChatGPT are impressive. But the real game-changer for working programmers is the code-completion AI now embedded in integrated development environments. These software applications, known as IDEs, are where working programmers spend most of their time.

“I was teaching a 200-level Java class and demonstrating how to write an algorithm” in an IDE, Wagner said. “I typed the name of a common function, greatest common denominator, and the AI completed the function for me and it was completely accurate. It totally stole my thunder. I went on to the next function, demonstrating recursion. I named it ‘tricky’ so I didn’t give it any clues. I wrote one line of the function and it did the rest.”

These automated helps give working programmers a speed boost. What do they mean for computer science education? The difference actually is not that great, Wagner says. “We faced all that a long time ago, with code being available on the web,” she said. “I’ve allowed students to use those tools because as a professional developer I’ve used those tools. They have to cite what they used and explain why it works.”

Going forward, computer science education will continue to change, Wagner predicts. “The students absolutely have to learn the basics, but I think we have to start teaching the higher thinking. Syntax has always been the easy part; any developer’s best friend is Stack Overflow. [A site where programmers can post questions and get help with tricky problems.] But understanding how to take that snippet and put it in context is crucial.”


“I’ve allowed students to use those tools because as a professional developer I’ve used those tools. They have to cite what they used and explain why it works.”


What does it mean for computer science education?

This summer, Wagner is part of a literature review effort in UAB’s computer science department to understand how other universities have added AI to their curricula and to make suggestions on appropriate changes and supporting activities for UAB courses. This will lead to a session in the Department of Computer Science fall faculty retreat.

As she uses AI tools, Wagner has seen more possibilities to help her students get better, faster. “For my intro class, I wanted them to be able to write something a little more advanced and difficult for a first-year programmer,” she said. Instead of an exam, she assigned her students to write a text-based adventure game. “They could use AI as long as they demonstrated how they communicated with it,” Wagner said. “The idea is to learn how to ask it the right questions.”

Some students barely used AI, others used it for creating storylines or images to illustrate their work, and a small number leaned on it too much, Wagner said: “I would say 98 percent used it as a tool and did not rely on it.”

Overall, the project worked well and “the students really enjoyed it,” Wagner said. “I had some students turn in projects that were 600 lines of code” — a hefty amount for a beginner. “They were super proud of what they had done.”

Wagner has since added AI to several more classes. “I use it in a software engineering class where students learn to redesign software,” she said. “A lot of what we do in the field is have written code that we have to edit or rewrite in some way. Having AI write the code and the students edit the design was a good assignment.”


““When you are a developer, you are constantly learning new tools,” she said. “I’m trying to show my students how to use AI to give them templates or examples or other learning resources to help them learn those tools faster.”


Using AI for bringing out new perspectives

A common theme among faculty using AI in teaching is that it is valuable for bringing out new perspectives. Wagner is planning a new project for her C++ course. “C++ code happens to have high vulnerabilities because it allows you to manipulate memory directly,” she said. “I want to come up with an exercise where the AI writes insecure C++ code and then have students identify the vulnerabilities — to teach them to code more securely.”

One use case that Wagner emphasizes to students is how AI can help them learn new skills. In a senior capstone course, she recommended that students use AI to generate a basic outline in the new framework. “When you are a developer, you are constantly learning new tools,” she said. “I’m trying to show my students how to use AI to give them templates or examples or other learning resources to help them learn those tools faster.”

Some of her students love using new AI tools “and are so excited because they are trying to produce something and this can help them advance more quickly,” Wagner said. “But I still have a lot of students who don’t like it and think it has crossed a lot of lines. Others are afraid of what it means for the job market. But what I have found is that, the more they use AI, the less they are against it. They start to see that it is more of a tool than a replacement.”

This is Wagner’s own assessment. “I don’t think it is going to eliminate software engineers,” she said. “It will just make us busier. It will certainly make you more competitive to use these tools.”