class: title # Testing and Debugging ## CSC 161 – February 26, 2026 --- # Agenda for Today 1. Quiz 2. Upcoming Work 3. Discussion 4. Lab 5. Wrap Up --- class: section green # Quiz --- class: section blue # Upcoming Work --- # Homework: Connect Four **Due:** Thursday, February 26th ## Questions _None so far_ If you need to work on the assignment from off campus you can access a MathLAN session by going to
. --- # Exam 1 In class on Thursday, March 5th ## Policies - You will have the full 110min class period to take the exam. - I will provide scratch paper and a scientific calculator. - You can bring a two-sided 8.5x11" sheet of *hand written* notes. - You may not use any other resources on the exam. --- # Exam 1 Topics The exam will cover material through week six. Topics may include: .left-col[ - Variables and Types - C Statements and Expressions - Loops - Conditionals - Functions - Pointers - Arrays - Strings ] .right-col[ - Structs - Enums - Unsigned Binary Integers - Two's Complement Binary Integers - Floating Point Representation - Multifile Projects - Makefiles - Debugging and Testing ] --- class: section blue # Discussion --- # Discussion: Testing and Debugging **Items for think, pair, share:** 1. What does `assert` do in C, and how can it help us test our programs? 2. Can we prove a program is free from bugs by testing it? Why or why not? 3. What are pre- and post-conditions, and how can they help us as programmers? 4. What is one thing `gdb` can do that would be helpful for finding and fixing bugs in your code? Describe a situation where you think it will help. --- class: section blue # Lab --- class: section blue # Wrap Up --- # Wrap Up ## Lab Work Write your explanations of the two bugs from today's lab in a file named `debugging.txt` and include this file with your lab report. Your responses should summarize your findings from exercises A.2 and B.2 on the lab. ## Exam Review We will spend the entire class period next Tuesday reviewing and preparing for the first exam. Think about whether there are any specific topics you'd like to revisit and come prepared with questions. ## Reading *No reading for the next class.*