Saturday, April 1, 2017

Web Client Performance: Webpage's Response Time and HTTP Requests -- Part 1


I'm practicing along with my colleague Chidambara, on Web Client Performance Testing (WCPT). While we practice together, we are learning, how to assess the current capability of the web page and then how to interpret the same.  Why I say this, because when I test, I will make a report; that test report as to help one to decide and assist in taking the necessary action if it has to be taken. If not, the purpose of the test report might just bound to know what did I test and what is my interpretation. For this, I need not write the test report.  The same with automation as well, isn't it? We will get the report on running the test suite and this report will be used further to decide what to do based on our interpretation of it. Coming back to WCPT, I happened to learn it this way and sharing my learning with my fellow tester.

I picked a Google India search page and monitored its requests and response. At time of testing, I used Firefox in private mode. I noticed total of 16 requests were fired and close to 1.4 MB data were transferred. Overall it took 4.62 seconds on 100 Mbps bandwidth internet line. Below picture reads the requests fired and its timeline.

HTTP requests fired from Google Search India page















I notice, first two redirection taking total of 294 ms, and then 484 ms to load the html document. In total, to load the html document, 778 ms is used. This is close to a second. If I had to make it to round figure, say 1 second to load the html document. Without html document, the web page will not get loaded and for this reason html document will be the first content to get downloaded on client i..e on the browser.  Notice that there are two redirects with HTTP status code 302.
I will walk through in a blog post how the redirects affects the web client performance potentially. I and Chidambara, practiced the same few days back.

Moving ahead, I see other 3 seconds are used to download the images, stylesheet (CSS) and scripts. This tells, more time is taken to download these elements of the page then the html document. When looked into other web's webpages the same is observed during time of testing.  With that, I learn, these elements are the time consumers if not handled well thereby showing the slow response time. Slower the response time is, i.e. the more time is taken to load the functional webpage.
Now you see, while carrying out the functional test you also test partially for the performance of it, and vice versa.

The 'capability' i.e. performance attribute of the webpage will be -- "how quickly it loaded on the client i.e. what is its response time".

Note that, the expectation is, it should be functional and  the experience of using it should be pleasant to the user; these are the implicit expectations with the words 'capability' and 'response time'.

In above picture, the total time for receiving the html document is 778 ms. But, the event DOMContentLoaded is fired after 1 second and somewhere it looks near to the mark of 1.2 second. Where did the 442 ms go then? On my network bandwidth of 100 Mbps and machine configuration with 8 GB RAM, still this is a question to me. Then what will be in other network bandwidth and client's machine configuration? Why DOM parsing took time?
I see there is JS being received i.e. in 8th request. I'm not sure if is synchronous or asynchronous. Technically where there is no dependencies between the scripts or any other page elements, keeping it as asynchronous helps.
Then there is a CSS being received in last second request. If the CSS isn't received well before, then page loading has to wait for it as the style cannot be defined for the parsed DOM of loaded html document.  It is a thumb rule to keep CSS in the top requests while receiving from the server. But context of the website's design can change this thumb rule.
If this gets tested, can the response time of the Google India search page can come close to 3.3 to 3.5 seconds?

If this is just for one webpage of a website, how many webpages do the product I'm testing, have? Now I understand very much better than ever that, like functionality is coded into the product, the performance as well should be designed and coded in equal importance.  I derive my tests with such thought process as it serves me to be the base in building the tests and for sampling the variation and interpretation of test observations.


What did I learn here?

These are key learning when I happened to interpret the Web Client's performance
  • More the number of HTTP requests, the response time increases for the webpage
    • Lesser the number of HTTP requests, it is good from point view of webpage's response time and performance
  • The html document takes minimal share in the total load time of the web page and rest of the time is taken by the webpage's element
    • Handling and optimizing this is important for better performance of web client
  • More the page weight, more the response time for webpage
    • Need to test and figure out is there any way the page weight can be optimized, so the response time for webpage will be fast
  • If said, 15% of time is for html document of the webpage and then other 85% is for the webpage's element, then the problem area is evident with respect to response time
    • If fine tuned the client for better performance, the experience for targeted user should still be pleasing with better response time
    • Upon this, if server performance is optimized, then do targeted user say, "it is just like this, so fast"? I do not know; but as a practicing tester I see, fine tuning the performance of web client is possible for a tester while she or he tests the website for functionality or any other quality criteria. In parallel, if taken care of server performance based on contextual learning from the tests observation, it will be very much useful.
  • Know this when looked at webpage
    • Number of HTTP requests fired; 
    • time taken by each requests; 
    • what each requests carries from client and back from server to client; 
    • size of the HTTP request transaction; 
    • page weight and contribution by each elements in the webpage; 
    • know when did DOMContentLoad event got fired in the timeline;
      • in above picture it is marked with blue line in the timeline
      • it is fired when the html document is completely parsed and loaded without waiting for other elements of the webpage i.e. css, js, images etc.
    • know when did Load event got fired in the timeline;
      • in above picture it is marked with red line in the timeline
      • it is fired when the page elements are loaded and finished loading
    • overall response time for the webpage;
    • understand what each page element is and why it is needed;
      • it is very much important from aspect of testing to know is it actually needed for the webpage or website
      • if it is not needed, then as a tester I should be in position to advocate my observations out of tests
      • if it is needed, then as a tester I should be in position to advocate my observations out of tests and how it can be tuned and optimized

It is important to know what is HTTP and how the web communicates. So that we understand the influence of bandwidth and latency on the response time. In next post, I will share what I have understood for the same. Later in subsequent will share, how I and Chidambara progressed in learning and practicing of this.

Sunday, March 26, 2017

My Learning from Agile Testing Alliance's 12th Bengaluru Meetup


I attended Agile Testing Alliance's 12th Bengaluru Meetup hosted at Moolya Software Testing Pvt. Ltd., office on 25th March 2017. I got to know about this meetup from the Facebook share by Moolya and made my mind to be there. The audience in the meetup were software testers, Agile trainer or coach, and technical lead.

Below listed presentation came in time between 9:40 am IST to 12:50 pm IST
  • Welcome and introduction to Agile Testing Alliance, by Nishi Grover Garg
  • Challenges of Agile for a Manger, by Preeth Pandalay, Techno Agilist, Agile Coach & Trainer
  • Behavior Driven Development: What, Why & How - from a tester's perspective, by Vinay Krishna, Agile Technology Coach
  • Problem Solving Techniques: An attempt to apply ideas across disciplines, by Ajay Balamurugadas, Tyto Software
  • Creating 100 mindmaps in 1 minute, a demo by, Dharamalingam K, Moolya Software Testing Pvt. Ltd
  • Concluding the meetup and vote of thanks, by Nishi Grover Garag


Brief lines on presentations from my notes

I'm listing few points here out of my notes. It was engaging sessions and I had to make sure that I will listen, I make notes and tweet to people if any who were curious to know what's happening in the meetup.

Nishi Grover Garg : Introduction to ATA and welcome note
  • She introduced herself and shared about the Agile Testing Alliance and what it does
  • Said about the recent testing conference that was held i.e. GTR Pune 2017
  • Shared about the different certifications and the assistance from ATA

Preeth Pandalay : Challenges of Agile for a Manager
  • Started with management structure, management hierarchy and bureaucracy
  • Spoke about management in 21st century and in technology era
  • Shared his views on traditional structure of management and Agile management structure
  • From there, he spoke about traditional manager and Agile manager
  • Mentioned about the network based management and said it as organization structure 2.0
  • Then he said about Agile Team Cross Functional and mentioned Katrina Clokie's blog which speaks about this
  • With that he said, Agile team is self organized
  • He shared statistics of Agile helping to solve and deliver better
  • With the statistics walk through, he says, Agile works
  • Audience had question around -- "Management yet to getting adapted to Agile and teams are on Agile. How to solve this so team gets much more support?"

Vinay Krishna : BDD -- What, Why, How - a tester's perspective
  • Started by asking do you know what is BDD and then said it is another buzz word and jargon
  • Says, "in this era we all are programmers and need to write code; testing is a specialization now."
  • He said about the surprises that software development brings and highlighted on "assumptions" what people make in team
  • Started a group activity saying to draw start having 12 points and later he asked "why you did not ask questions but assumed?"
  • Says, bug + feature = beature
    • misunderstanding at all levels
    • lack of effective communication
    • difficulty in communication
    • lots of assumptions
  • Then he shared, BDD = shared understanding by discussing examples
  • Continuing his talk, he said, for start have at least three amigos -- Business Analyst, Programmer and Tester
  • Also says, it is useful if identified and used more than three amigos
  • Shared about how important a scenario and use of Gherkins
  • Mentioned on BDD framework saying,
    • Feature File
    • Step defintion (glue code) 
    • Actual implementation
  • Started another group activity and asked to identify the scenarios for a ATM transaction
  • He said to avoid UI tests with BDD
  • Shared few myths around BDD
    • BDD is automation of functional testing
    • Using Cucumber is BDD
    • BDD is replacement of functional testing
  • Took questions from audience around
    • Difference between unit testing and BDD
    • Around usefulness on BDD
    • Deriving the benefits of BDD in performance and security testing
    • Limitations of BDD

Ajay Balamurugadas : Problem Solving Techniques: An attempt to apply ideas across disciplines
  • Starts by asking, "How do you solve problem? Take a minute and let me know."
    • Audience started interacting
    • There were no slide and it was a white board and interactive session througout
  • Then he mentioned about a crisp definition for "what is problem?" of Jerry Weinberg
    • difference between expectation and reality
  • He mentioned about Problem Solving Leadership workshop by Jerry Weinberg
  • He says, "focus on things which can be controlled"
  • From here, he asked the audience to pick any one problem, so that he demonstrates how to solve it
    • The audience picked -- why less number of attendees to the meetup
    • He started to brainstorm around this problem while audience interactively shared their thoughts on how to solve it
    • Nishi Grover Garg, said this is useful and it will be used from the next upcoming meetup
  • Moving from here, he said about four techniques which can be used in solving the problem
    1. Attributes and Improvement
      • by, Robert P Crawford
      • Further with examples he said
        • identify the problem and list out the attributes of the problem
        • work on the improvement of the problem
        • If you miss out an imporant attribute, problem might not be solved
    2. Six Thinking Hats
      • by, Edwared de Bono
        • Mentioned about 6 different thinking hats -- White, Black, Yellow, Green, Blue and Red
        • Briefed what each hats means and what they signify
        • He recommended to avoid using Black hat immediately after the use of Green hat
    3. Questioning
      • He said the importance of questioning
      • Mentioned about Osborn Questioning
    4. SCAMPER
      • A mnemonic
        • S - substitute
        • C - combine
        • A - adapt
        • M - magnify
        • P - put
        • E - eliminate
        • R - rearrange, reverse
  • Later he shared one more mnemonic which he made while on the way to meetup
    • PROBLEM
      • P - perception
      • R - reasoning
      • O - opportunity
      • B - beware of assumptions & problems caused by solving the problems
      • L - lawfulness
      • E - exploratory
      • M - management
  • He took the questions from audience on the techniques and applying it

Dharamalingam K : Creating 100 mindmaps in 1 minute, a demo

  • Walked through swiftly on what is Mindmap and where it can be used
  • He shared about the problem what he and his team encountered when wanting to build a mindmap for a product's feature
  • Then, he said how he built the mindmap via Python program
  • He ran a quick demo which showed creation of mindmaps
  • He took the questions from audience
    • On mindmap
    • On the complexity and how to do this via programming

Nishi Grover Garg : Concluding the meetup and vote of thanks

  • She thanked the audience who made for the meetup
  • Said about the Agile Testing Alliance and benefits the people can get from ceritification


I took below to my desk from this meetup
  • How to handle myself in teams which claims to run on Agile
  • How to coordinate and deliver my best in the environment which claims to run on Agile
  • How to focus on my work irrespective of Agile or not Agile and assist fellow testers and stakeholders
  • Thoughts and questions around BDD apart from functional testing
    • A mind which says to explore on this
  • To focus on things which is in my control and where I can deliver
    • Do not take responsibility without having the authority
      • I repeated this to myself again
    • To read and build skills from below resources shared by Ajay
      • Attributes and Improve, by Robert P Crawford
      • Game Storming, by Dave Gray, Sunni Brown, James Macanufo
      • To explore and use what I can to learn in the web -- http://humansystemsinaction.com
Post meetup hours, was part of three interactive discussing sessions with Ajay and Pranav. I did learn discussing to Ajay and Pranav on fundamental topics of software testing, programming and practice.


Here is a pic from the meetup

Attendees of Agile Testing Alliance's 12th Bengaluru Meetup hosted at Moolya