Tag Archives: performance

Google tests new Flight Explorer service to help you buy the perfect plane ticket

Google appears to be testing a new service called Flight Explorer. The company has not announced it, nor is there any documentation available via any of Google’s help pages. It doesn’t even have a typical Google beta tag.

Yet the service is fully functional. It detects your current location and puts it in the “From” section. Then it appears to put the nearest country into the “To” section (since I’m in Canada, for me that’s the US).

Unlike Google Flights, which launched in September 2011, Flight Explorer appears to be much more customizable. Not only does it let you easily modify your trip length on the left-hand side, but the top bar is full of options: stops, airline, duration, outbound time, and return time. The first two are drop down menus while the other ones are sliders helping you pick the timeframe you want.

The default page loads the “Lowest fares for trips of 3-5 days” and the outline is clearly something we haven’t seen before. There’s a picture of your destination and then a graph of the lowest prices to get you there, taking your filters into account, for the last few months.

Clicking on any of them redirects you to Google Flights, suggesting that this appears to be an augmentation of the previous service, not a replacement. Maybe the two will end up being merged together, but for now they remain separate. Either way, the goal appears to be getting you to stick to Google when looking for an online flight booking service that will help you purchase airline tickets.

It’s unclear if Google has launched Flights Explorer recently, or if it is just testing it out. When we played with it, however, it was perfectly usable.

We have contacted Google about Flight Explorer. We will update this article if we hear back.

Update on December 13: Google says this is indeed just a test.

“Flight Explorer is a an experimental feature of Flight Search that allow users to explore flight destinations,” a Google spokesperson told TNW. “The feature enables users to consider multiple destinations and multiple days at once, all using live prices, quickly.”

Source:  http://thenextweb.com/google/2012/12/13/google-tests-new-flight-explorer-service-to-help-you-buy-the-perfect-plane-ticket/

Did you like this? Share it:

Performance Testing vs Load Testing vs Stress Testing – Examples

Performance testing – It is performed to evaluate the performance of components of a particular system in a specific situation. It very wide term. It includes: Load Testing, Stress Testing, capacity testing, volume testing, endurance testing, spike testing, scalability testing and reliability testing etc. This type of testing generally does not give pass or fail. It is basically done to set the benchmark & standard of the application against Concurrency / Throughput, Server response time, Latency, Render response time etc. In other words, you can say it is technical & formal evaluation for responsiveness, speed, scalability and stability characteristics.

Performance Testing vs Load Testing vs Stress Testing - Examples

Load Testing is subset of performance testing. It is done by constantly increasing the load on the application under test till the time it reaches the threshold limit. The main goal of load testing is to identify the upper limit of the system in terms of database, hardware and network etc. The common goal of doing the load testing is to set the SLAs for the application. Example of load testing can be:

Running multiple applications on a computer simultaneously – starting with one application,Running multiple applications on a computer simultaneously – starting with one application, then start second application, then third and so on….Now see the performance of your computer.

Endurance test is also a part of load testing which used to calculate metrics like Mean Time Between Failure and Mean Time to Failure.
Load Testing helps to determine:

  • Throughput
  • Peak Production Load
  • Adequacy of H/W environment
  • Load balancing requirements
  • How many users application can handle with optimal performance results
  • How many users hardware can handle with optimal performance results

Stress testing – It is done to evaluate the application’s behaviour beyond normal or peak load conditions. It is basically testing the functionality of the application under high loads. Normally these are related to synchronization issues, memory leaks or race conditions etc. Some testing experts also call it as fatigue testing. Sometimes, it becomes difficult to set up a controlled environment before running the test. Example of Stress testing is:

A banking application can take a maximum user load of 20000 concurrent users. Increase the load to 21000 and do some transaction like deposit or withdraw. As soon as you did the transaction, banking application server database will sync with ATM database server. Now check with the user load of 21000 does this sync happened successfully. Now repeat the same test with 22000 thousand concurrent users and so on.

 

 

Spike test is also a part of stress testing which is performed when application is loaded with heavy loads repeatedly and increase beyond production operations for short duration.

Stress Testing helps to determine:

  • Errors in slowness & at peak user loads
  • Any security loop holes with over loads
  • How the hardware reacts with over loads
  • Data corruption issues at over loads

source: http://www.softwaretestingstuff.com/2011/09/performance-testing-vs-load-testing-vs.html

Did you like this? Share it:

5 Distinctive Software Testing Tools

Bangalore: Software Testing tools have not only simplified the testing process, but they have also ensured a product which is reliable and of a high quality. There’s a wide selection of testing tools available in the market that can be used for the various aspects of the testing process.
Based on the process the tools are used, they can be categorized as below:

1.    Source Code Testing Tools
This tool aims at debugging an application before it is distributed. It consists of statements which are created using a text editor which is then saved in a file.  The source code testing tool eliminates the need for testing at a later stage as it detects and reveals the errors in the early stage of development. Some of the well known tools in this category are the IBM AppScan Source Edition, Parasoft Test and the CxSuite.

2.    Functional Testing Tools
Functional Testing Tools aims at identifying the functions which the software is expected to perform. The tester feeds in the inputs such as clicks and key strokes and later verifies the output with the expected output. CitraTest, GUITAR and AberroTest are some of the famous functional testing tool.

3.    Performance Testing tools
Some websites crashes when they cannot withstand the stress load in the event when there are many users requesting the same page at the same time. Performance testing tools like Bug Timer, TestLoad and XtremeLoad ensures that the application can withstand stress.

4.    Database Testing Tools
Database form one of the most essential part in a system and testing it ensures a quality software apart from ensuring usefulness of the data. Jumpstart and SQL DB Validator are the popular Database Testing Tool.

5.    Bug Tracking Tools
Testers use this tool to track reported software bugs in their work. Bugzilla, DevTrack, QEngine, Squish are the popular bug tracking tools

source: http://qa.siliconindia.com/news/5-Distinctive-Software-Testing-Tools-nid-122013.html

Did you like this? Share it:

Peru’s Ambitious Laptop Program Gets Mixed Grades

LIMA, Peru (AP) — Peru’s equipping of more than 800,000 public schoolchildren in this rugged Andean nation with low-cost laptops ranks among the world’s most ambitious efforts to leverage digital technology in the fight against poverty.

Yet five years in, there are serious doubts about whether the largest single deployment in the One Laptop Per Child initiative inspired by MIT Media Lab founder Nicholas Negroponte was worth the more than $200 million that Peru’s government spent.

Ill-prepared rural teachers and administrators were too often unable to fathom much less teach with the machines, software bugs didn’t get fixed, Internet access was almost universally absent and cultural disconnects kept kids from benefitting from the machines.

"In essence, what we did was deliver the computers without preparing the teachers," said Sandro Marcone, the Peruvian education official who now runs the program.

He believes the missteps may have actually widened the gap between children able to benefit from the computers and those ill-equipped to do so, he says, in a country whose public education system is rated among the world’s most deficient.

The volume of "education" computers delivered globally remains modest. Intel Corp. says it has shipped more than 7 million, about a third in Argentina. Venezuela boasts 1.6 million distributed, licensed by a Portuguese company.

Negroponte’s nonprofit OLPC foundation, which pioneered the idea of bootstrapping the developing world with information technology, was never able to achieve the $100 laptop price tag it desired but nevertheless won adherents.

More than 2.5 million of its $200 laptops, not just the green-and-white models for the early grades but also blue-and-white machines with bigger keyboards for older kids, have been distributed in 46 countries since 2007.

OLPC laptops, which are rugged and energy efficient and run an open-source variant of the Linux operating system, are in Ethiopia, Rwanda, Mongolia and Haiti, and even in the United States and Australia. Uruguay, a compact South American nation of 3.5 million people, is the only country that has fully embraced the concept and given every elementary school child and teacher an XO laptop, as the machines are called.

No country, however, bought nearly as many as Peru.

"It’s a really great idea," said Jeff Patzer, a software engineer with a degree from the University of California at Berkeley who traveled from school to school in Peru’s rustic Cordillera Blanca highlands in 2010 introducing and maintaining the laptops. "It’s just seems like there was some stuff that wasn’t thought through quite enough."

Inter-American Development Bank researchers were less polite.

"There is little solid evidence regarding the effectiveness of this program," they said in a study sharply critical of the overall OLPC initiative that was based on a 15-month study at 319 schools in small, rural Peruvian communities that got laptops.

"The magical thinking that mere technology is enough to spur change, to improve learning, is what this study categorically disproves," co-author Eugenio Severin of Chile told The Associated Press.

The study found no increased math or language skills, no improvement in classroom instruction quality, no boost in time spent on homework, no improvement in reading habits.

On the positive side, the "dramatic increase in access to computers" accelerated by about six months students’ abstract reasoning, verbal fluency and speed in processing information, the report said.

A study in Ethiopian schools by Dutch researchers from the University of Groningen, published last year in the journal Computers and Education, similarly found that OLPC laptops improved abstract reasoning.

The teachers in those schools had received extensive training in the laptops, which the researchers said introduced an "information-rich novelty" into an environment previously starved for learning material.

The laptops in Ethiopia, like those in Peru, were loaded with books, memory games, music composing software and other programs.

The Education Ministry official who ran Peru’s program until last year, Oscar Becerra, calls the abstract reasoning findings "spectacular" and disputes claims that, overall, the program has been a failure.

"We knew from the start that it wouldn’t be possible to improve the teachers," he said, citing a 2007 census of 180,000 Peruvian teachers that showed more than 90 percent lacked basic math skills while three in five could not read above sixth-grade level.

Becerra took umbrage at the development bank’s finding that the computers didn’t motivate children to do school work. "In a school that’s a disgrace, with teachers who are ignorant and lessons that are a joke, how is having computers going to improve motivation?"

Each teacher was supposed to get 40 hours of OLPC training. That hardly helped in schools where teachers had never so much as booted up a computer. In Patzer’s experience "most of them barely knew how to interact with the computers at all."

At the Jose Arguedas primary school in Lima’s gritty San Juan de Lurigancho neighborhood, 40 computers for its 570 students arrived nearly two years ago but few teachers have worked them into their lesson plans.

"It’s been difficult for many teachers to adapt to them," said Graciela Martinez, the school’s technology coordinator.

Many of Magnus Fajardo’s second-graders struggled when he took them to the computer lab and asked them to write, sequentially, the numbers from 200 to 300 on their laptops.

The children knew their numbers but few knew their laptops. Less bashful children asked a visiting reporter for help. They wanted to know how to advance to a new line, how to increase the font size.

In the higher grades, Martinez said, children’s use of the machines is mostly social. They have Internet, and Facebook is big. So are online games.

"For them, the laptop is more for playing than for learning," she says.

Educators say that’s a clear sign the children haven’t been properly introduced either to the Internet or to what is on the machines, which have digital cameras and audi recorders, programming tools and a trimmed-down Wikipedia.

Negroponte thinks the main goal of technology educators should be simply getting computers into poor kids’ hands.

His proposal last year to parachute tablet computers from helicopters, limiting the involvement of adults and "educators," caused some colleagues to wince. But Negroponte is dead serious, and has begun a pilot project in two Ethiopian villages to test whether tablets alone, loaded with the right software, can teach children to read.

"There are about 100 million kids without schools, without access to literate adults, and I would like to explore a way to get tablets to them in a manner that does not need "educators" to go to the village," he said via email.

The OLPC team always considered Internet connectivity part of the recipe for success. They also insisted that each child be given a laptop and be permitted to take it home.

Uruguay, a small, flat country with a far higher standard of living and ubiquitous Internet, has honored those requirements

Peru did not.

Becerra said trade-offs were necessary because it would have cost $1.2 billion to provide all 6 million children in Peru’s elementary schools with laptops. Rural schools, beginning with those where a single teacher manages multiple grades, got priority.

But those schools’ very remoteness complicated matters.

Some parents, mistakenly believing themselves the laptops’ owners, tried to sell the machines, Becerra said.

Others, about a quarter, didn’t want the computers coming home, fearing theft, the development bank researchers found. Meanwhile, two in five children didn’t take their computers home because their school wouldn’t let them.

Some schools didn’t have enough electricity to power the machines.

And then there was the Internet. Less than 1 percent of the schools studied had it.

Not only were kids deprived of the chance to widen their horizons and meet like-minded students, they were also deprived of access to updated software purged of bugs.

"In lots of places (in Peru) they still have the software versions from 2008," said Pablo Flores, a steward of Uruguay’s OLPC program.

Patzer blogged about the frustration he witnessed when kids and teachers struggled with the laptops’ buggy software and, not understanding what to do, "promptly boxed them up put them back in the corner."

The contrast couldn’t be starker in Uruguay, whose program has been touted by Negroponte and others as a model although no major outside study has been done of it.

Programming festivals that Flores helps organize there have led to the development of applications that teach geography and chess, play radio stations and read to the blind.

Those applications are available for use by anyone, anywhere, including Peruvian children.

Sandro Marcone, the education official who took over Peru’s OLPC program last year, has already made modifications to the program, including making the XO laptop part of Peru’s university teacher-training curriculum this year so young educators are fully familiar with it.

Marcone’s office will continue to support the laptops and replace broken ones.

It plans to expand rural Internet penetration and put new support resources online. Part of the new strategy is to encourage regional governments to manage their own educational technology and support.

"The ministry is not going to do another macro project of this type. It is not going to make multimillion-dollar purchases and distribute (computers) like candy."

source:http://www.npr.org/templates/story/story.php?storyId=156172718

Did you like this? Share it:

Performance testing in the cloud

As cloud computing continues to mature, one is hard pressed to identify a class of enterprise software that is not delivered and consumed as a service. Performance and load-based application testing, important parts of ALM, can be counted among these cloud offerings. Moving these functions to the cloud offers typical cloud benefits, most notably lowered capital and operational costs, and support for distributed development teams. But cloud-based testing also changes the way the tests themselves are performed. These changes come at a time when more and more organizations are looking at software as their competitive differentiator.

“Every enterprise is a software company, regardless of what they’re vertical is. Many of them are building more lines of code than major software companies per year. Software is the competitive difference in what everyone is doing now,” says Theresa Lanowitz, founder and analyst, voke.

One of the biggest challenges in application lifecycle management (ALM), according to Lanowitz, is performance. “Performance will make or break whether or not someone is going to use your app. If you think about the type of apps you use – enterprise or personal apps – performance is the determining factor, so make sure that performance is there and that you’re able to test appropriately for performance.”

This is especially true of Web and mobile applications. Fortunately, cloud-based performance and load testing tools make it easier than ever before to ensure that internal enterprise apps as well as external customer-facing applications can handle user demand. There are three characteristics of cloud-based testing services that change the way http and https applications are tested:

Testing at scale

Cloud-based testing providers offer a cost-effective means of testing applications at scale – as opposed to a lab environment that simulates a small subset of the production environment. This means that instead of testing an application against a portion of users and extrapolating that data to scale with a production environment, the cloud-testing provider can test your application against the actual number of expected users. SOASTA, for example, offers CloudTest, a functional and performance testing service for Web and mobile applications. In the case of performance testing, SOASTA uses cloud servers to simulate traffic that would come from users visiting a website.

Testing globally

Similarly, cloud-based testing tools enable testing on a global scale, thereby reflecting the regions from which users are accessing the application. This is often done through partnerships with other cloud providers, such as Amazon and Rackspace. For example, Blitz by Mu Dynamics allows customers to run load tests constituting millions of concurrent users coming from multiple continents.

Testing production apps

In addition to testing test and stage applications, cloud-based testing tools can be used to test production applications. This is, according to Sven Hammar, founder and CEO of Apica, “where you have all the complexity, all the right servers, the right number of users, and you get more feedback on the problem.” When testing in production, you’re testing at maximum capacity, and different problems arise than those that are encountered at medium capacity. As a result, you get a more realistic picture of what can go wrong and the ability to make adjustments before problems occur with users.

Advice for using Software Testing as a Service

When it comes to using tools like SOASTA, Blitz and Apica, Lanowitz offers several recommendations. First off, she says, “When using a test tool in the cloud, make sure you understand how licensing is working. How are you going to pay that vendor for using that tool in the cloud? Understand what you’re paying that tool vendor for and how your costs are going to be affected as you attempt to test for more users. Be aware of the hidden costs and be able to identify what your total cost is going to be.”

Secondly, Lanowitz advises organizations to understand the software vendor’s roadmap, including how they plan to put out different communications for the development lifecycle and how tests are reported. “Understand how to interpret, read and act on the advice from the tool,” she says.

Finally, “Do a proof of concept when adopting a new tool,” says Lanowitz. Determine the two or three tools that you think you might want to adopt and do a proof of concept on each one, looking at integration with other tools in use, how the tool works with your different platforms and, again, understanding the costs and how you’ll be paying for them, she says.

Source:http://searchsoftwarequality.techtarget.com/feature/Performance-testing-in-the-cloud

Did you like this? Share it:

Use Memcached for Java enterprise performance, Part 2: Database-driven web apps

However you slice it traditional caching requires performance trade-offs that some enterprise applications cannot afford. Find out for yourself why Memcached is a go-to solution for Java developers whose applications need serious scale. After first setting up spymemcached as your open source Java client for Memcached, you’ll use it in two powerful application scenarios: first configuring Memcached as second-level cache for Hibernate (via hibernate-memcached), and then using it to cache the HTML generated for each web page.

We concluded the first half of this tutorial with a look at using Telnet and the Memcached protocol to store and retrieve cache entries in a Memcached server. Accessing Memcached via Telnet is especially useful for debugging, but if you want to use Memcached in a Java enterprise application you’ll need to use a Memcached Java client.

We’ll use spymemcached, a very popular Memcached Java client, for the introductory purposes of this tutorial. Listing 1 shows spymemcached’s main class, MemcachedClient.

Listing 1. MemcachedClient
public static void main(String[] args) throws Exception{
    if(args.length < 2){
        System.out.println("Please specify command line options");
        return;
    }
    MemcachedClient memcachedClient = new MemcachedClient(AddrUtil.getAddresses("127.0.0.1:11211"));
    if(commandName.equals("get")){
        String keyName= args[1];
        System.out.println("Key Name " +keyName);
        System.out.println("Value of key " +memcachedClient.get(keyName));
    }else if(commandName.equals("set")){
        String keyName =args[1];
        String value=args[2];
        System.out.println("Key Name " +keyName + " value=" + value);
        Future<Boolean> result= memcachedClient.set(keyName, 0, value);
        System.out.println("Result of set " + result.get());
    }else if(commandName.equals("add")){
        String keyName =args[1];
        String value=args[2];
        System.out.println("Key Name " +keyName + " value=" + value);
        Future<Boolean> result= memcachedClient.add(keyName, 0, value);
        System.out.println("Result of add " + result.get());
    }else if(commandName.equals("replace")){
        String keyName =args[1];
        String value=args[2];
        System.out.println("Key Name " +keyName + " value=" + value);
        Future<Boolean> result= memcachedClient.replace(keyName, 0, value);
        System.out.println("Result of replace " + result.get());
    }else if(commandName.equals("delete")){
        String keyName =args[1];
        System.out.println("Key Name " +keyName );
        Future<Boolean> result= memcachedClient.delete(keyName);
        System.out.println("Result of delete " + result.get());
    }else{
        System.out.println("Command not found");
    }
    memcachedClient.shutdown();

}

In Listing 1, we first create a MemcachedClient object with hostname:portname as its argument. Once we have the object we can start calling its methods to set and get cache entries. Note that MemcachedClient has equivalent methods for every method supported by the Memcached protocol:

  • MemcachedClient.set() is used to store a Java object into the Memcached server. In Listing 1, we stored an instance of a Contact object with the string contactId-1. The second parameter of this set method is time-in-seconds.
  • MemcachedClient.get() is used to get the value of the key from a Memcached server. In Listing 1 the value of the key is an object of Contact.java, so the client will first retrieve the value and then deserialize it and return the object. The get() method returns null if the value is not found or is expired.
  • MemcachedClient.add() is used to add an object to the cache only if it does not already exist. In Listing 1 the contactId-1 key exists in the cache already, so it won’t be added.
  • MemcachedClient.replace() replaces an object with the value for the given key (if there is already such a value). In Listing 1, contactId-1 is already in the cache, so its value would be replaced.
  • MemcachedClient.delete() deletes a given key from the cache. In Listing 1, the call is used to delete the contactId-1 key.
MemcachedClient.set()

You can use MemcachedClient.set() to store a simple string or a complex object. When you store a complex object, MemcachedClient will first serialize the object and then store it. As a result, every object that you store in Memcached must be serializable, and the key must also be a string. In Listing 1, the set() method returns an object of Future<Boolean>. When we call the set method, it is executed asynchronously, so the control moves to the next line without waiting for a response from the Memcached server. If you needed to know the result of the set operation, then you would call setResult.get() on the Future object instance.

Spying under the hood: spymemcached

Before we move on to the web application exercise, let’s look under the hood to see how spymemcached works. Figure 1 is a sequence diagram showing what happens in spymemcached when a client issues a get().

Figure 1. get() under the hood (click to enlarge)

Spymemcached is an asynchronous, single-threaded Memcached client. When you call any caching-related method on spymemcached’s MemcachedClient, it will be handled asynchronously. The client call method handles writing the details of the operation that should be performed into a queue and returning the control back to the client making the call. The actual interaction with the Memcached server, meanwhile, is handled by a separate thread that runs in the background.

Notice that the sequence diagram in Figure 1 has two different threads. The first thread shows the method sequence for what happens when a client makes a get() call. The second thread displays a method sequence for the daemon thread that communicates with the Memcached server. Both threads are worth a closer look.

Sequence of events in a client thread

When you call MemcachedClient‘s get() method it takes the arguments and forwards control to the asyncGet() method on the object of Memcached class. The asyncGet() method then forwards control to either AsciiOperationFactory or BinaryOperationFactory, depending on the Memcached protocol your client uses to communicate with the server. AsciiOperationFactory is the default value.

The AsciiOperationFactory constructs an object of the command-specific operation object. In this case, since the client issued a get command, it creates an object of GetOperationImpl and returns it. The MemcachedClient.asyncGet() method then takes care of attaching a callback function to the operation. This function will be called when MemcachedClient gets data back from the server and returns a java.util.concurrent.Future object. The client uses the java.util.concurrent.Future to retrieve the data returned from server.

Once MemcachedClient has the object of GetOperationImpl, it first tries to validate the key by ensuring that the length of the key is less than 250 characters and does not contain any special characters. Once the key is validated, the next task is to figure out which server the request should go to. For that MemcachedClient passes control to an instance of the NodeLocator class with the key. The NodeLocator class calls the HashAlgorithm.hash(key) method to get the hashCode for the key. By default, NodeLocator will call the hashCode() method on the key, which is a String object. Once it has the hashCode it will divide that by the number of servers; for example, if the hashCode were 10 and the number of servers three, then the remainder would be one. So the cache entry would be located in Server 1. The MemcachedNode object representing Server 1 would be selected. The MemcachedConnection object would then add the get operation to the queue of Server 1 and return control to the client code.

Sequence of events in daemon threads

If you take a look at the MemcachedClient source code, you will notice that it implements the java.lang.Thread interface. When you create a new instance of the MemcachedClient it kicks off a new thread by calling a start() method on the current object, at which point the JVM will call a MemcachedClient run() method from the newly created thread.

Inside the run() method, MemcachedClient checks the value of the running flag. If it is true, MemcachedClient calls the handleIO() method of the MemcachedConnection object. handleIo() looks at the current job queue to get a list of pending tasks and tries to optimize them. For example, if more than one get() request is pending then this method will combine them into one call. The handleIO() method uses the java.nio methods to communicate with the server. When you call the MemcachedClient shutdown() method, it changes the value of the running flag to false, which results in stopping the run() method and the background daemon thread. It also closes the connection with the Memcached server.

Using Memcached in an enterprise web application

This section introduces you to integrating Memcached into an enterprise architecture. Using the Contact web application introduced in Listing 1, we’ll add, remove, update, and view records in a CONTACT table. Next I’ll show you how to use Memcached to alleviate database load by configuring it as second-level cache for Hibernate. Finally, I’ll explain how to use Memcached to store custom Java objects and cache the HTML generated for each web page.

Start by downloading ManageContact-NoCaching.zip. The ManageContact application contains a ContactServlet that looks at incoming requests and decides what database interaction is required to execute each one. It then forwards control to ContactDAO in order to execute the required database interaction. ContactDAO uses Hibernate to execute select, insert, and update functions on the Contact table. When control is returned to ContactServlet, it forwards control to the appropriate JSP in order to generate markup on the web page. The ManageContact application has a Maven script that takes care of downloading all of the necessary dependencies; you can execute a mvn install command to download these dependencies and then run the application in an embedded Glassfish server. Once the server is started you should be able to access the application at http://localhost:8080/ManageContact/contact.

Enter hibernate-memcached

Most web applications spend a good chunk of their time interacting with databases. Caching data can help you speed up that interaction, as well reduce load on your database. Hibernate provides a nice interface for caching that allows you to use your own caching framework. You instruct Hibernate on which caching framework to use by specifying the name of a class that implements org.hibernate.cache.CacheProvider with the property hibernate.cache.provider_class. From there, you have two options: you can either create your own class that implements the org.hibernate.cache.CacheProvider interface and stores the cache entries in the Memcached server, or you can use the hibernate-memcached framework, which is an open source framework based on the spymemcached client. hibernate-memcached supports entity and query caching.

Configure hibernate-memcached as a caching framework

By default caching is disabled in hibernate-memcached, so our first step is to enable Hibernate’s second-level cache. We’ll also need to configure Memcached as a caching implementation for Hibernate. We can handle both of these requirements in the Hibernate configuration file (hibernate.cfg.xml), which is used to configure application-level settings for Hibernate:

Listing 2. Hibernate config
<property name="cache.provider_class">com.googlecode.hibernate.Memcached.MemcachedCacheProvider</property>
 <property name="hibernate.Memcached.servers">localhost:11211</property>
 <property name="hibernate.Memcached.cacheTimeSeconds">300</property>
 <property name="hibernate.Memcached.connectionFactory">BinaryConnectionFactory</property>

Now let’s take a closer look at each of the properties set. You can enable the second-level cache by setting a value of cache.provider_class to com.googlecode.hibernate.Memcached.MemcachedCacheProvider. The properties that start with "hibernate.Memcached" are specific to the Memcached provider:

  • cache.provider_class: The value of this property defines which class should be used as a cache implementation. In this case we set it to com.googlecode.hibernate.Memcached.MemcacheddCacheProvider, which is provided by the hibernate-memcached framework and uses Memcached as a caching framework.
  • hibernate.Memcached.server: The properties starting with hibernate.Memcached are used by the hibernate-memcached framework. The value of hibernate.Memcached.server should be a space-delimited list of Memcached instances in host:port format. This Memcached server is running on my localhost at port 11211, so I set the value to localhost:11211, which is the default value.
  • hibernate.Memcached.cacheTimeSeconds: The value of this property defines the default number of seconds that each item should be cached. I want the CONTACT record to be cached for 300 second.
  • hibernate.Memcached.connectionFactory: This is the "simple" name of the spyMemcached ConnectionFactory class. It must be one of DefaultConnectionFactory, KetamaConnectionFactory, or BinaryConnectionFactory. The BinaryConnectionFactory performs much better by using a binary protocol
More configuration properties

See "Adding hibernate-memcached to your application" on the hibernate-memcached wiki for a list of all the configuration properties supported by hibernate-memcached.

Develop a caching strategy

Once you have enabled caching your next step is to choose which data you want to cache and what caching strategy you will use. In my case, I want to cache the data from my CONTACT table. Since that will be regularly updated, I set my cache strategy to read-write by adding a cache element in the Contact.hbm.xml, like this:

Listing 3. Configure the caching strategy
<hibernate-mapping package="com.javaworld.Memcached">
    <class name="Contact" table="CONTACT"  >
    <cache usage="read-write"/>
        <id name="contactId" column="CONTACTID">
            <generator class="increment"/>
        </id>
        <property name="firstName" column="FIRSTNAME"/>
        <property name="lastName" column="LASTNAME"/>
        <property name="email" column="EMAIl"/>
    </class>
</hibernate-mapping>

After you’ve updated your own Contact.hbm.xml file (which you can download with the article source), start the Memcached server by executing a Memcached -vv command. This will start Memcached in verbose mode so that it prints every client interaction on the console. Next, execute mvn clean install to start the application. Go to http://localhost:8080/ManageContact/contact and add couple of records. When you click on the record to go to the details, you should notice that no SQL query is executed; instead those records are coming back from the cache. On the Memcached server console, you should see an interaction similar to what is shown in Figure 2.

Figure 2. A view from the Memcached console (click to enlarge)

Using Memcached for server responses

So far you’ve seen how to reduce the load on your database by using Memcached as a second-level cache in Hibernate. Not all application scenarios are quite so simple, however. For instance, how should you handle web pages that process and display data from a web service? You’ll find your application using CPU-intensive logic to build markup for every response, which probably would be better off cached. If you cache the generated markup then the next request for that markup will return from the cache instead of going to a servlet.

The first step is to build a simple Servlet filter to intercept the request. Start by copying the CachingResponseWrapper.java and CachingResponseWriter.java into a com.javaworld.Memcached.filter package. Together these two classes will collect the responses generated by ContactServlet into a String.

Next, create a CacheFilter.java in the com.javaworld.Memcached.filter package and change its doFilter() method so that it looks like this:

Listing 4. CacheFilter.java
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        log.debug("Inside CachingFilter.doFilter() " );
        try {
            HttpServletRequest httpServletRequest = (HttpServletRequest)request;
            HttpServletResponse httpServletResponse = (HttpServletResponse)response;
            ObjectPool<MemcachedClient> MemcachedClientPool = MemcachedHelper.getMemcachedConnectionPool();
            MemcachedClient  MemcachedClient = MemcachedClientPool.borrowObject();
            StringBuffer cacheKeyBuffer = new StringBuffer();
            cacheKeyBuffer.append(httpServletRequest.getContextPath());
            cacheKeyBuffer.append(httpServletRequest.getServletPath());
            if(httpServletRequest.getQueryString() != null){
                cacheKeyBuffer.append("?");
                cacheKeyBuffer.append(httpServletRequest.getQueryString());
            }
            
            String cacheKey = httpServletResponse.encodeURL(cacheKeyBuffer.toString());
            System.out.println ("Get Path Info  " + cacheKey);
            String cachedResponse =(String) MemcachedClient.get(cacheKey);
            
            if( cachedResponse == null){
                System.out.println("Response is not cached forwarding control to servlet");
                CachingResponseWrapper cachingResponseWrapper =new CachingResponseWrapper((HttpServletResponse)response);
                chain.doFilter(request, cachingResponseWrapper);
                CachingResponseWriter collectResponseWriter = (CachingResponseWriter)cachingResponseWrapper.getWriter();
                String collectedResponseStr = collectResponseWriter.getCollectedResponse();//.replaceAll("\n", "") ;
                System.out.println( "Set value in the Memcached for key " + httpServletResponse.encodeURL(collectedResponseStr));
                
                System.out.println("Result of set" + MemcachedClient.set(cacheKey, 0, collectedResponseStr).get());
                //MemcachedClient.flush().get();
            }else{
                System.out.println("Returning cached response ");
                response.setContentType("text/html");
                response.getWriter().println(cachedResponse);
            }
            //MemcachedClient.flush().get();
            MemcachedClientPool.returnObject(MemcachedClient);
        } catch (NoSuchElementException e) {
            e.printStackTrace();
        } catch (IllegalStateException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

Note that in the doFilter() method you’re first building the URL that the client used to access the ContactServlet; this URL is used as a key for caching. Once the URL is built, you’ll execute MemcachedClient.get(cacheKey) to check if the response for the given URL is already cached. If it is, then return it; if it isn’t, then wrap the response object into a CachingResponseWriter and pass control to a servlet that will generate the necessary markup. After the control returns from the servlet, call a collectResponseWriter.getCollectedResponse() method. This method will return the response generated by the servlet as a String. Take that response and save it in your cache with its URL as the key. The next time this query is used, the response will come from your cache and not from the servlet.

source:

http://www.javaworld.com/javaworld/jw-05-2012/120515-memcached-for-java-enterprise-performance-2.html?page=1

Did you like this? Share it:

Test Factors in Software Testing

Introduction

For designing Test Cases the following factors are considered:

  1. Correctness
  2. Negative
  3. User Interface
  4. Usability
  5. Performance
  6. Security
  7. Integration
  8. Reliability
  9. Compatibility

Correctness : Correctness is the minimum requirement of software, the essential purpose of testing. The tester may or may not know the inside details of the software module under test e.g. control flow, data flow etc.

Negative : In this factor we can check what the product it is not supposed to do.
User Interface : In UI testing we check the user interfaces. For example in a web page we may check for a button. In this we check for button size and shape. We can also check the navigation links.
Usability : Usability testing measures the suitability of the software for its users, and is directed at measuring the following factors with which specified users can achieve specified goals in particular environments.

  1. Effectiveness : The capability of the software product to enable users to achieve specified goals with the accuracy and completeness in a specified context of use.
  2. Efficiency : The capability of the product to enable users to expend appropriate amounts of resources in relation to the effectiveness achieved in a specified context of use.

Performance : In software engineering, performance testing is testing that is performed from one perspective to determine how fast some aspect of a system performs under a particular workload.
Performance testing can serve various purposes. It can demonstrate that the system needs performance criteria.

  1. Load Testing: This is the simplest form of performance testing. A load test is usually conducted to understand the behavior of the application under a specific expected load.
  2. Stress Testing: Stress testing focuses on the ability of a system to handle loads beyond maximum capacity. System performance should degrade slowly and predictably without failure as stress levels are increased.
  3. Volume Testing: Volume testing belongs to the group of non-functional values tests. Volume testing refers to testing a software application for a certain data volume. This volume can in generic terms be the database size or it could also be the size of an interface file that is the subject of volume testing.

Security : Process to determine that an Information System protects data and maintains functionality as intended. The basic security concepts that need to be covered by security testing are the following:

  1. Confidentiality : A security measure which protects against the disclosure of information to parties other than the intended recipient that is by no means the only way of ensuring
  2. Integrity: A measure intended to allow the receiver to determine that the information which it receives has not been altered in transit other than by the originator of the information.
  3. Authentication: A measure designed to establish the validity of a transmission, message or originator. Allows a receiver to have confidence that the information it receives originated from a specific known source.
  4. Authorization: The process of determining that a requester is allowed to receive a service/perform an operation.

Integration : Integration testing is a logical extension of unit testing. In its simplest form, two units that have already been tested are combined into a component and the interface between them is tested.

Reliability : Reliability testing is to monitor a statistical measure of software maturity over time and compare this to a desired reliability goal.

Compatibility : Compatibility testing of a part of software’s non-functional tests. This testing is conducted on the application to evaluate the application’s compatibility with the computing environment. Browser compatibility testing can be more appropriately referred to as user experience testing. This requires that the web applications are tested on various web browsers to ensure the following:

Users have the same visual experience irrespective of the browsers through which they view the web application.

In terms of functionality , the application must behave and respond the same across various browsers.

Source:http://www.c-sharpcorner.com/UploadFile/face6d/test-factors-in-software-testing/

Did you like this? Share it:

Cloud Performance Testing Tool Launched by Impetus

Impetus Technologies announced the release of SandStorm CE (SandStorm CloudEdition), a cloud-enabled version of its performance testing tool. SandStorm CE helps in saving the license and hardware provisioning costs, as well as offers affordable performance testing, with a ‘pay-as-you-go’ model.

With the release of SandStorm CE, Impetus provides its customers, enterprises, start-ups and ISVs an easy provisioning to load test their software at hugely reduced costs. It also reduces the customers’ CAPEX by automatically provisioning a cluster of servers and machines on the cloud, as and when needed. This helps customers test their applications against a concurrency of 50 – 200,000 users, with the same ease.

SandStorm CE helps test the performance of applications hosted in customers’ DMZ, datacenter or the cloud, seamlessly. The solution offers a ‘ready to use environment,’ and provides realistic test conditions across the application’s entire delivery chain from different parts of the globe.

SandStorm quickly identifies application bottlenecks and helps predict its reliability, scalability and performance issues. SandStorm is the only tool to provide multi-protocol support in a single package with easy parameterization of FLEX, AJAX, Silverlight and Applet based applications. Its integrated resource monitoring and intuitive real time status reporting enables high-end analytics and extract capabilities.

It helps reduce the performance engineering costs by at least 30%, vis-à-vis other popular load testing tools. Impetus offers comprehensive services around performance engineering, including performance testing and sizing, system diagnostics, performance tuning and optimization and capacity planning, among others.

Read More:

http://www.cloudcomputingdevelopment.net/cloud-performance-testing-tool-launched-by-impetus/

Did you like this? Share it:

Introducing LocalDB, an improved SQL Express

Introduction

It gives me great pleasure to introduce a new version of SQL Express called SQL Express LocalDB.

LocalDB is created specifically for developers. It is very easy to install and requires no management, yet it offers the same T-SQL language, programming surface and client-side providers as the regular SQL Server Express. In effect the developers that target SQL Server no longer have to install and manage a full instance of SQL Server Express on their laptops and other development machines. Moreover, if the simplicity (and limitations) of LocalDB fit the needs of the target application environment, developers can continue using it in production, as LocalDB makes a pretty good embedded database too.

Background

Before focusing on technical description of LocalDB, I’d like to provide some background on the direction we took building it.

Today SQL Server Express serves two distinct needs. On one hand it is a free edition of SQL Server. The installation, management and programming of SQL Express in this role is expected to be 100% compatible with other editions. It can be used for learning, training and to run relatively small production database (with less than 10GB of data). Upgrade from SQL Express to paid SQL Server editions is a matter of typing in a license key and no installation is required.

But SQL Express is also SQL Server edition for developers writing applications targeting SQL Server. In this role the programming of SQL Express is still expected to be 100% compatible with other SQL Server editions, but SQL Express is supposed to be small, simple, low-footprint, require no configuration or administration, run as non-admin user, etc.

Our approach so far was to try to make SQL Express perform well in both roles. But as SQL Server product matured, and in effect added more complexity, it became harder and harder for SQL Express to be both compatible with other SQL Server editions and small/simple. The challenge is most visible in installation and configuration of SQL Express. In SQL Server "Denali" we decided to change the approach it and introduce a dedicated version of SQL Express for developers – LocalDB that delivers the simplicity and yet is compatible with other editions of SQL Server at the API level.

Also, by making LocalDB a better SQL Express for developers, we hope to be able to improve the regular SQL Express to be a better free SQL Server. We’d be very happy to hear your feedback in this area, especially if you’re using SQL Express as a database server and find any issues caused by the new features that were introduced to fit the needs of developers and desktop environment.

Source: http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx

Did you like this? Share it:

Non-Functional Software Testing

If functional software testing is the practice of verifying and validating a software package — in other words making sure the software works and does was it was designed to do — then non-functional software testing is everything else beyond that. One of the first of these “everything-else” categories is performance testing.

Performance Testing

Testing the performance of a new or existing program is the process of determining how well an application performs under actual working conditions. Performance testing was not a great concern for software developers until the rise of client/server technology. In the earlier days of computer development, most programs were standalone, independent creations that were restricted to local environments. Having thousands and thousands of users attempting to access the same information simultaneously was not a consideration.

All of that emphasis on standalone software went away with the advent of the Internet. Suddenly, a program was expected to concurrently service similar requests of any number of users. The need for performance testing became evident in a hurry.

Performance Testing Requirements

The first requirement for testing performance is that the program in question be completely functional. That means that all functional testing should have been completed successfully, and all bugs should have been corrected. Performance testing also requires that the testing be done automatically, with the aid of a service that is designed to simulate multiple users performing identical actions in a short (or, at least, defined) period of time.

Performance testing attempts to verify that an application can perform satisfactorily while serving a given number of users. Typically, the number of virtual users will be determined by the testing program but it can often be more than a thousand simulated users. Hence the requirement for automation. Endurance testing, an element of performance testing sometimes referred to as “stability testing,” verifies that the application can continue to perform for an extended period of time under conditions that are as near to real-life parameters as possible. Load testing can easily fit into this category, as it attempts to verify either the number of simultaneous users that can be serviced or the level of parallel requests for data manipulation (this can include transfer quantity and/or data modification activity).

Stress testing, another form of performance testing, attempts to find the point at which the application begins to break down or fall apart under duress. One of the important elements of stress testing is to determine how the program reacts to overload situations: does it just quit, or does it systematically shut down, sending warning messages to users and management as appropriate?

Usability Testing

Usability testing is the method of checking to see if the program is easy to use and performs things the user wants in an intuitive manner. A relatively new practice employed by software developers is to have the users perform these tests themselves. The results are solicited through the use of surveys, which contain questions such as “Did you find the program easy to use?” and “Do you have any suggestions for improvements?” This form of testing is extremely useful to the developer because it often gets to the direct root of any existing usability problems.

The term “user-friendly” comes to mind under the umbrella of usability testing. “User-friendly” often refers to the user being able to progress through the program without having to make any abstract or unexpected decisions, which could cause the program to inadvertently abort. This may take the form of yes/no questions, radio-button pushing, or having the user make a selection from a dropdown list of choices. The more user-friendly a program is, the less likely it is to fail the usability test. Of course, writing user-friendly code for such a program puts a much greater demand on the programmer.

Security Testing

The latest addition to the whole software testing scheme involves the testing of security. Again, the need for this type of testing became evident with the creation of the Internet. Hackers originally took pleasure in breaking into a system and modifying the performance of an application. Their motivation was primarily self-identification to show the world just how smart they were. As the Internet became more commercial, though, it quickly became evident that there was money to be made in the practice of hacking.

There are numerous programs and services available to scan soon-to-be-released software for security breaches. They present a risk-based analysis as to the vulnerability of the program indicating whether the defects found are in need of immediate attention, or if they can possibly wait for the next release. At any level, they merely point out the security problems – it’s still up to the developers to come up with the solutions.

The difficulty with testing security is that it involves the human element. Passwords, personal questions, or other means of authenticating the user must be safeguarded by the user themself. If the user is not dutifully inclined to protect said security information, then all the security testing in the world is for naught. Writing passwords down, giving passwords to others, or just leaving a computer open and unattended are invitations for a security disaster.

Wrapping It Up

I hope you have enjoyed and gotten something out of this exploration on non-functional software testing. Obviously, my approach was merely an overview of the whole concept. Entire books (emphasis on the plural) have been written on the subject. My intent was to present you with the major facets and, hopefully, spark some interest in the subject.

Source: http://buildmobile.com/non-functional-software-testing/

Did you like this? Share it: