fuzzelogic Solutions

May 19, 2009

CodeRush Express is free

Filed under: Programming, projects — Tags: , , , , , — admin @ 2:05 am

Hi!

I usually use resharper, but it seems the good folks at devexpress want to give stuff away  http://www.devexpress.com/Home/Announces/CodeRushXpress.xml.  Its for vs 2008 (don’t think it works on the express editions) and if after you install it, you feel a little lost (cos’ I still can’t see the menu option) try this magic shortcut… Ctrl+Shift+Alt+O brings up the editor window.

Now there’s no excuse to not refactor !

Hope this helps

Zak

May 13, 2009

devG: 1st meeting

Filed under: BDD, OO, Programming, c#, design — Tags: , , — admin @ 4:53 pm

Hey!
So yep, a few guys actually turned up.

I was concerned that starting without any fixed agenda was going to be challenging, but a couple topics came out and were discussed rapidly, with everyone contributing.

It was great to have the conversations and chit chat among the group which consisted of different backgrounds converging on Microsoft technologies. There were brief conversations around the current trend in the market, .net, agile, oo + patterns and developers mindset. It was really great hearing the “real world” encounters and very encouraging to see every on the same page.

It seems everyone enjoyed it enough to consider making this a regular adventure. It was agreed that we should arrange another, possibly with a “fixed” technical topic. So in an attempt to keep the ball rolling, I’m going to throw a few suggestions (on a topic) out there, so drop me line and let me know……

  • Overview on S.O.L.I.D principles
  • Software patterns - although I’d suggest picking a single pattern and discussing it ..
  • Microsoft MVC
  • Dependency Injection
  • BDD
  • “Art” of writing transactional stored procs
  • Mocking
  • Project failure
  • NHibenate <added 14.5.09>
  • C# 3.5 Lambda’s, extension methods, Linq <added 14.5.09>

If anyone’s got any ideas on a venue again, please pass it on to me. 

It seems we’re sticking with devG (developers group) until we find a better one!

I’d like to thank Clive , Hatim, James,Justin, Michael, Owen and Steve for attending and thanks also to the crowd at C’est la vie.

Thanx

Zak

May 8, 2009

The dev group

Filed under: OO, Programming — Tags: — admin @ 4:07 pm

Hey !
It seems this is actually going to happen. I’ve booked a spot for Wednesday 13 May 2009,6:30 pm at c’est la vie and seems like we’ve got close to 10 people actually interested in being there. Pop over if you’re in the area.

So what’s it all about ? A couple of us want to get together and “talk dev”, to explore ideas, learn, unlearn and share.  

Well if no one turns up, at least they got good food there :-)

May 5, 2009

BDD : A Change in thinking part II

Filed under: BDD, OO, Programming, c#, design — Tags: , — admin @ 5:23 pm

Hi!
Ok, following on from the last post, lets examine whats going on here. We have one main “outer” class called Login_Specification. Now my convention (based on work from jp and mspec) is to add an _Specification to the class name. To me, this provides a central location for all the scenarios for a login specification.

public class Login_Specification

Next we have the “when_the_user_logs_in” class. This is the actual story. So in this case its the story that specifys the behaviour of “the user logging in”. This inherits from Story_For<> which is a generic base class that provides some syntax sugar, bringing bdd and the AAA style closer (more on this class later).

public abstract class when_the_user_logs_in : Story_for<>

Next we have the “if_the_credentials_supplied_are_correct” class this inherits the “story” class above. This is the actual scenario. In the traditional unit testing world this would be your TestClass. This is where the “should” will created. So as an example, if the story + 1st scenario was …

“If the credentials supplied are correct when the user logs in, it should show the home page.”

public class if_the_credentials_supplied_are_correct : when_the_user_logs_in{

public void it_should_direct_the_user_to_the_home_page () {
// this is where the ‘assertions’ happen..
}

This gives us executable code that

  • matches our user story.
  • can be run many times over to verify we are still “meeting the spec”
  • can be automated

Hope this help!

Thanx

May 2, 2009

BDD : a change in thinking

Filed under: BDD, OO, design — Tags: , , , — admin @ 5:47 pm

For everyone doing TDD (test first … test driven design) bdd is not going to sound like a lot of new stuff. BDD, at its core represents a change in thinking. It drives us down the path of writing out “specifications” so that its readable to everyone involoved in the software project. It steers developers into thinking about the behaviour in a given context, and what the “user experience” is going to be like.

It brings programmers close to the business…. that’s important enough to say it again. it brings programmers close to the business.

Additionally, BDD trys to get the words changed so that we stop communicating in terms of testing. We start talking about the behaviour of a system. Its worth mentioning, there’s a couple flavours in the BDD world. The Dan North “Given , When , Then” and then there’s Scott Bellware’s “Context specification” and of course mine (pretty much context specification based on sceanrios - each scenario is an If).

Using an example of a Login specification, let check each one.

Dans style : Given incorrect credentials when the user logs in then the user should be shown a failed to login message.

Scotts’s style: When the user logs in in [in the context of having incorrect details] then the user should be shown a failed login message

Mine: If the login credentials are incorrect when the user logs in, then the user should be shown a failed login message.

How this actually looks in code depends on the underlying framework used. For me, I’ve written up my own basic one, which relys on a few simple classes (I’ll post them at a later date)

// This is quick look at the layout of the test.
// The implemenation is left out for simplicity

public class Login_Specification
{
     [Story]
public abstract class when_the_user_logs_in: Story_for<ILoginController>  {}
// This is a scenario
public class if_the_credentials_supplied_are_incorrect : when_the_user_logs_in{}
// This is another scenario
public class if_the_credentials_supplied_are_correct :when_the_user_logs_in{}
}

Powered by WordPress