Thursday, May 12, 2011

Practical Implementation of Data Structures in Computers


Practical Usage of Data Structures in Computers

  1. Stack - any recursive call
  2. Queue, Circular Queue - all the FIFO algo use this
  3. Linked List, Doubly Linked list, Circular Linked list - all the RDBMS
  4. Tree, Binary Search Tree - Where searching is required. Memory is stored in B tree
  5. Graph - Google Maps

Data structure is a particular way of storing and organizing information in a computer so that it can be retrieved and used most productively.
Different kinds of data structures are meant for different kinds of applications, and some are highly specialized to specific tasks.
Data structures are important for the following reasons:
  1. Data structures are used in almost every program or software system.
  2. Specific data structures are essential ingredients of many efficient algorithms, and make possible the management of huge amounts of data, such as large integrated collection of databases.
  3. Some programming languages emphasize data structures, rather than algorithms, as the key organizing factor in software design.

Stack
Undo functions use this to pop most recent action off top of stack, then second most recent, etc.
Queue
Process Scheduling normally uses a queue (how processes or threads are accessed after the initial work varies though). A queue is often used to save a group of data in an organized structure so that it is easily accessed immediately when needed since its a FIFO (First in first out). However; when filling information into that queue when that queue is FULL the rest of the information is lost. To combat this circular queue is used, which overwrites the other elements so that recent data is NOT lost.
                           An example of this like you mentioned would be the queue of resources of a computer. Because a computer does not have infinite resources a queue has to be used in order to allocate resources to those that need it. For instance a process would request some resources and it would be thrown into the queue and be given a priority level, based on this information the OS would then make a decision how many resources it needs and how much time it will be given. In order to allow multiple processes to make use of this, any process that has processing that needs to be done will put in a request in that queue.
Tree
Directory traversal
Binary Search Tree
Searching quickly for a given element
Graph
Stores data so that you can think of it as a mathematical "plane" where the data is plotted. It is effective at representing (possibly) very complicated relationship between data, since (if you look at the image in the link) multiple "links" can exist between more than two pieces of data, as opposed to a linked list where you can only have a link to your left and to your right.
Hash Map
Searching for certain blocks of memory (i.e. when using many pointers) Hashing occurs when you have, say, an address book on your computer. It might use a hash map so that when you enter John Smith, his phone number and other information are available. This is because there is a hashing function that points to a certain location in memory when "John Smith" is entered. It would be a headache entering a memory address every time you wanted to access some simple information.
Linked List
Singly linked list offers movement in one direction between elements, doubly linked list offers movement back and forth between elements, and Circular linked list offers Circular navigation of similar objects (processes are one example) Use this when you want to be able to navigate between elements, because each element is linked to the next one and the one before it (for circular. noncircular linked lists have a beginning and an end). Imagine your web browser...you click "back" to go to the previous page, and you can click "forward" to go to the next. You can think of this as a linear linked list. A photo slide show that goes to the next or previous photo and then eventually starts at the beginning can be thought of as a circular linked list. (They're not necessarily implemented like that but it's a good way to visualize it)
A linked list has many applications that it’s not really possible to simplify it into one. For instance, you could link accounts (objects) through the queue of the nodes of an element in the linked list. In a linked list, a node has a previous and a next node, which effectively links all the elements together so that they can be traversed. Depending on the style of the linked list, this allows forward traversal backward traversal, or both directions. One thing to note is that a linked list can be dynamic in terms of size since all that needs to be done to add a new note is just attach it to the end of the list. However; in terms of performance the speed of that would be O (N) which means that the performance is heavily dependent on the size of the list.

Two data structures that are primarily used in a file cabinet are:-

1>Arrays

2>Link Lists

ARRAYS:-

Arrays are linear data structures consisting of a group of elements that are accessed by indexing. In most programming languages each element of array has the same data type and the array occupies a contiguous area of storage.

By data types we refer to integers, characters etc.

Integer arrays can be used to store numbers and similar numerical values.

Similarly character arrays can be used to store series of characters and so can be used to store names, address, and other strings.

So as a file cabinet consists of different files with variety of information, these arrays can be used to store variety of data.

Implementation of arrays is easy(can be implemented by several programming languages including C and C++)

We can also assign memory to arrays statically and dynamically.

Arrays are also used to implement mathematical vectors and matrices, as well as other kinds of rectangular tables. In early programming languages, these were often the applications that motivated having arrays.

Because of their performance characteristics, arrays are used to implement other data structures, such as heaps, hash tables, queues, deques, stacks, strings, lists etc .So am major tool to implement several other data structures.

 LINK LISTS:-

A linked list is one of the fundamental data structures and can be used to implement other data structures. It consists of a sequence of nodes, each containing arbitrary data fields and one or two references ("links") pointing to the next and/or previous nodes. The principal benefit of a linked list over a conventional array is that the order of the linked items may be different from the order that the data items are stored in memory or on disk, allowing the list of items to be traversed in a different order. A linked list is a self-referential data type because it contains a pointer or link to another datum of the same type. Linked lists permit insertion and removal of nodes at any point in the list in constant time, but do not allow random access. Several different types of linked list exist: singly-linked lists, doubly-linked lists, and circularly-linked lists.

Linked lists can be implemented in most languages. Languages such as Lisp and Scheme have the data structure built in, along with operations to access the linked list. Procedural or object-oriented languages such as C, C++, Java typically rely on mutable references to create linked lists.


Linked lists are used as a building block for many other data structures, such as stacks, Queues and their variations.

The "data" field of a node can be another linked list. By this device, one can construct many linked data structures with lists.


It is necessary to emulate these types of data structures as these are the basic data structure types and other compels data structures can be built from this.
These data structures are excellent means of storing and accessing data.

I would use this type of program in a typical project like a railway reservation project or a library system. Here we need to store a lot of data and need to frequently access these data. So these data structures can come handy.

10 Tips for Decreasing Web Page Load Times

10 Tips for Decreasing Web Page Load Times
Patience is a virtue, but for many, it is often a difficult concept to practice. That is especially true for web users visiting a website that takes a long time to load. Users are enamored with speedy websites, and when a site responds slowly, visitors lose their patience and are less likely to come back.
Improving the speed of your website is important not only to users, but to search engine rankings as well. Last April, Google announced that they are now including website speed in their search ranking algorithms.


While this inclusion doesn’t hold the same weight as many of Google’s other ranking signals, it is still something that should be considered when planning out your website’s SEO efforts.
The following are some tips for decreasing your web page loading times.

1. Check the Current Speed of the Website

The first thing you will want to do is to analyze your current page speed. This allows you to track your improvement and ensure that any changes you make positively improves your page load times.
There are many free tools out there for checking how long it takes to load your website. Here are a few of them:
  • Pingdom offers an easy-to-use site speed test that mimics that way a page is loaded in a web browser.
  • Page Speed is an open source Firefox add-on that helps you assess the performance of your web pages. It also provides suggestions on how to fix performance issues.
  • Web Page Test is another great tool that shows you the speed and performance of your website in different browsers.

2. Optimize Your Images

Know when to use the appropriate file format for your images. Changing to a different file format can dramatically decrease the file size of an image.
  • GIF is ideal for images with few colors like logos.
  • JPEG is great for images with lots of colors and details like photographs.
  • PNG is the choice when you need high quality transparent images.

3. Don’t Scale Down Images

Avoid using a larger image than you need just because you can set the width and height attributes of <img> elements in HTML.
If you need a 100x100px image and you have a 700x700px image, use an image editor like Photoshop or one of these web-based image editors to resize the image to the needed dimensions. This lowers the file size of the image, thus helping to decrease page loading times.

4. Compress and Optimize Your Content

The task of compressing your website content can have a huge impact on reducing load times. When using HTTP compression, all of your web page data is sent in a single smaller file instead of a request that is full of many different files. For more information, see this Wikipedia article on HTTP Compression.
You can also optimize and compress your JavaScript and CSS files by combining them and minifying the source code.

5. Put Stylesheet References at the Top

Moving your stylesheet references to the <head> of your HTML document helps your pages feel like it is loading faster because doing so allows your pages to render the styles progressively. In addition, it doesn’t hurt that it’s the W3C standard.

6. Put Script References at the Bottom

Browsers can only download two components per hostname at the same time. If you add your scripts towards the top, it would block anything else below it on the initial loading of the page. This makes it feel like the page is loading slower.
To avoid this situation, place script references as far down the HTML document as possible, preferably right before the closing <body> tag.

7. Place JavaScript and CSS in External Files

If your JavaScript and CSS are directly in your HTML document, they are downloaded every time an HTML document is requested. This, then, doesn’t take advantage of browser caching and increases the size of the HTML document.
Always place your CSS and JavaScript in external files; it’s a best practice and makes your site easier to maintain and update.

8. Minimize HTTP Requests

When visiting a new web page, most of the page-loading time is spent downloading components of that page (e.g. images, stylesheets, and scripts).
By minimizing the number of requests a web page needs to make, it will load faster. To reduce HTTP requests for images, one thing you can do is to use CSS sprites to combine multiple images.
If you have multiple stylesheets and JavaScript libraries, consider combining them to reduce the number of HTTP requests.

9. Cache Your Web Pages

If you use a content management system that dynamically generates your web pages, you should statically cache your web pages and database queries so that you can decrease the strain on your server as well as speed up page rendering times.
When you cache your page, it saves a static version of it to be presented to the user instead of recreating it every time it’s requested.
For WordPress, check out WP Super Cache and W3 Total Cache (also read this WordPress codex entry on optimizing/caching WordPress). Drupal core has native caching.

10. Reduce 301 Redirects

Every time a 301 redirect is used, it forces the browser to a new URL which increases page-loading times. If possible, avoid using 301 redirects.

Conclusion

Web page speed is a metric that should not be ignored if you are concerned about providing an optimal user experience.
Want more information on decreasing your website’s page load times? Read Google’s section on page speed, which provides tools, articles, and community feedback regarding website speed. Good luck and happy optimizing!

Monday, December 13, 2010

Basic For Sofware Testing

1. What is 'Software Quality Assurance'?
Answer: Software QA involves the entire software development PROCESS - monitoring and improving the process, making sure that any agreed-upon standards and procedures are followed, and ensuring that problems are found and dealt with. It is oriented to 'prevention'.
2. What is verification? Validation?
Answer: Verification typically involves reviews and meetings to evaluate documents, plans, code, requirements, and specifications. This can be done with checklists, issues lists, walkthroughs, and inspection meetings. Validation typically involves actual testing and takes place after verifications are completed.
3. What are 5 common problems in the software development process?
Answer:
• Poor requirements - if requirements are unclear, incomplete, too general, and not testable, there will be problems.
• Unrealistic schedule - if too much work is crammed in too little time, problems are inevitable.
• Inadequate testing - no one will know whether or not the program is any good until the customer complains or systems crash.
• Requests to pile on new features after development is underway; extremely common.
• Miscommunication - if developers don't know what's needed or customer's have erroneous expectations, problems are guaranteed.
4. What is software 'quality'?
Answer: Quality software is reasonably bug-free, delivered on time and within budget, meets requirements and/or expectations, and is maintainable.
5. What makes a good Software Test engineer?
Answer: A good test engineer has a 'test to break' attitude, an ability to take the point of view of the customer, a strong desire for quality, intuitive and an attention to detail.
6. What's a 'test plan'?
Answer: A software project test plan is a document that describes the objectives, scope, approach, of a software testing effort. The completed document will help people outside the test group understand the 'why' and 'how' of product validation.
7. What are the components of a test plan?
Answer: objective, scope, entrance criteria, exit criteria, features to be tested, features not to be tested, approach, item pass fail criteria, Suspension Criteria and Resumption Requirements, Test Deliverables, Environmental Needs, Staffing and Training Needs, Schedule, risk analysis, approval.
8. What is 'configuration management'?
Answer: CCB and version control of test plan.

9. What if the software is so buggy it can't really be tested at all?
Answer: The build must pass the build acceptance testing, which is done by quickly going thru the major functionality testing. Log a problem with high severity. Since this type of problem can severely affect schedules, and indicates deeper problems in the software development process (such as insufficient unit testing or insufficient integration testing, poor design, improper build or release procedures, etc.) managers should be notified, and provided with some documentation as evidence of the problem.
10. How can it be known when to stop testing?
Answer: Zero ship issues, Zero assigned/answered Problem, Complete final regression, complete SnS testing and user documentation is ready.
11. What if there isn't enough time for thorough testing?
Answer: First try to pull more resources from other project. If not possible use risk analysis to determine where testing should be focused.
• Which functionality is most important to the project's intended purpose?
• Which functionality is most visible to the user?
• Which functionality has the largest safety impact?
• Which functionality has the largest financial impact on users?
• What do the developers think are the highest-risk aspects of the application?
• Which aspects of similar/related previous projects caused problems?
12. How can World Wide Web sites be tested?
Answer: Web sites are essentially client/server applications - with web servers and 'browser' clients. Consideration should be given to the interactions between html pages, TCP/IP communications, Internet connections, firewalls, applications that run in web pages (such as applets, javascript, plug-in applications), and applications that run on the server side (such as cgi scripts, database interfaces, logging applications, dynamic page generators, asp, etc.). Additionally, there are a wide variety of servers and browsers, various versions of each, small but sometimes significant differences between them, variations in connection speeds, rapidly changing technologies, and multiple standards and protocols. The end result is that testing for web sites can become a major ongoing effort. Other considerations might include:
• What are the expected loads on the server (e.g., number of hits per unit time?), and what kind of performance is required under such loads (such as web server response time, database query response times). What kinds of tools will be needed for performance testing (such as web load testing tools, other tools already in house that can be adapted, web robot downloading tools, etc.)?
• Pages should be 3-5 screens max unless content is tightly focused on a single topic. If larger, provide internal links within the page.
• The page layouts and design elements should be consistent throughout a site, so that it's clear to the user that they're still within a site.
• Pages should be as browser-independent as possible, or pages should be provided or generated based on the browser-type.
• All pages should have links external to the page; there should be no dead-end pages.
13. What is END-TO-END Testing?
Answer: You do these tests either in System Testing OR User Acceptance testing (UAT) Business (Business Analyst are most interested in this type of tests)
End-to-End testing is a generic word. It means that we are testing from one end to the other end of the application to test a particular functionality from the user perspective. For Ex: If you use the application to make a payment to Mr. XXX, using the web, you are not just interested in getting a "Successfully paid to Mr. XXX" message on the web page, but you need to ensure that the payment did reach Mr. XXX after creating an entry in the local database and then update all relevant databases and indeed update the balance after payment. (One End -to the- other End)

In other words, in end-To-End test, we have to make sure that the entire functional path is exercised so that the software path for this function is tested from this end to the other end, internally. (Testing the Functionality of the requirements from the perspective of the user using the system and performing a particular task)

14. What is exploratory testing?
Answer: exploratory testing is simultaneous learning, test plan and execution. Usually done by exp testers. Done whenever we have vague requirements about the product and time constraints
15. What types of testing does non-functional testing?
Answer: Non-functional testing: This testing is used to test the other quality factors of our build other than the usability testing and functionality testing. This testing includes 7 types of testings: 1) Compatibility testing2) Configuration testing3) Load testing4) Stress testing5) Storage testing6) Data-volume testing7) Installation testing
16. What is the Test we are going to do when a New Build is come to test environment?
Answer: Generic Sequence: 1. Run Smoke Test Plan, 2. Execute Functional Test Plan (If planned), 3. Verify Bug Fixes, 4. Execute Regression Test Plan (applicable to build under test, if planned)
Based on above executions decide (probably test lead/QA manager) whether this build can be accepted
17. What are QA and QC? Explain Briefly.
Answer: QA people involved in entire software development life cycle, they create and enforce some standards and methods to be followed to develop the software. They are the people who were preventing the bugs. QC means testing.
18. What is Test Metrics and how to calculate the Test Metrics?
Answer: Test matrices are used either for test status or for test process improvement.
21. Describe components of a typical test plan?
Answer: Actually test plan describes what to test, how to test, when to test, & who test.
22. How should you learn about problems discovered in the field, and what should you learn from those problems?
Answer: learn about the scenario in which the problem occurred. check your test plans/test design/test cases for the scenarion1. You donot have that scenario. Its an escape. Analyze the scenario where you slipped and make amendments in future releases /versions2. You have it. Did not cover because of lack of time or resources [hardware /software/others] ...Not your fault. Report to Manager he will take care of it.
23. How do you scope, organize, and execute a test project?
Answer: test plan will have everything.
24. What is the difference between error, bug, fault, failure etc?
Answer: My understanding is that:
An Error is an occurrence of human error that can happen during documentation, software construction or testing (such as a misunderstanding of system-use meaning an incorrect condition or test script has been written)
A Fault is a manifestation of an error within the software delivery that causes a deviance of software behavior from expected behavior (ie a defect or a bug).
A Failure is a deviance of software from expected behavior post-live implementation. The implication is that catching an error is more cost effective than having failures.
25. What is the difference between beta and user acceptance testing?
Answer: Acceptance testing: This is where you have to be careful with book definitions. In practice, unless your testers are incompetent, you will have finished all final testing based on specifications during systems testing. Therefore, there is one additional (key) reason for acceptance testing: to see if the code actually works in the real world. I am not even referring to acceptance of offshore code (that is a local systems testing task to confirm that all functionality is properly implemented).
Beta testing: Something similar happens with beta testing. The code, however, is developed for general use, and it should already have passed all the normal test efforts. While technically "perfect" the code may not strike a chord with potential customers. Beta versions are an overt trial code offered to allow potential customers to provide feedback prior to a broad distribution. Sometimes code never sees commercial use as a result of beta feedback, and I assure you that potential customers don't care about any specifications either.
26. What are the types of Bottlenecks in Performance testing?
Answer: hardware bottleneck, process leak bottleneck, network bottleneck, memory leak bottleneck
27. What is the difference between Load, Volume and stress testing?
Answer: Volume testing: Testing where the system is subjected to large volumes of data. Testing which confirms that any values that may become large over time (such as accumulated counts, logs, and data files), can be accommodated by the program and will not cause the program to stop working or degrade its operation in any manner.

Stress testing: Testing conducted to evaluate a system or component at or beyond the limits of its specified requirements. [IEEE] Stress testing is a form of testing which is used to determine the stability of a given system or entity. It involves testing beyond normal operational capacity, often to a breaking point, in order to observe the results.

Load Testing
Testing the load-bearing ability of a system. For example, verifying that the system can handle the required number of users per time period.

28. What are the severity levels?
Answer:
1. Fatal error:(e.g.: Suppose u will open a IE Browser then browser cannot be opened, The page cannot be displayed), it is also called as Show Stopper Errors or 500 Internal servers problem.
2. Major error:(On the above example, the page can be opened, but the contents cannot be displayed)
3. Minor error: Cosmetic errors such as spell check, alignment problem, and etc.
4. Suggestion: At Last How the tester can contact to the developer in a polite way.
29. What is the difference between Client Server Testing and Web Testing?
Answer: mainly differ in security and configuration.

Sunday, December 12, 2010

A New Beginning

Hello Friends, This is my first blog so i really need you guys.I am pretty sure this will really help you in Software Testing.This blog will very helpful for them who are wants their career in Software Testing.

This Blog will carry The Books related to Testing, Helpful Links & other Important Information in Testing.

So Guys always give your feedback because it will help me for making this blog more useful.

Thank You,
Pratap Gusain