https://vimeo.com/leanagilescotland/videos/page:1/sort:dat/
Sandro mancuso blog
http://codurance.com/blog/
Bret Victor shows how to get instantaneous feedback. Very cool!
Scotland videos conference
https://vimeo.com/52085327
Create tool which allows to set componentes state. This allows to either check the state of the components in a TDD classic style test or to check the behaviour by testing that the tool was called with the right parameters.
Logic place within a form process cant be reused. Not good to put logic in a place that you can't reuse it.
You test mainly logic.
when you test the through the ui you are testing the most end to end test, the most black possible black box.. However you'll need to stub or mock some object in order to get the behaviour you want. Which means not testing directly the object that implements it youll have to configure quite a lot in your test, which at this point you don't have a black box test anymore because you are configuring the inside of the ui. Although you could use factories to encapsulate that knowledge
Form processes can be tested as any other object. However if make sense
--> which means we test them as a black box, without looking at who he delegates to.
Testing at the form process level is more end to end test. It covers more code
In a call center application one of the key/core aspects is the user entitlements which determine given a user what can and cannot this user do.
Another reason for an action to be available can depend on the entity which that action belongs to. For example you might not to edit a policy if the policy is already closed.
So that's two different reasons to determine if action is available: the entitlement and the action entity or context in which the action is carried over. Its quite possible that these reason are handled in different ways. Entitlement failure, can be handled simply by hiding the functionality. While context failure can be handled with an informative error message.
Again is important to determine same simple error code object which allow to handle the failure in different ways.
Again this can fit within the generic validator, handler approach. Where a composed validator can be created, and them invoked by passing the handler which can be composed one too;one generic handler which handles the failure hiding a parametrized form component. And one popup error message handler which displays the failure message for the context failure.
I have just finished what it could be one of my last developments in my current client, the false new business comparator. One screen which based on a renewal proposal and fnb proposal compares them and return a lost of the fields which are different. The design is an FnbComparator class which acts as the core of this screen. This class has a fnbcomparator service which does job of getting the info from the db an compare it returning a list of differences. The fnbComparator has a Compariaosn translator which transforms the service reaponses into calls to a listener, which is implementes by the displayer. The main class remains like this:
Displayer = new FnbComparatorDisplayer()
New FnbComparator(displayer,new FnbComparatorService(), new FnbComparatorTranslator(displayer)
Displayer and comparator have each other references to allow call backs.
Responsibilities remain like this:
FnbComparator displayer: allows the user to enter info and it triggers the behavior on the comparator main class.
FnbComparator: its the class which supports the screen behavior. Expose methods accordingly to the fields shown in the displayer. It does the validation and send messages back to a listener (the displayer in this case) with whether or not that operation succeed.
There might be another way to look at his responsibilities; This class expose and interface which allows to set the correct information to compare two prp, and them expose the method compare. Each of this methods produces output messages to a class listener. However notice how the interface its dictated by the neccesity of the screen:
Setfnb(fnb fnb)
Setrenewal(renewal renewal)
Setfnbbyprposalno(string prpno)
Compare()
Notice those methods support the selection of a renewal, selection of a fnb and the manual entering of the fnb number from the ui. So he is really acting as screen listener.
Comparator service
In order to provide the screen support, the FnbComparator needs something that does the comparison, is clear this responsibility.
Notice an interesting thing this service returns a response to itscaller (FnbComparator) who is in charge of handling the response. He does it by using a response translator which allows yo hide the internals from the respond and it sends accordingly output messages (compared, unknownerror, different vehicles...) That means the respond error code system can change and we only have to change this class. It exchanges the error codes for output messages. That job is done in the book 'growing objects orientated systems" by registering the translator within the chat (my comparator service). This allows the FnbComparator remain ignorant from the fact that he needs a "servicerespondtranslator" combined with the service. Its not obvious that you need this translator to do that. It would be if the service ask for it.
This design of registering listeners seems emerging when we do outside in development. If youll start thinking from the inside out...
It seems useful when calling a service which can have multiple outputs. This way you can have one class which manages this outputs and converts them into messages creating a nice interface.
Other approach will the caller getting the response. This might bbe more the casa when the call returns more of a concrete answer, like a calculation, which then its used by the caller to calculate something else that you can assert on the final calculation.
However im this scenario the next step will be to enable or disable the buttons. Which is not the responsabilty of the caller. So you'll have to create too many classes for this test.
One approach will be pass the displayer as a listener and asserts that the displayer calls some util action. Class. With an interface very specific like 'disable button compare'. In this case given a service call you could test almost till the last step of the ui logic. As much fine grained are method in the ui as more logic you can test leaving only without testing the line of code which sets CSS class or calls the disabled. Method on the button
Bottom line is that testing state in ui is difficult and that's why we look for this mesage approach.
I've finished today the book. Just to write a list of the top things within the book:
Asking for what instead of telling how
Seeking context independence
She uses the example of mechanics and Trip. Where a trip is prepare if its bikes are prepare. There are two knowledge levels here. One is how to prepare a bike (pump the tires, check chain...). The other is how to prepare a trip. Which is by preparing each of his bikes. Both responsibilities correspond to the Mechanic. In order todo that a mechanic knows that a trip has bikes. But we could abstract this concept into a preparable , where something can be preparable is it has bikes. This avoids the preparing knowledge from leaking into the trip class.
Notice that in order to achieve this we have to different kinds of interfaces. On one side we have a mechanic (preparator), exposes command methods, which allow to tell the what not the how. But on the other we have something preparable, which responds to query methods.
I though that this kind of query concept was wrong, and was looking always for the command like concept. However it does make sense in situation like this where preparing is domain heavy concept which needs to be extracted from bike AMD put into a service. Then the dilemma is whether trip passes bikes and makes the service more context independent (he doesn't works with something that has bikes, he works with bikes directly). In this case the trip knows that are his bikes the thing that need Ti be prepare.
The other. Trip seems that. Still know that the bikes. Are prepare since still needs to respond tio bikes as a preparable.
But un tje example mechanic ask for the bikes,vehicles and something else from the trip so it totally make sense to pass the wrapping object trip.
Remove argument order dependency with a has table
Inheritance
Decoupling subclasses using hook messages (post_initialise)
It removes. The super from subclasses and therefore the knowledge within the subclass of the superclass
Query versus command important for testing