Learning to use computing skills, ethically

April 15, 2025
News Body
Image
A hand points at a photo depicting a diverse group of people smiling together. Other elements in the image include a curly bracket used in computer code, a large reddish circle with graph paper texture, and three question marks in boxes.
Princeton's Department of Computer Science is teaching practical ethics in its technical courses. Photo illustration by Bumper DeJesus

By Julia Schwarz 

In a course on ethics and computing in fall 2024, the professor asked Cathy Di to help run a fictional company. A company with a thorny problem on its hands.

Di and her classmates each played a different role — CEO, software developer, general counsel, UX designer, product manager. The company, the students were told, had developed an AI algorithm to detect skin cancer. Users upload a photo of their skin and an AI system analyzes it and recommends whether to seek medical care.

But the company discovers close to launch that the algorithm isn’t as effective at detecting cancer for people over 65 and those with darker skin. What should the company do with this information?

Should they launch the app, even though it’s imperfect, potentially saving thousands of lives? Should they delay the launch and improve the algorithm, training it on more diverse sets of images? Or should they scrap the product entirely because it could worsen social inequality and harm some people by giving them false reassurance?

In the class, students quickly began to disagree. “Everyone was super engaged,” said Di, a junior in the computer science department. Exercises like these don’t just present abstract ideas, she said. “It puts you in a situation and a context that you could encounter in the real world.”

Based on a real-world example of a skin cancer detection algorithm developed by a major tech company, the roleplay was created by Steven Kelts, an ethicist and lecturer affiliated with the Center for Information Technology Policy.

Image
Steven Kelts
Steven Kelts. Photo by Sameer Khan/Fotobuddy

Over the last four years, Kelts has designed ethics content for about a dozen computer science courses. His work is part of a broader push within the computer science department at Princeton, and the discipline more broadly, to teach students computing ethics alongside technical computing skills.

There is no broad consensus on how exactly to teach computing ethics, however. Some universities have added standalone lecture courses, others have added lectures on ethics to technical courses. Kelts has crafted a distinct approach: he designs practical, hands-on ethics exercises tailored specifically for engineering courses.

He calls this whole suite of teaching tools Integrated Ethics. “It’s not about adding philosophy to the computer science classroom,” Kelts said. “It’s about teaching students to put computing skills to socially constructive uses.” 

Integrated Ethics

The exercise Cathy Di and her classmates participated in was part of a course entirely about ethics and computing taught by Aleksandra Korolova, assistant professor of computer science and public affairs.

The roleplay exercise gave students a chance to test out what they had learned in the class, said Korolova. "Steven’s roleplays help teach the ideas in more depth," she said. "They become more tangible. They show students: this is how it feels when you are actually in this situation."

Andrés Monroy-Hernández, an assistant professor of computer science and an expert in human-computer interaction, always includes ethics in his courses: because human-computer interaction research involves people, he said, "ethics are part of what we do."

Typically, he has invited guests to his class to give lectures on ethics. For example, in a recent introductory course he invited a speaker from Google, who is blind, to talk about her research on AI and accessibility. This was one of two lectures on ethics he built into the syllabus. Then, he met Kelts and added two additional sessions for Integrated Ethics roleplays.

"Steven’s roleplays went beyond the traditional kind of more passive content that we have," said Monroy-Hernández. "I suspect students will remember them more than a traditional lecture."

Image
Students in a classroom
Steven Kelts leading a roleplay exercise with students in 2022, hosted by the Princeton Council on Science and Technology. Photo courtesy of Kelts

Evidence from psychology supports this, said Kelts.  While general ethics classes and lectures are important for teaching students to make complex arguments, they don’t necessarily make students any better at deciding what to do when they later encounter an ethical dilemma. 

“Even if you show people horror stories of computing technologies gone awry and the social problems they’ve caused in the past, that doesn’t necessarily tell a student precisely how they should have programmed it differently,” said Kelts.

Mikey Squires, a senior in the computer science department, said he learned a lot from his various encounters with Integrated Ethics in the classroom. “When you’re building a product, you have this ideal notion of all the good it’s going to do,” he said. “But you don’t really think of all the unintended consequences.”

Customizing the curriculum

Kelts first began working on tech ethics around 2018, inspired by colleagues who ran the Princeton Dialogues in AI and Ethics. Then, in collaboration with industry contacts and the Princeton Council on Science and Technology, he helped to develop roleplay exercises and other pedagogical tools to teach computing ethics.

For many courses, he will design and run a roleplay. In other classes, he has helped to identify resources on ethics for short assignments and practice sets. In project-based courses he sometimes meets individually with students to run ethical impact assessments on their proposals. There is no one-size-fits-all approach, he said. Every class is different.

Part of the teaching challenge Kelts addresses is the difficulty of weaving practical ethics into purely technical courses. For professors, it’s often much simpler to add ethics as a standalone class or lecture.

“There is so much technical depth in computer science now,” said Korolova, “there just isn’t time to study everything.” Many courses that aren’t directly related to ethics, she added, would nevertheless be enriched by incorporating some of the tools that Integrated Ethics offers. 

In summer 2024, Marcel Dall’Agnol, a teaching faculty member, co-taught an introductory summer course for students with no background in computer science. There was a lot of technical ground to cover in the course, he said, including math and coding skills.

To incorporate ethics into the syllabus, Dall’Agnol had thought to do one guest lecture. But then he met Kelts, who worked with him to design a lecture, precept case studies and a technical assignment about confidentiality and privacy — a topic that could be directly applied to the skills students were learning.

“I remember the precept being really fun,” said Dall’Agnol. The students were assigned to anonymize a data set and there was a spirited debate about exactly how much information ought to be removed from the file.

“The really cool thing was that the case studies were explicitly designed so that there's not just one correct answer,” said Dall’Agnol. “You could always argue both ways,” he added, which is not typical for computer science courses.  

Exposing students to technical ethics early on is particularly important, Dall’Agnol said. It makes no sense to spend years teaching students how to build things and only ask them halfway through to think about the ethical implications of what they’re building. “It makes much more sense to do it from the get-go.”