Quote

"Between stimulus and response there is a space. In that space is our power to choose our response.
In our response lies our growth and freedom"


“The only way to discover the limits of the possible is to go beyond them into the impossible.”


Tuesday, 8 May 2012

10 skills for developers to focus on in 2012

Software development had a few years of relative calm. But now it’s picking up speed, as HTML5 gains a foothold and Windows 8 threatens to significantly change the Windows development landscape. If you want to stay ahead of the curve, you should consider learning at least a few of these 10 software development skills.

1: Mobile development

If you don’t think it is worth your time to learn mobile development, think again. Global shipments of Android phones in 2011 are almost equal to PC sales. Add in the other big-name mobile devices (iPhones, iPads, and even the “dying” RIM devices), and what you see is that mobile devices now dwarf PCs in sales. What does this mean? If you make your living from software that can run only on a PC (which includes Web sites that don’t work or are hard to use on mobile devices), now is the time to learn mobile development.

2: NoSQL

I appreciate a well-designed relational database schema as much as the next person, but they just are not appropriate for every project. We’ve been using them even when they aren’t the best tool because the alternatives haven’t been great. The last few years have seen the introduction of a wide variety of NoSQL database systems. And now that major service vendors (like Amazon and Microsoft) support NoSQL as well, there is no technical limitation on their use. Are they right for every project? No. Are they going to replace traditional databases? In some projects, and for some developers, definitely. This is the year to learn how to use them, as they will only become more prevalent in the year to follow.

3: Unit testing

We’ve seen unit testing go from being, “Oh, that’s neat” to being a best practice in the industry. And with the increasing use of dynamic languages, unit testing is becoming more and more important. A wide variety of tools and frameworks are available for unit testing. If you do not know how to do it, now is the time to learn. This is the year where it goes from “resume enhancement” to “resume requirement.”

4: Python or Ruby

Not every project is a good fit for a dynamic language, but a lot of projects are better done in them. PHP has been a winner in the industry for some time, but Python and Ruby are now being taken seriously as well. Strong arguments can be made for Ruby + Rails (or Ruby + Sinatra) or Python + Django as excellent platforms for Web development, and Python has long been a favorite for “utility” work. Learning Python or Ruby in addition to your existing skillset gives you a useful alternative and a better way to get certain projects done.

5: HTML5

HTML5 is quickly pulling away from the station. The impending release of IE 10 is the last piece of the puzzle to make the full power of HTML5 available to most users (those not stuck with IE 6 or IE 8). Learning HTML5 now positions you to be on the forefront of the next generation of applications. Oh, and most mobile devices already have excellent support for it, so it is a great way to get into mobile development too. And don’t forget: HTML5 is also one route for UI definitions in Windows 8!

6: Windows 8

Windows 8 should be released sometime in 2012, unless the schedule slips badly. While Windows 8 may very well get off to a slow start, being the top dog in an app store is often based on being the first dog in the race. The first mover advantage is huge. It is better to be in the Windows 8 app store at launch time than to take a wait-and-see approach. Even if Windows 8 sales disappoint, it’s better to be the only fish in a small pond than a fish of any size in a big pond, as recent app sales numbers have shown.

7: RESTful Web services

While I personally prefer the convenience and ease of working with SOAP in the confines of Visual Studio, REST is booming. Even Microsoft is starting to embrace it with OData. JSON really was the final straw on this matter, relegating SOAP to be for server-to-server work only. Unless your applications can run in isolation, not knowing REST is going to hold you back, as of 2012.

8: JavaScript

Before the Windows 8 Developer Preview, it was easy for non-Web developers to look at JavaScript as a Web-only language. No more! JavaScript is now a first-class citizen for native desktop and tablet development, thanks to the Metro UI and WinRT API in Windows 8. XAML + C# or VB.NET may be a good way for you to get things done, but if you want to maximize what you can get out of your knowledge, HTML5 and JavaScript are the best bet. They give you Web andMetro/WinRT, and you can also use them for some of the cross-platform mobile systems out there, like Appcelerator’s Titanium product.

9: jQuery

If you are going to do any kind of Web development where you are working directly with HTML, jQuery is becoming a must-know skill. While there are plenty of credible alternatives, jQuery is quickly turning into the de facto tool for rich UIs with HTML.

10: User experience

Other than getting that first mover advantage in new app stores, there is little to differentiate many applications on a feature basis; it’s a crowded field. User experience, on the other hand, is a different story. Creating a great user experience is not easy; it starts before anyone even downloads your application and continues through to the uninstall process. In the age of instant $0.99 and free app downloads, and ad-supported Web apps, the barriers to switching to another application are mighty low. If your user experience is poor, do not expect much business.
Reference: (Tech Republik)

Monday, 7 May 2012

Reading a Soap Response and Passing Values to Other Requests in JMeter

As per the SOA architecture Web services are often designed that one of them is a consumer of the other. This often leads to scenarios where the output of one service is fed to the other to complete an overall business flow.

The provider and the consumer service can be loaded simultaneously by JMeter and performance of the system can be measured under the expected load.

Let us create an example where we will be passing the output value from the response of the first request to the input SOAP request of the second web service method.


Step 1: Create a test plan

Step 2: Add a Thread Group

Step 3: Add a User Defined Variable

Step 4: Add a WebService Request

Step 5: Add an XPath extractor

Step 6: Add a BeanShell PostProcessor

Step 7: Add Second WebService Request

Step 8: Add View Results Tree


Step 1: Create a test plan

 

In the default test plan that appears on opening the JMeter UI (from JMeter.bat in the bin directory) set the option of 'Functional Test Mode' as true. You may also want to add user defined variables. However for this example I will not be using any user defined variable.


Step 2: Add a Thread Group


Add a Thread Group element by right clicking the test plan node and selecting 'Add-->Threads (Users)-->Thread Group'
Add Thread Group


Set the number of threads in the provided section and set the Ramp-up period as zero if you want all the users to be loaded without any lime lag. You can put a time lag between each user request by using the formula: Time Lag=Time/No. of users
You set the loop count to specify how many times do you want each user to hit the web service. If you want to continue loading the web service then you can check the 'Forever' option on the Thread Group element UI.
You can also schedule the load tests by using the 'Scheduler' option provided on the 'Thread Group' UI.


Step 3: Add a User Defined Variable



Right Click on the Thread Group element and select 'Add --> Config Element --> User Defined Variables' to add the 'User Defined Variables' element. On the user defined variables UI screen click on the 'Add' button. Set the 'Name' of the variables and keep the value as blank.

Add User Defined Variable




Step 4: Add a WebService Request


Right click on the 'Thread Group' element and select ' Add --> Sampler --> WebService (SOAP) Request'

Add Web Service Request

Load the WSDL after putting the wsdl in the 'WSDL URL' text box and select the target web method from the 'Web Methods' drop down. configure the server, IP, port, and path.
Copy the SOAP request XML in the 'Soap/XML-RPC Data' text box you provide the path of the file  in the 'Filename' section.


Step 5: Add an XPath extractor


Right click on the 'Thread Group' element and select ' Add -->Post Processors --> XPath Extractor'

Add XPath Extractor

In the Refrence Name section enter the name of the variable that you created in the 'User Defined Variable section'. Enter the XPath query to point to the value which needs to be picked from the XML response. If the value 'TARGET' needs to be picked from the response XML of the format: <ABCD>TARGET</ABCD> then the following XPath query should work:

//*[local-name()='ABCD']/text()

Step 6: Add a BeanShell PostProcessor


Right click on the 'Thread Group' element and select ' Add --> Post Processors --> BeanShell Postpocessor'

Add BeanShell PostProcessor

You can print the value of the user defined variable that you created above using the below script written for bean shell:

print("Beanshell processing  SOAP response");
print("ACQIDD" +${ACQIDD} );


Here the name of the variable created is "ACQIDD" and the value is fetched from ${ACQIDD}.
You can see the value of the variable printed on the command screen that was used to launch the JMeter UI.

Step 7: Add Second WebService Request


Add another webservice request to your thread group element and pass the value of the user defined variable to the input request using the following format:
<value>${ACQIDD}</value>


Step 8: Add View Results Tree


Add a result tree element to the thread group to view the results of the web service requests. After adding the element you can save and run the test plan to see that the output of one SOAP request is read to extract the required value. This value is then passed to another SOAP request. The result tree looks something like this:
Results Tree

Thursday, 3 May 2012

Loading WebServices With JMETER

Apache JMeter is a 100% pure Java desktop application designed to load test client/server software. JMeter can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types.
Additionally, JMeter can help you regression test your application by letting you create test scripts by putting assertions to validate that the application is returning the results that are expected.

 Web Services can be easily loaded and it s performance measured using JMeter. The typical steps for load testing using JMeter is as follows:

1) Create a test plan
2) Add a Thread Group
3) Add a WebSerice Request
4) Apply Assertions on the response
5) View results

Creating a Test Plan

In the default test plan that appears on opening the JMeter UI (from JMeter.bat in the bin directory) set the option of 'Functional Test Mode' as true. You may also want to add user defined variables. However for this example I will not be using any user defined variable.

Add a Thread Group

Add a Thread Group element by right clicking the test plan node and selecting 'Add-->Threads (Users)-->Thread Group'
Adding Thread Group
Set the number of threads in the provided section and set the Ramp-up period as zero if you want all the users to be loaded without any lime lag. You can put a time lag between each user request by using the formula: Time Lag=Time/No. of users 
You set the loop count to specify how many times do you want each user to hit the web service. If you want to continue loading the web service then you can check the 'Forever' option on the Thread Group element UI.
You can also schedule the load tests by using the 'Scheduler' option provided on the 'Thread Group' UI.

Add a WebService Request

Right click on the 'Thread Group' element and select ' Add --> Sampler --> WebService (SOAP) Request
Adding WebService Request
Load the WSDL after putting the wsdl in the 'WSDL URL' text box and select the target web method from the 'Web Methods' drop down. configure the server, IP, port, and path.
Copy the SOAP request XML in the 'Soap/XML-RPC Data' text box you provide the path of the file  in the 'Filename' section. Make sure to check the 'Read SOAP Response' check box to ensure that the soap response is read for asserting the results.

Apply Assertions on the Response

Right click on the 'Thread Group' element and select ' Add --> Assertions --> Response Assertions
Applying Assertion on Response
Select the radio button 'Main Sample only' in the Apply to section. Then select the 'Text Response' radio button in the Response Field to Test section. Add the pattern to test in the response of the SOAP request. For example if you expect the text '<status>Completed</status>' in the response than you may want to add an assertion to check if the text: "<status>Completed</status>" is present in the response.

View Results

We can view the results of the tests in multiple format, such as Graph, Table or Tree structure. The results can also be stored in files at a specified location. In our case we will be using 'Graph Results' and 'View Results Tree' elements.
Graph Results element can be added from 'Add-->Listeners-->Graph Results' and View results tree element can be added at 'Add-->Listeners-->View Results Tree'.

Adding Graph Results
Provide location of the results file in the 'Filename' section. You can create a new results file and point its location in the 'Filename' section.

You can now run the test and see the Graph and Results Tree as follows:

Graph Results



The result tree is displayed as follows:
Results Tree


Now you may want to pass the output from one request to the input of the next request.