Ready to Rock Software Development

Blog

// Operations resulting in NaN 0.0/0.0; // NaN Math.Sqrt(-1); // NaN 0/0; // Compile time error: integer division by zero double c = double.Nan; // NaN 5.0 + double.NaN; // NaN double.NaN + 5.0; // NaN 5.0 * double.NaN; // NaN double.NaN * 5.0; // NaN 5.0 – double.NaN; //…

Pop quiz… what does the following C# program output? void Main() { var myclass = new MyClass(); switch (myclass.TheEnum) { case MyEnum.baz: Console.WriteLine(“BAZ”); break; case MyEnum.bar: Console.WriteLine(“BAR”); break; } } public enum MyEnum { baz = 1, bar = 2 } public class MyClass { public MyEnum TheEnum { get…

NUnit’s ‘Values’ and ‘ValueSource’ attributes allow you to greatly reduce the number of unit tests that you need to write. With these two attributes, you can get better coverage in less time. The Hard Way Let’s say you’re designing a feature for your app that retrieves a list of software…

The previous two articles in this series have shown the enormous drag that unit testing impose and the drop in test quality over time caused by unit test aging. Unit testing is good, but costly. And that’s why, in terms of quality, design trumps unit testing. What we’ve seen so…

Last time we looked at the drag unit tests create on code changes. Drag is the downside, but some would argue that the upside more than makes up for it. The upside is that, when I refactor a class with comprehensive unit tests, I can have confidence that I didn’t…

In any field, when evaluating a technology or methodology, the benefits must be weighed against the costs. In the world of software development, that includes unit testing. I’ve written about the costs of unit testing before, and the most contentious assertion I made was: Unit tests are, by definition, brittle….

Unit testing is like paying for fire insurance. You’d be foolish not to have insurance, but you don’t have to like paying for it. So, you shop around to get a good deal because you don’t want to spend more than you have to. Unit tests often cost more than…

You’re having a great coding session. You know where you’re going and it’s falling into place. You’re hitting your targets like clockwork. Then you hit a wall. You’ve run your app for a quick check and it’s not behaving the way you expect. And nothing is making sense. It should…

Let’s say you’ve found yourself procrastinating at work, not getting your work done. And it’s starting to become an problem. So you install distraction-blockers on your browser. But you quickly find new ways to distract yourself. It feels like a battle you can’t win. And you’d be right. But it’s…

The goal of free browser plug-in, Rescue Time, is to give you insights into your habits to help you focus and be more productive. Maybe you’ve tried Rescue Time before and, like me, found that it didn’t really help you improve your productivity. There’s a reason you couldn’t turn your…