For Programmers: Free Programming Magazines  


Home > Archive > Software Engineering > October 2006 > When to introduce unit test in a teaching environment?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author When to introduce unit test in a teaching environment?
Roy Smith

2006-10-14, 9:59 pm

I just got back from helping my neighbor's kid with his homework. He's in
his first semester of a Masters in CS and is just learning Java. I'm not
sure how much programming experience he had before this; his undergrad work
was an EE program in his native Damascus.

He's set up with a Windows laptop, Java, and Eclipse. The homework
assignment was the classic 8-queens problem. We poked around a bit and I
couldn't see what was wrong. My first thought was we should be writing
unit tests, so I asked him if he had J-unit, to which he replied that he
didn't know what that was.

Which finally brings me to my question. Where in a typical CS curriculum
these days do they start to introduce the concept of unit tests and tools
like J-unit?

Based on what I see with most of the fresh-out-of-school programmers we
hire in my shop, I'm guessing that most CS programs really don't go into
unit testing much, if at all. Most of them seem to have at least heard of
the concept, but it doesn't seem to be ingrained as a core part of their
software development habits.
Phlip

2006-10-15, 7:05 pm

Roy Smith wrote:

> Which finally brings me to my question. Where in a typical CS curriculum
> these days do they start to introduce the concept of unit tests and tools
> like J-unit?


Ralph Johnson, at the University of Illinois IIRC, starts all his freshman
classes on XP.

--
Phlip
[url]http://www.greencheese.us/ZLand[/url] <-- NOT a blog!!!


maros.vranec@gmail.com

2006-10-16, 7:59 am

Roy Smith wrote:
> Which finally brings me to my question. Where in a typical CS curriculum
> these days do they start to introduce the concept of unit tests and tools
> like J-unit?


I study at Charles University in Prague. We are taught the software
engineering after we know how to program. So the unit-tests will
usually come in 7th semester or later.

H. S. Lahman

2006-10-16, 9:59 pm

Responding to Smith...

> Which finally brings me to my question. Where in a typical CS curriculum
> these days do they start to introduce the concept of unit tests and tools
> like J-unit?


In the US, most don't. Only schools that deal with software development
as a process will teach that sort of stuff. Schools in the US tend to
be emphasize IT and current technologies rather than basic software
development. OTOH, schools in Europe, India, and the Far East tend to
emphasize process a lot more.

[FWIW, I noticed that trend several years ago and <informally> verified
it with an experiment that could easily be duplicated today. Look at a
few issues of refereed journals. Divide the articles roughly into
process articles and technology articles. Then look at where the
authors come from. If an article is on multiprocessor algorithms or
SOA, the authors are probably based in US universities. If an article
is on defect prevention or requirements traceability, the authors are
probably at non-US universities. (Obviously there is overlap, but the
relative biases are enough to still show up in smallish samples.)]

Why that is so is pure speculation at this point, but I think it is due
to relative maturity. The US CS departments are usually older and they
tend to be moribund. (At my alma mater CS is still taught in the EE
department!) A lot of CS departments elsewhere were founded in the late
'80s and the early '90s, so they started with a clean slate. They also
followed the profound paradigm shift of the '70s in manufacturing and
learned from that. IOW, I don't think it is an issue of international
boundaries; I think it is an issue of older vs. younger CS departments
and the US just has more older departments.

[Ironically, the older CS departments that are upgrading and do
currently teach testing as a basic part of software development are
already behind because they are adopting to the wrong paradigm. They
are teaching testing as a tool to directly improve product reliability,
which was a classic pre-'70s notion. Meanwhile the new CS departments
are teaching defect prevention where testing is just used as a process
monitoring tool because they learned from the manufacturing paradigm
shift in the '70s. IOW, the older CS departments are busily evolving
from Neanderthal to Cro-Magnon while the new CS departments from the
late '80s went directly to Modern.]


*************
There is nothing wrong with me that could
not be cured by a capful of Drano.

H. S. Lahman
hsl@pathfindermda.com
Pathfinder Solutions
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
"Model-Based Translation: The Next Step in Agile Development". Email
info@pathfindermda.com for your copy.
Pathfinder is hiring:
http://www.pathfindermda.com/about_us/careers_pos3.php.
(888)OOA-PATH



Phlip

2006-10-16, 9:59 pm

maros.vranec wrote:

> I study at Charles University in Prague. We are taught the software
> engineering after we know how to program. So the unit-tests will
> usually come in 7th semester or later.


There's unit tests and then there's unit tests.

Tools like JUnit, and simple test cases, should be taught on day one. Before
debugging. Maybe debugging should wait a few semesters!

--
Phlip
[url]http://www.greencheese.us/ZLand[/url] <-- NOT a blog!!!


maros.vranec@gmail.com

2006-10-16, 9:59 pm

Phlip wrote:
> Tools like JUnit, and simple test cases, should be taught on day one. Before
> debugging. Maybe debugging should wait a few semesters!


I agree that unit tests should be taught before or along with
debugging. But there is day one and day one. My school makes no
assumptions on students' technical knowledge, so we must first learn to
program, then other things. I couldn't enjoy learning tools like JUnit
before I know (simple) Java. Maybe colleges in your country assume you
know Java or something else before you start.

Phlip

2006-10-16, 9:59 pm

maros.vranec wrote:

> I agree that unit tests should be taught before or along with
> debugging. But there is day one and day one. My school makes no
> assumptions on students' technical knowledge, so we must first learn to
> program, then other things. I couldn't enjoy learning tools like JUnit
> before I know (simple) Java. Maybe colleges in your country assume you
> know Java or something else before you start.


assert_equal("hello world", myFirstFunction());

We ought to envision a mild paradigm shift on even how we write tutorials.

If 66% of TDD users' source code is generally test-side, then it stands to
reason that 66% of each tutorial should speak of tests, 66% of the sample
code with our compilers should be tests, 66% of all posts on USENET should
be about tests, etc.

--
Phlip
[url]http://www.greencheese.us/ZLand[/url] <-- NOT a blog!!!


Bjorn Reese

2006-10-17, 9:59 pm

Phlip wrote:

> If 66% of TDD users' source code is generally test-side, then it stands to
> reason that 66% of each tutorial should speak of tests, 66% of the sample
> code with our compilers should be tests, 66% of all posts on USENET should
> be about tests, etc.


66% of all posts from TDD users...

Can we take the above as your commitment to come down to the 66% mark?
:)

--
mail1dotstofanetdotdk
Phlip

2006-10-17, 9:59 pm

Bjorn Reese wrote:

> Can we take the above as your commitment to come down to the 66% mark?
> :)


I'm heroically making up the difference.

--
Phlip
[url]http://www.greencheese.us/ZLand[/url] <-- NOT a blog!!!


Paul E. Black

2006-10-17, 9:59 pm

On Monday 16 October 2006 19:58, Phlip wrote:
> If 66% of TDD users' source code is generally test-side, then it stands to
> reason that 66% of each tutorial should speak of tests, 66% of the sample
> code with our compilers should be tests, 66% of all posts on USENET should
> be about tests, etc.


Naw. I spend about 1/3 of my time sleeping, but school never taught
such subjects.

Seriously, we teach (roughly) according to the (mental?) size of the
concepts, not according to how much they are used. Parallel parking
in learning to drive. Writing. (Now I write FAR more than I program,
but I think I should have taken only a little more writing in school.)

There's probably a Zipf's law or Praeto principle in there somewhere ...
http://www.nist.gov/dads/HTML/zipfslaw.html

-paul-
--
Paul E. Black (p.black@acm.org)
Phlip

2006-10-17, 9:59 pm

Paul E. Black wrote:

> There's probably a Zipf's law or Praeto principle in there somewhere ...
> http://www.nist.gov/dads/HTML/zipfslaw.html


Ooh! He quoted both Zipf and Pareto at me! I am belittled by my own logic! I
can feel myself shrinking along an axiomatic slope!!

--
Phlip
[url]http://www.greencheese.us/ZLand[/url] <-- NOT a blog!!!


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com