"Never in the field of software development was so much owed by so many to so few lines of code." Martin Fowler in reference to the JUnit Project.
The selective retesting of a software system that has been modified to ensure that any bugs have been fixed and that no other previously working functions have failed as a result of the reparations and that newly added features have not created problems with previous versions of the software. Also referred to as verification testing, regression testing is initiated after a programmer has attempted to fix a recognized problem or has added source code to a program that may have inadvertently introduced errors. It is a quality control measure to ensure that the newly modified code still complies with its specified requirements and that unmodified code has not been affected by the maintenance activity.
The great value of a paradigm in the study of a discipline like Computer Science at the high school level is the scope of it's transference. Few would or should study Computer Science at the high school level if the only payoff were to come in the event that one chose it for a career. At the high school level, there are still far too many generic experiences and skills to learn that will apply to a multitude of careers and lifestyles. It is always good to learn new knowledge, but it is even better if that new knowledge can be applied across a wide spectrum of disciplines.
Regression testing and its Java derivation, JUnit Testing, is one of the most important practices that a student can learn in Computer Science because the fruits of the paradigm transfer with profound impact across virtually every discipline and life experience there is. It really is that worthwhile to learn about regression testing!
Sociology's Hawthorne Effect: Every social scientist worth their salt knows that the results and reporting of an observation can be completely invalidated if the scientist themselves interacts with the population being studied. The most famous case of this is known as the Hawthorne Effect. In a research project (1927 - 1932) of the Hawthorne Plant of the Western Electric Company in Cicero, Illinois, researchers studied the physical and environmental influences of the workplace (e.g. brightness of lights, humidity) and later, moved into the psychological aspects (e.g. breaks, group pressure, working hours, managerial leadership). The major finding of the study was that almost regardless of the experimental manipulation employed, the production of the workers seemed to improve. One reasonable conclusion is that the workers were pleased to receive attention from the researchers who expressed an interest in them. - Clark, Donald (1999). Hawthorne Effect in Big Dog's HRD Page. Retrieved January 8, 2006.
The poor factory women of the Hawthorne Plant being studied had never received such great attention, and from prominent Harvard professors no less. Their work performance increased when working conditions decreased because, and this is our point, effects of the testing itself became part of the process that was being observed. Testing should be independent of the matter being tested!!Physics Heisenberg's Uncertainty Principle (HUP): In 1927 Werner Heisenberg stated, "The more precisely the position is determined, the less precisely the momentum is known in this instant, and vice versa." [The Uncertainty Principle]
The uncertainty principle applies to the simultaneous MEASUREMENT of a particle's (e.g. electron) position and momentum. A quantum ensemble does not act differently when we aren't looking at it. When we do look at it, however, we change the state of the system, and it is accordingly reflected in what we observe. We become part of the system we observe, so it isn't the same system anymore. - Uncertainty Principle. Retrieved January 8th, 2006, from Google Groups: sci.physics
Heisenberg's Uncertainty Principle is one of the most contentious principles in all of physics because it observes that we find the location of a particle by striking it with another particle without knowing the precise momentum of the other particle. By the time we learn the effects of striking the particle, we cannot know the location or momentum of that particle ... because the very act of stiking it caused it to move in an unknown direction at an unknown momentum, and the reason we can't know that is because we don't know the momentum of the particle that struck it in the first place. The very act of testing interferes with what we are testing. Testing should be independent of the matter being tested!!
Anthropology's Pacifist Hoax: Margaret Mead is one of the most famous anthropologists to have ever lived. Her work with natives of Samoa and the book which was based upon it became incredibly popular and is still read today. According to Mead, this was a society which was free of the repressions and burdens of 20th century industrial society - especially when it came to sex and love. [The Mountain Arapesh (1938)] This in turn gave people cause to reconsider the social rules they had always taken for granted.
Evidence later indicated that the natives of Samoa, in particular two young girls, simply fooled Mead by telling her outlandish stories. Derek Freeman published Margaret Mead and Samoa: The Making and Unmaking of an Anthropological Myth in 1983 where he argues exactly this - however, many in the field continue to assert either than Mead was not fooled or, if she was, it has no bearing on her ultimate conclusions. [About Margaret Mead]
Whether Mead was indeed fooled is something that anthropologists will debate for another century. The point is that she gathered her evidence by interacting with the people that she was studying. Since we have trouble reading minds in the twenty-first century, interviewing subjects in the nineteenth century was one of the most effective ways of knowing what the subjects were thinking - except that the subjects might say things because they are saying them to you rather than simply expressing the thoughts that they had before they knew that you existed! Testing should be independent of the matter being tested!!
Would the measures of workplace influences on employee production in the Hawthorne Study have been more accurate and thus valid had the employees been observed without their awareness that they were being observed? Would accurate measures of particle direction and momentum be possible if we didn't have to influence the direction and momentum of the observed particle by striking it with another particle? Would the correctness and accuracy of Mead's observations about the sexual behavior in Samoa have been more reliable had she observed that behavior without she, herself, becoming part of the focus for what her informants had to say to her? Testing should be independent of the matter being tested!!
It is precisely in this grand tradition of separating testing instruments from the subject matter being tested that we applaud the magnificence of JUnit Testing of Java source code. Here too, we see another great strength of OOP - the ability for a class to inherit (extend) another class means that we can test the the inherited (extended) testing class without affecting the class being observed!! Computer programming has its own tradition to describe the quality of this approach. It is called elegance!
JUnit Testing is simple. Extend the class being tested. Use a setup( ) method to create objects of the testing class. Generate boolean statements (assert statements) for all non-trivial methods that evaluate to true when a method works and false when a method does not work. Couple each boolean statement with a clearly articulated error message that precisely describes what is wrong when a boolean assert statement fails. Use a tearDown( ) method to release the objects back to the operating system (obj = null;) after the tests are run. That's it in a nutshell. Only the testing instrument is affected. There are no side effects to the class being tested because observations of the correctness of that class are made completely independently of that class! Testing should be independent of the matter being tested!!