Hacker News new | past | comments | ask | show | jobs | submit login

Giggle. How things evolve. "Unit Testing" came out of the Smalltalk work around 1997. I was there.

It was Kent Becks brain child. The first NUnit framework was SUnit.

What was a unit? Kent was never absolute about this, I always felt because as a consultant he wanted to peddle the theory far and wide. But the early examples all had a pretty strong trend towards "a unit is an object." Nowaday "what is an object" is pretty loose; I just finished some Dart tutorials where an object is a way of "organizing our code into smaller reusable pieces" which ironically, I did in Fortran77 with common blocks and well factored files. But in the Smalltalk world, which was "objects all the way down", an object was small amounts of imperative behavior bound to data, where computational results were achieved via an approximation of the way cellular biology solves problems: lots of little glumps of data that achieve a larger result by sending messages to each other.

This process of turning behavior and algorithms into things, or reification, was sometimes easy and sometimes hard. An object for Point, obvious. An object for SortCollationPolicy, less so.

What Unit Tests did was help programmers design good objects. Beck said this in eXtreme Programming eXplained. He said that traditional QA departments would laugh themselves silly at what unit tests did. But that the value was that it drove good design. And that in a collaborative (pair programming) environment, it helped communicate the design intents around objects to fellow developers. I did the Smalltalk koolaid fest for 20 years. I found Unit Testing to be immensely effective. It made my designs more cellular again and again. When my designs were solid, I had less bugs.

As a mechanical engineer, I still see similarities between unit tests and geometric dimensioning and tolerancing, a practice in the mechanical world that also swam against the current of conventional testing practices and left some shaking their head.

In todays world where OO design is more of a "small unit of organization" I'm not surprised that unit testing also seems meh.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: