Contents tagged with unit testing
-
One interface to rule them all
I'm not shy about telling people that I'm not much of a computer science kind of guy. It's not that I don't respect computer science or understand it, I'm just not one to get academic over it to the point of not building anything. And while I can't always remember what the hell SOLID stands for, I do remember that the "I" stands for the "interface segregation principle." It says, "Thou shalt not force everything to use one interface, because specific interfaces are better."
-
Rebuilding CoasterBuzz, Part IV: Dependency injection, it's what's for breakfast
(Repost from my personal blog.)
-
Abstracting away issues of HttpContext from your ASP.NET MVC controllers
I've noticed that I write software in one of three modes:
-
This isn’t the process you’re looking for
There was a fairly awesome pissing match between “Uncle” Bob Martin and, well, everyone, on Twitter today. Twitter isn’t a great venue for this kind of thing, because it’s hard to read and hard to make a solid point, but basically Bob suggested that you should do everything possible to make sure you have 100% test coverage. He was making the argument that this was the cheaper way to go for the long-term quality and maintainability of code (or at least, that’s what I interpreted it as, in 140 characters or less).
-
Lessons from rewriting POP Forums for MVC, open source-like
It has been a ton of work, interrupted over the last two years by unemployment, moving, a baby, failing to sell houses and other life events, but it's really exciting to see POP Forums v9 coming together. I'm not even sure when I decided to really commit to it as an open source project, but working on the same team as the CodePlex folks probably had something to do with it. Moving along the roadmap I set for myself, the app is now running on a quasi-production site... we launched MouseZoom last weekend. (That's a post-beta 1 build of the forum. There's also some nifty Silverlight DeepZoom goodness on that site.)
-
Coding rules, self-debate and formatting a string in your view
I was thinking to myself about how I wanted to format dates in a particular project recently. I said, "Self, is it wrong to use an extension method inside a view to do this?" I was clearly distracted with something else, so I didn't answer, but then The Gu did the Twitter to this gem by a guy named Chris, and he says it would not be cool.
-
Current technology stack
Every once in awhile, I feel like I've changed enough stuff around the technology that I'm using to take a sort of inventory. Mostly I just want to be able to refer back to it the next time I feel compelled to do so.
-
Dependency injection, providers and ASP.NET MVC
I've been thinking a lot about all of the frameworks we have now to use with our, uh, frameworks. There's a framework to solve every problem. Dependency injection frameworks are of particular interest to a lot of people because they make unit testing ridiculously easy. They're also well suited to something like ASP.NET MVC, where you're trying to make as few dependencies as possible between the various concerns.
-
Made the switch to Subversion, back to NUnit from VSTS
After about two years of using SourceGear's Vault, I switched to Subversion for source control. I was using Vault because it was free, Web-based, integrated with Visual Studio and was generally familiar.
-
A four-hour software challenge
I was thinking about stuff that I need to code for my sites, and was thinking about how I'd like a place for the public to track bugs. Yeah, stuff like that already exists, but it'd be nice to have something more basic.
Then I realized it might be fun to crank something out like that for myself. As fast as humanly possible. Like four hours or less. Could I do it?
I started to ask myself what it is that takes the longest for me. It's almost always the data access code, and more specifically, the test code to make sure it all works. I know that I test wrong by normal standards, in that my data access code is always dependent on the business objects that call it as containers. So a method that gets data from a table of users is called by a User object, and expects a User object from the data call. Most "experts" would say that's bad design.
So if I can let go of the intense testing, maybe I'll give it a try.