Skip to main content

AI-aided programming and collaborative software development

AI in teaching and learning Computational competencies Project-based education
AI-assisted scientific programming in python and use of Git to host projects, utilizing version control and synchronous collaboration.

The project

The project motivation was twofold; the first objective was to leverage the use of AI-assistants to empower participants in problem solving through the use of the Python programming language. This was achieved by teaching first the basics of the language, before moving on to using with AI assistants. A large focus was placed on responsible use of AI through a structured approach of problem breakdown, code testing, enforcing readability and documenting code. In addition, the project introduced the first ever AI-assisted programming exam at ETH. The second objective was to enable participants to collaborate on their research project and also make it reproducible and accessible through the Git platform. For the latter, the participants had to hand in a project at the end of the semester which was hosted on a Git platform.

My motivation stems primarily from the years of teaching to Earth Science students, who often have little to no programming background and struggle to get their codes running. In addition, I see in my own interactions with colleagues that we often lack as a community (or even as a larger community of scientists who are not seasoned computer scientists) to make our work readable, reproducible and reusable. My aim was to enable, through this course, participants to tackle and efficiently collaborate on real-world problems while making their work transparent and accessible.

Implementation into teaching practice

The project required hands-on experience and a dynamic classroom environment, that would foster learning in both directions; from the participants to the teachers and vice versa. With the help of two motivated teaching assistants, our aim was to create a classroom environment that allowed space for the students to question the use of AI and be critical about the output. Being flexible in teaching proved to be practically imperative when teaching the use of generative AI – in this case large language models that write Python code. The reason is because the outcome can be unpredictable, so it is important to focus on the process and how to evaluate the outcome, how to question the responses and test the results.
In practice, all this meant that we had a loose classroom setting where the “classical” teaching with content being delivered from slides was reduced to the bare minimum, and instead focus was placed on in-class exercises, demonstrations and mini-tasks. The participants were encouraged to engage, discuss with their classmates and teachers, question the tasks and output, and finally find their own way to arrive to the correct answer; which was often not the instructed path.
A large focus was placed on making code readable, both for future users but also for the practitioners themselves, who may often not fully understand the output from genAI. Testing was introduced as a way to evaluate whether the output was as expected, and the problems to be solved spanned a wide range of disciplines; from earth sciences to constructing several games, working with diverse open datasets from social or natural sciences, or even analysing books.
To foster the collaborative aspect of Git, the class ended with a semester project where the students could propose a topic and work in teams to create a Python-based solution for it. The projects were hosted in various Git platforms.

Lessons learned and further impacts

A first goal was to introduce genAI assistants for Python programming in a manner that enforces understanding of the generated code, and responsible evaluation of the outcome. This is clearly not an easy task, as the capabilities of genAI are increasing at a fast pace, while our understanding of their inner working (at least to lay people) remain limited. In this course we focused on methodological approaches to construct and evaluate the output of genAI, which proved to be a very interesting and challenging task. While the preparations for the teaching material begun almost a year prior to the semester, the continuously evolving nature of genAI tools required that the concepts and techniques were revised almost at a weekly basis, often the day before the lecture. Participants were engaged in the classroom and their feedback was taken to improve the following week. Feedback was also requested on the teaching style, which allowed us to shift from the classical (slide-based) approach to more engaging in-class problem solving sessions. This was done after the first few lectures, which also meant that most of the upcoming course content had to be restructured.
Constant feedback, either in the class directly or through anonymous feedback on Moodle, was pivotal to assess how the class advanced in “real-time”. In addition, the participants received 6 take-home assignments but they were motivated to “simply” try and solve them, give a self-assessment on their learning experience and also peer-review someone else’s assignment. The grade was given when these boxes were ticked, and not if the exercises were solved correctly. This was greatly appreciated by the participants.
Finally, the end-of-semester project fostered collaboration and integration of the knowledge acquired during the semester into a project; however, it is finally a better idea to start the semester project early on so that the students can get constant feedback on their work.
I believe that the teaching philosophy described above can be implemented in other contexts and in larger classrooms. It may prove challenging to have in-class feedback on very large classrooms, but digital tools may be useful in this direction. Finally, the current course (as is) is useful to a very broad audience at ETH and not just earth scientists. Actually, we had students from 9 different departments and 16 different degrees, which created a remarkable and enriching learning environment.