Horizontal Split View = Unit Testing | Coding heaven
I’ve been hooked on unit testing for almost two years now. I haven’t really done TDD given that I don’t write the tests before doing any coding. I usually write my code (designed for testability, of course) and afterwards I write the unit tests and then go back and forth when there are changes. Last week I started getting into unit testing in MacRuby for a project I’ve been playing around with at home. I am using Xcode 4 as IDE with hidden tool bar and navigation bar (I have a 13” MacBook so I need the real estate). I’ve never used split views much for coding but for this particular task I decided to use them and… I loved it.
This week I started working on a new project at work. I followed my regular approach of dissecting the requirements to find the pieces which will conform my system (aka quick class diagram), then I started writing the interfaces (C#) and got myself ready to do some coding. What changed this time was the fact that I adopted this split screen trick by having the unit test on the left and the code on the right side and hiding the solution explorer (unfortunately Visual Studio doesn’t have Xcode 4’s jump bar which makes navigating the files easier without the explorer). Writing tests has never been more fun, fast and clean.
Writing the tests and the code became one, jumping from the left panel to the right panel back and forth and making sure my code did what it was supposed to do. I reached 97% code coverage on the whole project! I’m not done yet but I’m very confident about my code and I’m enjoying this new approach.
-
sandmanapp liked this
-
gabrielayuso posted this