Thursday, November 27, 2008
Anger is a gift (quote)
...
if you're not outraged, you're not paying attention. If you witness someone suffer undeservedly, that ought to madden. If you see someone profit through malice or fraud, that ought to infuriate. When you see cruelty, when you see pain, when you see injustice, and you know it would sacrifice nothing of moral consequence to end that cruelty, to soothe that pain, or right that wrong, and yet it persists, something has to explode inside you if you've got anything resembling a soul.
....
Tuesday, November 25, 2008
Stop Unittesting Its A waste Of Time!?
Ever noticed that some professionals (dedicated people most of the time) can have fatigues for certain attitudes or situations?
You know what I am talking about... Just think of Gordan Ramsy for example.
Today, I noticed that I am about to have some fatigues myself!
- Don't tell me that working with a version control system takes way too much time making it impossible to meet your deadlines! Just don't!
- Don't tell me that spreading (not adding) your code out over an interface, baseclass and factory takes way much more time! Don't!
- Don't tell me that managers won't give you extra time to write unittests for your project! Don't, Don't, Don't!
"Managers won't give you extra time to write unittests...?"
If you don't get extra time to write unittests it is probably a very good thing! I mean, why do you ask your manager for this in the first place? Are you asking your manager for extra time to have sensible variable names in the code you write? Are you asking for extra time for something "exotic" as comments? Ofcourse you are not! Same goes for (unit)testing! When your manager asked you how long it would take to develop that piece of software he ment "How much time will it take to develop the software in a sensible way!". Asking for extra time for comments or testing or anything else that is normal when it comes to software development is your own attempt to get everybody frustrated... If this would be your attitude I bet that if you would get this mysteriously needed extra time in the first place , your software would still not meet quality standards only to find another excuse... but that's a different story.
"Unittesting takes way too much time?"
The first thing that pops into my mind is what do you compare it to? Changes are that you are comparing a well (unit) tested software system with a hardly tested at all software system. Sure testing takes a fair amount of time but this has nothing to do with unittesting or any other testing methodology.
To make this point extra crystal clear I will give you an example:
Today is your lucky day! Your are asked to extend your Acme-company's intranet with a way too simple news-part.
Your current "timesaving" scenario:
You create the table in your database, write some queries and code to get the data in and out the database, some helper functions probably and finally the User Interfaces. Not using any sensible (unit)testing strategy you probably test the application by inserting, updating and deleting minimal news articles (subject=a, body=a, startdate=select from calendar, department=select from list) as long as it takes for the simple scenario to work. Tired of "testing" you do another test with a large newsarticle. You call it a day and a finished application ready to take into production... only for the nightmare (maybe not your nightmare but definitely mine). When users start using your application bug reports are being made to the helpdesk by phone and by email to be answered, added and forwarded via the bugtrackingsystem only to be discussed with the manager what to do and when. You find the bug, change your code again you do some simple and random testing, do a release (with all the overhead that comes with), close the bug and tell the manager and helpdesk for them to inform the original user.
Why did all these bugs hit you in the face? Because you did not test at all... If this is what you call testing I suggest you buy a book about testing software... I call it a waist of time....
Your new "timesaving" scenario:
Instead of doing those random dataentry scenarios that usually involve endless logins and selecting the needed menu buttons and options... I will write three simple test that do a "way too simple" insert, update and delete. I know that doing those will save me a lot of time compared to your scenario. I will run the tests and modify my code until it works. The time I have left I spent on writing some extra simple tests for my code (test principle: find defects early). Now that everything works I tie things up to my user interface and do some simple but serious Blackbox testing because the user interface contains hardly any code (test principle: software that is easy to test is easy to maintain).
Now when a bug report comes in I check it against my unittests to see why that situation is not covered. If it is covered it's simply a user interface problem easily fixed.
Conclusion:
Unittesting does not take extra time if you don't do extra testing. It does save time because you can just repeat and repeat your tests with one press of a button untill things work.
Of course, even if you would compair proper repetitive manual testing in comparison to proper unitesting, unittesting will saveyou time right from the strart (even before you start refactoring). Not to mention that unittesting not only results in less defects but also leads to better designs....
Happy UnitTesting, Today !
P.S.: I know the example is not UnitTesting by the book its more integration testing but that's not what this article is about...
Friday, November 21, 2008
What is Architecture (Quote)
"Architecture is the continues quest for finding, keeping and sharing the perfect balance between philosphy and pragmatism through continuous evaluation of all stakes in blind justice by utilizing all available creativity and knowledge ."
Marcel van Eijkel -Eindhoven, 21 November 2008
Marcel van Eijkel -Eindhoven, 21 November 2008
Labels:
Architectuur,
Quotes,
Wat is Architectuur
Thursday, November 6, 2008
Whats new in DotNet 4.0 (pdf)
Take a look at this .pdf to get a good but quick impression about the new types and namespaces included asof Dotnet 4.0 (and 3.5 servicepack 1).
http://brad_abrams.members.winisp.net/Projects/PDC2008/PDC2008-NETFX4.pdf
I think there is enough for everybody to benefit.
For me I particularly like:
http://brad_abrams.members.winisp.net/Projects/PDC2008/PDC2008-NETFX4.pdf
I think there is enough for everybody to benefit.
For me I particularly like:
- the new biginteger datatype that is part of the new core;
- the new concurrent-collection;
- the mvc framework that is included;
- the many new classes for the workflow framework;
What I like less about this release:
- the entity framework seems part of this release. My experiences sofar before it was included in this release were disappointing;
- in my opinion, the unity should have been part of the core;
- new ajax stuff, but i would bet my money on jquery. No microsoft ajax for me anymore for a while;
Monday, November 3, 2008
My Favorite Code Snippets (Visual Studio)
Below, my ever growing list of my favorite Code Snippets:
- IDisposable: http://gotcodesnippets.com/1136.snippet (replace destructor in the comments with finalizer)
- Singleton: http://www.gotcodesnippets.com/1042.snippet (as per http://www.yoda.arachsys.com/csharp/singleton.html)
happy Snippeting!
Friday, October 31, 2008
Visual Studio Unittest Inheritance
As your project thus your unittests grow and get more complex you might have to use every Object Oriented "trick" in the book to keep your UnitTests lean/mean/fast and flexible. Of course you don't want any redundant (unittest)code so applying inheritance to your unittests might seem a natural step (especially with provider/Inversion Of Control/Plugins beging used more and more).
Inheritance of UnitTests for Visual Studio however, still, is only partly supported by Visual Studio 2005 and Visual Studio 2008 (all editions). You can't define your baseclass/derivedclass in seperate assemblies.
To me this is a big limitation and the "obvious" solutions offered by Microsoft (copy/paste or add twice) for me are no option. I rather go for sharing in my version control system.
Just an other example of why UnitTesting as offered by Visual Studio so far "feels" a bit unmature. Speaking of which: the atrributename of "fixture" is so much more right then "testmethod"...
======== From MSDN =============
A test class is any class that is marked with the TestClass attribute. Test classes can now inherit members from other test classes. This means that you can create reusable tests in base test classes; derived test classes can inherit tests from base test classes. This feature eliminates duplicated test code and gives developers more flexibility while unit-testing production code.
A test class cannot inherit from a class that is in a different assembly. You can circumvent this limitation in the following way:
===============================
For more information:
Visual Studio 2005: http://support.microsoft.com/kb/919649
Visual Studio 2008: http://msdn.microsoft.com/en-us/library/ms182516.aspx
Happy Testing!
Inheritance of UnitTests for Visual Studio however, still, is only partly supported by Visual Studio 2005 and Visual Studio 2008 (all editions). You can't define your baseclass/derivedclass in seperate assemblies.
To me this is a big limitation and the "obvious" solutions offered by Microsoft (copy/paste or add twice) for me are no option. I rather go for sharing in my version control system.
Just an other example of why UnitTesting as offered by Visual Studio so far "feels" a bit unmature. Speaking of which: the atrributename of "fixture" is so much more right then "testmethod"...
======== From MSDN =============
A test class is any class that is marked with the TestClass attribute. Test classes can now inherit members from other test classes. This means that you can create reusable tests in base test classes; derived test classes can inherit tests from base test classes. This feature eliminates duplicated test code and gives developers more flexibility while unit-testing production code.
A test class cannot inherit from a class that is in a different assembly. You can circumvent this limitation in the following way:
- Define your base test class in a source code file and add the file to Project A.
- Add the same source code file to a different project, Project B. To do this, right-click the project in Solution Explorer, click Add, click Existing Item, and then use the Add Existing Item dialog box to select the file.
Although Project B builds into a different assembly, it includes the base test class. Other test classes in Project B can inherit from that base test class
===============================
For more information:
Visual Studio 2005: http://support.microsoft.com/kb/919649
Visual Studio 2008: http://msdn.microsoft.com/en-us/library/ms182516.aspx
Happy Testing!
Thursday, October 30, 2008
Bad Architects (Quote)
"We would not discuss so abstract about Architecture if we were not such bad Architects."
Marcel van Eijkel, 30 oktober 2008 (based on a quote of Friedrich Nietzsche)
Marcel van Eijkel, 30 oktober 2008 (based on a quote of Friedrich Nietzsche)
Wednesday, October 22, 2008
ASP.Net Ajax Update Panel Quirks
Mainly as a reference for myself, when working with the ASP.Net UpdatePanel remember the following limitations, I have encountered sofar:
- Radiobutton-triggers only work if you set no default value (you can set it from the codebhind) see: http://forums.asp.net/t/1126914.aspx
- Script-blocks don't work if you want it anyway there is a nice solution here: http://weblogs.asp.net/infinitiesloop/archive/2007/09/17/inline-script-inside-an-asp-net-ajax-updatepanel.aspx
For now, I am a big fan of the updatepanel because it gives me the user experience benefits of Ajax without the (architectural) impact.
Microsoft's Ajax Strategy
With only a bugrich codeplex AJAX Toolkit available, professional ASP.Net Developers were forced to count their options outside the Microsoft playfield. Fast amounts of time were and are invested in encorperating Ajax-frameworks into ASP.net. Just think of Backbase, Dojo, Prototype and Yahoo to name a few.
But there is hope If you are a fan of Scott Guthrie it can't be a suprise, Microsoft future direction for their Ajax strategy will be "JQuery". Atleast that is what I expect given the influence that Scott has and the recent beta release of the mvc-framework heavily depending on JQuery.
My experiences with JQuery are amazin: in the very first place it is very very practical. Its amazing what one can accomplish with a few, intuitive, lines of code.
Secondly, the availability of ready-to-use components build on "JQuery" is rapidly increasing.
So my advise: start experimenting with "JQuery" today, and learn the basics.
See: http://www.jquery.com/
But there is hope If you are a fan of Scott Guthrie it can't be a suprise, Microsoft future direction for their Ajax strategy will be "JQuery". Atleast that is what I expect given the influence that Scott has and the recent beta release of the mvc-framework heavily depending on JQuery.
My experiences with JQuery are amazin: in the very first place it is very very practical. Its amazing what one can accomplish with a few, intuitive, lines of code.
Secondly, the availability of ready-to-use components build on "JQuery" is rapidly increasing.
So my advise: start experimenting with "JQuery" today, and learn the basics.
See: http://www.jquery.com/
Tuesday, October 21, 2008
Quote about recognizing a leader
Iedereen met een doel, die van anderen afhankelijk is om dat te bereiken, is een leider.
21 oktober 2008, Marcel van Eijkel
=====
(translation)
Anyone, who has a goal being dependent on others to accomplish it, is a leader.
21 oktober 2008, Marcel van Eijkel
=====
(translation)
Anyone, who has a goal being dependent on others to accomplish it, is a leader.
Monday, October 20, 2008
Null Column Values in Linq2SQL ( isNull, Linq )
Just wanted to share that a common mistake using Linq2SQL is to use the "equals operator" if you want to find a row that has null-values in certain columns.
Wrong:
From table in context.Table where (searchValue == table.Column)
Results in "from Table where Column=null"
Right:
From table in context.Table where (Object.Equals(searchValue, table.Column))
Results in "from Table where Column is null";
Happy Linqing!
PS: the reason I am using Linq2Sql and not Linq2Entities because of the current lack of disconnected entities support. I tried it but it was way too time consuming to use the conceptual layer as a business/object layer.
Wrong:
From table in context.Table where (searchValue == table.Column)
Results in "from Table where Column=null"
Right:
From table in context.Table where (Object.Equals(searchValue, table.Column))
Results in "from Table where Column is null";
Happy Linqing!
PS: the reason I am using Linq2Sql and not Linq2Entities because of the current lack of disconnected entities support. I tried it but it was way too time consuming to use the conceptual layer as a business/object layer.
Saturday, October 18, 2008
Decorator Pattern using the Unity Framework
Realizing the decorator pattern in the DotNet-Framework has always been easy.
But, with the arrival of the new Unity (Inversion Of Control) Framework setting this up is less intuitive.
Below a config-based example (mainly for my own reference) copied from a codeplex discussion see:
http://www.codeplex.com/unity/Thread/View.aspx?ThreadId=24015
Happy decorating!
But, with the arrival of the new Unity (Inversion Of Control) Framework setting this up is less intuitive.
Below a config-based example (mainly for my own reference) copied from a codeplex discussion see:
http://www.codeplex.com/unity/Thread/View.aspx?ThreadId=24015
Happy decorating!
Thursday, October 9, 2008
WCF Windows Service (Debugging)
Seeing the popularity of SOA rising, Microsoft's WCF services are rightfully being used more and more. Ofcourse, those services need to be hosted somewhere. One of the options for this is in a Windows Service (or technically speaking in a Process Service).
But, with the development of Windows Services comes the, generally accepted, burdon of deploying (compiling, installing, starting, attaching debugger, stopping, uninstalling) these services with every change we make, atleast if we do this by the book.
Not settling for that situation I counted my (too many) options and choose the following stratagy:
1) As goes without saying, allways make sure your service has hardly any "guts". Have all the logic in a seperate class that is seperately and indepentdently unittested.
2) Add a "program.cs" to your WindowsService-project, change its type to "Console Application" finally have Visual Studio start that project up when you start debugging your solution. (see source here: Run-windows-service-as-a-console-program.
Happy Servicing
Notes:
But, with the development of Windows Services comes the, generally accepted, burdon of deploying (compiling, installing, starting, attaching debugger, stopping, uninstalling) these services with every change we make, atleast if we do this by the book.
Not settling for that situation I counted my (too many) options and choose the following stratagy:
1) As goes without saying, allways make sure your service has hardly any "guts". Have all the logic in a seperate class that is seperately and indepentdently unittested.
2) Add a "program.cs" to your WindowsService-project, change its type to "Console Application" finally have Visual Studio start that project up when you start debugging your solution. (see source here: Run-windows-service-as-a-console-program.
Happy Servicing
Notes:
- Don't worry, by changing the type to "Console Application" you only tell Visual Studio to start (technically speaking "exec"-buildtask) the main-function of the program.cs you can still deploy your services without any changes to the sources/binaries.
- Try to group your Services in one Windows Services (technically speaking adding multiple appdomains to the process). If applicable this does save a significant amount of memory.
- Microsoft's upcoming OSLO concept might make this approach less needed;
- Add the following configuration block to your "app.config" to get usefull Console output:
<system.diagnostics>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="configConsoleListener"
type="System.Diagnostics.ConsoleTraceListener">
</listeners>
</trace>
</system.diagnostics>
Monday, October 6, 2008
Quote about being reasonable
The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man.
Friday, September 26, 2008
The world of business (Quote)
The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing.
Albert Einstein
Its unmistakable that that business is an eminent part of that same world.Tuesday, July 22, 2008
Quote about energy through patience
In the sweet exile of labour we first of all learn patience. Patience teaches us energy and energy gives us eternal youth composed of receptivity and enthousiasm.
Tuesday, July 15, 2008
Plain Agility (Project Management)
I just found an excellent (pdf)article on the Microsoft website exaplaing basic Agility concepts in the first place and the role of tooling second.
Although it is written for Microsoft the author keeps the role of tooling general. I just love articles like that.
Easy to read, hard for anyone (other than purists) to disagree.
Its written by Kent Beck from Three Rivers Institute.
You can find the document here.
Happy Reading!
Although it is written for Microsoft the author keeps the role of tooling general. I just love articles like that.
Easy to read, hard for anyone (other than purists) to disagree.
Its written by Kent Beck from Three Rivers Institute.
You can find the document here.
Happy Reading!
Sunday, July 6, 2008
Hollands own technology TV Station!
The last few years, I have been watching the t.v. less and less! Except for the discovery channel it has really rock-bottomed for me.
But I expect things to change the first of October! A date to put in your calendar. That date will be te start for Holland's Technology / Inovation / Internet TV-Station.
Check it out at: http://www.blueshots.tv/
Supported by Hollands Boris Veldhuis van Zanten!
Happ Watching...
But I expect things to change the first of October! A date to put in your calendar. That date will be te start for Holland's Technology / Inovation / Internet TV-Station.
Check it out at: http://www.blueshots.tv/
Supported by Hollands Boris Veldhuis van Zanten!
Happ Watching...
Microsoft Arrowhead (DotNet)
Finally, I just found the time to download, install and play a bit with the DotNet Framework 3.5 Service Pack 1 (beta).
Part of this service pack seems to be something called "ArrowHead". As we are used from Microsoft, this is still the codename of course.
As I understand this "ArrowHead"is about supporting occasional connected clients.
Let me know what your experiences when you have taken the time to play with it. There is not much information available to me yet, but have a look at wiki:
http://en.wikipedia.org/wiki/Microsoft_.NET#SP1_.28codename_.22Arrowhead.22.29
Happy Playing (with your arrow-head :)
Part of this service pack seems to be something called "ArrowHead". As we are used from Microsoft, this is still the codename of course.
As I understand this "ArrowHead"is about supporting occasional connected clients.
Let me know what your experiences when you have taken the time to play with it. There is not much information available to me yet, but have a look at wiki:
http://en.wikipedia.org/wiki/Microsoft_.NET#SP1_.28codename_.22Arrowhead.22.29
Happy Playing (with your arrow-head :)
Tuesday, July 1, 2008
Linq Examples (Cheat Sheet)
Just came across this webpage from Microsoft where you can find 101 neatly categorized Linq examples:
Happy Linking!
Happy Linking!
Subscribe to:
Posts (Atom)