Saturday, December 31, 2011
Tuesday, November 8, 2011
VirtualBox-4.1.6-74713-OSX.dmg is rubbish
It failed to instal.
When I increased the size of the instal window to read the message it suggested I try again.
It failed.
It had overwritten enough of the previous installation to prevent that working too.
Fortunately I keep the old dmgs. Well I don't tidy up properly so I had VirtualBox-4.1.4.
I installed that. Logged out to release files locks and stuff. Logged back in. It worked.
When I increased the size of the instal window to read the message it suggested I try again.
It failed.
It had overwritten enough of the previous installation to prevent that working too.
Fortunately I keep the old dmgs. Well I don't tidy up properly so I had VirtualBox-4.1.4.
I installed that. Logged out to release files locks and stuff. Logged back in. It worked.
Friday, November 4, 2011
Wednesday, November 2, 2011
The Given, When, Then - User Story Scenarios
In a previous post I talked about User Stories. This post is the next step on from there, and a way to evolve the User Stories into Scenarios.
As useful as this stuff is, it is often not used.
The relation between Stories and Scenarios
A User Story will contain one or more Scenarios and the Scenario describes how the Story is used.
The Scenario Recipe
These are the three ingredients to writing a Scenario:
Some examples
The following examples start from a User Story, which is where they should start of course.
User Story: Refund on a wheel
As a customer I want return a purchased wheel so that I can get a refund.
As useful as this stuff is, it is often not used.
The relation between Stories and Scenarios
A User Story will contain one or more Scenarios and the Scenario describes how the Story is used.
The Scenario Recipe
These are the three ingredients to writing a Scenario:
- Given a context and set of circumstances
- When something happens
- Then the outcome is
Given <one or more contexts here> when <something is done>
then <the outcomes go here>
Some examples
The following examples start from a User Story, which is where they should start of course.
User Story: Refund on a wheel
As a customer I want return a purchased wheel so that I can get a refund.
Scenario #1
Given I am a Platinum user and I have purchased a new wheel, when I wish to return the wheel within 30 days of purchase, then I can do so without a penally.
Scenario #2
Given I am not a Platinum user and I have purchased a new wheel, when I wish to return the wheel within 30 days of purchase, then I can do so without 75% penally.
Scenario #3
Given I am a Platinum user and I have purchased a new wheel, when I wish to return the wheel after 30 days of purchase, then I can do so with a 75% penally.
Scenario #4
Given that I am a customer who has returned a wheel, when I am given a refund, then I get a notification email.
User Story: Order an out of stock item
As a customer I want to be informed on the status of out-of-stock items so that I can cancel the order if it takes too long.
Scenario #1
Given that I have ordered an out of stock item, and I have been told the wheel's delivery is 2 weeks, when the wheel is not in stock on despatch day - 1, Then email me and apologise and offer to cancel the order.
etc....
So why bother
There is a lot more information in these Scenarios and the process of getting people together and talking about these is hugely productive. You do not need a highly paid analyst or a developer guru for this stuff. You just need to start thinking, talking and recording. If it's incomplete and your project environment is evolving, then just starting is a great step forward.
Advice
What you can do, is pick a fictitious project, a small project, and go through the motions. This will be quite instructive.
Testing
In an earlier post I mentioned the INVEST acronym which stands for Independent, Negotiable, Valuable, Estimable, Sized, and Testable. This technique of writing Scenarios enables Testing and it go somewhere to assist Estimating.
I think the next post should be about using these User Stories and estimating work. I might wait for a week or so.
Scenario #2
Given I am not a Platinum user and I have purchased a new wheel, when I wish to return the wheel within 30 days of purchase, then I can do so without 75% penally.
Scenario #3
Given I am a Platinum user and I have purchased a new wheel, when I wish to return the wheel after 30 days of purchase, then I can do so with a 75% penally.
Scenario #4
Given that I am a customer who has returned a wheel, when I am given a refund, then I get a notification email.
User Story: Order an out of stock item
As a customer I want to be informed on the status of out-of-stock items so that I can cancel the order if it takes too long.
Scenario #1
Given that I have ordered an out of stock item, and I have been told the wheel's delivery is 2 weeks, when the wheel is not in stock on despatch day - 1, Then email me and apologise and offer to cancel the order.
etc....
So why bother
There is a lot more information in these Scenarios and the process of getting people together and talking about these is hugely productive. You do not need a highly paid analyst or a developer guru for this stuff. You just need to start thinking, talking and recording. If it's incomplete and your project environment is evolving, then just starting is a great step forward.
Advice
What you can do, is pick a fictitious project, a small project, and go through the motions. This will be quite instructive.
Testing
In an earlier post I mentioned the INVEST acronym which stands for Independent, Negotiable, Valuable, Estimable, Sized, and Testable. This technique of writing Scenarios enables Testing and it go somewhere to assist Estimating.
I think the next post should be about using these User Stories and estimating work. I might wait for a week or so.
Tuesday, November 1, 2011
How to do User Stories - easy and fast but effective
Intro type waffle
I think that there are tons of people, developers especially, working in less structured teams, under pressure to get things done ASAP, wishing that they had more experience perhaps, and not really feeling that the project is totally in control or that they are not really getting the whole picture. This text is a quick heads-up on how we can quickly switch to User Stories to help us. User stories are a key concept in SCRUM so it might be worth thinking about getting your company to look at SCRUM. It is very good, it is simple, but it can be deceptively difficult for companies to adopt. But, even without SCRUM User Stories are very helpful in their own right.
- We need to stop.
- Lookup.
- Look around us.
- Ask some simple questions.
- Then ask some more questions.
- You now have some ideas - share them.
Writing stuff down is Good
The pressure to code first, to evolve the ideas on the fly, is big. Just because you do this does not mean you are being Agile. If it's a bit chaotic, don't convince yourself you are doing bits of SCRUM or XP when you're not. Don't give it a name if it doesn't deserve it. Rather, give your work a bit of structure.
Think before you code.
List all the types of people going to use the system
This is very important. It is usually quite quick, it often gives you a slightly different view or appreciation of the project ahead.
Don't really know the answer to this? Excellent. Start talking to the Client or Client representative and any major stakeholder (don't forget the department that might be supporting the completed).
If the Client / Business has names for these users already, then use those names. Don't create your own. Use the Business terminology if you can.
Don't keep this information to yourself. Share it. Even if it's in an email. If you don't have a BA, then make sure people up the management chain understand. Share it with other developers verbally.
Actively avoid using "User" as a role. Should it be, Premium user, Bronze user, Auditor, HR staff,...
The Secret is talking
Talking, chatting, discussion - this shows that things are going well. There should be constant chatter about requirements and needs. Talking is a function of a successful project.
Core is Key
It really is. Whenever we talk about requirement, the functionality we want, the things the client needs. Keep one eye on it Context. Oh dear, I've mentioned Context without clearing up the meaning of Core. Always consider if the function is Vital to the business. Maybe you want to remember the MoSCoW mnemonic too, if that helps. But discover more about the domain, more about the business, and then discover if the feature is Core to the Business. Knowing this helps prioritise and makes sense of it in context. Context - well that can be any grouping of features or subset of the system or business. Any logical group that helps decompose the big problem.
Requirements - Stories are NOT contracts
Your junior colleagues, the management, the Clients - they will all think that once a requirement is written down it is finished with. They think you will go away and create something and you will return with a working thing. Emphasis to them that this is not the case.
Requirements will always fall short. They will always change or evolve.
The clients must not be scared of this. Embrace discovery.
Use the Business language
Ubiquitous language. Ensure that the developers and the Client Business use the same language. Use the Business terminology in preference to any technical jargon. Sometimes two departments in an enterprise may have slightly different terms for the same thing. Sometimes they are using the wrong term completely. Be aware of this. If you need to create a new term for a category or something, do so WITH the User or domain expert's knowledge.
List the Stories
Get writing the stories. This is quick to start and it will grow. Don't worry about getting it right or wrong, at least you are doing something. Stories are written from the perspective of the USER.
Follow this simple structure:
As a <put user role here> I want <put the feature here>
so that <put the benefit here>
Divide and conquer the list.
Just start listing these down and keep them short and sweet.
To help get started, in your mind before you write the list, make some sub-headings on how you can break the list into related sections. Do whatever you want and don't think too deeply about it.
Just get the list down. It will evolve and therefore whatever you write now will be either wrong or incomplete. Don't worry about that, it is good.
The list will not be complete.
Don't think you're going to capture everything if you're pushed for time. Instead,
- Start by listing the easy and obvious User Stories
- Stop and think a bit, imagine the system is in use, and imagine who is using it, and note down the use cases that are difficult, risky, or likely to be forgotten by an under pressure developer.
- Add some more.
Scope of the thinking
You start with an overview of the future and work down towards the detail. If you are a developer then technology will keep leaping into your mind and you can not avoid trying to implement the system in your imagination. This is natural, but keep it under control. Developers often focus on the technical detail and work up to the daylight of the overview. Don't do this. Imagine you are the Users of the system.
You can break the scope of the project or the list of the Stories, into areas. Get a happy understanding of any areas that you would like to park and think about another day.
So there we are. Job done.
Not quite but the work done to get this far is probably the most valuable in the project.
Make sure you are talking to the people in the know and make sure you share your thoughts with others.
Discuss or think about the stories
They probably hide a lot of information about the system. If a story raises more questions than it answers, then you've hit a rich seam of value. You can break this Story down further and document it, or if you're happy that the information is not needed on paper and has been captured, then don't. I would suggest writing it if poss. It is rarely wasted time.
At the end I'll give an example of breaking down a User Story and the types of question raised by an initial Story.
Where from here
These stories can now be taken forward and used in project estimation, planning and testing.
(That will be in another blog posting.)
(That will be in another blog posting.)
But:
- We have improved our knowledge of the business.
- We have greatly improved our chances of success.
- We have disovered information about the system.
- We have a feeling for the risky areas of the development project.
- People are talking.
Summary
- Writing is GOOD
- Start asking question and continue asking questions.
- List the Roles of the users.
- Divide and conquer the list before you make the list.
- As a <put user role here> I want <put the feature here> so that <put the benefit here>
- Concentrate on Stories that are risky, likely to be forgotten, difficult.
- Use the Client's terminology.
- Discuss and discover more hidden in the stories.
Example:
A very common user story:
As a user I want get an order notification so that I know my order has been placed.
This is ok as far as it goes and is much better than nothing.
However, thinking about it a bit could raise some questions, such as:
Do staff members, the support staff get to order stuff?
Do the staff members need to create another account?
Can all Customers order everything?
Do we have a category of Customer, say Corporate, or Business, that can access certain areas?
The answer to this is yes or no or maybe, BUT this question is not relevant to the User Story. It may well though generate another User Story along side of this. Or it might make us alter the list of Roles.
Email?
Postal?
Encrypted?
What happens if email is rejected?
How to ensure the email is correct before ordering?
Another email?
There's tons of things to think about.... and it's great fun. The problem is:
- How do I record all this new information because I'm lazy and/or busy.
- How do I make sure this information is used and acted upon.
Labels:
Agile,
Project process,
Requirements,
SCRUM,
User Stories,
XP
Monday, October 31, 2011
INVEST for requirements
A very useful acronym for use when thinking about requirements. This simple discipline helps a great deal.
Independent
Each and every requirement must be independent. It can exist in itself. If it's too large then reduce it.
Negotiable
Requireemts are not contracts. They are points of conversation and they can evolve. Clients often think that a documented requirement is the end of the story. This causes problems and must be avoided.
Valuable
The requirement should be presented as a value to the client. It makes sense to the client.
Estimable
Requirements are use in planning. Requirements must be granular enough for understanding and estimation.
Sized Appropriately
In Agile, a requirement must be around 50% of the iteration.
Testable
All requirements should be testable to ensure the requirement has been achieved.
Independent
Each and every requirement must be independent. It can exist in itself. If it's too large then reduce it.
Negotiable
Requireemts are not contracts. They are points of conversation and they can evolve. Clients often think that a documented requirement is the end of the story. This causes problems and must be avoided.
Valuable
The requirement should be presented as a value to the client. It makes sense to the client.
Estimable
Requirements are use in planning. Requirements must be granular enough for understanding and estimation.
Sized Appropriately
In Agile, a requirement must be around 50% of the iteration.
Testable
All requirements should be testable to ensure the requirement has been achieved.
Saturday, October 29, 2011
Microsoft's Distributed systems. A potted history.
I began to wonder how many technologies for distributed system that we have moved through since the 90's when I first started using DCOM. COM in VB was my first foray. Happy days.
DCOM and COM+
In the 90's, when programming with Microsoft, we had Distributed COM, DCOM and COM+ to play with if we wanted to get computers to communicate and work together as a system. These technologies were RPC based, worked only with Windows and required the DCOM to be infrastructure available on each node. The COM acronym, Component Object Model, gives us a clue that these were component based technologies.
ES
With .NET came a wrapper for DCOM and Com+ and that was Enterprise Services. This therefore had the same paradigm attributes as pre-.NET, it was RPC and worked only on Windows machines.
Remoting
.NET Remoting came along and was very simple and useful. It was ideal for new developments on new contained systems but it required each node to have the .NET CLR installed. This therefore reduced the effectiveness to only managed code systems running on Windows. It too was RPC in style.
MSMQ
Running alongside these technologies has been Microsoft Message Queue, MSMQ. It has been around since NT 4 and Windows 95. This differed from the other technologies in that rather than the RPC model it concentrated on Messages. It was not component based. But it did still require the nodes to have the MSMQ infrastructure on each node.
So we have:
DCOM/COM+ and ES
.NET Remoting
MSMQ
In the late 90's web-services became prevalent and this enables any platform to communicate to another. Linux to Mac to Windows to whatever. Utilising the ubiquitous HTTP protocol we can use XML for the message formats and they can be in a variety of types - SOAP or RSS etc.
SOAP & REST
SOAP (Simple Object Access Protocol) was the most common protocol specification used and is still very popular. http://en.wikipedia.org/wiki/SOAP
- SOAP is simple.
- It is an XML file.
- The message contains a SOAP ENVELOPE element as the root.
- The Envelope contains a Body element and a Head element.
- Your payload goes in the Body and the some controlling specifications can go into the Header. The controlling specifications are for Security, Reliable Messaging and Transaction features.
The main differing feature between SOAP and RESTful services is tat SOAP is specified to be used on any transport mechanism. REST however is tends only to be used on HTTP.
![]() |
| The SOAP stack |
SOAP can therefore be used on any platform and requires the service contract to be coded in a similar way to RPC
REST (Representation State Transfer) http://en.wikipedia.org/wiki/REST
With REST we treat services as Resources with unique identifies and we use the HTTP defined interface of
- GET,
- POST,
- PUT,
- DELETE and
- HEAD.
ASP.NET Web Services
Microsoft provided ASP.NET Web Services (ASMX) which provided early basic support for SOAP.
Web Services Enhancements
Soon after the ASMX came WSE. This provided some support for the Security, RM and Tx protocols. Also supported were some TCP support. There were however no support for REST.
Microsoft started to create a single model for all their communication frameworks. This became the Windows Communication Framework.
WCF
Now we can use use WCF to write the communication logic and then we can use whatever features we need.
This is a huge step forward. The developer can now write against one single framework even if the requirement is for binary communication over TCP, or SOAP or REST.
Tuesday, October 25, 2011
Thursday, October 20, 2011
The very best Bayes Explanation?
Is by the very interesting Eliezer S. Yudkowsky. Spend some time on his site. It's good to think.
Why is Bayes important?
Here's a story problem about a situation that doctors often encounter:
1% of women at age forty who participate in routine screening have breast cancer. 80% of women with breast cancer will get positive mammographies. 9.6% of women without breast cancer will also get positive mammographies. A woman in this age group had a positive mammography in a routine screening. What is the probability that she actually has breast cancer?
Next, suppose I told you that most doctors get the same wrong answer on this problem - usually, only around 15% of doctors get it right. Most doctors estimate the probability to be between 70% and 80%, which is wildly incorrect.
What do you think the answer is?
(see below for the answer. See Yudkowsky for why.)
R - Cheat sheet - Matrices
Return to the R Cheat sheet index page
cbind() - Column bind - Equal length vectors can be combined to create a matrix.
> x<-c(1,2,3)
> y<-c(4,5,6)
> x
[1] 1 2 3
> y
[1] 4 5 6
> mm<-cbind(x,y);mm
x y
[1,] 1 4
[2,] 2 5
[3,] 3 6
>
rbind() - As above but Row binding.
> mr<-rbind(x,y);mr
[,1] [,2] [,3]
x 1 2 3
y 4 5 6
>
t( ) - Transpose the matrix.
> mm
x y
[1,] 1 4
[2,] 2 5
[3,] 3 6
> t(mm)
[,1] [,2] [,3]
x 1 2 3
y 4 5 6
>
Build a matrix in one instruction.
> m<-matrix(c(1,2,3,4,5,6), nrow=2);m
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
>
or
> m<-matrix(c(1,2,3,4,5,6), nrow=2, byrow=T);m
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 4 5 6
>
Matrix multiplication
m1 %*% m2 - multiply matrix m1 with matrix m2
> m1<-matrix(c(1,5,10,12), nrow=2);m1
[,1] [,2]
[1,] 1 10
[2,] 5 12
> m2<-matrix(c(3,4,7,9), nrow=2);m2
[,1] [,2]
[1,] 3 7
[2,] 4 9
> m1%*%m2
[,1] [,2]
[1,] 43 97
[2,] 63 143
and using the * operator gives scalar multiplication.
> m1*m2
[,1] [,2]
[1,] 3 70
[2,] 20 108
>
Solve the matrix
solve(m1)
> m1
[,1] [,2]
[1,] 1 10
[2,] 5 12
>
> ms<-solve(m1)
> ms
[,1] [,2]
[1,] -0.3157895 0.26315789
[2,] 0.1315789 -0.02631579
>
> ms%*%m1
[,1] [,2]
[1,] 1 0
[2,] 0 1
>
Eigenvalues and vectors
> m1
[,1] [,2]
[1,] 1 10
[2,] 5 12
> eigen(m1)
$values
[1] 15.458236 -2.458236
$vectors
[,1] [,2]
[1,] -0.5688428 -0.9450825
[2,] -0.8224463 0.3268319
>
Getting elements from a matrix
diag(mm) - Diagonal
cbind() - Column bind - Equal length vectors can be combined to create a matrix.
> x<-c(1,2,3)
> y<-c(4,5,6)
> x
[1] 1 2 3
> y
[1] 4 5 6
> mm<-cbind(x,y);mm
x y
[1,] 1 4
[2,] 2 5
[3,] 3 6
>
rbind() - As above but Row binding.
> mr<-rbind(x,y);mr
[,1] [,2] [,3]
x 1 2 3
y 4 5 6
>
t( ) - Transpose the matrix.
> mm
x y
[1,] 1 4
[2,] 2 5
[3,] 3 6
> t(mm)
[,1] [,2] [,3]
x 1 2 3
y 4 5 6
>
Build a matrix in one instruction.
> m<-matrix(c(1,2,3,4,5,6), nrow=2);m
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
>
or
> m<-matrix(c(1,2,3,4,5,6), nrow=2, byrow=T);m
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 4 5 6
>
Matrix multiplication
m1 %*% m2 - multiply matrix m1 with matrix m2
> m1<-matrix(c(1,5,10,12), nrow=2);m1
[,1] [,2]
[1,] 1 10
[2,] 5 12
> m2<-matrix(c(3,4,7,9), nrow=2);m2
[,1] [,2]
[1,] 3 7
[2,] 4 9
> m1%*%m2
[,1] [,2]
[1,] 43 97
[2,] 63 143
and using the * operator gives scalar multiplication.
> m1*m2
[,1] [,2]
[1,] 3 70
[2,] 20 108
>
Solve the matrix
solve(m1)
> m1
[,1] [,2]
[1,] 1 10
[2,] 5 12
>
> ms<-solve(m1)
> ms
[,1] [,2]
[1,] -0.3157895 0.26315789
[2,] 0.1315789 -0.02631579
>
> ms%*%m1
[,1] [,2]
[1,] 1 0
[2,] 0 1
>
Eigenvalues and vectors
> m1
[,1] [,2]
[1,] 1 10
[2,] 5 12
> eigen(m1)
$values
[1] 15.458236 -2.458236
$vectors
[,1] [,2]
[1,] -0.5688428 -0.9450825
[2,] -0.8224463 0.3268319
>
Getting elements from a matrix
diag(mm) - Diagonal
Subscribe to:
Posts (Atom)






