Color Code

The framework annotates HtmlTables to indicate test results. The most visible annotation is the addition of a background color to tested cells. Colors follow the traffic light metaphor ...

  • Red -- Stop -- Results are known to disagree with expectation.
  • Yellow -- Caution -- Can't get results so we don't know if they agree.
  • Green -- Go -- Results agree so we are ready to proceed.

This is a transportation metaphor. It works. That is to say it yields useful implications. It works because we think of code moving and we think of tests as a signal that code can safely move to across the street to the next group that will depend on it..

Developers' attentions also move. Red means stop for them too. The transportation metaphor applies at this level too. In fact, a motivation of this particular framework is to make the traffic signal visible from before the crossing.

The framework uses gray as both a background and a foreground color.

  • Gray Background -- Value ignored.
  • Gray Foreground -- Generated value.

The gray background is an annotation just like red, yellow and green. When a fixture knows that it should be testing a cell, but the test is not possible, the cell is marked gray and the ignored value counted. Cells may be ignored because the fixture is incomplete. In this case the gray background is the developer's way of saying: this cell under construction. Often cells are ignored because of exceptions nearby. Exceptions can lead to cells being ignored without the fixture "knowing it" and therefor without the cells being annotated or the circumstances counted.

The gray forground (that is, gray text) indicates table contents that has been generated in the course of running a fixture. It is not possible to edit this text because it does not exist in the original document.

The choice of red and green for traffic light colors is unfortunate considering the number of red-green colorblind in the population. It is important that color not be the only code for success or failure in our reports. (Failure includes modification of the text of a cell also.) But is is possible that some adjustment of shades will make the color coding useable by even the colorblind. Compare this test report with one processed to appear to the fully sighted as it might to the colorblind.

In the new input code there is a class CellStatus that indicates the state of a cell without specifying the color. The HtmlCell is responsable for turning this CellStatus into some usefull visual representation. In the new input code Fixturs will have no concept of color, just CellStatus. We could use the 'class' attribute in HTML to show the status of the cell and then use CSS to color the results. This would allow colorblind individuals to change the CSS to a high contrast scheme. -- GarethFarrington


Last edited November 16, 2002
Return to WelcomeVisitors