1 / 5

CUTE Homework

CUTE Homework. CS294-32. Assignment. Due Noon 02/06/2009 Arrange to give me a demo on Monday 02/09/2009 after 1 pm Your Program: Trace -> Input You must compute overall branch coverage. Sample Program. #include <stdio.h> #include <cute.h> int dbl(int x) { return 2 * x; } void f(){

ivor-french
Download Presentation

CUTE Homework

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CUTE Homework CS294-32

  2. Assignment • Due Noon 02/06/2009 • Arrange to give me a demo on Monday 02/09/2009 after 1 pm • Your Program: Trace -> Input • You must compute overall branch coverage

  3. Sample Program #include <stdio.h> #include <cute.h> int dbl(int x) { return 2 * x; } void f(){ int x; int y; CUTE_integer(x); CUTE_integer(y); printf("x=%d y=%d\n",x,y); int z = dbl(x); if(z==y){ if(x != y+10){ printf("I am fine here\n"); } else { printf("I should not reach here\n"); } } }

  4. (2280624,_) = (0,_) (2280640,_) = (0,4) (2280620,_) = (0,_) (2280636,_) = (0,8) (2280616,_) = (0,_) (2280612,_) = (0,_) (2280608,_) = (0,4210688) (2280640,_) = (int)(x1,_) (2280604,_) = (0,_) (2280600,_) = (0,_) (2280596,_) = (0,4210688) (2280636,_) = (int)(x2,_) (2280592,_) = (0,_) (2280588,_) = (2280640,0) (2280584,_) = (0,_) (2280580,_) = (2280636,0) (2280576,_) = (0,_) (2280572,_) = (2280640,0) (2280528,_) = (2280572,_) (2280628,_) = (0,2) * (2280528,0) (2280632,_) = (2280628,0) (2280568,_) = (0,_) (2280564,_) = (2280636,0) then:1 (2280632,0) == (2280564,0) (2280560,_) = (0,_) (2280556,_) = (2280636,0) (2280552,_) = (2280556,0) + (0,10) (2280548,_) = (0,_) (2280544,_) = (2280640,0) then:3 (2280544,0) != (2280552,10) Sample Trace

  5. Sample Input sat (= x1 -10) (= x2 -20)

More Related