27
$\begingroup$

In university, I was a student in an operating systems programming course in C. Assignment help was offered in tutorials. Students would usually present the tutor(s) with run-time errors and an enormous amount of code. The tutors took 20 minutes to figure out the mess and offer help. In a 50 minute class of 30, most students went neglected, while some scored private tuition. Assignments were large and students were forbidden to view each other's code.

This was a serious problem. What could teaching staff do to address this?

$\endgroup$
8
  • 4
    $\begingroup$ Choose a different programming language next time. It's an intrinsic characteristic of programming in C that you spend a lot of time debugging run-time errors; and the only thing you learn from this is how to debug C programs. $\endgroup$ Commented Sep 7, 2017 at 22:42
  • 6
    $\begingroup$ @MichaelKay I really don't think a language other than C or C++ would work for an operating systems programming course (C seems best for this particular kind of class)... And often you don't have a choice of which language to use for a particular class (others make that choice for you) $\endgroup$
    – mgarey
    Commented Sep 8, 2017 at 17:46
  • $\begingroup$ Does that mean you are still teaching 1960s operating systems? $\endgroup$ Commented Sep 8, 2017 at 22:44
  • $\begingroup$ @MichaelKay Did somebody hack your account? What is this nonsense comment? C didn't exist in the 1960s and what language do you think modern operating systems are written in? (Hint: letter after B). $\endgroup$
    – Oleg
    Commented Sep 10, 2017 at 0:14
  • 2
    $\begingroup$ I'm just really expressing frustration that operating systems practice has advanced so little since 1970. I spent the 70s/80s working with an operating system (ICL's VME) written in an Algol-68 derivative; programming in C is a big step backwards, and it's disappointing to see that teaching of operating systems is still bogged down in unnecessary low-level stuff like that. $\endgroup$ Commented Sep 10, 2017 at 8:26

7 Answers 7

38
$\begingroup$

The problem, in my view, is a misplaced assumption that students should never see one another's code and that seeing it would somehow or other "pollute" the student's mind in some way or make grading invalid.

A clear solution, provided that you can give up that assumption, is to have the students work in pairs in the tutorial, giving help and advice to one another. A more radical approach, that I also favor, is to have students work together to develop the code in the first place.

It has been observed (I have seen the video) that when students work together they seldom need outside help and call for tutor help only rarely. When students work alone and wait for the tutor they are mostly idle while waiting.

The reason for this is that, while both students in a pair may have problems, they seldom have the same problems and so can support one another's learning. When a tutor's help is needed, there has already been a deeper analysis of the issue at hand, since there were two minds working on it.

If you worry less about grading, and less about some students "slacking" you can do a better job overall, especially for those who are interested in learning. Students can learn from one another. It isn't essential that they learn only from the instructor.


My experience, also, is that when a "better" student helps another, both benefit from the experience. The helper gains deeper insight by having to verbalize an understanding that may be only partly formed.

When abrasive personalities get in the way of pairing, the one that is abrasive needs to learn better behavior in any case if he/she is to be successful in the long run. Instructors need to watch for this, of course, and offer advice as needed.

$\endgroup$
2
  • 13
    $\begingroup$ One extra benefit of having "better" students help another is that sometimes the "better" students are tempted to skip through exercises quickly because they "already know it". They complete the tasks, but don't learn the lesson fully. By helping someone else work through it, they accidentally work through the exercise fully and may learn more. $\endgroup$ Commented Sep 7, 2017 at 21:05
  • $\begingroup$ I had a few undergraduate courses in which we were asked to pick a partner with whom we would pair-program throughout the semester. I found pair-programming to be an extremely effective and helpful for both my own learning and getting projects done. Note that this was actually pair-programming - sitting at a single computer at the same time - not splitting up tasks. (I had many more classes that I programmed by myself, but I came to love pair-programming.) $\endgroup$
    – mgarey
    Commented Sep 8, 2017 at 17:43
20
$\begingroup$

Smaller Chunks: Students should be working in smaller chunks of code.

  • They need to write as small a chunk as possible (one function or even one line of code), then compile, run, and test that. This process should be introduced as early as possible and enforced as much as possible- for the sake of the sanity of everybody involved.

  • Students should not be writing an entire application or feature and then having no idea why something isn't working, or why a runtime error is occuring. This is a common pitfall for novices, and it's a habit they need to be broken of as soon as possible.

Debugging: Students should be debugging their code before asking questions.

  • When they encounter an error, their first instinct should be to debug their program to get more info about what's going on. Have you taught them how to read a stack trace? How to trace through code with a piece of paper and a pencil? How to use a debugger?

  • The goal of debugging is to narrow the problem down to a single line of code, or as few lines of code as possible, that are exhibiting an unexpected behavior. "I tried X, expected Y, but got Z instead" is a much easier question than "this isn't working".

  • Debugging is much easier if they're already working in small chunks of code!

Isolating: Students should be isolating their problems into smaller example programs.

  • Now that they have the problem narrowed down to as few lines as possible, if they still can't figure it out, then they should be isolating the problem in its own standalone program. This involves starting over with a blank program and only copying over the lines of code that are directly related to the problem.

  • Stack Overflow calls this a Minimal, Complete, and Verifiable example. Other places call it a Short, Self Contained, Correct (Compilable), Example. Sending out these links to students might help, but the idea is that they should be coming to the teacher with an isolated example problem, not their whole project.

  • This is a much easier process if they're working in smaller chunks and debugging their code!

  • This also prepares them for real life, where they'll have to formulate questions for their coworkers, and for Stack Overflow or other online forums.

For example, if a student has written their whole project without testing it, and wants to know why something isn't working, then the answer could be that they need to start over and only add a few lines of code at a time, so they can test it in small chunks like they should have from the beginning. Or if a student wants to know why a function isn't working, then the answer might be to ask them which line of code is behaving differently than what they expected. If they don't know, then it's time for the student to break out the debugger to narrow it down.

It's up to the teacher how strict they want to be about the above rules, but at a bare minimum, teachers should spend some time really explaining the first two points. Coming with a "question" about 100 lines of code that you haven't debugged at all is a non-starter.

$\endgroup$
3
  • 2
    $\begingroup$ Note: those advices also apply to professionals. $\endgroup$ Commented Sep 8, 2017 at 13:55
  • $\begingroup$ And when are they supposed to learn it? $\endgroup$ Commented Sep 8, 2017 at 16:21
  • 3
    $\begingroup$ @ThorbjørnRavnAndersen Like I said in my answer, they should be learning this as early as possible. It should be introduced in their first programming course. If it's not, then spending a class at the beginning going over these expectations would help. $\endgroup$ Commented Sep 8, 2017 at 16:28
6
$\begingroup$

It sounds like the students were not really ready for these assignments in the first place. If students are coming with runtime errors (instead of logic errors), then they are not testing their code well as they write. Helping students debug their code is a band-aid on the larger problem that the students do not know how to organize and test their code.

My first choice would be for the professor to offer an emergency session on some basic Software Engineering practices, ideally before the assignment has even begun.

However, if I were in the position of the TAs (and could not modify the assignment), then I would consider the situation a mini crisis, and I would have to act as a First Responder. I would send out an email to this effect:

Dear class,

We have noticed that many students are having trouble with the latest assignment and have been asking for help. That's okay! That's what we're here for.

However, much of the code that we have been seeing has been poorly organized, and as a result, it has become impossible for us to help everyone in a timely manner. In order to help us fix our timing problem (and, honestly, to help you fix your code before you even need to come to us) please make sure that you have placed a comments on the top of each method in your code that contains the following:

  1. A short description of what the method is meant to do.
  2. A list of all of the test cases you have tried for this method, and an indication of the results returned.

Doing this will help you spot your own errors, and will make it substantially faster for us to help you in case you are still stuck.

Thanks,

The TA Team

$\endgroup$
3
  • $\begingroup$ May want to grab a copy of and de-profanitize ESR's "How to ask questions the smart way". catb.org/esr/faqs/smart-questions.html $\endgroup$
    – ivanivan
    Commented Apr 29, 2018 at 14:27
  • $\begingroup$ @ivanivan What, now? $\endgroup$
    – Ben I.
    Commented Apr 29, 2018 at 16:09
  • 2
    $\begingroup$ ESR has this nice document on how to ask good questions in online help, how to get help for technical issues in general, etc. Well worth reading. He does use some offensive language, so I have a copy I tell my students to read with some slight wording changes (ie, RTFM becomes Read The Fine Manual). $\endgroup$
    – ivanivan
    Commented Apr 29, 2018 at 16:13
4
$\begingroup$

As @buffy @BenI said. In addition:

  • Allocate shorter time slots.
  • Have names in a queue on a white board.
  • Students can move up the queue if they help someone else that is in the queue (take there place).
  • Have an entry criteria:
    • Able to state:
      • what you are trying to do
      • what you expected
      • what the inputs are
      • what went wrong
    • Code uses good name, and is easy to read. ( Better names are better than better comments. But comments where necessary.)
    • Have them code one thing at a time, and test it: test first.
    • Have them use revision control, and be able to answer “What has changed since the last time it worked?”
    • Stop the class for an emergency mini lesson, if you see several of the same problem.

You may use your time to help them meet entry criteria, or hand them to a minion, or give them a handout. However you will only do this, and not deal with the problem, in this time slot. They must re-join the queue.

$\endgroup$
3
  • $\begingroup$ I agree with variable names, but what I was after was a way to survey the test cases that the function has passed. This is the fastest way that I am aware of to spot errors in student code $\endgroup$
    – Ben I.
    Commented Sep 7, 2017 at 17:21
  • $\begingroup$ @BenI that is similar to contracts (pre/post conditions, and invariants). As most languages don't support these (well), then comments can be used for this. And test cases (as I just re-read in your answer) is like but better that “What you expected, and what went wrong”. $\endgroup$ Commented Sep 7, 2017 at 17:26
  • $\begingroup$ I like to promote the idea of test before code. xUnit testing frameworks are free, and they encourage strong formalization of requirements $\endgroup$
    – pojo-guy
    Commented Apr 3, 2018 at 11:34
3
$\begingroup$

The others answers are very good.

I'd like to add to them some practical advice for the tutors.

Raise the standards of what an acceptable questions is. Much like over on Stack Overflow.

If a student presents an error along 500 lines of code that might or might not be the cause they should be told to look for the line of code where the error occurred and ask again, if at that point they still don't understand the nature of the error.

Most will find a solution to the problem on their own this way.

This however would require the students to learn some basic debugging skills. So instead of helping 3 out of 30 students untangling their code, teach all of them basic debugging skills on examples.

It would also require some discipline on the tutor's part, to ignore too broad questions, along with the proper advice to isolate the error.

$\endgroup$
3
  • 2
    $\begingroup$ "teach all of them basic debugging skills" this should be more heavily emphasized in classrooms then it is typically since much programming in the real world is actually debugging code not writing it. $\endgroup$ Commented Sep 8, 2017 at 15:23
  • $\begingroup$ Relevant article that I'm going to keep posting whenever relevant until all programmers everywhere are able debuggers ;) is The Fundamental Philosophy of Debugging. $\endgroup$
    – Wildcard
    Commented Sep 9, 2017 at 3:29
  • $\begingroup$ A dupe of my comment above, but relevant for asking questions the right way - ESR's "How to ask questions the smart way" - catb.org/esr/faqs/smart-questions.html $\endgroup$
    – ivanivan
    Commented Apr 29, 2018 at 14:28
2
$\begingroup$

The tutors took 20 minutes to figure out the mess and offer help. In a 50 minute class of 30, most students went neglected, while some scored private tuition. Assignments were large and students were forbidden to view each other's code. This was a serious problem. What could teaching staff do to address this?

You've inherited the mess that no one else wanted to bother with, and you're stuck with students that don't know how to perform basic debugging and self-testing.

So you can either work on teaching them basic debugging skills, or work with the hands you have available. I would say the choice heavily depends on the students you're working with. You might end up with a class full of people who don't know jack about debugging, or vice versa; YMMV.

You'll anger some of your more advanced students if you spend a day going over just debugging, but if you do it in a way to where your lesson of the day focuses on debugging a kind of obscure issue(s) where error messages prove less helpful, you can show students how to perform basic debugging skills where the error messages aren't the reliable source of truth, forcing you to go line-by-line for in-depth analysis, and likely doing things like cross-referencing documentation.

Do this with class participation and maybe even introduce things as low-level as memory-inspection and traversal, and you'll be surprised how many debugging issues your students will start squashing on their own.

Their co-workers later in life will thank you in-spirit, even if they don't know you :)

ps: If you're in charge of when assignments are due, shoot for either EOD or first thing in the morning, just like work would be. Coding classes that require students to learn a concept and flawlessly code it and turn it in with limited/no help is pretty, um... poorly thought out, especially given the question's original scenario. The only time you're pushing out code that quickly IRL is for emergency hotfixes, which isn't something your school should be expecting as the typical MO for handling assignments.

$\endgroup$
2
$\begingroup$

You should consider "Pair Programming". I know many answers above does talk about working in pairs but the details are important: "Pair programming" has rules of how to do it and is used in the industry and in education.

This article from Khan Academy is a good starting point on how to implement pair programming in the class room

I used to have the same issue as you and pair programming definitely improved the situation significantly. The key to success however is to follow the rules. a) They have to switch at given time b) They have to use one computer c) It is a good idea to have random paining beginning of each class.

When I teach I usually have 35+ students in a lab, when I applied pair programming I was able to assist them better especially when adding the random pairing. They explain to each other and you only end-up needing to help a pair who is stuck.

Funny that this also has proved better than having a lab assistant (if s/he is not my previous student) since in some cases I (and the students) end-up teaching the assistant instead :-)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.