Testing Methods

16
Testing Methods Carl Smith National Certificate Year 2 – Unit 4

description

 

Transcript of Testing Methods

  • 1. Testing Methods Carl Smith National Certificate Year 2 Unit 4

2. Unit 4 objectives

  • Apply simple analysis and design techniques to the software development process.
  • Develop basic high-level code using an appropriate procedural programming language.
  • Use suitable testing methods to ascertain the correctness of a working piece of code.
  • Produce appropriate documentation for a given program application.

3. Errors in your code

  • What are the types of errors we need to test for?

4. Syntax Errors

  • Syntax Errors:errors in the use of the Pascal language.
  • The most common examples are missing semicolons and misspelled words.
  • These errors are detected by the compiler and an error message is produced.

5. Runtime Errors

  • Runtime Errors:a program stops executing because a program statement, although syntactically correct, produces a meaningless or impossible result e.g. dividing by zero

6. Logic Errors

  • Logic Errors:a program completes execution but the results expected are not correct.
  • A calculation may have been coded incorrectly or the sequence of instructions may be incorrect
  • The level of error checking provided by the compiler and the meaningfulness oferror messages displayed vary depending on the implementation of the development environment (e.g. TP)

7. Detecting Errors

  • The compiler will detect syntax errors. Execution of the program will terminate when a run-time error is present
  • It is important that we have a strategy for detecting the existence oflogic errors

8. Black Box Testing

  • Also known asfunctional testing . Asoftwaretesting technique whereby the internal workings of the item being tested are not known by the tester. For example, in a black box test on a software design the tester only knows the inputs and what the expected outcomes should be and not how the program arrives at those outputs. The tester does not ever examine the programmingcodeand does not need any further knowledge of the program other than its specifications.

9. Advantages & Disadvantages

  • The advantages of this type of testing include:
    • The test is unbiased because the designer and the tester are independent of each other.
    • The tester does not need knowledge of any specific programming languages.
    • The test is done from the point of view of the user, not the designer.
    • Test cases can be designed as soon as the specifications are complete.
  • The disadvantages of this type of testing include:
    • The test can be redundant if the software designer has already run a test case.
    • The test cases are difficult to design.
    • Testing every possible input stream is unrealistic because it would take a inordinate amount of time; therefore, many program paths will go untested.

10. White Box Testing

  • Also known asglass box ,structural ,clear boxandopen box testing . Asoftwaretesting technique whereby explicit knowledge of the internal workings of the item being tested are used to select the test data. Unlikeblack box testing , white box testing uses specific knowledge of programmingcodeto examine outputs. The test is accurate only if the tester knows what the program is supposed to do. He or she can then see if the program diverges from its intended goal. White box testing does not account for errors caused by omission, and all visible code must also be readable.
  • For a complete software examination, both white box and black box tests are required.

11. The Test Plan

  • Atest planmay or may not form part of thetechnical specification , but one needs to be produced.
  • It should be developed by a systems analyst with an overview of the entire system being produced (and certainly not by a programmer involved in the coding process)

12. The Test Plan - 2

  • Individual programmers will test their own programs as part of the development process.
  • The test planmayprovide for testing of individual programs, but should concentrate on testing how the various elements of the new system co-operate together. It must test the entire system.

13. Successful Testing

  • Since the purpose of testing is to discover bugs, a test is termedsuccessfulif it uncovers an error, and isunsuccessfulif the program behaves as it should.
  • Try to break your program dont try to convince yourself it works.
  • Involve others in your testing!

14. Testing Stages

  • Design your test strategy
  • Record your test plan
  • List the results

15. Example Test Plan

  • Table here

16. Summary

  • We covered:-
    • National Certificate Unit 4 objectives
    • The importance of testing
    • Syntax, Runtime and Logic errors
    • Successful Testing
    • Example Test Plan
    • Any Questions?