“It’s Not like a Missing Unit Test and Then – BOOM, China Syndrome!”

“My boss is very traditional, old Ukrainian KGB, and he hasn’t followed the latest ‘Is Test-Driven Development Dead?’-debate”

It’s Juric Malec who writes this in a letter. He is a software engineer at the Zaporizhia nuclear power plant in Ukraine. Near the city of Enerhodar, on the banks of the Kakhovka Reservoir on the Dnieper river, the plant produces 6,000 megawatt electrical.

Deep inside the plant sit Juric and his boss Nikolai Mikhailovich Golushko.

Juric is visibly frustrated in his writing. He feels his Master in Computer Science from Kyiv-Mohyla is going to waste.

Prīvіt, Cheeky Coder!

My english not so fantastic. I write this because tired of writing very small unit test for all small parts of the reactor administration system. Many many tiny mocks. Mock, mock, mock, says my boss. Mooock, mock, mock! Like chicken impression. He funny sometimes, my boss.

I try tell him, but he no listen. If someone turn the reactor OFF, then all the mocks are not good. Cannot assert for China Syndrome.

Juric says it’s much better and more realistic to do end to end integration testing in settings like this.

He sent me a code example:

    @Test
    public void testReactorShutDown() {
      ZaporizhiaReactor0001 reactor0001 = new ZaporizhiaReactor0001();
      reactor0001.setOverrideSecurity(true); // from Soviet time
      try {
          reactor0001.shutDown();
      } catch (ChinaSyndrome cs) {
          fail("Get out of here!");
      } catch (NuclearWinter nw) {
          fail("Get out of here!");
      }
    }

… There isn’t a mock framework in the world that could help testing this anything close to real. Kent Beck and Martin Fowler is full of old mother Soviet’s crap.

Juric has got a point there. But I’m not sure Kent Beck’s JUnit is up to the task here, either. In the test above, will the fail-method ever be called if one of those exceptions is thrown?

Well, it doesn’t matter in the big picture of small atoms.



Please follow me on Twitter and let my my feed sit idle in your RSS reader.