Saturday, May 10, 2014

Is Karma sexy?




During the last week I had to work with a JavaScript unit test execution tool. At the beginning it was bit difficult since I’m not the guy who has a crush with web based technologies. Guess what I was falling in love with this after a while. So here I’m writing a post on “karma”, another product of Google’s AngularJS team.
Testing a Java or .Net code is not a strange thing, but testing a code that written in JavaScript may be quite tedious due to its’ workflow. Again writing an easily testable code in JavaScript comes with the experience. Test Driven Development can solve these two scenarios with its prerequisites; writing a testable code and providing an effective test environment.   
The philosophy of AngularJS is quite similar with above scenarios I have mentioned, but still it requires a tool that takes the responsibility of testing your code. This is what Karma does for you. It executes test cases on your code and test them in each browser you want.
Testing your code in every browser by opening them is not what developers want to do. Karma does it automatically. You only have to mention what browsers it should be tested in the configurations.

 
                        browsers: ['Chrome']                                             

In TDD, developers have to test code in every unit they code, but this won’t happen with web development due to its workflow. Ultimately it will remain a set of bugs in the code where you have no idea of the root cause. What Karma does is, it executes all test cases when developer save an update in his code.

Karma uses node.js so there are no OS limits. It allows you to write test cases in Behavior Driven Style and wrap BDD test frameworks like Jasmine.
So finally this test runner is all about giving feedback to the developer about what he coded. This feedback is what makes developers more productive. Ultimately this provides you a productive test environment, which requires minimum number of configuration to make your life easy.

Related links:



Sunday, February 9, 2014

The magic behind Intelligence


According to my point of view, intelligence can be described as a functionality of a no embodiment component. This functionality has capabilities to make decisions and take suitable actions. The no embodiment component I have mentioned here is not strongly associated with the brain, instead it exist somewhere above the brain and manipulate the brain activity. The visible outcome of the intelligence is performing an action. The action coheres with a set of decisions made by thought classification.
A decision cannot make without knowledge. The knowledge can be either explicit or tacit. The explicit knowledge mostly represents factors in the environment or the situation. The tacit knowledge represents the value (knowledge) can be added to the explicit knowledge. Making a set of decisions depends on explicit knowledge while selecting a decision about what action to be performed depends on tacit knowledge.
So far it is clear that intelligence is all about manipulating the knowledge. Therefore it is necessary to have knowledge collecting mechanism to gain or implement intelligent properties. This knowledge collecting mechanism can be either Cognition or Perception. The no embodiment component should store the collected knowledge in such a way that the knowledge could use to make relationships among them. This storage mechanism will be discussed in another article.
The cognition is allowing to collect knowledge without experience or self-awareness of the knowledge. The knowledge gained form cognition should implement above mentioned correlations among different knowledge groups to ensure the accuracy of its actions. The perception is realizing the knowledge. Realization of knowledge is performed on the knowledge gained from cognition. Tacit knowledge is most of the time gained by perception.
The Cognition is strongly used to make Artificial Intelligence a success. The problem with this method is thought classification doesn’t use tacit knowledge, which makes it half intelligent-half predefined. In Artificial General Intelligence expectations of intelligence are on human level or beyond without any physical or theoretical constraint. As I see the AGI is in correct path with wrong compass. A human level knowledge gaining mechanism is required to achieve intelligence of human level or beyond.
Though humans are using cognition to collect knowledge, the evolutionary process made them to use perception. Adam and Eva have already given evidence for that. The knowledge gained by perception makes perfective decisions. It shouldn’t explicitly define a mechanism to reflect what knowledge gained and doesn’t need strong interrelationships like in cognition since realization crates a unique knowledge to the no embodiment component.
Perception can contribute to make a knowledge infrastructure for intelligence of human level or beyond. Detailed understanding of perception, knowledge storing and thought classification is required and to be discussed.