Working in software development you run into many opinions of testing your software you develop. Early in my career I worked in mostly Waterfall development methodology shops. We would usually think that testing is what someone else would do to your code. You would test it quickly and then move onto the next thing. I have heard people express the notion that good testers are never good programmers and vice versa. I want to say Joel Spolsky from Joel on Software fame said this in a podcast I used to listen too. He even went on a rant against unit testing too. We will get to that soon.
Later on something called Extreme Programming(XP) took hold and we were taught to test our code in small units. Similar to how Electrical Engineers will test each component before wiring them together on say a circuit board. I remember writing some of my first unit tests quite a few years ago. I can’t say I did a good job at writing them. Test Driven Development wants us to develop the test first and then write our code.
Most recently in my career I have worked in some Agile teams that try to incorporate Unit Testing and short iterations. I have even paired up a couple times to do pair programming. More ways to find bugs earlier in the development life cycle. Even reviewing your feature changes with a Quality Assurance team member can be helpful too.
How do you test your code?