(update: I added some updates about more reasons for the settlements as well as more about the size of israel, and a note about the british rule (with some images))
Apologies to the regular readers of this blog.
This is a political post, which I don’t usually do. I live in Israel. I love the fact that technology brings people together, and I have several online friends from countries considered enemies of or hostile to israel (syria, iran, lebanon).
With the recent conflicts between Israel and Palestinians in Gaza, You’ve probably seen this map being thrown around in various forums.

It depicts what seems to be a loss of land that was previously Palestinian. It looks pretty horrible without context, I know.As an israeli and as someone who really dislikes dis-information, I though I’d give my point of view, based on what the real facts .
I’m writing this so that I can point my friends and those who ask to a place where there is more context and info about this map, and why, even though it may be georgraphically correct, it is a distortion of reality to take it out of context.
A good source of history information about the conflict
a site doesn’t take sides, that has a more or less accurate information about the dispute can be found here.
OK, let’s talk about the maps from left to right (chronological order):
Map 1: 1946
The map is NOT graphically correct. Several things are not accurate. First – the british had ruled israel. this was not arab land or jewish land. jews and arabs were living in british occupation. Another thing that needs to be said is that the bottom half of the map was unpopulated – it is a desert part in israel, and even today, it has less than 10% of the population living there because of the conditions. so it should not be green or white. it was largely empty.
The arab population in israel was larger than the jewish population, and they were both growing at a large rate.There was a large influx of jews coming in(most of whom were fleeing the increasing persecution in Europe). There was lots of killing and massacres against the jews until the UN decided to partition the land (as seen on map 2).
Map 2:
The UN decided what the division would be(israel got most of the uninhebited, desert part). arabs got the right part, and lots of the top and parts of the left. For context – the right side of the map borders with Jordan, which means the UN declared the green right part to actually be jordanian terrotory. the top part id bordering with syria and lebanon. the bottom part borders with egypt.
map 3:
The important thing to remember here is that the arabs did not accept the UN decision and instead began to wage war against the israelis (who wanted to accept it). During this war the israelies had won, and had pushed the arabs back into what is now seen in map 3 (second from the right). Remember, this was war and the green zones were attaching the white ones. so green was smaller at the end of the war.
in essence, map 2 never came into existence. except in the minds of the UN.
that’s how it roughly stayed until 67.
map 4:
so how did we get from map 3 to map 4?
in 67, Egypt decided to declare war on Israel (the bottom gray in the map is the start of egypt. They essentially closed all the bottom part of israel and parts which are not seen on this map.
Jordan and Syria (to the right and to the top of israel) quickly joined in the war, and israel was now attacked from 3 sides. yes. that includes in inner green part that was actually attacking israel from almost within it.
Israel gained victory in that war, pushing back jordan, syria and egypt into what will now look closer to map no. 4 (most right).
the settlement problem
After Israel had won, it could have chosen to do many things – for example negotiate with jordan and leave the places won over to something like the 67’ border. But it chose, for mostly security, ideological and religious reasons, to stay in those territories and start building settlements there. it built roads that divided the occupied land and basically did lots of things which today there is nothing really good to say about them (and is slowly trying to turn back the wheel on some of them). Still, the security aspect is the one that is the most relevant today. It keeps the other side farther away. if they were closer, their missiles could have easily hit 60% of israel, instead of 30% right now.
A hole we can’t get out of
a lot of what people have a problem with today is the fact that israel as a country supported and still supports parts of the settlements, which are not legal by international law. the reasons, again, are security,ideological and religion (promised land etc..). there is a great divide among the israeli people whether this should continue or not but the situation has now become too problematic to easily solve. Many also believe that the settlements are a security measure that helps to keep the missile attacks farther away from the cities.
for example, Israel had actually gotten fully out of part of the territories (gaza for example), but got back missilies and rockets (which is why we see the Israel coming back in – to stop this). there were many negotiations and many agreements that were broken or followed by both on a single side of the conflict, and many believe that there is no one to talk to on the other side.
many in israel believe that two states are the end result any way, (something like the 67 borders) but want to make sure that the other state will not try to destroy israel (as it had promised to do, with the backing of iran and syria) many times. a state next to you has to recognize that you have a right to exist, and not try to burn you.
Why we are in gaza now
Israel is in gaza now for the simple reason of stopping the rockets and achieving a ceasefire that will last for a long time. it has started with a 6 month quiet period in which over 400 rockets were fired on israel from gaza with no retaliation.
there is no denying that the human situation in gaza sucks. Israel tries to aid in allowing food shipments, money and international aid through passages, but at the end of the day, right now, it is trying to defend itself. nothing more, and nothing less. with force, yes. because nothing else before that has worked.
The size of israel
Israel is Tiny. Seriously. Much smaller than California, Norway or Argentina (see more places to compare). I can take my car and drive from north to south in about 6-8 hours of non stop driving. Compare israel to the size of its surrounding countries and you begin to see what “small and surrounded with enemies” feels like. Jews have literally nowhere else to go. Arabs have lots and lots. yet they insist that Israel be destroyed. And Israel still has to defend itself from many threats all around. and now, also from within.



There is a lot of mis and dis information running around the web right now. I hope that the facts can help sort things out. I hope that I had done justice to the facts.
Before writing this, I did some fact checking with a well known middle-east researcher before publishing this, and will update this post on problems or important comments.
FYI, the morning brew is one of the link blogs that I read on a daily basis too. Thanks for the work!
I find that it is a good place to find out what’s going on in the .NET and ALT.NET scene these days.
I’ve been asked quite a lot recently whether one can write unit tests and isolate logical code that runs inside a silverlight application. Up until today my initial answer was ‘no’ because silverlight runs under different versions of mscorlib.dll.
however.
Today I actually gave it a try and realized that writing unit tests (not integration tests, as the silverlight test framework allows) against silverlight based code is possible and quite easy. Just like any other code that relies on a third party platform (like sharepoint code) the silverlight related code might have various dependencies.
I’m going to show how to use Typemock Isolator to overcome a couple of simple silverlight dependencies (using HtmlPage) and how to setup a test project against a silverlight project (with NUnit or MsTest)
Assumptions:
- You have an open solution
- the solution contains a silverlight class library or silverlight application project
To setup a test project against silverlight using MSTest:
- Add a new test project to the solution
- Remove all the existing classes (Database test, ordered test etc..) so that you are only left with the unit test class (UnitTest1).
- Remove all useless comments and crud code from the test class so that you are only left with a test method (no comments, not even the TestContext)
- Add a reference to the silverlight versions of “System.dll”, “System.Windows.dll” to the test project. (usually located under “C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies\” (remove existing reference to system.dll if you need to first)
- Add a reference to the project under test
- You can now write tests against the object model (standard classes)
To setup a test project against silverlight using NUnit or MbUnit:
- Add a new class library to the solution as your test project
- Add a reference to the silverlight versions of “System.dll”, “System.Windows.dll” to the test project. (usually located under “C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies\” (remove existing reference to system.dll if you need to first)
- Add a reference to the project under test
- You can now write tests against the object model (standard classes)
How to break the dependencies
Now, here is a simple example of code that has a silverlight dependency we’d like to test:
Let’s say we have a class in the silverlight project called ChatSession (I’m basing this on ScottGu’s Chat demo). but it’s constructor looks like this:
What if we wanted to control during our test whether the page is enabled or disabled?
Here’s one way to do it using Isolator:
- In your test project add two references under the .NET tab: “Typemock Isolator” and “Typemock ArrangeActAssert”
- Write the following test:
Using Isolate.WhenCalled() we are able to circumvent any method (static or not) to return whatever we want, or throw an exception.
Here’s a more interesting case. Let’s say we have a method that modifies the current page and shows some html to the user in a span tag:
here is one way to write a test that makes sure that the right text is set into the message element in the page, without needing to have a real page present:
There are several things to note here:
- HtmlElement is Sealed has an internal constructor, but we can still create a fake instance of it using Isolator. None of the other frameworks can do this.
- We are returning a fake object from a method call chain (HtmlPage.Document.GetElementById ) without needing to create a separate stub for document. None of the other frameworks can do this (especially since it is based on a static method call to begin with)
- We assert in the end that the method was indeed called with the correct arguments without needing to change a single piece of code. Granted, I wouldn’t write code like this (I like decoupling!) but sometimes you just don’t have the ability to change existing code.
If you are developing an open source silverlight project, it is important to note that there is a free full version of isolator for open source projects with full functionality.
These are just the beginning of my journey into silverlight unit testing. I’m looking for good code examples that you might want to test, with various dependencies that need breaking. your comments are appreciated.
I’ve always been looking for real research numbers on the effectiveness of TDD. For future reference, there are several listed here:
http://biblio.gdinwiddie.com/biblio/StudiesOfTestDrivenDevelopment
One area that I didn’t know about was brought to me by an attendee in one of the conferences I was in. It’s a simple idea, really: write the tests for a method as part of the method’s documentation. but make them executable.
In python, they have something called doctest (thanks to Alf Lervåg for the emails!)
here’s a PDF with more in.
With the upcoming WPF editor in VS 2010, we could find a good use for such a thing. I think it might ease adoption of unit testing becuase it’s much easier to accomplish if you can write the test right there where the method you’re writing is. The cons are lack of intellisense, compilation errors and such, but it’s something to look at, indeed.
I’m in the process of teaching another TDD master class in Oslo this week, and in the past two days we went over the major Isolation frameworks in .NET (I refuse to say Mocking frameworks anymore. the “Mock” work is too overloaded as it is). We covered NMock, Rhino Mocks, Moq and Typemock , and alos as a start we used hand written mocks and stubs, and NUnit.Mocks for entry level learning.
Several things can be gleaned from how students reacted to using these frameworks (in random order of thought)
- The verification error messages that all three big frameworks (rhino, typemock and mock) throw could be much clearer (expected X but only got Y)
- The AAA (Arrange act assert) model for isolaation framework, whilke much shorter, is still not as easy to grasp as you might think for newcomers. In fact, I’m not sure people found it easier than record-replay.
- One of the hardest points was remebering the APIs in rhino and Moq, becuase there is more than one entry point to using the API (Constraints alone in rhino have 4 different “root” classes)
- The word “Expect” confuses because it makes you think about “expectations” as in interaction testing, when in fact it can be used for stubbing out things.
- Once people realized that “Strict” mocks are causing lots of problems, it was one of the first questions they had about any new framework they learned. NMock2 doesn’t have a way to turn off Strict mocks. weird.
- Verification Exceptions can be too easily “swallowed” by inner code so the test seems to pass (false positive). i think Isolator is the only one that will re throw swallowed exceptions).
- in AAA, People kept doing Expectations or Stubs method return values when what they meant was they want to veify the method was called
- Given an interface IFoo with a boolean property,if people want to make the property return a false value they instinctively write “myFake.Foo=false”. All frameworks should support default “property like behavior” to make this possible. Rhino mocks has this ability.
- 2 VB.NET students in the class kept hitting walls with everything that had lambdas in it,(Vb.NET has partial support for anonymous delegates) which means right now VB.NET has to use record-replay.
- The fact that Moq needs lambda expression trees and not regular lambdas prevents resharper from generating code signatures using smart intellisense. Moq is not resharper-friendly..
- the Moq syntax for constraints is just too complicated (It.IsAny<string> is OK, but It.Is<string>(s=>s.contains”a”) is just too much code noise and complexity
- The rhino AAA way of constraints is also hard to remember, but a bit more friendly (but not by much) : Arg<string>.Matches(Text.Contains(“A”)
- Mixing inheritance and frameworks fake objects in the same test is very confusing for beginners.Either use an isolation framework or override virtual methods, but not both.
- TestDriven.NET wins hands down against resharper unit test runner
- People love RowTest (which seems to have been gone with the new version nunit 2.5 and replaced with [TestCase(values…)] )
- the book “Test Driven Development with MS.NET” is hideously outdated by now (given out to students)
- People want the ability to define a call-by-call behavior of a stub return value. Feels very much like over-specification
- With hand written stubs newcomers will easily make the mistake of adding real functionality into the hand written class instead of into the production code.
- Test names really help to find misunderstood requirements
- 3 frameworks in 1 day could prove to be too much information. 2 could be just enough.
- When doing TDD people will actually forget that they can debug the test to see why it’s not behaving like it should
- People really likes the fluent API design of NMock2, but disliked its strictness
- If you use moth Moq and rhino in the same test class, you will see all the extension methods mixed up when you open intellisense on any object. *shiver*
- Isolator was the only one where people didn’t ask me a single question about what API to use. they did put calls in the wrong place in the test though (AAA is hard to get used to)
- AssertWasNotCalled feels like over-specification.
- lambdas were easier to get used to than I expected.
I'm working on adding a VB.NET Friendly syntax for Typemock Isolator. If you're into VB, I'd love your input on the usability of this API and how to make it better.
We'll start going through several basic scenarios that you can do using Typemock Isolator, and show them in VB proposed syntax:
- Faking instances of classes or interfaces
- Setting Stub return values or errors on methods
- Verifying the methods were called
- Swapping calls between two types
- Swapping future instances
- Faking Non Public Members
Faking instances of classes or interfaces
the method Fake() is part of a Module called "Test" so it can be used from the tests easily. You could also write Test.Fake(..) if you wanted.
Setting Stub return values or errors on methods
here are three examples of returning a fake result from a method or a bunch of methods (below). ThisCall(s) is located on the Module Test so you can also write Using Test.ThisCall.WillThrow(...) if you wanted to.
Verifying that methods were called
This would go at the end of an interaction test
Here's an example of a full Arrange-Act-Assert in a test using VB and fakes:
One possible thing I am considering is adding Arrange-Act-Assert "Regions" to the test by taking advantage of the "Using" feature:
Question #1: What do think about the custom Arrange-act-assert regions? (they are option to use anyway)
Swapping calls between two types
This is the "duck typing" feature we introduced in Isolator: allowing you to make calls on one object be invoked on another, without them sharing the same interface, as long as the method names match.
Swapping future instances
Isolator supports faking the next creation of an object type, and replace that with the fake we create:
Faking Non Public Members

Time for a freebie!
We’re announcing today about a new product: Isolator for sharepoint – which allows unit testing sharepoint code without needing sharepoint installed.
A good article on this can be found
here “Huh?”
It is almost the same as Typemock Isolator, but will only work on APIs that are directly connected with sharepoint’s API. All the other features are the same. That means that if you only need to test sharepoint stuff, you can get a powerful product, for a much cheaper price than the full Isolator (you can always upgrade later if you need to isolate more APIs). How cheap? Isolator for sharepoint is only 99$ during this offer .
With this release, we want to gather the power of crowds, by offering you an incentive for blogging about this news: Get A free Typemock Isolator license (the full one) just because you have a blog. Here are the full rules on how to get a free License for Typemock Isolator (full).
Basically, you just write the following text on your blog (with the links) and tell us about :
<Begin>
Typemock are offering their new product for unit testing SharePoint called Isolator For SharePoint, for a special introduction price. it is the only tool that allows you to unit test SharePoint without a SharePoint server. To learn more click here.
The first 50 bloggers who blog this text in their blog and tell us about it, will get a Full Isolator license, Free. for rules and info click here.
<End>
Here are the full rules on how to get a free License
It's that time again. We're Hiring.
Typemock Is looking for a developer with good .NET skills, and a passion for agile development.
You don't have to know TDD, but it's a plus. Knowing some C++ is a must, but most of the work is in managed code, building the next generation of unit test frameworks. Like Threading? Like API design?
send me an email to roy at osherove.com with your CV. 2 years experience at least, please.
and be prepared for an interview that includes you programming a little bit..
Oh, you have to be located in Israel.
My son, Itamar, playing invisible Tennis
_thumb_RNTGcg.jpg)
More Posts
« Previous page -
Next page »