Friday, April 01, 2011

Goodwill for Automation Code

I had an interesting dream, thought, or inspiration last night.  It could have been codeine induced based on the horrible cough I have been battling, but no the less it was an important thought.

What happens to legacy code?  Does it simply get deleted and gone eternally?  Does it fall into an abyss?

No!  We take it to Goodwill for Automation Code.

It occurred to me that one of the key takeaways from STP conference was mentoring.  The "Ah Ha moment" was that we could leverage legacy code to educate others.  We have some Software Engineers in test that are struggling with TDD, test driven development.  So my concept is to look at our code repository and find code that has matured over time.  We can then share this evolution of code with the testers that struggle with TDD.

I also struggled a bit with TDD, until I saw the light.  Even for test automation it is important to unit test your code.  How did I learn?  What turned on the light?

Mentoring by my colleague certainly was key. The knowledge of knowing my new methods would potentially be used by many tests forced me to write better code, that could easily and repeatably be tested.  I still struggle because I simply want to get a test implemented quickly, so I admit sometimes I write my unit tests after the fact.  One rule of thumb I do have is that if I struggle at all to write a piece of code, I immediately stop and write the unit tests.  Breaking the complexity into simpler chunks helps me to get to a more robust solution.

So I am going to go into the office today, then search for learning examples of code.  These legacy jewels will then be moved into Goodwill for future education opportunities.

Cast off code will be used to assist others.  Amazing the thoughts that come to you during sleep and I do not recommend the codeine!

Keep on testing!

No comments: