From: http://www.michaelsalamon.com/?p=20
Cyclomatic Complexity (CC):Let's look at a couple examples:
Usage (U): How many other methods/classes rely on this code.
Test Coverage Percentage (TC): The percentage of the code that is exercised by a unit test
Risk Factor = CC x U x (1 - TC)
| CC | Usage | Code Coverage | Risk Factor |
|---|---|---|---|
| 20 | 50 | 0 | 1,000 |
| 20 | 50 | 0.1 | 900 |
| 20 | 50 | 0.5 | 500 |
| 20 | 50 | 0.9 | 100 |
| CC | Usage | Code Coverage | Risk Factor |
|---|---|---|---|
| 10 | 50 | .5 | 250 |
| 50 | 10 | 0.5 | 250 |
| 50 | 50 | 0.9 | 250 |
I'm happy to see more people everyday are interested in Agile methods, however I'm saddened by the misinterpretation and perceptions of Agile by people who have never experienced it.
I've discovered that when I mention Agile to a group of IT Professionals, there is an initial reaction of shock and defensive posturing.
"Agile isn't for us. We don't want the developers coding without any direction."
or
"If we're going to use XP, that's fine. I'll just find another team!"
It's hard enough to have people listen about the spirit of agility when they have already made their minds up...which leads me to the topic of this post.
Lean is the new Agile
Recently I've been hearing more and more about Lean software development. It's not new, but I believe the agile community is looking for another way to market agility outside the software industry. And it makes sense to use Lean Manufacturing as the model. Every business person in the world has heard about lean manufacturing. Not only have they heard the term, there is an engrained positive feeling about it. Lean sounds like it costs less with more quality. They associate lean with Toyota which they associate with quality...Oh what a feeling!
Agile, on the other hand, is associated with XP (Extreme Programming). Nobody in business wants anything to do with anything that is extreme. Extreme equates to Risk and the business world is all about reducing risks (or as we say, "mitigating risks").
So give it a shot. Next time someone is discussing your software development methodology, tell them you use a lean software development methodology based on the principles from the Toyota Production System and see how they react.
There are two strategies to complete the things you want to get done:
How do you do it in your daily life? If you have a list of tasks that you need to get done which approach do you use?
Let's think about how your company completes project. Which approach do they use? Are they the same?
Let's weigh the Pros and Cons of each approach. Let's assume your team needs to complete 3 similar sized projects (Project A, Project B, Project C) within 3 months.
All project stakeholders are told their project has started
Tracking each project's status is difficult
People on the project frequently have to switch thinking between each project
Each project will take 3 months duration to finish
Don't start earning returns on the projects
If there are overruns, each project is affected
Only need to track a single project at a time
People on the project are focused
Each project should finish in one month
Project A will earn returns for 2 months
Project B will earn 1 month of returns
Overruns affect fewer projects
Project stakeholders are told their project hasn't started
Am I missing any Pro/Cons for either of these scenarios?
I recently started working with a new team and like any time you start something new there is a rush of learning that occurs. I would like to share some of what I've observer/learned while working with this team over the last few weeks. These are my opinions and subject to change...
1.) Visual Studio 2005 Unit Test (MS TEST) Runner is awful!
Don't get me wrong, I'm glad that Microsoft has a unit testing framework integrated with the IDE (as long as your using the "ultra" Team Suite edition). For most Microsoft devs, if it isn't baked into the IDE, they won't use or acknowledge the value of the technology.
Back to what makes the baked in tools so bad:
a.) All these views and the one that I want doesn't exist!
Do you need the Test Manager, the Test View, the Test Result or the Test Result Detail window? Don't ask me, because I haven't figured out a good way to use them...yet.
If you don't know the difference between the views, here are some thumbnails. Click on the image to see a larger version. You tell me which one I should use (and you can't say TestDriven.NET).
Worst of all the "xUnit" view doesn't exist. A simple tree view in the left pane with a console window on the right to view exceptions and output values.
I'm using James Kocacs' VstsUnit Plugin for ReSharper. (A huge Thank You to James) It gives me what I need.
![]()
b.) Unit test architecture is slow
They must be copying the test assemblies to another location and starting another process. It is slow! I'm a firm believer that a unit test should execute in less than a 100th of a second (no dependencies on external systems - Yes, the file system is an external system.), and my unit tests still take multiple seconds to respond with the first result.
c.) Code Gen'd Accessor class feels dirty
If you haven't worked with the the VSTS testing tools, then you don't know about the class that Visual Studio generates for you. This code-gened class wraps the class you are testing and thru the magic of reflection, allow you access to private fields, properties and methods.
I both love and hate this. I love the convenience of it, but hate that it allows badly designed classes to be unit tested. The first sign that I've created a poorly designed class is that I can't unit test it....Actually that doesn't happen because I create a unit test first, but I do run into this when I'm trying to get legacy code into a test harness.
2.) Resharper = Love
I've been away from her too long, but I rekindled the flame with Resharper. Don't tell my wife!
3.) Developers need tools
Speaking for Resharper, the first question I will ask when I'm considering a project is, "Can I install software on my machine?" When you leave a company that won't allow you to install a font, you start to appreciate the little things that make you productive.
4.) Dual Screen Monitors = More Love
Now I have to find dual screen wallpapers