<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:rawvoice="http://www.rawvoice.com/rawvoiceRssModule/"
>

<channel>
	<title>Solution Hacker &#187; jmeter</title>
	<atom:link href="http://www.solutionhacker.com/tag/jmeter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.solutionhacker.com</link>
	<description>This blog provides solutions for enterpreneurs!</description>
	<lastBuildDate>Mon, 06 Feb 2012 07:19:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=486</generator>
<!-- podcast_generator="Blubrry PowerPress/2.0.4" -->
	<itunes:summary>This blog provides solutions for enterpreneurs!</itunes:summary>
	<itunes:author>Solution Hacker</itunes:author>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.solutionhacker.com/wp-content/plugins/powerpress/itunes_default.jpg" />
	<itunes:subtitle>This blog provides solutions for enterpreneurs!</itunes:subtitle>
	<image>
		<title>Solution Hacker &#187; jmeter</title>
		<url>http://www.solutionhacker.com/wp-content/plugins/powerpress/rss_default.jpg</url>
		<link>http://www.solutionhacker.com</link>
	</image>
		<item>
		<title>Load and stress testing my website</title>
		<link>http://www.solutionhacker.com/implement-your-idea/test-your-website/load-and-stress-testing-my-website/</link>
		<comments>http://www.solutionhacker.com/implement-your-idea/test-your-website/load-and-stress-testing-my-website/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 02:18:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[AMF]]></category>
		<category><![CDATA[charles http proxy]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[jmeter]]></category>
		<category><![CDATA[load testing]]></category>
		<category><![CDATA[stress testing]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=209</guid>
		<description><![CDATA[<h2>Purpose of Load and Stress testing</h2>
<p>The key goals of load testing are:</p>
<ol>
	<li>Find out whether your website can support the<strong> expected </strong># of concurrent users.</li>
	<li>At what load does the app break?</li>
</ol>
<p>To do that, you normally follow these steps:</p>
<ol>
	<li>Identifying the primary user path</li>
	<li>Identifying the expected # of concurrent users. (Both now and future)</li>
	<li>Set up virtual users to hit the app (<strong>load generation capability </strong>is the key factor to pick the right tool. You don&#39;t want too much hardware investment to generate the load you want, right? <img alt=":wink:" onclick="grin(':wink:');" src="../../../../../wp-includes/images/smilies/icon_wink.gif" />)</li>
	<li>Run the test</li>
	<li>Analyze the result (throughput under load, avg response time under load)</li>
</ol>
<p>&#160;</p>
<h2><!--more-->Challenges to load test Flex app</h2>
<p>We have a web application that has <strong>Flex </strong>frontend talks to J2EE web application backend via <strong>AMF</strong>. How do we load and stress test this system? We certainly can just perform load test against our backend. However, it may need to expose our service via Servlet and load test it as typical restful web service. If we want to simulate Flex and load test through AMF. We need to find a way to capture the AMF requests from Flex client and replay it in our load testing suite. To do that, we can use <a href="http://www.charlesproxy.com/">Charles http proxy</a> to capture the AMF request and tell <strong>JMeter </strong>to load test our application via replaying this AMF request. This&#160; <a href="http://note19.com/2008/05/06/how-to-use-jmeter-to-load-test-flex-applications/">article</a> can give us the detail. However, Charles is a commerical product. If you want a free solution, you can try <a href="http://90kts.com/blog/2008/performance-testing-flex-remoting-amf-with-jmeter/">this</a>.</p>
<p>I know that JMeter comes with proxy to record the request. You can <a href="http://jakarta.apache.org/jmeter/usermanual/best-practices.html#proxy_server">try it out</a> to see whether you can exam the AMF message. Let me know if it works!</p>
<h2>JMeter</h2>
<p><strong><span class="docEmphasis">Load</span> </strong>is all of the users using your web site at a point in time. Load includes users making requests to your web site as well as those reading pages from previous requests. However, we do need some way of differentiating between all clients and those clients actually making requests to our web site. We use the terms <strong><span class="docEmphasis">concurrent load</span></strong> and <strong><span class="docEmphasis">active load</span></strong> (making request) to make this distinction. We use the <strong>JMeter </strong>to help us to generate the load to our system. In term of load generation, we should make sure that we can simulate the <strong>peak load</strong>. JMeter is a great load testing tool. I have heard that Google is using this to load and stress test its application.</p>
<p><embed allowfullscreen="true" allowscriptaccess="always" id="VideoPlayback" src="http://video.google.co.uk/googleplayer.swf?docid=-6891978643577501895&#38;hl=en&#38;fs=true" style="width: 400px; height: 326px;" type="application/x-shockwave-flash"></embed></p>
<p><u><strong>To use JMeter, follow the steps below:</strong></u></p>
<ol>
	<li><strong>Set up Thread Group</strong> - use to model concurrent virtual users and decide how you want the load be generated.
		<ul>
			<li><strong>Number of threads</strong>.</li>
			<li><strong>The ramp-up period</strong> (it tells JMeter the amount of time for creating the total number of threads). At the beginning of a load test, if the ramp-up period is zero, JMeter will create all the threads at once and send out requests immediately, thus potentially saturating the server and, more importantly, deceivingly increasing the load. That is, the server could become overloaded, not because the average hit rate is high, but because you send all the threads&#39; first requests simultaneously, causing an unusual initial peak hit rate. The rule of thumb for determining a reasonable ramp-up period is to keep the initial hit rate close to the average hit rate.</li>
			<li><strong>The number of times</strong> to execute the test.</li>
			<li>If the client machine running JMeter lacks enough computing power to model a heavy load, JMeter&#39;s <strong>distributive testing feature</strong> allows you to control multiple remote JMeter engines from a single JMeter console.</li>
		</ul>
	</li>
	<li><strong>Introduce user think time</strong></li>
	<li><strong>Specify response-time requirements and validate test results.</strong></li>
</ol>
<p>To get familiar with it, here are some articles I found it useful</p>
<ol>
	<li><a href="http://www.linux.com/feature/34432">Stress testing with JMeter by Daniel Rubio - Linux.com</a></li>
	<li><a href="http://www.devx.com/webdev/Article/17950/0/page/1">Loading testing with Apache JMeter by Kulvir Singh Bhogal, - Devx.com</a></li>
	<li><a href="http://jakarta.apache.org/jmeter/usermanual/jmeter_distributed_testing_step_by_step.pdf">JMeter distributed testing</a></li>
	<li><a href="http://jakarta.apache.org/jmeter/usermanual/jmeter_proxy_step_by_step.pdf">JMeter recording testing</a></li>
	<li><a href="http://www.johnandcailin.com/blog/john/load-test-your-drupal-application-scalability-apache-jmeter">Load test your drupal app scalability with JMeter</a> - Part 1, <a href="http://www.johnandcailin.com/blog/john/load-test-your-drupal-application-scalability-apache-jmeter%3A-part-two">Part 2</a></li>
	<li><a href="http://www.scribd.com/doc/7499267/Load-Testing-With-JMeter">Load testing with JMeter - powerpoint</a> - very good!</li>
	<li><a href="http://www.scribd.com/doc/3805411/Scalability-Factors-of-JMeter-in-Performance-Testing-projects">Scalability Factors of JMeter in Performance Testing</a> - response size, response time, protocol, hardware configuration, load generating tool architecture and configuration, complexity of client-side processing.</li>
	<li><a href="http://www.javaworld.com/javaworld/jw-07-2005/jw-0711-jmeter.html?page=1">JMeter Tips - Javaworld</a></li>
</ol>
<h2>&#160;Reference</h2>
<ol>
	<li>Someone has written a nice <a href="http://flex.sys-con.com/node/614811/mobile">article </a>in sys-con to talk about how to load test Flex application.</li>
	<li><a href="http://mdzyuba.blogspot.com/2008/05/using-flexunit-for-stress-testing.html">Use FlexUnit for stress testing</a></li>
	<li><a href="http://mdzyuba.blogspot.com/2008/05/testing-remote-data-services-with.html">Test Remote Data Service via FlexUnit</a></li>
	<li><a href="http://www.igvita.com/2008/09/30/load-testing-with-log-replay/">Load testing with log replay - interesting idea</a></li>
</ol>
]]></description>
			<content:encoded><![CDATA[<h2>Purpose of Load and Stress testing</h2>
<p>The key goals of load testing are:</p>
<ol>
<li>Find out whether your website can support the<strong> expected </strong># of concurrent users.</li>
<li>At what load does the app break?</li>
</ol>
<p>To do that, you normally follow these steps:</p>
<ol>
<li>Identifying the primary user path</li>
<li>Identifying the expected # of concurrent users. (Both now and future)</li>
<li>Set up virtual users to hit the app (<strong>load generation capability </strong>is the key factor to pick the right tool. You don&#39;t want too much hardware investment to generate the load you want, right? <img alt=":wink:" onclick="grin(':wink:');" src="../../../../../wp-includes/images/smilies/icon_wink.gif" />)</li>
<li>Run the test</li>
<li>Analyze the result (throughput under load, avg response time under load)</li>
</ol>
<p>&nbsp;</p>
<h2><span id="more-209"></span>Challenges to load test Flex app</h2>
<p>We have a web application that has <strong>Flex </strong>frontend talks to J2EE web application backend via <strong>AMF</strong>. How do we load and stress test this system? We certainly can just perform load test against our backend. However, it may need to expose our service via Servlet and load test it as typical restful web service. If we want to simulate Flex and load test through AMF. We need to find a way to capture the AMF requests from Flex client and replay it in our load testing suite. To do that, we can use <a href="http://www.charlesproxy.com/">Charles http proxy</a> to capture the AMF request and tell <strong>JMeter </strong>to load test our application via replaying this AMF request. This&nbsp; <a href="http://note19.com/2008/05/06/how-to-use-jmeter-to-load-test-flex-applications/">article</a> can give us the detail. However, Charles is a commerical product. If you want a free solution, you can try <a href="http://90kts.com/blog/2008/performance-testing-flex-remoting-amf-with-jmeter/">this</a>.</p>
<p>I know that JMeter comes with proxy to record the request. You can <a href="http://jakarta.apache.org/jmeter/usermanual/best-practices.html#proxy_server">try it out</a> to see whether you can exam the AMF message. Let me know if it works!</p>
<h2>JMeter</h2>
<p><strong><span class="docEmphasis">Load</span> </strong>is all of the users using your web site at a point in time. Load includes users making requests to your web site as well as those reading pages from previous requests. However, we do need some way of differentiating between all clients and those clients actually making requests to our web site. We use the terms <strong><span class="docEmphasis">concurrent load</span></strong> and <strong><span class="docEmphasis">active load</span></strong> (making request) to make this distinction. We use the <strong>JMeter </strong>to help us to generate the load to our system. In term of load generation, we should make sure that we can simulate the <strong>peak load</strong>. JMeter is a great load testing tool. I have heard that Google is using this to load and stress test its application.</p>
<p><embed allowfullscreen="true" allowscriptaccess="always" id="VideoPlayback" src="http://video.google.co.uk/googleplayer.swf?docid=-6891978643577501895&amp;hl=en&amp;fs=true" style="width: 400px; height: 326px;" type="application/x-shockwave-flash"></embed></p>
<p><u><strong>To use JMeter, follow the steps below:</strong></u></p>
<ol>
<li><strong>Set up Thread Group</strong> &#8211; use to model concurrent virtual users and decide how you want the load be generated.
<ul>
<li><strong>Number of threads</strong>.</li>
<li><strong>The ramp-up period</strong> (it tells JMeter the amount of time for creating the total number of threads). At the beginning of a load test, if the ramp-up period is zero, JMeter will create all the threads at once and send out requests immediately, thus potentially saturating the server and, more importantly, deceivingly increasing the load. That is, the server could become overloaded, not because the average hit rate is high, but because you send all the threads&#39; first requests simultaneously, causing an unusual initial peak hit rate. The rule of thumb for determining a reasonable ramp-up period is to keep the initial hit rate close to the average hit rate.</li>
<li><strong>The number of times</strong> to execute the test.</li>
<li>If the client machine running JMeter lacks enough computing power to model a heavy load, JMeter&#39;s <strong>distributive testing feature</strong> allows you to control multiple remote JMeter engines from a single JMeter console.</li>
</ul>
</li>
<li><strong>Introduce user think time</strong></li>
<li><strong>Specify response-time requirements and validate test results.</strong></li>
</ol>
<p>To get familiar with it, here are some articles I found it useful</p>
<ol>
<li><a href="http://www.linux.com/feature/34432">Stress testing with JMeter by Daniel Rubio &#8211; Linux.com</a></li>
<li><a href="http://www.devx.com/webdev/Article/17950/0/page/1">Loading testing with Apache JMeter by Kulvir Singh Bhogal, &#8211; Devx.com</a></li>
<li><a href="http://jakarta.apache.org/jmeter/usermanual/jmeter_distributed_testing_step_by_step.pdf">JMeter distributed testing</a></li>
<li><a href="http://jakarta.apache.org/jmeter/usermanual/jmeter_proxy_step_by_step.pdf">JMeter recording testing</a></li>
<li><a href="http://www.johnandcailin.com/blog/john/load-test-your-drupal-application-scalability-apache-jmeter">Load test your drupal app scalability with JMeter</a> &#8211; Part 1, <a href="http://www.johnandcailin.com/blog/john/load-test-your-drupal-application-scalability-apache-jmeter%3A-part-two">Part 2</a></li>
<li><a href="http://www.scribd.com/doc/7499267/Load-Testing-With-JMeter">Load testing with JMeter &#8211; powerpoint</a> &#8211; very good!</li>
<li><a href="http://www.scribd.com/doc/3805411/Scalability-Factors-of-JMeter-in-Performance-Testing-projects">Scalability Factors of JMeter in Performance Testing</a> &#8211; response size, response time, protocol, hardware configuration, load generating tool architecture and configuration, complexity of client-side processing.</li>
<li><a href="http://www.javaworld.com/javaworld/jw-07-2005/jw-0711-jmeter.html?page=1">JMeter Tips &#8211; Javaworld</a></li>
</ol>
<h2>&nbsp;Reference</h2>
<ol>
<li>Someone has written a nice <a href="http://flex.sys-con.com/node/614811/mobile">article </a>in sys-con to talk about how to load test Flex application.</li>
<li><a href="http://mdzyuba.blogspot.com/2008/05/using-flexunit-for-stress-testing.html">Use FlexUnit for stress testing</a></li>
<li><a href="http://mdzyuba.blogspot.com/2008/05/testing-remote-data-services-with.html">Test Remote Data Service via FlexUnit</a></li>
<li><a href="http://www.igvita.com/2008/09/30/load-testing-with-log-replay/">Load testing with log replay &#8211; interesting idea</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/implement-your-idea/test-your-website/load-and-stress-testing-my-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to test my system?</title>
		<link>http://www.solutionhacker.com/uncategorized/how-to-test-my-system/</link>
		<comments>http://www.solutionhacker.com/uncategorized/how-to-test-my-system/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 15:03:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[6. Uncategorized]]></category>
		<category><![CDATA[Team]]></category>
		<category><![CDATA[automated testing]]></category>
		<category><![CDATA[Flex Monkey]]></category>
		<category><![CDATA[functional testing]]></category>
		<category><![CDATA[jmeter]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[stress testing]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://www.solutionhacker.com/?p=194</guid>
		<description><![CDATA[<h2>Here is a good video from Google&#160;</h2>
<embed id="VideoPlayback" src="http://video.google.com/googleplayer.swf?docid=-6891978643577501895&#38;hl=en&#38;fs=true" style="width: 400px; height: 326px;" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"></embed>
<h2>Testing Strategies Overview</h2>
<p>I believe that I don't need to stress out how important testing is. So, lets cut the crap and talk about the challenging areas related to this subject. Here are the things I want to talk about</p>
<ol>
    <li>Write your unit test first then code<br />
    <ul>
        <li>It is the core concept from <strong>Test Driven Development (TDD)</strong>. Everyone tried that will tell how great it is. However, the difficult part of it is to <strong>enforce </strong>it across your team especially under the time constraint. Everyone wants to get something out right away and we are all getting so much stresses from our business side about features release to stay competitive in the market. How can we allocate time for this "luxury"? The key here is whether you believe it will save you tons of time in a long run. If not, it is hard to carry out this idea.</li>
        <li>What are the areas that could save my time? <strong>Agile </strong>development may face one big challenge from the product side. The problem is mainly due to the way they break down the project into <strong>mini-specs</strong> to fit into a sprint of work. Sometimes they find it difficult to think of a project in a micro level. To deliver the mini-spec in a agile process, they may leave out the detail in the spec and try to fill them up in an iterative fashion. Write your test first forces you to think API, input, output and use cases ahead of time. This will help you to feedback the product team earlier in the loop. Otherwise, it will cause you more time to change your logic or patch your codes later.</li>
        <li>If you have a suite of unit tests, you are more confidence to do refactoring because you can perform regression tests to make sure nothing is broken. Apart from that, you can add new features to someone's code without worrying that it will break the old features as you have the unit tests from the owner to verify.</li>
        <li>Things you need to pay attention are: (1) Don't commit code to the trunk that breaks the build (compile), but it is ok that it doesn't pass the tests temporary as you are in the middle to fill up the code and you don't want to have your code sitting in your local box too long. (2) Do <strong>code coverage</strong> to make sure you have your unit test exercises your codes in good %.</li>
        <li>Tools I used to write my unit test: <strong>TestNG/ JUnit </strong>for Java code, <strong>FlexUnit </strong>for flex code</li>
        <li>How do we unit test our DAO? Test with your local database (use same vendor and version of the database as the one in production. I don't like to use any memory databases like Hypersonic or SQLite b/c it doesn't really test our your SQL).</li>
    </ul>
    </li>
    <li>Functional testing - use <strong>Selenium </strong>to automate it.</li>
</ol>
<h2>Performance/load testing</h2>
<p><strong><u>Basic workflow</u></strong></p>
<ol>
    <li><strong>Create use case scripts</strong> for your application via <strong>recording</strong>. For Flex, we want a tool that can convert the binary AMF message to readable text as part of our script.</li>
    <li><strong>Introduce natural variability </strong>- varying the login credentials, records opened, records saved, and other user actions including thinking time. This step is important because it provides the real-world variability that keeps your application working hard and prevents you from missing performance problems because of caching at various layers on your server.</li>
    <li><strong>Define test data</strong> sets to be used by your scripts as you ramp up hundreds or thousands of simulated users executing your tests.</li>
    <li><strong>Define profiles of load on your application</strong>. You might decide to have 20% of your users entering information slowly, 20% entering information very quickly, 40% looking up information, 10% producing reports, and 10% making account changes. The breakdowns and level of detail are entirely up to you.</li>
    <li><strong>Specify how to run the test.</strong> You control such things as the <strong>speed of ramping up</strong> user load, how fast each user executes the test, and whether there should be natural variability between users and sessions. Each tool provides different fine-grained control over this step.</li>
</ol>
<p><u><span style="font-weight: bold;">Tips</span></u></p>
<ul>
    <li>Don't carry performance test without passing all the functional tests.</li>
    <li>Test against single box first and you should not run JMeter on the same machine running the application to be tested.</li>
    <li>Make sure that the testing is affected as little as possible by network traffic (do it in the subnet to take out network IO factor).</li>
    <li>Create a <strong>test plan</strong> that contains <strong>thread group</strong>(s) that controls the threads that will be created by JMeter to simulate simultaneous users. Determine # of threads and the ramp-up period. Add HttpRequest then listener to view result in table and/or graph format. Each thread will issue an HttpRequest and response time will be recorded. Then <strong>avg response time</strong> and <strong>standard deviation</strong> will be calculated. Another way people uses JMeter is to use its <a href="http://jakarta.apache.org/jmeter/usermanual/jmeter_proxy_step_by_step.pdf">HTTP session recording</a> to produce load tests.</li>
    <li>On the other hand, you need to <strong>monitor </strong>your target in terms of CPU, memory and IO consumption (use <strong>OpenNMS</strong>) during the perfomance testing.</li>
    <li>Create a <strong>scheduled integration build</strong> that runs       JMeter tests (use <strong>CruiseControl</strong>). Read this <a href="http://www.ibm.com/developerworks/java/library/j-ap04088/index.html">article </a>for integration detail.</li>
    <li>How to achieve the load via distribution?</li>
    <li>How to obtain meaningful information from the raw data?</li>
    <li>Look at throughput (QPS), resources consumption (CPU, Memory, IO) over time and over users/ load.</li>
    <li>Need to set up the database with good amount of data for testing.</li>
    <li>Performance profiling
    <ul>
        <li>Obtain the rough data from performance test first</li>
        <li>Identify the bottleneck and fix the problem.</li>
        <li>Don't waste too much time to over-tune your system. Just fix the bottlenecks that impact the SLA.</li>
    </ul>
    </li>
    <li>Stress testing</li>
    <li>Scalability testing - testing on scaling out or up your system.</li>
    <li>Availability testing</li>
</ul>
<h2>Reference</h2>
<p>Below are the references I read to write this article</p>
<ol>
    <li><a href="http://www.opensourcetesting.org/resources.php">http://www.opensourcetesting.org</a></li>
    <li><a href="http://jakarta.apache.org/jmeter/usermanual/index.html">JMeter User Manual</a></li>
</ol>
<p>&#160;</p>]]></description>
			<content:encoded><![CDATA[<h2>Here is a good video from Google&#160;</h2>
<p><embed id="VideoPlayback" src="http://video.google.com/googleplayer.swf?docid=-6891978643577501895&amp;hl=en&amp;fs=true" style="width: 400px; height: 326px;" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></p>
<h2>Testing Strategies Overview</h2>
<p>I believe that I don&#8217;t need to stress out how important testing is. So, lets cut the crap and talk about the challenging areas related to this subject. Here are the things I want to talk about</p>
<ol>
<li>Write your unit test first then code
<ul>
<li>It is the core concept from <strong>Test Driven Development (TDD)</strong>. Everyone tried that will tell how great it is. However, the difficult part of it is to <strong>enforce </strong>it across your team especially under the time constraint. Everyone wants to get something out right away and we are all getting so much stresses from our business side about features release to stay competitive in the market. How can we allocate time for this &#8220;luxury&#8221;? The key here is whether you believe it will save you tons of time in a long run. If not, it is hard to carry out this idea.</li>
<li>What are the areas that could save my time? <strong>Agile </strong>development may face one big challenge from the product side. The problem is mainly due to the way they break down the project into <strong>mini-specs</strong> to fit into a sprint of work. Sometimes they find it difficult to think of a project in a micro level. To deliver the mini-spec in a agile process, they may leave out the detail in the spec and try to fill them up in an iterative fashion. Write your test first forces you to think API, input, output and use cases ahead of time. This will help you to feedback the product team earlier in the loop. Otherwise, it will cause you more time to change your logic or patch your codes later.</li>
<li>If you have a suite of unit tests, you are more confidence to do refactoring because you can perform regression tests to make sure nothing is broken. Apart from that, you can add new features to someone&#8217;s code without worrying that it will break the old features as you have the unit tests from the owner to verify.</li>
<li>Things you need to pay attention are: (1) Don&#8217;t commit code to the trunk that breaks the build (compile), but it is ok that it doesn&#8217;t pass the tests temporary as you are in the middle to fill up the code and you don&#8217;t want to have your code sitting in your local box too long. (2) Do <strong>code coverage</strong> to make sure you have your unit test exercises your codes in good %.</li>
<li>Tools I used to write my unit test: <strong>TestNG/ JUnit </strong>for Java code, <strong>FlexUnit </strong>for flex code</li>
<li>How do we unit test our DAO? Test with your local database (use same vendor and version of the database as the one in production. I don&#8217;t like to use any memory databases like Hypersonic or SQLite b/c it doesn&#8217;t really test our your SQL).</li>
</ul>
</li>
<li>Functional testing &#8211; use <strong>Selenium </strong>to automate it.</li>
</ol>
<h2>Performance/load testing</h2>
<p><strong><u>Basic workflow</u></strong></p>
<ol>
<li><strong>Create use case scripts</strong> for your application via <strong>recording</strong>. For Flex, we want a tool that can convert the binary AMF message to readable text as part of our script.</li>
<li><strong>Introduce natural variability </strong>- varying the login credentials, records opened, records saved, and other user actions including thinking time. This step is important because it provides the real-world variability that keeps your application working hard and prevents you from missing performance problems because of caching at various layers on your server.</li>
<li><strong>Define test data</strong> sets to be used by your scripts as you ramp up hundreds or thousands of simulated users executing your tests.</li>
<li><strong>Define profiles of load on your application</strong>. You might decide to have 20% of your users entering information slowly, 20% entering information very quickly, 40% looking up information, 10% producing reports, and 10% making account changes. The breakdowns and level of detail are entirely up to you.</li>
<li><strong>Specify how to run the test.</strong> You control such things as the <strong>speed of ramping up</strong> user load, how fast each user executes the test, and whether there should be natural variability between users and sessions. Each tool provides different fine-grained control over this step.</li>
</ol>
<p><u><span style="font-weight: bold;">Tips</span></u></p>
<ul>
<li>Don&#8217;t carry performance test without passing all the functional tests.</li>
<li>Test against single box first and you should not run JMeter on the same machine running the application to be tested.</li>
<li>Make sure that the testing is affected as little as possible by network traffic (do it in the subnet to take out network IO factor).</li>
<li>Create a <strong>test plan</strong> that contains <strong>thread group</strong>(s) that controls the threads that will be created by JMeter to simulate simultaneous users. Determine # of threads and the ramp-up period. Add HttpRequest then listener to view result in table and/or graph format. Each thread will issue an HttpRequest and response time will be recorded. Then <strong>avg response time</strong> and <strong>standard deviation</strong> will be calculated. Another way people uses JMeter is to use its <a href="http://jakarta.apache.org/jmeter/usermanual/jmeter_proxy_step_by_step.pdf">HTTP session recording</a> to produce load tests.</li>
<li>On the other hand, you need to <strong>monitor </strong>your target in terms of CPU, memory and IO consumption (use <strong>OpenNMS</strong>) during the perfomance testing.</li>
<li>Create a <strong>scheduled integration build</strong> that runs       JMeter tests (use <strong>CruiseControl</strong>). Read this <a href="http://www.ibm.com/developerworks/java/library/j-ap04088/index.html">article </a>for integration detail.</li>
<li>How to achieve the load via distribution?</li>
<li>How to obtain meaningful information from the raw data?</li>
<li>Look at throughput (QPS), resources consumption (CPU, Memory, IO) over time and over users/ load.</li>
<li>Need to set up the database with good amount of data for testing.</li>
<li>Performance profiling
<ul>
<li>Obtain the rough data from performance test first</li>
<li>Identify the bottleneck and fix the problem.</li>
<li>Don&#8217;t waste too much time to over-tune your system. Just fix the bottlenecks that impact the SLA.</li>
</ul>
</li>
<li>Stress testing</li>
<li>Scalability testing &#8211; testing on scaling out or up your system.</li>
<li>Availability testing</li>
</ul>
<h2>Reference</h2>
<p>Below are the references I read to write this article</p>
<ol>
<li><a href="http://www.opensourcetesting.org/resources.php">http://www.opensourcetesting.org</a></li>
<li><a href="http://jakarta.apache.org/jmeter/usermanual/index.html">JMeter User Manual</a></li>
</ol>
<p>&#160;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.solutionhacker.com/uncategorized/how-to-test-my-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

