Logic Specification Template, Codes and Instructions-Software Quality-Handout, Exercises of Software Development Methodologies

This handout is part of Software Quality course. It was provided by Dr. Raja Sahay at Biju Patnaik University of Technology, Rourkela. It includes: Logic, Specification, Template, CAT, SDS, Global, Variable, String, PUT

Typology: Exercises

2011/2012

Uploaded on 07/09/2012

chandu
chandu 🇮🇳

4

(4)

44 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
LST.doc Page 1 of 6
Logic Specification Template
Student
Andrew Phelps
Date
03/14/2009
Program
CAT Edge Class - Cycle 1
Program #
1
Instructor
Fredericks
Language
Java
Design
CAT Needs Statement
References
SDS Edge Description
Parameters
Global variable String PUT: String has been assigned to this class.
Global variable int nodeNumber: Integer has been assigned to this class.
Global variable of int nodeCoverArray[]: Array has been assigned to this class.
function decorateEdge()
place PUT file into an array with each line being an index in that array
while index is less than array length
if array index is an end node flag
set variables to move through remaining code
if variable is at end of file
break and do not label anything
do look for edge types while not back at the beginning of the node
if moving variable has ‘else if’
do find the location of the ‘if’ (is the branching node) for the
‘else if’
set the edge open flag at the branching node
do count backwards
if beginning of node
close edge
increment edgeNumber
set the edge open flag to go to the body of the ‘else if’
do count backwards
if beginning of node
close edge
increment edgeNumber
do count until end node found
do count backwards to beginning of node
if there is a return in the node
set return exist flag
if !returnFlag
set the edge open flag for continuing code
do until find ‘else’ condition or end of last ‘else if’
condition
do until new node found
close edge at new node
do until end of current block
count to the end of block
move past end of block, increment edgeNumber
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Logic Specification Template, Codes and Instructions-Software Quality-Handout and more Exercises Software Development Methodologies in PDF only on Docsity!

LST.doc Page 1 of 6

Logic Specification Template

Student Andrew Phelps Date 03/1 4 / Program CAT Edge Class - Cycle 1 Program # 1 Instructor Fredericks Language Java Design CAT Needs Statement References SDS Edge Description Parameters Global variable String PUT: String has been assigned to this class. Global variable int nodeNumber: Integer has been assigned to this class. Global variable of int nodeCoverArray[]: Array has been assigned to this class. function decorateEdge() place PUT file into an array with each line being an index in that array while index is less than array length if array index is an end node flag set variables to move through remaining code if variable is at end of file break and do not label anything do look for edge types while not back at the beginning of the node if moving variable has ‘else if’ do find the location of the ‘if’ (is the branching node) for the ‘else if’ set the edge open flag at the branching node do count backwards if beginning of node close edge increment edgeNumber set the edge open flag to go to the body of the ‘else if’ do count backwards if beginning of node close edge increment edgeNumber do count until end node found do count backwards to beginning of node if there is a return in the node set return exist flag if !returnFlag set the edge open flag for continuing code do until find ‘else’ condition or end of last ‘else if’ condition do until new node found close edge at new node do until end of current block count to the end of block move past end of block, increment edgeNumber

LST.doc Page 2 of 6

break else if moving variable has ‘if’ set the edge open flag do count forewards if beginning of node close edge and break increment edgeNumber do count until end node found do count backwards to beginning of node if there is a return in the node set return exist flag if !returnFlag set the edge open flag for continuing code do until find ‘else’ condition or end of last ‘else if’ condition do until new node found close edge at new node do until end of current block count to the end of block move past end of block, increment edgeNumber break else if moving variable has ‘else’ do count backwards until the if has been read if is ‘else if’ conditional put statement in temp local variable and continue to next ‘if’ or ‘else if’ else if is ‘if’ conditional put statement in temp local variable and stop set the edge open flag using not(local variable) do count backwards if beginning of node close edge increment edgeNumber set the edge open flag to go to the body of the ‘else’ do count backwards if beginning of node close edge increment edgeNumber do count until end node found do count backwards to beginning of node if there is a return in the node set return exist flag if !returnFlag set the edge open flag for continuing code do until find ‘else’ condition or end of last ‘else if’ condition do until new node found close edge at new node do until end of current block count to the end of block move past end of block, increment edgeNumber break else if moving variable has ‘try’

LST.doc Page 4 of 6

set the edge close flag at the beginning of the loop increment edgeNumber and break else if moving variable has ‘for’ set the edge open flag do count forewards if beginning of node close edge and break do move array index to end of ‘for’ block increment edgeNumber set the edge open flag, the not of the ‘for’ do count forewards if beginning of node close edge and break increment edgeNumber set open edge flag for connecting body do count forewards if beginning of node close edge and break do move array index to end of ‘for’ block increment edgeNumber do count forward and find the end of the ‘for’ block if at the end of the while block set the edge open flag set the edge close flag at the beginning of the loop increment edgeNumber and break else if moving variable has ‘switch’ set local variable with the ‘switch’ variable do count backwards if beginning of node close edge and break increment edgeNumber and break else if moving variable has ‘switch’ set local variable with the ‘switch’ variable do until the counter is on the default case if the counter is on a case set the edge open flag do count forewards if beginning of node close edge and break increment edgeNumber else if the counter is on default set the edge open flag, default case do count forewards if beginning of node close edge and break increment edgeNumber move array index passed the switch statement and break else do while not at beginning of function if line contains a }

LST.doc Page 5 of 6

increment counter else if line contains a { decrement counter if counter! 0 set end flag to true else set end flag to false if end flag do until end of node if line contains a ‘while’, ‘switch’, ‘for’, ‘if’, ‘else’, ‘try’, and ‘catch’ set skip flag to false if at the beginning of a node and skip flag set open edge flag do while local variable has not reached array index if not(local variable is > array length – 1) set close edge flag at local variable else set close edge flag at local variable - 1 increment edgeNumber else set edgeNumber to 0 break while index is less than array length put instrumented code into public accessible variable