Creating Web Apps  «Prev  Next»

Lesson 9 Testing the Web site
Objective Describe the Web site elements and applications that should be tested.

Website Elements to be tested before launching an Application

Testing is a continuous process. Your list of items to be tested will be particular to each site. However, server and client components should always be tested, especially the functioning of links, the site display on different browsers, and site performance.
  • Links: Make a systematic check of all the links on all your Web pages. This check should be made on a regular schedule. There is nothing more annoying to visitors than broken or dead links.
  • Different Browsers: As the Web site develops, the code should be tested in different browsers, different versions of the browsers, and on different platforms. A Web page may display one way in a particular version of a browser on a certain platform, but may display differently in a later version of the same browser on the same platform. On a different platform, the page may not be displayed at all. You will learn how to test your code in the following series of images below.

User Interface Testing before Website Launch
1) Test to see if your pages display correctly by installing the target browsers on test machines and looking at your pages.
1) Test to see if your pages display correctly by installing the target browsers on test machines and looking at your pages.

2) Test the HTML by using HTML validators
2) Test the HTML by using HTML validators

3) Test the scripted browser functions by loading the page containing the script
3) Test the scripted browser functions by loading the page containing the script

4) Test the Java components by varying the arguments presented to the components
4) Test the Java components by varying the arguments presented to the components

Testing Website Performance

Here’s a structured approach to testing your website's performance after launch:
1. Performance Testing
  1. Download and Response Time:
    • Tools:
      • Use tools like Google PageSpeed Insights, GTmetrix, or WebPageTest to measure load times, first contentful paint, and other performance metrics.
      • Browser developer tools (like Chrome's Lighthouse) provide insights into performance from the client side.
    • Methodology:
      • Initial Load Test: Check how long it takes for your homepage and key landing pages to load completely.
      • Subsequent Load Tests: Test subsequent page loads to ensure caching mechanisms are working correctly.
      • Asset Loading: Monitor the time taken for images, scripts, and stylesheets to load. Consider lazy loading for images or deferring non-critical JS.
    • Varying Times:
      • Schedule tests at different times to account for peak and off-peak hours, especially if your website has global traffic or if there are known high-traffic periods.
    • Connection Types:
      • Simulate various connection speeds using tools like WebPageTest which can mimic different bandwidths or use real device testing with different network conditions (3G, 4G, 5G, various cable modem speeds).
  2. Performance Optimization:
    • If you find long delays:
    • Optimize Images: Compress images without significant quality loss.
    • Minify CSS, JavaScript, and HTML: Reduce file sizes.
    • Use Content Delivery Networks (CDNs): Serve static content from servers closer to the user.
    • Server-side Caching: Implement caching strategies.
    • Database Optimization: If applicable, optimize database queries or indexing.
2. Scalability Testing (Load Testing)
  1. Determining User Capacity:
    • Tools:
      • Load testing tools like Apache JMeter, LoadRunner, or Gatling can simulate thousands of virtual users accessing your website simultaneously.
      • Cloud-based services like BlazeMeter or LoadNinja can scale testing in the cloud.
    • Methodology:
      • Gradual Load Increase: Start with a small number of simulated users and incrementally increase the load until you see performance degradation or system failure.
      • Peak Load Simulation: Test with the number of users expected during peak traffic to see if your infrastructure can handle it.
      • Sustained Load: Run tests over a longer period to check for memory leaks, database locks, or other issues that might appear over time.
    • Monitoring:
      • Monitor CPU usage, memory consumption, disk I/O, network usage, and response times on both the server and application level.
      • Use Application Performance Monitoring (APM) tools like New Relic or Datadog to get insights into application bottlenecks.
  2. Infrastructure Scaling:
    • If the site crashes or slows down significantly:
    • Horizontal Scaling: Add more servers to distribute the load.
    • Vertical Scaling: Upgrade the existing server hardware.
    • Database Sharding or Replication: For database-intensive sites.
    • Load Balancing: Ensure traffic is evenly distributed across servers.
3. Documentation and Iteration
  • Document Findings: Keep detailed records of what was tested, how, and the outcomes. This documentation will be invaluable for future performance tuning.
  • Iterate: Based on the results, make necessary changes, then retest to confirm improvements.
By following this comprehensive testing plan, you'll be well-equipped to ensure your website performs well under various conditions and can handle the load as your user base grows. Remember, performance optimization is an ongoing process, especially as your site evolves or as new technologies and best practices emerge.
After the website is launched, test the pages to see whether downloading and response times are acceptable. Unexpected long delays may require design or code modifications to improve performance. Test the performance at various times of day, with as many connection types as possible. For example, cable modems of different speeds. Test to determine how many users the site can handle without crashing.

Additional Elements to Test

  • Database access: Test the database to ensure information can be retrieved and manipulated. Try performing queries on the information.
  • Website Access: Routinely test local and remote accessibility to ensure the system is always online.
  • New Components: When new components are added to an existing Web site or application, previously tested functionality should be retested to ensure the new components do not corrupt the system. This form of testing is called regression testing.

The next lesson wraps-up this module.

SEMrush Software 9 SEMrush Banner 9