Irish Open Spaces Coding Day II
Hi all:
Just thought I d post here that a group of us in Dublin. Alt.Net are organizing a coding day the 24th of April in UCD, it should be a fun day of hacking some code. One of the really cool things is that James Gregory will be there talking about Fluent Nhibernate.
If this sounds like something you d’like to do you, can register and find out more about it in codingday.org
Cheers
Filed under: Uncategorized | Leave a Comment
I understand the title makes little sense, but this is probably what I would search in a web search engine ( hopefully at the time I ll find my own post) A short, unordered list of things I install when I get a new machine/wipped machine
- An FTP client Filezilla will do
- Firefox + Add on: firebug, noscript, colurful tabs,
- Chrome ( for js intensive stuff it jsut renders faster)
- ieTester ( run multiple ie versions parallely)
- ieDebuger
- Wireshark, comes handy
- Reflector
- Resharper
- Syntax friendly Notepad ( I use Notepad ++ but not mad about it)
- Tortoisesvn or Anksvn
- Tortoise git
- SVN Monitor
- Git ( you ll need it at least to download libraries code)
- foobar2000 music player ( after all you need to block the noise from the outside)
- Sql Server Management Studio , you ll eventually need it and if you have profiler you ll probably need it too
- #Develop is kinda handy too
- I use Evernote, so I would install that, tho not run it often just because I don’t like the desktop client much tbh
- Sumatra PDF (if anyone knows a better one I d appreciate it)
- Visual Studio
- Setup IIS
Filed under: Uncategorized | 4 Comments
DDD South West
So there is another DDD event the 5th of June, and this time is in Bristol, call for speakers is on ( if you want to submit, you can get instructions on how to do so here)
Sessions look interesting so far.
I really enjoyed the last DDD in Reading, Uk.
Filed under: Uncategorized | Leave a Comment
The Art of Unit Testing – Review
A few of us have been reading this book as a part of a book club. Finally I think is time to push a review for this book .
Let me start saying that my expectations for the book were very high, the book club helped because we were really reading it in depth and going over little bits of each chapter.
Bad things about the book
Examples are not great, there are errors on some of them, and (possibly the worse thing of it all) some of the tests dont follow the advice that is given in the book, particularly in naming convention.
If you download the code that accompanies the book, some of the tests (that are supposed to pass) fail.
We sent an email with corrections but never heard back ( not sure if they didnt get it or what), which, to be honest, was a bit disappointing, if this code was on github I would have forked it just to get it fixed, tho I m not sure Is correct to do that if the code is not on github (if anyone knows please let me know).
Again on the code samples, some of the examples scenarios are not really that descriptive, I have to add, that after preparing the talk I gave in DDD, I have to say its really really hard to come up with good sample code, that demonstrates a smell and a solution in a clear way in not a lot of code… so maybe its not a fair criticism, but I really had to mentione it, because you read the sample and really wtf? a bit .
The chapter on Mocking is not great either, Rhino mocks is not used in anger, and I m pretty sure Roy could have gotten someone with loads of experience in Rhino Mocks to look and review (and improve ) the example code.
Good things about the book
I know that after what I said what bad in the book, this will sound fake, but I actually think the book is really good, because I learned loads about unit testing.
It made me think about how to test, What to think about when testing, how to approach writing code with testing in mind.
It basically gave me a lot of basics like, the difference between Unit and integration tests, and that was important, because I could clearly define, I need to tests this (whatever it is you are writing) I understood the differences between different Fakes, as well as the difference between state and behavioural tests.
Along the way, you pick up on test smells, and many tips on what to do and most important, what not to do.
Since I read the book I understand and I have the purpose of writting code ( test code included of course) , that is readable and maintainable. And I want to trust my tests, and thanks to the book, I can now understand why these are important qualities of the code.
The funny thing is, that since then, I actually feel like I really got how to be test driven, because writing code in any different way, simply doesn’t make sense any more.
Conclusion
A really good book if you are interested in unit testing and feel the need to learn how to do it better, like anything you read, take it, use what you can and completely believe in and then, discard the rest; even then you will have about 80% of the book (or more) really valuable.
Reading this book, along with TDD by example by Kent Beck and maybe completing it with xUnit Test Patterns byMeszaros
Filed under: Uncategorized | Leave a Comment
Tags: unit-testing
The other day I was listening to Kent Beck in this podcast where he was talking about, amongst other things, push on green deployment, basically the idea is that once your test suite goes green, you deploy.
When I heard this originally I thought :
1) Think about all possible problems -> not only technical( this component is not compatible with the component just rolled out, etc, etc) but also processes ( and people using them ) this is a real concern, because the pace of change would increase I would guess)
2) What tests? Who wrote them? I would think higher level tests? actually all tests? Possibly the upside of this is that companies that produce quality software will become incredibly popular ( “My software doesn’t brake, we test throughly” could actually be part of the marketing and backed by actual tests, imagine that)
3) The premise for push on green is basically to push Software Development practices up a notch, so that as a developer we can say we are delivering a feature on a particular date and we can do that confidently, How does push on green help us deliver as we promised, would it makes us slower?
Deployment is a painful process, and often neglected topic, as a developer how often do you think about it? And worse, How many times you just don’t know what will happen? Most importantly. How stressed do you get close to going live? (I guess this is the time when we all start thinking about it seriously)
Great, now imagine What if that would happens every hour?
In the beginning it would be scary, but then, the practices need to be polished enough so it becomes something normal, that you are not only used to , but confident about it. After all we all become better at things with practice.
Do i like the idea? Yeah! and Its as scary as it gets
Lets look into it more in depth
So how can this possibly work?
If I was going insane(er?) and really wanted to do this, as a C# developer, what is possible?
Maybe I would start of an continuous open beta or, edge (somehow warning my users of the fact that the code they are using is “fresh out of the oven”) and once I see some stability (perhaps people could vote for it or similar)then I can fully deploy.
But then thats is just my application, lets imagine I produce code that is not public facing, but that , its an API, consumed by many other applications, how would they be aware and react to interface changes? More importantly, would this make software evolution slower by persisting everlasting APIs? or would it induce APIs that are very noisy, hence harder to discover?
I m asking this because: lets forget about the barrier of web or desktop for a minute and focus on dlls, where they live and how we use them and consume them.
If my Operating System vendor/framework provider makes a push do i want my app to get that immediately?
Say I m using an interface something like IEmailSender, that has the methods Send(IEmailTemplate, ISomethingElse) and that is replaced for the better designed IEmailSender.Send(Message) with the Send(Message[]) overload. In that example I agree with the change, I want to use the new code because the contract is better (lets assume we all agree is better ok); however, that would mean changing my application, re testing all those areas where I use IEmailSender and I most likely don’t want that.
I have to add, I would probably want to do an integration test anyway, or should I blindly trust the new IEmailSender implementation because we are all pushing on green now?
So the option here seems to be, create the new contract but maintain the old one around for a while right?, but then your API will have all these Send methods, and that doesnt seem to be going into the better development practices direction
Next I m gonna try heroku in anger and see if I get more ideas from using it, heroku is a service that runs ruby applications that are deployed when you commit.
This is a brain dump on this and would love to hear thoughts from other people, corrections, feedback, etc always welcome
Filed under: Uncategorized | 5 Comments
Tags: deployment, development, push-on-green
Test Class Organization
Hi there
Just though I d share this
this is the way I ve been organizing my test code as of late
public class MyClassTests { public class Given_a_context { [Fact] public void When_somthing_happens_Then_result() { throw new NotImplementedException(); } //............... } public class Given_a_different_context { [Fact] public void When_somthing_happens_Then_result() { throw new NotImplementedException(); } //............... } }I like this because you can still easily find the class name with resharper
you can also separate the contexts you are testing in a more clean way
this works out good for me most of the times, even when you are inheriting
from a base test class.
It also reads well in the Test runner.
Any comments?
Filed under: Uncategorized | 9 Comments
Tags: unit-testing
- I do speak too quick,
- I should talk about legacy code and how to deal with that
Filed under: Uncategorized | 6 Comments
Step by Step StarterSTS Setup
I m planing on a series of blogs on WIF ( windows Identity Foundation) however that might or might not happen
, so meanwhile I m posting this, StarterSTS is as the name implies a starter sts something to get you started on the world of Federeation Identity , claims and all that lovely stuff.
You can find a video about all this steps in the codeplex site to starter STS, however there are a few differences between what you can see in the config files there and whats in 0.95 ( this is what I’ve used) .
I tried this on a Windows 7 and a Server 2008 machine
1) Get the sources from codeplex and copy them over somewhere. create a web app that points to it
2) Create a new app pool ( not necesary but nice to be able to see what is happening)
3) Install WIF (used to be called geneva framework) latest binaries available here
4) Download and install SQL server express,or if you have a ssql server there happy days ![]()
5) Create a self signed cert and add it to the default web site , then go to default website and add the certificate to https with Bindings options
6) Add read access to the Network service account in the folder where you put the sts sources
7) Run mmc -> add snap in and get the cert thumb print , also set the network service read permisions by right click Manage Private Keys…
Open the file config/Certificates.config and change the thumbprints of the certificates ( initialliy they are all the same , the last one RP, should be the thumbprint with all spaces removed) (you can get the thumbprint of the certificate in mmc ->certificate ->properties -> thumbprint)
9) Run aspnet_regsql ( to create the asp.net membership provider aspnetdb) (This program is not in the path, so you ll probably have to go to C:\Windows\Microsoft.NET\Framework\<your version of the .net framework, if in doubt go to 2.0>>aspnet_regsql )
10) Create some users from IIS Maanger.
11) If you are going to be using from somewhere other than localhost:
- The self cert you provided must be added to your the trusted providers( whereever you are using this)
- when you are using fedutil make sure teh references to the federationmetadata.xml points to your server and not localhost ( i seen this happening more than once)
12) On the application side of things Add STS reference…
13) you might need to tweak the startersts.Config
Filed under: Uncategorized | Leave a Comment
Tags: Geneva, starter_sts, WIF
Using Ninject and Asp.Net MVC
If you are trying to use Ninject with Asp.net MVC, there is an integration available in github
http://github.com/enkari/ninject.web.mvc if you look at the code there its just 3 clases, but
the fact that its been used by much more people than just myself makes me a bit more confortable because
I m not terriby familiar with Asp.Net MVC. Please note I m not too familiar with Ninject either
If there is anything that can be improved, I m all ears.
Anyway, this is the integration working, using Ninject 2, I tried this with MVC 1 and 2 and they both worked.
Obviously get the code from the Github repository and build the solution in release mode, add them to your
project.
Then in your Global.asax.cs you need to do your implementation of CreateKernel, and a really important step,
to register all your controllers, to do that just override the OnApplicationStarted with RegisterAllControllersIn(“SomeAssemblyName”)
as in the example there in github.
If you are not familiar with ninject you ll need to look at defining your Modules as well, something like
private class MyWebAppModule : NinjectModule
{
public override void Load()
{
Bind<ISomething>().To<Something>();
......
}
}
Oh yeah, for some reason, kernel.AutoLoadModules() doesn’t work for me, its not a feature I m interested in at the moment but …
and you can use that module to create the kernel, there are other ways to use Modules but that worked for me
on my todo now is to understand why you would use one way over the other to create and work with modules
and what modules actually are.
Filed under: .net | 1 Comment
Tags: asp.net MVC, ninject
Ext Js bits
Just some interesting thing I found on the extjs world.
I m only looking at stuff working on ext3.0
In ExtJs the JsonStore has paramNames this Object contains 4 properties
{
start : 'start', // The parameter name which specifies the start row
limit : 'limit', // The parameter name which specifies number of rows to return
sort : 'sort', // The parameter name which specifies the column to sort on
dir : 'dir' // The parameter name which specifies the sort direction
}
This properties are the default however they can be changed by using a configuration property or to change globally
it should be changed in the store prototype
Drag and Drop into a grid
Shea Frederick has a very nifty Excel drag and drop into the grid, got the code
and runs in ie7, ie8, ff3.5 and Chrome and you can get it here
Filed under: Uncategorized | Leave a Comment
Search
Recent Entries
- Irish Open Spaces Coding Day II
- New/Swiped Development Machine – software musts
- DDD South West
- The Art of Unit Testing – Review
- Push on Green Deployment – (Brain Dump)
- Test Class Organization
- Lessons Learned in Unit Testing Session – DDD8
- Step by Step StarterSTS Setup
- Using Ninject and Asp.Net MVC
- Ext Js bits
- Barcamp Derry Presentation
Categories
- .net (2)
- ActiveRecord (2)
- adobe (1)
- agile (1)
- alt.net (7)
- ayende (1)
- Best Practices (2)
- blogging (2)
- browser plus (1)
- castle (2)
- conference (1)
- couchDB (1)
- dlr (1)
- Entity Framework (1)
- events pencil (1)
- ExtJs (4)
- FireBug (1)
- firefox (1)
- foxit (1)
- Girl Geek Dinners (2)
- GWT (6)
- gwt-ext (2)
- ie (2)
- ie debugger (1)
- IIS (1)
- ironruby (1)
- java (1)
- javascript (7)
- jQuery (5)
- Linux (2)
- monorail (7)
- NHibernate (4)
- NVelocity (5)
- openCoffee (2)
- pdf (1)
- php (1)
- phyton (1)
- png (1)
- podcast (1)
- principles (1)
- productivity (2)
- ruby (3)
- silverlight (1)
- speed (1)
- Sql Server (1)
- SSIS (1)
- talk (8)
- technical talks (4)
- time picker (1)
- UI (1)
- umbrella project (1)
- Uncategorized (22)
- unit-testing (2)
- urlhelper (1)
- WALL (1)
- web-development (2)
- web-server (1)
- windsor (2)
- WURFL (1)
