While developing the Metric Dashboard, I on purposely did not write any unit tests. I wanted to feel and remember what is like to develop without unit test and see how to write the unit tests after the deed 🙂
Manually Unit Testing
The first issue that I had with developing is that I found myself running the code- either with the debugger or without – much more then usual – lets call this Manual Unit Testing . There where times when I know that I was wasting my time, and manually rerunning the same scenarios over and over again. I felt the urge to write a unit test as I knew that I was wasting my time. But the feeling that I had was always: I am nearly there, I’m just about to fix the bug, so why waste time writing a unit test. Most times, I wasn’t there and it took many runs and setups just to reach the correct scenario.
If I had the Metric Dashboard running I would have seen this
That is 32% of my time in the debugger and running the application, and 68% of my time authoring production code.
Seeing this is a great indicator that I can do better. because after all this work, I still have ZERO tests to cover me.
Application Architecture
I am going to start writing unit tests, but beforehand lets give a short architecture overview.
There are 3 components
Typemock Server
This component is responsible to store the metrics of the team and publish them to the dashboard
- The Server is a Windows Service
- It broadcasts itself to the world so that clients can discover servers automatically and free them from manually typing in the servers address
- It merges and stores the data
Managers Dashboard
This component is the reporting component and allows managers and team leader to see how unit testing helped the team (by catching bugs early on) and by spending less time doing manual unit testing. Using this dashboard we can see how much time is being put into writing unit tests and how useful it really is.
- Auto-Finder, discovers the Typemock Server and then automatically connects to it.
- Data Filtering is done in the Dashboard via different criteria’s
- Export the data as Excel
- Charts and Pies
Visual Studio Add-in
This component tracks the unit testing effort per each solution and saves it locally and on the Typemock Server. Using this each develop can see how much time is being invested in unit tests and the immediate benefits.
- Auto-Finder, discovers the Typemock Server and then automatically connects to it.
- Current Action, discovers what the developer is doing. Debugging, Running the application, Writing unit tests, Writing production code, Idle or in another application.
- Bugs caught, reads the test run data and calculates the numbers of bugs found. i.e. the number of failing tests. This component counts each failed test once until it is fixed.
- Charts and Pies.
What do the colors mean?
The colors are:
- Yellow: Communication aspects
- Green: Data aspects
- Charts: UI aspects
- White: others
Where do I start?
So now that I want to get going, my biggest question is where do I start?