Lecture 14

Post on 14-Nov-2014

308 views 0 download

Tags:

description

 

Transcript of Lecture 14

Database Design ConceptsInfo 1408

Lecture 14 Term 2 week 3

Testing

Objectives Why software has errors Common software development

problems Software testing Testing vs debugging Types of software testing

“A program which does not work is undoubtedly wrong, but a program which does work is not necessarily right”

Michael Jackson

Software Quality Control

Quality software is reasonably bug-free, delivered on time and within budget, meets requirements and is maintainable.

Why does software have errors?

Miscommunication or no communication The specifics of what an application

should or shouldn't do (the application's requirements).

Programming errors Programmers, like anyone else, can

make mistakes.

Why does software have errors?

Software complexity Windows-type interfaces Client-server and distributed applications Enormous relational databases Sheer size of applications Object-oriented programs

Why does software have errors?

Changing requirements Time pressures

Scheduling of software projects is difficult at best, often requiring a lot of guesswork. When deadlines loom and the crunch comes, mistakes will be made

Why does software have errors?

Egos People prefer to say things like:

’No problem' ’Piece of cake' ’We can do that’

Contract Hunting ’Just win the contract, we’ll sort the rest

out after'

Why does software have errors?

Poorly documented code It's difficult to maintain and modify code that

is badly written or poorly documented In many organisations management provides

no incentive for programmers to document their code or write clear, understandable code

Poor documentation Seen by many programmers as an

unnecessary evil

Why does software have errors?

Software development tools Visual tools Class libraries Compilers Scripting tools, etc.

Often introduce their own errors or are poorly documented, resulting in added errors

Testing Vs Debugging

Testing & debugging are distinct processes Testing - confirming the presence of

errors Debugging - locating and repairing

these errors

The Debugging Process

Re-test ProgramLocate Error

Design Error Repair Repair Error

Types of Testing (there are more)

Unit TestingIntegrationSystem Tests the whole

system

PerformanceAcceptance testing

The Testing Process

Unit Testing

Module Testing

Sub-System Testing

System Testing

Acceptance Testing

Unit/Component Testing

Integration Testing

User Testing

Unit Testing

The testing of individual modules of code eg an SQL statement, procedure or subroutine

This will check Calculations are correct, validations are working correctly, the correct output is produced.

Test Software Components

Software Verification: Evaluation of:

Documents Code

Software Validation: Involves the actual software testing Takes place after verification Includes all requirements & specifications

Do the programs do what they are supposed to do?

Integration testing

Checks that modules work together Interface compatability ( modules can

work together) Parameter values- correct values are

passed as parameter between modules

Run time exceptions

Performance Testing

Tests the whole system in the working environment Can the system deal with the amount

of transactions- Throughput Can the system respond to the user

requests in the required time- response time

If it crashes is recovery time acceptable?

Performance testing (2)

Some systems designed to handle a specified load Number of users or transactions per second

Tests are designed to ensure the system can process its intended load Usually a series of tests where the load is

gradually increased Continues beyond maximum design load or

until system fails

Performance testing (3)

It is often necessary for specific test software to be written to simulate the specified loads

Robustness

A program is said to crash when it terminates unexpectedly.

A robust program is one that doesn't crash even if it receives unexpected input values.

Generally, whenever a value is received to be processed, it should be checked before processing continues, if an unexpected value could cause the program to crash.

Acceptance testing

Carried out by end usersIs the system acceptable to the users Interface acceptable Performance ok

Formal testingIf everything is OK the user will ‘Sign off’- i.e. project is complete

Usability

The usability of a program refers to the ease with which users of your application can interact with your program.

A user-manual can help make your programs easier to follow.

Another point to consider is when to check and print out error messages, it should be done at an appropriate point in the process to minimise user annoyance.

Similarly the number of operations that a user is required to do to carry out an operation should be carefully considered.

Test Planning

Concerned with setting out standards for the testing process, describing the test and the expected result.Test Plan Test number Date Purpose/type of test Expected outputs for stated inputs

More about this next week

Summary

We have considered the reasons why a system needs to be tested.Explained the difference between testing and debugging.Covered the main categories of tests

References

Satzinger, Burd and JacksonChapter 15 pages 621-628