Thursday, March 20, 2008

The Logical Positivists were Test-Infected
(Is that a good thing?)

While reading Looking at Philosophy[1], I came across the section about Logical Positivists[2] whom I immediately recognized as "test infected"[3]! The Logical Positivists (circa 1910s-1930s) promoted the idea British philosopher, A. J. Ayer, named "the principle of verification"[8][9] i.e. "the meaning of a proposition is its method of verification". In other words, a statement is meaningless if it can't be objectively tested. This is the same big idea of Test Driven Development[5] and more specifically Test Driven Specifications[6] (aka Test Driven Requirements[7]); namely, don't create a requirement (or interface definition) that is so vague, subjective, or contradictory that an automated computer program can't be written to test for compliance.

In other words, all that verbage[12] that usually passes for a specification/requirements document is really just commentary to the REAL specification which is encoded in a comprehensive compliance test suite. [BTW, this isn't just a software concept since IC chips have long had not only "testbed" circuit boards to test chips, but also ICE (in circuit emulators) to test circuit boards via simulated chips (which software copied with "mock objects").]

The goal of both Logical Positivists and test-driven engineers is to weed out statements that are so poorly conceived and worded as to be effectively meaningless. The way to ensure this is to submit each statement to this rigorous method and rework any statements that come up short.

What did Logical Positivists have to say about "how" to do tests?

My whole excitement about finding philosophy movements that parallel aspects of software engineering is the notion that "top men"[11] have already thought and argued long & hard about this stuff, and therefore we programmers can benefit from what they've already learned the hard way. So, what method did they advocate? Basically, it is the idea that all statements should be broken down into "protocol sentences" plus logical conclusions built on top of them. Protocol Sentences were to be simply observation reports (based on first hand direct sensory experience). This was ultimately unworkable for humans, but everything in a computer test is based on its first hand direct sensory experience (of electrical signals anyway).

Karl Popper, among the most influential philosophers of science of the 20th century, said that claims could only be considered "scientific" if they were falsifiable, meaning that there should be some observation or experiment specified that, if it were verified, would prove the claim false.

Logical Positivists claimed that unverifiable statements were LITERALLY meaningless, and therefore they dismissed entire disciplines like metaphysics, morality, and ethics. Other, more moderate philosophers held that untestable propositions were merely unproductive to work with. Popper claimed that his demand for falsifiability was not meant as a theory of meaning, but rather as a methodological norm for the sciences.

Uh oh, Logical Positivism was considered a failure...Will Test Driven be too?!

I was all happy about a philosophical foundation to being test driven (since I was test infected years ago), until I got to the part where Logical Positivism has been so devalued by other philosophers that one wrote "Logical positivism is one of the very few philosophical positions which can be easily shown to be dead wrong, and that is its principle claim to fame."[10] OUCH!

By saying that so-called metaphysical claims were meaningless, they unwittingly said that the very claim "metaphysical claims are meaningless" was itself meaningless! I.E. there was no way to prove the statement that "only provable statements had meaning".

Lessons for the Test Driven Approach

Luckily, Logical Positivism was only an extreme position in the spectrum of ideas under the Verificationism[4] umbrella. In the conclusion of "Verificationism: Its History and Prospects"[8], some points were noted...
  • one can't reduce every statement to be a logically equivalent statement about sensory experiences. (i.e. not every thought comes under the umbrella of "natural science")
  • one can say that "a statement lacks legitimacy or objectivity if there would be no evidence for or against it; if it is insulated from reason, where reason is linked to the possibility of public evidence for or against the statement from other, already established statements"
  • one must admit that some more abstract statements are understandable even if not testable.
So, the bottom line seems to be that the Test Driven approach is a good one if you...
  1. concentrate on testing what can be tested, 
  2. create tests that would actively prove statements to be false, and 
  3. know that you probably can't prove (with tests) that the test driven approach itself is correct.

[1] Looking at Philosophy, Donald Palmer, 4th Ed. 2005

[2] ibid, pg 327

[6] Acceptance Tests and the Test Driven Specification

[7] Test Driven Development or Test Driven Requirements?

[8] Verificationism: Its History and Prospects, C. J. Misak, 1995

[9] Language, Truth and Logic, Alfred Jules Ayer, 1952

[10] Prolegomena to Philosophy, Jon Wheatley, 1970

[11] "top men", Raiders of the Lost Arc

[12] verbage vs verbiage

Tuesday, March 11, 2008

Scott is Scott

While reading Looking at Philosophy[1], I came across its discussion of Bertrand Russell's Theory of Descriptions[2]. It was a proposed solution to several problems that occur when logic propositions are made about an entity's existence or identity. One of the problems being solved was that a statement like "Scott is the author of the novel Waverley", if it is true, reduces to the statement "Scott is Scott". This is because in traditional logic, two terms that denote the same object can be interchanged without affecting the meaning or truth of a statement. But since "Scott is Scott" doesn't seem to be equivalent to "Scott is the author of Waverley", Russell proposed that a better way to state the latter was using the template:

There is an entity C, such that the sentence "X is Y" is true, iff X=C.

This would produce the sentence "There is an entity C, such that "X wrote Waverley" is true, if and only if X=C; moreover, C is Scott". What Russell was getting at was that there was a problem with the traditional view that a definite description could be exchanged with a proper name. A phrase describing something (e.g. "the author of Waverley") means something different than a name (e.g. Scott) because while it is true that "George IV wanted to know if Scott was the author of Waverley", it is false that "George IV wanted to know if Scott was Scott". Russell's template solved this problem along with others like making claims about non-existent things. E.G. "The present king of France is bald" is problematic because there is no present king of France. If it were considered false then "The present king of France is not bald" would have to be considered true. This is avoided by saying instead: There is an entity C, such that the sentence 'X is French, bald, and kingly' is true iff X=C. THAT statement is false (because there is no entity that fits that description), and its opposite is true (i.e. There is NOT an entity...).

[1] pg 322, "Looking At Philosophy: The Unbearable Heaviness of Philosophy Made Lighter", 2005, Palmer
[2] Existence and Description, Bertrand Russell from "Metaphysics: an anthology" by Jaegwon Kim, Ernest Sosa - 1999