advanced material n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Advanced Material PowerPoint Presentation
Download Presentation
Advanced Material

Loading in 2 Seconds...

play fullscreen
1 / 12

Advanced Material - PowerPoint PPT Presentation


  • 128 Views
  • Uploaded on

Advanced Material. The following slides contain advanced material and are optional. Outline. Testing What is testing Unit testing Automatic testing. Program verification. Verification checks validity of a program by Testing (here, functional testing on class level) Proving Testing

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Advanced Material' - holt


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
advanced material
Advanced Material

The following slides contain advanced material and are optional.

outline
Outline
  • Testing
    • What is testing
    • Unit testing
    • Automatic testing
program verification
Program verification
  • Verification checks validity of a program by
    • Testing (here, functional testing on class level)
    • Proving
  • Testing
    • Execute a program to check if it works
    • Verifies one particular execution of a program
    • Applicable to no/partial specification
  • Proving
    • Program is statically checked (not executed)
    • Verifies every possible execution
    • Needs complete specification
testing
Testing
  • Execute program
    • Manual testing
    • Unit testing
    • Automatic testing
  • If a test is successful:
    • The program works with exactly this input
    • The program could still fail with different input
  • If a test fails:
    • Bug found in program
  • A good test is a test that fails!
unit testing
Unit testing
  • Write test for a „unit“ of source code:
    • In object-oriented code, mostly per routine or class
  • Each test case has three steps
    • Prepare environment
    • Run test case
    • Evaluate output
  • Library support exists for all major languages
automatic testing
Automatic testing
  • Generate test cases automatically
    • Need a way to generate valid input data
    • Need a way to check validity of output data
  • Any ideas?
  • Input to a routine is valid if precondition is satisfied
  • Output of a routine is valid if postcondition is satisfied
automatic input generation
Automatic input generation
  • Create objects at random by
    • Calling a creation routine
    • Calling commands on the object
  • These objects can then be used to test a routine
    • Call routine with random input data (in case of basic types like integer)
    • Call routine with random objects, created as mentioned above
validate input
Validate input
  • Check if randomly chosen objects satisfy precondition
    • If yes, this is a valid test case
    • If no, ignore this test case
evaluate output
Evaluate output
  • For a valid test case, check if postcondition is satisfied
    • If yes, the test was successful
    • If no, there is a bug in the routine
  • Test also fails if
    • any exception happens during routine evaluation, e.g. Void-call or Precondition violation