Difference between revisions of "Cascade User Manual"
(→Basic Structure) |
(→Basic Structure) |
||
Line 9: | Line 9: | ||
== Basic Structure == | == Basic Structure == | ||
− | Every control file starts with '''sourceFile''' sections that specify the files to be analyzed. Each source file has two attributes: '''name''' contains the path to the file, and '''fileId''' attaches a unique id to it. After '''sourceFile''', one or more '''run''' sections are specified, which describe the runs to be checked. Each run starts with a single ''''startPosition'''' and ''''endPosition'''' to give the start point and the end point respectively, and in between, one or more | + | Every control file starts with '''sourceFile''' sections that specify the files to be analyzed. Each source file has two attributes: '''name''' contains the path to the file, and '''fileId''' attaches a unique id to it. After '''sourceFile''', one or more '''run''' sections are specified, which describe the runs to be checked. Each run starts with a single ''''startPosition'''' and ''''endPosition'''' to give the start point and the end point respectively, and in between, one or more ''''wayPoint''''s may be inserted optionally to indicate the positions should be passed through. |
− | Let's discuss it more with a simple example abs.c. This program returns the absolute value of parameter x. abs1.ctrl is the control file for it, in which the ''''sourceFile'''' indicates the path to abs.c and assigns an id 1 for it. Now, we need to determine the target run to check. For the ''''startPosition'''' and | + | Let's discuss it more with a simple example abs.c. This program returns the absolute value of parameter x. abs1.ctrl is the control file for it, in which the ''''sourceFile'''' indicates the path to abs.c and assigns an id 1 for it. Now, we need to determine the target run to check. For the ''''startPosition'''' and ''''endPosition'''', we simply use the start and end line number of the function "abs". Since there's an if-else branchs, we use a ''''wayPoint'''' to select one to check. Normally, a ''''wayPoint'''' is often the first line of the chosen code. Note that the "fileId" is all assigned to 1 in the ''''startPosition'''', ''''endPosition'''' and ''''wayPoint'''', which means these positions are all in abs.c (whose id is 1) |
Revision as of 10:26, 12 December 2012
Getting Cascade
Using Cascade
Control File
Instead of inserting annotations in the source code, Cascade keeps them in a control file in order to leaves the source code clean. The control file is in the simple XML format, which serves as the guidance of verification. In this section, we will introduce the elements included control files by showing how to verify some sample codes in Cascade.
Basic Structure
Every control file starts with sourceFile sections that specify the files to be analyzed. Each source file has two attributes: name contains the path to the file, and fileId attaches a unique id to it. After sourceFile, one or more run sections are specified, which describe the runs to be checked. Each run starts with a single 'startPosition' and 'endPosition' to give the start point and the end point respectively, and in between, one or more 'wayPoint's may be inserted optionally to indicate the positions should be passed through.
Let's discuss it more with a simple example abs.c. This program returns the absolute value of parameter x. abs1.ctrl is the control file for it, in which the 'sourceFile' indicates the path to abs.c and assigns an id 1 for it. Now, we need to determine the target run to check. For the 'startPosition' and 'endPosition', we simply use the start and end line number of the function "abs". Since there's an if-else branchs, we use a 'wayPoint' to select one to check. Normally, a 'wayPoint' is often the first line of the chosen code. Note that the "fileId" is all assigned to 1 in the 'startPosition', 'endPosition' and 'wayPoint', which means these positions are all in abs.c (whose id is 1)