Testing Methods

434 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
434
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Testing Methods

  1. 1. Testing Methods Carl Smith National Certificate Year 2 – Unit 4
  2. 2. Unit 4 objectives <ul><li>Apply simple analysis and design techniques to the software development process. </li></ul><ul><li>Develop basic high-level code using an appropriate procedural programming language. </li></ul><ul><li>Use suitable testing methods to ascertain the correctness of a working piece of code. </li></ul><ul><li>Produce appropriate documentation for a given program application. </li></ul>
  3. 3. Errors in your code <ul><li>What are the types of errors we need to test for? </li></ul>
  4. 4. Syntax Errors <ul><li>Syntax Errors: errors in the use of the Pascal language. </li></ul><ul><li>The most common examples are missing semicolons and misspelled words. </li></ul><ul><li>These errors are detected by the compiler and an error message is produced. </li></ul>
  5. 5. Runtime Errors <ul><li>Runtime Errors: a program stops executing because a program statement, although syntactically correct, produces a meaningless or impossible result e.g. dividing by zero </li></ul>
  6. 6. Logic Errors <ul><li>Logic Errors: a program completes execution but the results expected are not correct. </li></ul><ul><li>A calculation may have been coded incorrectly or the sequence of instructions may be incorrect </li></ul><ul><li>The level of error checking provided by the compiler and the meaningfulness of error messages displayed vary depending on the implementation of the development environment (e.g. TP) </li></ul>
  7. 7. Detecting Errors <ul><li>The compiler will detect syntax errors. Execution of the program will terminate when a run-time error is present </li></ul><ul><li>It is important that we have a strategy for detecting the existence of logic errors </li></ul>
  8. 8. Black Box Testing <ul><li>Also known as functional testing . A software testing 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 programming code and does not need any further knowledge of the program other than its specifications. </li></ul>
  9. 9. Advantages & Disadvantages <ul><li>The advantages of this type of testing include: </li></ul><ul><ul><li>The test is unbiased because the designer and the tester are independent of each other. </li></ul></ul><ul><ul><li>The tester does not need knowledge of any specific programming languages. </li></ul></ul><ul><ul><li>The test is done from the point of view of the user, not the designer. </li></ul></ul><ul><ul><li>Test cases can be designed as soon as the specifications are complete. </li></ul></ul><ul><li>The disadvantages of this type of testing include: </li></ul><ul><ul><li>The test can be redundant if the software designer has already run a test case. </li></ul></ul><ul><ul><li>The test cases are difficult to design. </li></ul></ul><ul><ul><li>Testing every possible input stream is unrealistic because it would take a inordinate amount of time; therefore, many program paths will go untested. </li></ul></ul>
  10. 10. White Box Testing <ul><li>Also known as glass box , structural , clear box and open box testing . A software testing technique whereby explicit knowledge of the internal workings of the item being tested are used to select the test data. Unlike black box testing , white box testing uses specific knowledge of programming code to 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. </li></ul><ul><li>For a complete software examination, both white box and black box tests are required. </li></ul>
  11. 11. The Test Plan <ul><li>A test plan may or may not form part of the technical specification , but one needs to be produced. </li></ul><ul><li>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) </li></ul>
  12. 12. The Test Plan - 2 <ul><li>Individual programmers will test their own programs as part of the development process. </li></ul><ul><li>The test plan may provide 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. </li></ul>
  13. 13. Successful Testing <ul><li>Since the purpose of testing is to discover “bugs”, a test is termed successful if it uncovers an error, and is unsuccessful if the program behaves as it should. </li></ul><ul><li>Try to “break” your program – don’t try to convince yourself it works. </li></ul><ul><li>Involve others in your testing…! </li></ul>
  14. 14. Testing Stages <ul><li>Design your test strategy </li></ul><ul><li>Record your test plan </li></ul><ul><li>List the results </li></ul>
  15. 15. Example Test Plan <ul><li>Table here… </li></ul>
  16. 16. Summary <ul><li>We covered:- </li></ul><ul><ul><li>National Certificate Unit 4 objectives </li></ul></ul><ul><ul><li>The importance of testing </li></ul></ul><ul><ul><li>Syntax, Runtime and Logic errors </li></ul></ul><ul><ul><li>Successful Testing </li></ul></ul><ul><ul><li>Example Test Plan </li></ul></ul><ul><ul><li>Any Questions? </li></ul></ul>

×