
Last weekend I spent some time helping my 13 year old son with his math homework. He had to simplify/rewrite some expressions such as:
This is how he solved it at first:
So, being the teacher that I am, I taught him to do it like this:
That made him think and he resolved to start writing his sums like this:
And that made me think. The answer was correct. All the steps involved too. But I smelled something bad in this solution. Originally when he was learning these sums, my son wrote the long version of his sums but after a while dropped the habit because he found out he could do without. He then wasn’t able to find errors and correct them, so I told him to write the extra steps which made him assume that more steps were better and that more steps would please me and his teacher.
This morning I discussed Test Driven Development with my colleague Paul and we talked about TDD adoption by developers. Many times developers start out well-motivated and writing tests first but as soon as pressure, deadlines and boredom show up they drop the habit and write their tests afterwards to satisfy coverage requirements. Like my son they make a capital mistake.
The extra steps and Test First are not to satisfy the teacher or coverage requirements! They are there to help you think and solve a problem in a controlled way. Writing tests is not a “nice to have”, an extra; it is the way to solve a problem. The coverage requirement and the math teacher are not interested in those lines. All they want is to guide you into a correct, effective way of solving a problem.
5 comments
You’re a better teacher than I had at 13. She really did demand that we write down all the intermediate steps on a test, and would routinely take off points for not doing so in sufficient detail, even when the answer was correct. I remember being frustrated in cases where the question was simple enough that it was easy to see the answer intuitively and verify its correctness, but I then had to come up with some artificial intermediate steps in order to satisfy the teacher.
Of course, she probably had her reasons. Cheating is an obvious one: it’s easier to sneak a peek at a single number than to inconspicuously copy several lines of equations from the person next to you. And maybe in some cases she was satisfied that student X had come up with his answers honestly, but she felt a moral duty to penalise him anyway in order to be fair to student Y, who she was not so sure about.
Hmm, perhaps the old joke “don’t let school get in the way of your education” holds deeper truths than I thought..
(By the way, although test-first development is generally best, writing coverage tests afterwards is still a lot better than not writing them at all. If you do it that way, you will miss some of their benefits, but they will still serve as regression tests in case you break something later while working on something else.)
Martin Wolf
I’d rather reward the good than punnish the bad because tracking the bad is not very motivating for both teacher and student. However, it seems that most students start with being motivated by getting praise from their teacher. It is the teachers job to move this postive stimulus to the satisfaction a student should get from solving the problem. Not all students get there at the same time (some never do) but that is one of the main tasks of a teacher because in real life there is no teacher and problems hardly ever are as cleanly stated as in the textbooks and there will be no teacher but yourself.
Teachers who are focused on (in their eyes) the correct behavior will, in reality, be distracted by it. Writing all the lines, writing unit tests, meeting coverage requirements are NEVER a goal in themselves they are a means towards an end. The student should really learn what ends and when the means are useful.
Yes, some coverage (added later) is always better than non at all. It is too hard to do any solid refactoring without these.
Erno de Weerd
Another option would be like: http://xkcd.com/759/
which is the also the same as programmers do 😛
Rolf Huisman
Rolf, unfortunatly this only works for the product of a number and its square.. LOL
Erno de Weerd
This post makes it clear my math skills have dwindled. Sigh!
Wouter