Entries from April 1, 2010 - April 30, 2010

Sunday
Apr112010

First Hoverfly of the Year

My first hoverfly of 2010: a male Syrphus sp (Diptera: Syrphidae).  Either Syrphus ribesii or Syrphus vitripennis, for males it is not easy to distinguish between these two species.

Photo taken in the Wilderness, Whiteknights Park, Reading University grounds, Reading, UK, on 2010-04-09.

Saturday
Apr102010

Bee Flies

Yesterday morning I was on my regular foray through the Wilderness looking for fungi and slime moulds, when I noticed several largish flies buzzing around in a sunny clearing between the trees.  Occasionally they would settle on a dead leaf on the ground to sun themselves.  After photographing static fungi through the winter, I had to relearn the technique for photographing insects: take off my white sun-hat to make myself less conspicuous, start taking photos from long-range, and slowly creep closer taking photos all the time.

These are bee flies, Bombylius major (Diptera: Bombyliidae).  I remember them from last spring.  With their long proboscises they look like little humming birds.

Both of the flies shown here are male: their eyes meet on the tops of their heads.  In females the eyes are well separated.

Photos taken in the Wilderness, Whiteknights Park, Reading University grounds, Reading, UK, on 2010-04-09.

Friday
Apr092010

Cohesion, Coupling and Unit Testing

Unit testing improves designs by making the costs of bad design explicit to the programmer as the software is written.  Complicated software with low cohesion and tight coupling requires more tests than simple software with high cohesion and loose coupling.  Without unit tests, the costs of the poor design are borne by QA, operators, and customers.  With unit tests, the costs are borne by the programmers.  Unit tests require time and effort to write, and at their best programmers are lazy and proud folk.  They don't want to spend time writing needless tests.

Unit tests make low cohesion visible through the costs of test setup.  Low cohesion increases the number of setup tasks performed in a test.  In a functionally cohesive module, it is usually only necessary to set up a few different sets of test conditions.  The code to set up such a condition is called a test fixture.  In a random or functionally cohesive module, many more fixtures are required  by comparison.  Each fixture is code that must be written, and time and effort must be expended.

The more dependencies on external modules, the more setup is required for tests, and the more tests must be written.  Each different class of inputs has to be tested, and each different class of input is yet another test to be written.

Jeff Younker (Foundations of Agile Python Development, Apress, 2008, pages 141 - 142).

Never have I seen the case for unit testing and TDD put better.

Friday
Apr092010

White Cup Fungus

An tiny white cup fungus, possibly Dasyscyphella nivea, but there is a warning here, in the Wild About Britain fungi forum, that microscopic examination is really needed to identify this type of fungus to the species.  Still, it is rather pretty.

Photo taken in the Wilderness, Whiteknights Park, Reading University grounds, Reading, UK, on 2010-04-05.

Thursday
Apr082010

Ladybird Development

A larva of the harlequin ladybird, Harmonia axyridis (Coleoptera: Coccinellidae).

The following is a pupa which I think is of the same species, the spikes are apparently characteristic.

 

And this, I think this a more mature pupa of this species:

And this is an adult of this species:

The adults of H. axyridis are very variable in colour and pattern, see here for some illustrations.

Photos taken in Whiteknights Park, Reading University grounds on 2009-05-10, 2009-09-24, 2009-07-16, and 2009-05-10, respectively.