An Introduction to Software Testing

What is software testing?

Software testing is a means of analysing the operation of a system or application under controlled conditions. It aims to look at all possible eventualities and ensure that the system or application is ‘bug free’. The idea of testing is to make things go wrong to determine that what is meant to happen, does.

What is Software Quality assurance?

Software QA is aimed at testing the entire software development process. It includes monitoring and then improving the process in place. It is vital to ensure that agreed upon standards and procedures are followed to make sure problems are discovered. The focus for QA testers is around prevention rather than cure.

Do all software projects need testers?

Some projects that are very small or those with trivial risks may not require an independent tester, however all projects would benefit from using a tester. The size, context, risks, development methodology and skill and experience of the developers will have the biggest sway on the need for testers. In smaller IT companies, having full time testers employed can be too costly. In this situation, a contractor is likely to be brought in for larger, more important projects.

Why does software have bugs?

When trying to spot and remove bugs it is important to understand how they come to be there in the first place.

  • Miscommunication – a difference of understandings of the applications requirements
  • Complexity of the software – nowadays software can be hugely complex. Multi tiered systems, remote server application, security complexes etc all add to the exponential growth in this area which make bugs much more likely.
  • Programming errors – programmers are only human, they do make mistakes
  • Changing application requirements – any changes made can throw out whole sections of code causing major bugs.
  • Poorly maintained code – if changes aren’t well documented, code becomes very difficult to maintain.

What is software 'quality'?

Quality software is bug-free, delivered on time and within budget, meets requirements and expectations, and is maintainable. Software however is judged by many different customers. An overview of some of the 'customers' a software development project might have include end-users, customer acceptance testers, customer contract officers, customer management, the development organization's management/accountants/testers/salespeople, future software maintenance engineers, stockholders and magazine columnists. Each type of 'customer' will have their own slant on 'quality'. For example, the accounting department might define quality in terms of profits while an end-user might define quality as user-friendly and bug-free.

What is 'good code'?

Similar to software quality 'good code' is code that works, is bug free, and is readable and maintainable. Some organizations have coding 'standards' that all developers are supposed to adhere to, but everyone has different ideas about what's best, or what is too many or too few rules. There are also various theories and metrics, such as McCabe Complexity metrics. It should be kept in mind that excessive use of standards and rules can stifle productivity and creativity. 'Peer reviews', 'buddy checks' pair programming, code analysis tools, etc. can be used to check for problems and enforce standards.

For example, in C/C++ coding, here are some typical ideas to consider in setting standards; these are general and obviously vary by project and the requirements associated with it:

  • Minimize or eliminate use of global variables.
  • Use descriptive variable names - use both upper and lower case, avoid abbreviations, use as many characters as necessary to be adequately descriptive (use of more than 20 characters is not out of line); be consistent in naming conventions.
  • Use descriptive function and method names - use both upper and lower case, avoid abbreviations, use as many characters as necessary to be adequately descriptive (use of more than 20 characters is not excessive); be consistent in naming conventions.
  • Function and method sizes should be minimized; less than 100 lines of code is good, less than 50 lines is better.
  • Function descriptions should be clearly spelled out in comments preceding a function's code.
  • Organize code for readability.
  • Use whitespace generously - vertically and horizontally
  • Each line of code should contain 70 characters max.
  • One code statement per line.
  • Coding style should be consistent throughout a program (eg, use of brackets, indentations, naming conventions, etc.)
  • In adding comments, it’s better to add too many rather than too few; a common rule of thumb is that there should be at least as many lines of comments (including header blocks) as lines of code.
  • No matter how small, an application should include documentation of the overall program function and flow (even a few paragraphs is better than nothing); or if possible a separate flow chart and detailed program documentation.
  • Make extensive use of error handling procedures, status and logging.
  • For C++, to minimize complexity and increase maintainability, avoid too many levels of inheritance in class hierarchies (relative to the size and complexity of the application). Minimize use of multiple inheritances, and minimize use of operator overloading (note that the Java programming language eliminates multiple inheritance and operator overloading.)
  • For C++, keep class methods small, less than 50 lines of code per method is preferable.
  • For C++, make liberal use of exception handlers

What is 'good design'?

'Design' could refer to many things, but generally means 'functional design' or 'internal design'.

Good internal design is indicated by software code whose overall structure is clear, understandable, easily modifiable, and maintainable; is robust with sufficient error-handling and status logging capability; and works correctly when implemented.

Good functional design is indicated by an application whose functionality can be traced back to customer and end-user requirements. For programs that have a user interface, it's often a good idea to assume that the end user will have little computer knowledge and may not read a user manual or even the on-line help; some common rules-of-thumb include:

  • The program should act in a way that least surprises the user
  • It should always be evident to the user what can be done next and how to exit
  • The program shouldn't let the users do something stupid without warning them.

So what is a good software tester?

A good test engineer has a 'test to break' attitude, an ability to understand the point of view of the customer, a strong desire for quality, and attention to detail. Being able to communicate tactfully with the developer as well as being able to translate his technical jargon in to easy to understand concepts for the end user are definitely key skills. Judgement skills are also important in order to assess high-risk or critical areas of an application on which to focus testing efforts when time is limited.

Find Software Testing Jobs by clicking here