Coding Naked at the C# Corner 2022 Virtual Conference
January 25, 2022 Category: Blog, Events No Comments »
Later today I’ll be speaking at the C# Corner 2022 .NET Conference. This is a 3-day FREE online conference with a great set of speakers. I’ve been really impressed with the quality of production and how the C# Corner team is really building a community with their articles, events and how they are encouraging people to get involved.
I’ll be speaking on unit testing strategies with my “Coding Naked – Unit Testing those hard to reach places” talk. I need to update the slides on SlideShare, these ones are a bit dated by now, if you watch the live steam or recording, you’ll see I’ve updated this talk quite a bit since I first put it together (in 2012!).
In addition to TDD fundamentals, I dig into a few strategies for better TDD and test coverage.
One area I address is working with extension methods. Extension methods can be hard to mock, or at least, they often get in the way. Extension methods that are “functionally pure” (input, output, no side effects) are pretty easy to unit test, the challenge are extension methods that return void, or that do a lot of work under the hood.
The three strategies I discuss for dealing with extension methods are:
- Wrapping Extensions with an Interface (my preferred approach)
- Mocking around Extension Methods (creates dev cognitive load, and leaky abstractions)
- Using Fakes, Pose or Isolator (I don’t recommend these)
You can download or fork the sample code on githuib.
One thing I recently added to the sample code, is a new method for mocking around a common extension method. The Microsoft.Logging.Extensions! I’m really glad that Microsoft has created a common logging interface. There are a lot of great .NET loggers.. but often moving from project to project the nuanced api differences can be really annoying. I’ve used the Common.Logging interface several times, but it never really took off the way I hoped it would. I think the Microsoft logging abstractions will have a much higher adoption. š¤
Here’s the thing though. There is only 1 logging method in the Microsoft.Logg Interface, and you’ll likely never use it! Instead, you’ll end up using one of the many logging extension methods. So now you might try and mock around it since the source code is all available. This will lead you to a massive deep dive where you finally realize that all of the Microsoft Extensions, end up using a method call that takes an internal class as a parameter! Ugh. That makes it really hard to mock around!
That being said, MOQ recently added a parameter option for It.IsAnyType – huzzah! Adam Storr has a much more extensive write up on this challenge and the solution that he came up with (go read it!) to Mock Around the Microsoft Logging Abstractions. I extended his solution in my code, and am planning on publishing this as a reusable nuget package soon.
Happy Coding!
Always Be Learning – Grow Your Craft
September 21, 2017 Category: Blog 1 Comment »
I received a great question about the value of trying out new tools after my presentation earlier this week.
Side note: I presented at an internal conference that Quicken Loans organizes and hosts every year for the employees in our technology group.
It was HUGE. ā Extra thanks to Paige and Derik for taking much better conference pictures that I did.
Here was the question.
I attended your talk yesterday, and was wondering if you had heard of this tool:
It seemed desirable as it is cross-platform, and open source. Do you think it might be worth investigating in light of all of the other tools we already have at our disposal?
Thanks for your time (and for the talk, it was a good) āŗ
Iāve seen this line of thing several times. Is it even worth learning something new, when I probably already have something that sort of does that?
Taking Scottās advice (āKeep your emails to 3-4 sentences … Anything longer should be on a blogā¦ā)
Here is my answer:
.. Thanks for pointing me to this! I have not looked in to this tool. However, when I led the UX team at Sabre, one of the goals that each member had was to research 1 tool or technique or practice every 6 months. Then to share it with the team. This became a monthly lunch that we would do together where someone would share the new thing they had discovered. Team adoption was NOT part of the goal.. just to learn and share. In fact, many times ā the person sharing would end up saying something like ā¦ āand that is why this tool is not for us!ā
Itās way too easy to work work work with our heads down and not realize the new options and approaches that are available and emerging in our fields. At Sabre, we didnāt have BulletTime ā so this was one way we tried to encourage each other to look up from our work, and work on how we worked. š
So yes, I always encourage looking in to a new tool. You might not ultimately adopt that tool ā in fact usually you wonāt, but there will be value in learning what you like, new ways of doing things, and ultimately ā growing who you are.
Side note: At Quicken Loans we set a side 4 hours every Monday afternoon to work on or learn whatever you want. We call this BulletTime, and itās a great way to continue sharpening who you are. If youāve ever seen me present on ā10 Reasons Software Sucksā then youāll know how passionate I am about continual learning. Weāve chosen to be in a field thatās always changing, itās up to us to always be growing too.
Happy Coding!
Detroit Code – 3 Days of Awesome.
July 7, 2017 Category: Blog, Events 1 Comment »
TL;DR:
Detroit.Code() is a 3 Day conference Iāll be giving two talks at in Detroit next week. You can register now and save 10% by using code CalebJenkins10
The rest..
Earlier this year I spoke twice at our internal Software Craftsmanship Community at Quicken Loans. Next week, Iāll be giving two more talks in Detroit. Coding Naked and Scaling Scrum.
Iām really looking forward to this ālocalā conference. Itās local for me since I started working in Detroit every day. Well, āin Detroitā is relative, my commute involves walking to my standing desk in Texas ā more on that in a future post! OK, I really am excited to experience this conference. The speaker line up is amazing. The hardest part will be some of the time slots where there are way too many good speakers and topics I want to hear at the same time. Where else can you go spend a whole day learning about ASP.NET CORE directly from Microsoftās Jeffrey Fritz or Do Architecture Kataās with Ted Neward or spend a day learning directly from Ted X Speaker Christina Aldan? Seriously, hereās me trying to decide which session to attend in one slot
Too many good talks to decide.
The only thing that made this one easy to pick, is that one of them I have to be at..
You get the idea.. so much great content, learning, growing ā mind stretching will be going on next week.
Iām also looking forward to seeing how the people from Amegala run a conference. They do a number of conferences that Iāve never been at before.
This feels like a notch up from a TechFest, but not quite at the VS Live sort of level. In other words: just perfect.
Quicken Loans
I should also mention how awesome it is to work for a company that not only gives time off for attending a speaking at conferences.. but actively encourages broader community participation. Not only is Quicken Loans officially sponsoring Detroit Code, 6 of the speakers are from QL, many of us are from out of town, and QL is paying for our travel and hotel for the week. Awesome!
- Keith Elder ā will be flying up from Mississippi, and is talking about the highly scalable encryption platform that we built and use at Quicken Loans
- Mike Eaton ā is giving two talks, one on Becoming a Remote Worker Pro, and other on making the transition from individual contributor to Team Leader (Manager outside of QL)
- Peter Ritchie ā 2 talks: Introduction to Microsoft Service Fabric, and Moving Towards Elastic Scalability
- Jason Follas - 2 talks: Bit Coin: What makes it secure, and Lightweight Pub/Sub for Web Applications using MQTT
- Eric Helin ā Adventures with TDD and Paired Programming
Iāll be giving two talks:
Coding Naked ā Unit Testing those hard to reach places.
This is an updated version of this talk that Iāve given many times. The new version (updated slides coming soon) is much more focused on code examples and working through various scenarios that people run in to while at the same time delivering on the principles behind those examples to really help people get better at navigating the world of automated unit testing. Original slides: https://www.slideshare.net/calebjenkins/coding-naked
Scaling Scrum to the Enterprise
Scrum is awesome.. just incomplete. (by design) ā this talk goes through some of the patterns and practices that we used to scale scrum at Sabre to help people increase their over all agility and deliver better software.
Thereās still time to register.
The full day workshops are on Monday with the rest of the conference taking place Tuesday and Wednesday. If you use the discount code CalebJenkins10, youāll save 10% off of your registration.
Hope to see you there!
UX + Agile
May 13, 2011 Category: Blog No Comments »
Jared Spool published a great article yesterday titled āEssential UX Layers for Agile and Lean Design Teamsā.
Jared talks briefly about proliferation of agile approaches in software design and user experience (UX) design and contrasts that to the Big Design Up Front approaches of the past, he then goes further in describing, not only User Stories, but several other layers of UX design and how each layer differs in scope and purpose from the other layers.
we frequently saw the successful teams talking about these other layers all through development. When a team member would produce a deliverable or design sketch that wasn’t quite matching the direction that the other team members imagined, the team would step back and talk about the other layers, trying to figure out where the disconnect came from. Because the team established the layers together, based on research they jointly conducted, they found it easy to collaborate on creating coherent experiences that regularly delighted their users.
Itās a great read, and I highly recommend heading over to the UIE site and reading the full article. You might also consider subscribing to the UIE podcast BrainSparks.
If youāve never heard Jared Spool speak live, heās a great presenter and is always thought provoking and memorable, our chief mentor will be presenting at the same conference as Jared in July, The Big (D)esign Conference is July 14th ā 16th ā Hope to see you there!
Debug like a pro! Memory Dumps with WinDbg
September 30, 2010 Category: Blog No Comments »
Recently I was working with a client to debug an issue that they could only reproduce in production (I hate those). Unfortunately, this was the sort of error that was sporadic and unpredictable ā so hooking up a debugger and waiting wasnāt much of an option. Fortunately, Microsoftās Debug Diagnostic Tool can be used to automatically grab an IIS Memory Dump during certain scenarios (like crashes and hangs). Normally, memory dumps arenāt the kind of things that .NET developers go digging in to. Well never fear my .NET developer friend, let Tess from the Microsoft debugging team show you the way!
This is a great presentation that Tess Ferrandez gave at 0reDev last year on Debugging .NET Applications with WinDbg. After youāve watched her presentation be sure to check out the rest of her full blog, especially her post on using CMDTree then go read John Robbinās post on Debugger Markup Language (DML).
Now you are well on your way to being the Memory Dump Ninja that I always knew you were!
Using RhinoMocks to Test Model View Presenter Events with Lambdas and VB / C#
July 4, 2010 Category: Blog No Comments »
This week I had the privilege of leading a custom workshop for a team of developers in Fort Worth, TX. One of the topics that we covered was Writing Testable Code; specifically, we looked at the Model-View-Presenter (MVP) patterns, dependency injection and using RhinoMocks to pull it all together. The one catch wasā¦ this group of developers used Visual Basic.
Iāve never shied away from VB. In fact, VB6 with classic ASP is where I cut my programming teeth, and VB.NET was my first move to a true OO language. That being said, I work day in and day out with C#ā¦ Iām much more fluent there, and I realized that there were a ton of new features in VB that I wanted to cover that I wasnāt up to par with, fortunately I was able to call on my network of super smart friends and recruit/hire a fellow MVPāer to help me out for the day (thanks Cory for doing that 2 days after your wedding!)
One of the things that tripped me up was using Lambdas in VB. Lambdas are especially important if you are going to use a Mocking framework like RhinoMocks (which I do). Doing Lambdas in VB ā especially when I was trying to raise an event from a mock ā sort of tripped me upā¦
First ā if you are working with Rhino Mocks, you should go have a look at the excellent Wiki. http://ayende.com/Wiki/Rhino+Mocks+3.5.ashx I find that a lot of people (read: I had) skip the ādocumentationā since RhinoMocks is so fluent and straight forward, but itās definitely worth the read!
Second, if youāve never raised an event in mock from your test in C# hereās the code:
viewMock.Raise(x => x.CalcShippingRequest += null, this, EventArgs.Empty);
and in VB:
Bing 404 Plugin for WordPress
June 5, 2010 Category: Blog 2 Comments »
Yesterday Microsoft released a new plug-in for WordPress that uses Bing Search to improve your 404 pages. It works by grabbing keywords from the missing URL string and then uses the Bing API to search your site for those keywords.
Update: The creator of this plug-in just added a quick start video… go check it out!
So, your 404 page can go from thisā¦Ā
(boring WordPress Default 404)
To thisā¦
iPad + Velcro = good
June 4, 2010 Category: Blog 1 Comment »
I may not own an iPad… but thanks for Giovanni’s “help“, my wife now wants one, and I have to admit, after playing Plants vs Zombies on both an iPad and a PC.. the iPad touch is a much better PvZ experience. This video show some of the other things that you *could* to with an iPad… plus velcro. Enjoy!
iPad + Velcro from Jesse Rosten on Vimeo.
Ā
Practice Software Patterns ā Component Patterns
March 10, 2010 Category: Blog 2 Comments »
This post is the 6th in aĀ series that started with theĀ 10 practices that every developer needs to start right now
The first time that someone taught me about Software Design Patterns it went something like this:
- Them: āā¦ and so that is the pattern.ā
- Me: āThatās itā
- Them: āWell, yeah.ā
- Me: āBut thatās how Iāve always done that.ā
- Them: āWell, then youāve always been following that patternā
I find that is how a lot of people react when they first learn about patterns. āSo a pattern is just giving a name to good software developmentā Well, yes and no. On the one hand ā yes, a software pattern is recognizing common software challenges and the approaches that have worked in the past to over come those challenges ā and naming it. On the other hand, donāt underestimate the power of giving something a name.
Thinking about gamesā¦
February 25, 2010 Category: Blog 1 Comment »
Stephen was the first person that really got me to think about game theory as it relates to general application design. Then my friends at Improving Enterprises introduced me to Luke Hohmann and his Innovation Games approach to product management and games like ābuy a featureā. Iām certain that their is much more work that needs to be done in this field. Think about it. Game theory flips ātraditionalā usability on it heels. Every application that Iāve ever worked on āeasy to useā was one of the requirements. In games, ātoo easyā is a negative. Challenging, engaging, rewarding and FUN are the goals the rule the day. This talk by Jesse Schell really drove this point home for me.
Carnegie Mellon University Professor, Jesse Schell, dives into a world of game development which will emerge from the popular “Facebook Games” era.
– Enjoy!