Wednesday, June 27, 2012

Behavior-driven development framework för Javascript


Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests.
Check out : http://pivotal.github.com/jasmine/

Tuesday, June 26, 2012

Webscraping using Javascript



There are a number of Javascript frameworks you can use to web scraping:

1) Selenium, check out Seleinum Grid.
Selenium has been adopted as the primary technology for functional testong of web applications within Google.
Selenium now wraps htmlunit so you don´t need start a browser anymore. The new WebDriver api is very easy to use too. The first example use htmlunit driver
2) Watir (Ruby)
3) PhantomJS
4) CasperJS
5) Zombie for Node.js
6) Pjscrap based on PhantomJS and JQuery
7) HTMLUnit (Java)


Friday, May 25, 2012

Why BPEL ?


 BPEL is for process/workflow technology what SQL is for relational databases. This is a way to bridge method war from different business school.
If you ahve several web services around the world, you should use BPEL to orchestrate them all into some new service.

Why using Maven is better than Ant?

In Ant you have to set up the classpath and configure and invoke the tool tasks for compilation and packaging.
Maven automatically downloads all dependencies, makes them available to your aplication and plugs them into the build life cycle phase.

Open source Live Profiling of Java ?



There are a lot of tools for profiling Java and the following is a list:

  • HPROF
           http://java.sun.com/developer/technicalArticles/Programming/HPROF.html
           $java -agentlib:hprof[=options] ToBeProfiledClass
           You get a dump AFTER running your application. This is not a live heap watching.

  •  Jmap, jps
         With command line tools  Jmap,jps you do not need to download anything. This comes with JAVA2SE.
         You must know the pid of the Java application to
  • EurekaJ and BTrace
           You can add inside Java code annotations to be gathered by BTrace.

  • AspectJ

         This is the preferred method.

Generally any metric-gathering can take up to 2500 nanoseconds, so use it only when necessary. For example disc access takes 40 milliseconds, servlet processing up to a second so adding 2500 nanoseconds for each of the methods would be negligible.

However the best way is to use AOP for performance monitoring and metric gathering consider JMetrix 
From AspectJ you can read the following:

3. What are some common development aspects?
Aspects for logging, tracing, debugging, profiling or performance monitoring, or testing.

4. What are some common production aspects?
Aspects for performance monitoring and diagnostic systems, display updating or notifications generally, security, context passing, and error handling.