// The KnowledgeModel.txt file holds the template for the knowledge model. // // The syntax for each Knowledge Unit is as follows: // // Name of the Knowledge Unit on a line by itself. Use quotes if more than one word // # numbers corresponding to generated, correct, partial, incorrect and missed // This must be the line that immediately follows the name of the knowledge unit // These numbers will refer to this unit as well as all its subunits unless over-ridden // Not all the number have to be provided // For Correct KM, generated will be the minimum number of problems of each type that must be generated // correct / 100 will be the percentage of problems the user must get right before // the user is considered as knowing this topic. // other three could be used in the future. // If NO numbers are provided, the KU inherits ALL its numbers from the parent. // Note, the larger generated is, the more problems the user must attempt before moving on // You would want to give larger numbers for harder topics // The larger correct is, the greater the percentage the user must get right before moving on // You would want to give larger numbers for EASIER topics // @ The line beginning with @ says 2 things: // 1) That this node with Name should be a part of the displayed tree // 2) Whatever follows the @, to the end of the line, is the // description to be displayed when mouseOver the oval // So, if a node does not have an @ line between Name and { // then, that node will not be part of the displayed tree. // // Any comments regarding this knowledge unit etc - optional // { - Open brace on a line by itself to indicate all subunits of this KU // Each subunit listed recursively with the same syntax // } - Closing brace on a line by itself to indicate the end of the list of subunits // // Note: use braces even if a Knowledge Unit does not have any subunits. // ------------------------------------------------------------------------------------------------- // Format: // Each open and close brace on a separate line // Each objective on a separate line for easy parsing // Description preceded by @description // Filename for text preceded by @filename // Performance numbers preceded by # // PERFORMANCE MUST COME AFTER DESCRIPTION // Comments preceded by // // Any changes here - propagate to // KnowledgeUnit // Name of topic in web page Program # 4 75 { Data # 3 90 { Form { Constant # 1 100 { Literal { } Symbolic { } } Variable { Declaration { Correct { } Scope { Correct { } Accessing variable out of its scope { } } Re-declaring a variable that has already been declared { } } Initialization { } Assignment { Single { } Multiple { } Self Referential { } } Input { Whole { Whitespace delimited { } Non-whitespace delimited { } } Real { Whitespace delimited { } Non-whitespace delimited { } } Boolean { Legal { } Illegal { } } Input stream is empty { } Data type of next item in input stream incompatible with variable in input statement { } } Referencing { Correct { } Referencing variable before initializing its value { } Referencing garbage value assigned to variable { } } Storage Class # 5 50 { auto { } static { } extern { } register { } } Write { Declaration { } Initialization { } } } } RefVariable { Declaration { Correct { } Scope { Correct { } Accessing reference variable out of its scope { } } } Initialization { Correct { } Initializing a reference variable to refer to a pointer/another reference variable { } } Assigning to a reference variable { } Referencing { Correct { } Referencing variable before initializing its value { } Referencing garbage value assigned to variable { } } } Type { Primitive { Predefined { Integral { Signed { long { } int { } short { } } Unsigned { unsigned long { } unsigned { } unsigned short { } } char { } bool { } } Real { float { } double { } long double { } } } Programmer Defined { Enumeration { } Subrange { } } } Pointer # 2 60 // Access data type { Declaration { Correct @description Pointer is declared correctly { } scope { Correct @description Pointer is accessed always within scope { } Accessing pointer out of scope @description Pointer is accessed after it has gone out of scope { } } } Allocation { Correct @description Pointer is properly allocated { } } Initialization { Correct @description Initialization of the pointer is correct { } } Assignment { Correct @description Assignment to the pointer is correct { } } Referencing { Correct @description Pointer is referenced correctly { } } Dereferencing { Correct @description Pointer is dereferenced correctly { } Dereferencing pointer before initializing/allocating @description Pointer is dereferenced before it is initialized/allocated { } Dereferencing pointer after the variable to which it points goes out of scope @description Pointer is dereferenced after whe variable (to which it points) has gone out of scope { } Dereferencing pointer after the anonymous variable to which it points is deallocated @description Pointer is dereferenced after the heap object (to which it points) is deallocated { } } Deallocation { Correct @description Pointer is deallocated correctly { } No pointer pointing to the anonymous variable @description Heap object is lost - it cannot be accessed through any pointer # 5 60 { } } Anonymous Variable { correct @description Heap object is used correctly { } initialization @description Heap object is initialized correctly { } assignment @description Heap object is assigned correctly { } Referencing { correct @description Heap object is referenced correctly { } Referencing anonymous variable before initializing its value @description Heap object is referenced before it is initialized { } } } } Aggregate { Array { OneDim { Declaration { Correct { } // These are pertinent, but, should we consider them for arrays, not just variables? // Scope // { // Correct // { // } // Accessing variable out of its scope // { // } // } // // Accessing variable before declaring it // { // } } Initialization { // Missing braces in array initialization // { // } // Too many initializers // { // } Complete { Correct { } Not specifying size in the declaration of the array { } } Incomplete { } } Subscript { Constant { } Variable { } Expression { } Accessing an element outside the bounds of the array @description Accessing an element outside the bounds of the array { } } Assignment { Random { } Systematic { } Self Referential { } // Coercion // { // } // Assigning an element of the wrong data type // { // } // Missing brackets [] in the statement // { // } } Referencing { Random { } Systematic { } Referencing variable before initializing its value @description Referencing array element before initializing its value { } // Missing brackets [] in the statement // { // } } Parameter { Aggregate { Accessed @description Passing entire array to a function, Referencing it in the function { } Modified @description Passing entire array to a function, Assigning to it in the function { } } Element @description Passing elements of an array by value to a function { } Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition { } } } } Structure { Definition { Definition is not in scope @description Declaring a structure variable when the structure definition is out of scope { } } Declaration { Conflict in the name of structure fields @description Same name is used for fields in more than one structure { } } Initialization { Complete @description Initialization of all the fields of a structure { } Incomplete @description Initialization of only some of the fields of a structure { } } Assignment { Field { Correct @description Assignment to a field of a structure variable { } Value of incorrect data type assigned to variable @description Assignment of a value of incorrect data type to a field of a structure variable { } Referring to field as independent variable @description Treating a field as an independent variable { } } Aggregate @description Assigning from one structure variable to another in aggregate { } Assigning to structure type instead of structure variable @description Assigning to structure type instead of structure variable { } } Referencing { Field { Correct @description Correctly referencing the field of a structure variable { } Referencing variable before initializing its value @description Referencing the field of a structure variable before initializing it { } Referencing field that is not part of the structure @description Referencing a field that is not part of a structure variable { } // Missing dot operator in the statement // @description Referencing the field of a structure variable without using the dot operator // SAME AS Assignment.Referring to field as independent variable // { // } } } Parameter { Aggregate.Accessed @description Structure variable passed as a parameter to a function where it is referenced { } Aggregate.Modified @description Structure variable passed as a parameter to a function where it is modified { } Field @description Field of a structure variable passed as a parameter to a function { } Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition @description Structure is passed to a function when a field is expected or vice versa { } } Returned @description Entire structure is returned by a function { } Nested { Declaring variable of nested structure @description Declaring variable of nested structure { } Assigning to nested field @description Assigning to nested field { } Referencing nested field @description Referencing nested field { } } // Function // { // } } // ends Type.Aggregate.Structure } // ends Aggregate typedef { } } // ends Type Operator { Arithmetic @description Arithmetic operators # 2 60 // Specifying coercion for each since it does not apply to % { + @description Addition operator { Correct @description Correctly evaluating an addition expression { } Precedence @description Precedence of + operator { } Associativity @description Associativity of + operator { } Coercion @description Conversion automatically done when operands of + are of different data types # 1 50 { } } - @description Subtraction operator { Correct @description Correctly evaluating a subtraction expression { } Precedence @description Precedence of - operator { } Associativity @description Associativity of - operator { } Coercion @description Conversion automatically done when operands of - are of different data types # 1 50 { } } * @description Multiplication operator { Correct @description Correctly evaluating a multiplication expression { } Precedence @description Precedence of * operator { } Associativity @description Associativity of * operator { } Coercion @description Conversion automatically done when operands of * are of different data types # 1 50 { } } / @description Division operator { Integer { Correct @description Correctly evaluating an integer division expression { } } Real { Correct @description Correctly evaluating a real division expression { } } Precedence @description Precedence of / operator { } Associativity @description Associativity of / operator { } Coercion @description Conversion automatically done when operands of / are of different data types # 1 50 { } Dividing By Zero @description Divide by zero error # 1 0 { } } % @description Remainder or Modulus operator { Correct @description Correctly evaluating a remainder expression { } Precedence @description Precedence of % operator { } Associativity @description Associativity of % operator { } Dividing By Zero @description Divide by zero error in modulus expression # 1 0 { } // Applicable only to C/C++ // Incorrect operand type for modulus (%) operator // Not retaining this since this duplicates the next learn objective // @description Modulus (%) operator cannot be applied to real operands // # 1 0 // { // } // Applicable only to Java, C# Real @description Modulus (%) operator applied to real operands # 1 0 { } } Parenthesis @description Parenthesis applied to arithmetic expressions { // Correct evaluation is meaningless since parenthesis returns results of embedded operators Precedence @description How parentheses affect the precedence in arithmetic expressions { } Associativity @description The associativity of parentheses in arithmetic expressions { } } } // Parenthesis // @description Parenthesis applied to expressions // { // // Correct evaluation is meaningless since parenthesis returns results of embedded operators // Precedence // @description How parentheses affect the precedence in expressions // { // } // // Associativity // @description The associativity of parentheses in expressions // { // } // } Relational # 2 60 { < { Correct @description Correctly evaluating a less-than expression { } Precedence @description Precedence of < operator { } Associativity @description Associativity of < operator # 1 0 { } } <= { Correct @description Correctly evaluating a <= expression { } Precedence @description Precedence of <= operator { } Associativity @description Associativity of <= operator # 1 0 { } } == { Correct @description Correctly evaluating an equality expression { } Precedence @description Precedence of == operator { } Associativity @description Associativity of == operator # 1 0 { } } != { Correct @description Correctly evaluating a != expression { } Precedence @description Precedence of != operator { } Associativity @description Associativity of != operator # 1 0 { } } > { Correct @description Correctly evaluating a greater-than expression { } Precedence @description Precedence of > operator { } Associativity @description Associativity of > operator # 1 0 { } } >= { Correct @description Correctly evaluating a >= expression { } Precedence @description Precedence of >= operator { } Associativity @description Associativity of >= operator # 1 0 { } } // Arithmetic and Relational Operators combined // The combinations are: // Arithmetic Operators Relational Operators // Low (+ -) Low (== !=) // Low High (< <= > >=) // High (* / %) Low (== !=) // High High (< <= > >=) Arithmetic { Low { Low { Precedence @description Precedence of +, - versus ==, != { } } High { Precedence @description Precedence of +, - versus <, <=, >, >= { } } } High { Low { Precedence @description Precedence of *, /, % versus ==, != { } } High { Precedence @description Precedence of *, /, % versus <, <=, >, >= { } } } } Parenthesis @description Parenthesis applied to relational expressions { // Correct evaluation is meaningless since parenthesis returns results of embedded operators Precedence @description How parentheses affect the precedence in relational expressions { } Associativity @description The associativity of parentheses in relational expressions { } } } Logical # 3 60 { && { Correct @description Correctly evaluating an and expression { Boolean @description Correctly evaluating an and expression with boolean operands { } Other @description Correctly evaluating an and expression with non-boolean operands # 1 60 { } } // Applicable only to Java/C# - problems generated for Correct.Other update this Incorrect operand type for and (&&) operator @description Incorrect operand type for and (&&) operator { } Short Circuit @description Short circuit evaluation of and expression { Boolean @description Correctly evaluating short circuit and expression with boolean operands { } Other @description Correctly evaluating short circuit and expression with non-boolean operands # 1 60 { } } Precedence @description Precedence of && operator { Logical @description Correctly evaluating the precedence of and with respect to other logical operators { } Other @description Correctly evaluating the precedence of and with respect to non-logical operators { } } Associativity @description Associativity of && operator # 2 60 { } } || { Correct @description Correctly evaluating an or expression { Boolean @description Correctly evaluating an or expression with boolean operands { } Other @description Correctly evaluating an or expression with non-boolean operands # 1 60 { } } // Applicable only to Java/C# - problems generated for Correct.Other update this Incorrect operand type for or (||) operator @description Incorrect operand type for or (||) operator { } Short Circuit @description Short circuit evaluation of or expression { Boolean @description Correctly evaluating short circuit or expression with boolean operands { } Other @description Correctly evaluating short circuit or expression with non-boolean operands # 1 60 { } } Precedence @description Precedence of || operator { Logical @description Correctly evaluating the precedence of or with respect to other logical operators { } Other @description Correctly evaluating the precedence of or with respect to non-logical operators { } } Associativity @description Associativity of || operator # 2 60 { } } ! { Correct @description Correctly evaluating a not expression { Boolean @description Correctly evaluating a not expression with boolean operands { } Other @description Correctly evaluating a not expression with non-boolean operands # 1 60 { } } Precedence @description Precedence of ! operator { Logical @description Correctly evaluating the precedence of not with respect to other logical operators { } Other @description Correctly evaluating the precedence of not with respect to non-logical operators { } } Associativity @description Associativity of ! operator # 2 60 { } } Parenthesis @description Parenthesis applied to logical expressions { // Correct evaluation is meaningless since parenthesis returns results of embedded operators Precedence @description How parentheses affect the precedence in logical expressions { } Associativity @description The associativity of parentheses in logical expressions { } } } Assignment # 2 60 { Simple # 1 60 { Correct @description Correctly evaluating a simple assignment { } Self Referential @description Correctly evaluating a self-referential assignment (same variable on both sides) { } Precedence @description Precedence of = operator { } Associativity @description Associativity of = operator { } Coercion @description Conversion automatically done when operands of = are of different data types { Widening @description Conversion automatically done when value of a smaller data type is assigned to a variable of a larger data type { } Narrowing @description Conversion automatically done when value of a larger data type is assigned to a variable of a smaller data type { } } } Compound { Correct { Arithmetic @description Correctly evaluating a compound arithmetic assignment { } Bitwise @description Correctly evaluating a compound bitwise assignment { } } Precedence @description Precedence of compound assignment operators { } Associativity @description Associativity of compound assignment operators { } Coercion @description Conversion automatically done when operands of compound assignment are of different data types { Widening @description Conversion automatically done when value of a smaller data type is assigned to a variable of a larger data type { } Narrowing @description Conversion automatically done when value of a larger data type is assigned to a variable of a smaller data type { } } } Prefix { Associativity @description Associativity of prefix increment and decrement operators { } Increment { Correct @description Correctly evaluating prefix increment { } Precedence @description Precedence of prefix increment operator { } } Decrement { Correct @description Correctly evaluating prefix decrement { } Precedence @description Precedence of prefix decrement operator { } } } Postfix { Increment { Correct @description Correctly evaluating postfix increment { } Precedence @description Precedence of postfix increment operator { } } Decrement { Correct @description Correctly evaluating postfix decrement { } Precedence @description Precedence of postfix decrement operator { } } } Parenthesis @description Parenthesis applied to assignment expressions { // Correct evaluation is meaningless since parenthesis returns results of embedded operators Precedence @description How parentheses affect the precedence in assignment expressions { } Associativity @description The associativity of parentheses in assignment expressions { } } } Bitwise # 2 50 { & { Correct { } Precedence @description Precedence of & operator { Bitwise @description Precedence of & operator with respect to other bitwise operators { } Other @description Precedence of & operator with respect to non-bitwise operators { } } Associativity @description Associativity of & operator { } // Incorrect operand type for bitwise operator // { // } } | { Correct { } Precedence @description Precedence of | operator { Bitwise @description Precedence of | operator with respect to other bitwise operators { } Other @description Precedence of | operator with respect to non-bitwise operators { } } Associativity @description Associativity of | operator { } // Incorrect operand type for bitwise operator // { // } } ^ { Correct { } Precedence @description Precedence of ^ operator { Bitwise @description Precedence of ^ operator with respect to other bitwise operators { } Other @description Precedence of ^ operator with respect to non-bitwise operators { } } Associativity @description Associativity of ^ operator { } // Incorrect operand type for bitwise operator // { // } } << { Correct { } Precedence @description Precedence of << operator { Bitwise @description Precedence of << operator with respect to other bitwise operators { } Other @description Precedence of << operator with respect to non-bitwise operators { } } Associativity @description Associativity of << operator { } // Incorrect operand type for bitwise operator // { // } } >> { Positive { Correct @ Right-shifting positive number { } } Negative { Correct @ Right-shifting negative number { } } Precedence @description Precedence of >> operator { Bitwise @description Precedence of >> operator with respect to other bitwise operators { } Other @description Precedence of >> operator with respect to non-bitwise operators { } } Associativity @description Associativity of >> operator { } // Incorrect operand type for bitwise operator // { // } } >>> { Correct { } Precedence @description Precedence of >>> operator { Bitwise @description Precedence of >>> operator with respect to other bitwise operators { } Other @description Precedence of >>> operator with respect to non-bitwise operators { } } Associativity @description Associativity of >>> operator { } // Incorrect operand type for bitwise operator // { // } } ~ { Correct { } Precedence @description Precedence of ~ operator { Bitwise @description Precedence of ~ operator with respect to other bitwise operators { } Other @description Precedence of ~ operator with respect to non-bitwise operators { } } Associativity @description Associativity of ~ operator { } // Incorrect operand type for bitwise operator // { // } } Incorrect operand type for bitwise operator { } Parenthesis @description Parenthesis applied to bitwise expressions { // Correct evaluation is meaningless since parenthesis returns results of embedded operators Precedence @description How parentheses affect the precedence in bitwise expressions { } Associativity @description The associativity of parentheses in bitwise expressions { } } } } } Control # 5 60 { Sequence { Simple Statement { } Compound Statement { } } Selection @description Programming constructs for selecting among options # 1 60 { ifElse @description Two-way selection statement { Condition { Relational @description Condition of if-else is a relational expression { true @description Condition of if-else is a relational expression, evaluates to true { } false @description Condition of if-else is a relational expression, evaluates to false { } } Declaration @description Condition is a variable declaration # 1 50 { true @description Condition of if-else is a variable declaration, evaluates to true { } false @description Condition of if-else is a variable declaration, evaluates to false { } } // Arithmetic, assignment, constants (literal/symbolic/boolean), Other @description Condition of if-else is neither a relational expression nor a declaration # 1 50 { true @description Condition of if-else (neither relational nor a declaration), evaluates to true { } false @description Condition of if-else (neither relational nor declaration), evaluates to false { } } } ifClause { Simple @description if clause of if-else is a simple statement { } Compound @description if clause of if-else is a compound statement { } } elseClause { Simple @description else clause of if-else is a simple statement { } Compound @description else clause of if-else is a compound statement { } } PostStatement @description After the if-else, execution resumes from the statement following it { } // Dependent Vs Independent nested statements are not as // different as dependent and independent loops Nested @description Nested if-else statements { Cascading @description Cascaded nested if-else statements { } Classification @description if-else statements nested for classification { } Random @description if-else statements nested randomly { } DanglingElse @description Dangling else problem { } } Multiple @description Multiple if-else statements in a program { } } if @description One-way selection statement { Condition { Relational @description Condition of if is a relational expression { true @description Condition of if is a relational expression, evaluates to true { } false @description Condition of if is a relational expression, evaluates to false { } } Declaration @description Condition of if is a variable declaration # 1 50 { true @description Condition of if is a variable declaration, evaluates to true { } false @description Condition of if is a variable declaration, evaluates to false { } } // Arithmetic, assignment, constants (literal/symbolic/boolean), Other @description Condition of if is neither a relational expression nor a declaration # 1 50 { true @description Condition of if (neither relational nor declaration), evaluates to true { } false @description Condition of if (neither relational nor declaration), evaluates to false { } } } ifClause { Simple @description if clause of if statement is a simple statement { } Compound @description if clause of if statement is a compound statement { } } PostStatement @description After the if, execution resumes from the statement following it { } Nested @description Nested if statements { } Multiple @description Multiple if statements in a program { } } Switch @description Multi-way selection statement { Condition @description Condition of a multi-way selection statement { Matches case @description Condition of multi-way selection statement matches a case // condition is a variable // Sequential cases (incrementing versus decrementing), cases with gaps in coverage { } Matches default @description Condition of multi-way selection statement matches the default case // condition is a variable { } Matches none @description Condition of multi-way selection statement matches no case // condition is a variable, no default case, { } Expression @description Condition of multi-way selection statement is an expression // matches a case { } Switch condition is not an integer expression @description Condition of multi-way selection statement is not an integer { } } Case { Case value is not an integer expression { } Case value is not a constant expression @description Variable in not allowed in a case value { } } Body @description The body of the case executed in a multi-way selection statement { No statement @description No statement in the body of a case // Has break { } No break @description No break provided at the end of the body of a case // Has statements in the case { Has statements @description Body of a case has no break, but has statements { } No statement @description Body of a case has neither break nor statements { } } } Nested @description A multi-way selection statement nested inside another // Could be independent or dependent { } Multiple @description Multiple multi-way selection statements // Could be independent or dependent { } } } // ends Selection Condition @description Concerns particular to condition of selection and repetition { Boundary @description Boundary value for condition { Legal @description Condition evaluates to true when value of condition variable is that of literal constant in the condition { } Illegal @description Condition evaluates to false when value of condition variable is that of literal constant in the condition { } } } Repetition @description Programming constructs for repeated execution # 1 60 { Iteration @description Loops { Logic @description Logic-controlled loops { Pretest @description Pre-test logic-contolled loop # 1 60 { // > The normal case of one loop in the function // The normal case of multiple iterations Initialization { Yes @description Condition variable is initialized before the loop { } No @description Condition variable is not initialized before the loop { } } Condition { Relational @description Loop condition is a relational expression { } Arithmetic @description Loop condition is an arithmetic expression { } Logical @description Loop condition is a boolean expression { } Assignment @description Loop condition is an assignment expression { } Declaration @description Loop condition is a variable declaration { } Empty @description Loop has no condition { } // The boundary value changes in relational expression Changing @description More than one condition variable is updated in the loop body { } No @description No condition variable is updated in the loop body { } } Action { Compound @description Body of the loop is a compound statement { } Simple @description Body of the loop is a simple statement { } Empty @description Body of the loop is an empty statement { } } Update { After @description Condition variable is updated at the end of the loop body { } Before @description Condition variable is updated at the top of the loop body { } No @description Condition variable is not updated in the loop body { } } PostLoop @description After the loop, execution resumes from the statement following it { } // >> The exceptional cases of number of iterations Skip @description The loop executes zero times { } PassThrough @description The loop executes exactly once { } // > The exceptional cases of multiple loops in the function Nested @description Nested loops { Independent @description Nested loops, inner loop's condition is independent of the outer loop { } Dependent @description Nested loops, inner loop's condition is dependent on the outer loop { } } Multiple { Independent @description Mutiple loops, second loop's condition is independent of the first loop { } Dependent @description Mutiple loops, second loop's condition is dependent on the first loop { } } } PostTest @description Post-test logic-contolled loop # 1 60 { // > The normal case of one loop in the function // // The normal case of multiple iterations // Initialization // { // Yes // @description Condition variable is initialized before the loop // { // } // No // @description Condition variable is not initialized before the loop // { // } // } Condition { Relational @description Loop condition is a relational expression { } // Abnormal cases - weird conditions Arithmetic @description Loop condition is an arithmetic expression { } Logical @description Loop condition is a boolean expression { Range @description Loop condition tests for a contiguous range of values { Conjunct @description Loop condition tests for a contiguous range of values specified by a conjunctive expression { } Disjunct @description Loop condition tests for a contiguous range of values specified by a disjunctive expression { } } Negation @description Loop condition is negation of a relational or logical expression { } Discrete @description Loop condition tests for a set of discrete values { Inclusionary @description Loop condition excludes a set of discrete values { } Exclusionary @description Loop condition tests for a set of discrete values { } } } Assignment @description Loop condition is an assignment expression { } Condition of the loop is empty @description Loop has no condition { } // The boundary value changes in relational expression Changing @description More than one condition variable updated in the loop body { } } // Action // { // Compound // @description Body of the loop is a compound statement // { // } // Simple // @description Body of the loop is a simple statement // { // } // Empty // @description Body of the loop is an empty statement // { // } // } Update { After @description Condition variable is updated at the end of the loop body { } Before @description Condition variable is updated at the top of the loop body { } No @description Condition variable is not updated in the loop body { } } PostLoop @description After the loop, execution resumes from the statement following it { } // >> The exceptional cases of number of iterations PassThrough @description The loop executes exactly once { } Nested { Independent @description Nested loops, inner loop's condition is independent of the outer loop { } Dependent @description Nested loops, inner loop's condition is dependent on the outer loop { } } // > The special cases of multiple loops in the function Multiple { Independent @description Mutiple loops, second loop's condition is independent of the first loop { } Dependent @description Mutiple loops, second loop's condition is dependent on the first loop { } } } } Counter @description Counter-controlled loops # 1 60 { // > The normal case of one loop in the function // The normal case of multiple iterations Initialization { Assignment @description Loop is initialized using an assignment statement { } Declaration @description Loop is initialized using a declaration statement { } No @description Loop does not have an initialization statement { } } Condition { Relational @description Loop condition is a relational expression { } Arithmetic @description Loop condition is an arithmetic expression { } Logical @description Loop condition is a boolean expression { } Assignment @description Loop condition is an assignment expression { } Declaration @description Loop condition is a variable declaration { } // The boundary value changes in condition which is relational Changing @description Loop parameter is updated in the loop body { } // Abnormal cases of condition No @description Loop does not have a condition { } } Action { Compound @description Body of the loop is a compound statement { } Simple @description Body of the loop is a simple statement { } Empty @description Body of the loop is an empty statement { } // Whether the loop counter is changed in body Changing { Before @description Loop counter's value is also updated at the top of the loop body { } After @description Loop counter's value is also updated at the bottom of the loop body { } } } Update { Up @description Incrementing counter-controlled loop { One @description Loop counter's value is incremented by one on every iteration { } Many @description Loop counter's value is incremented by more than one on every iteration { } } Down { One @description Loop counter's value is decremented by one on every iteration { } Many @description Loop counter's value is decremented by more than one on every iteration { } } No @description Loop counter is never updated { } } PostLoop @description After the loop, execution resumes from the statement following it { } // >> The exceptional cases of number of iterations Skip @description The loop executes zero times { } PassThrough @description The loop executes exactly once { } // > The exceptional cases of multiple loops in the function Nested @description Nested loops { Independent @description Nested loops, inner loop's condition is independent of the outer loop { } Dependent @description Nested loops, inner loop's condition is dependent on the outer loop { } } Multiple { Independent @description Mutiple loops, second loop's condition is independent of the first loop { } Dependent @description Mutiple loops, second loop's condition is dependent on the first loop { } } } break @description Using break statement to terminate a loop { Single @description break statement in a loop { } Nested @description break statement in nested loops { } break statement not inside a loop or switch statement @description Illegal use of break statement { } } continue @description Using continue statement to skip the rest of the loop { Correct @description Using continue statement to skip the rest of the loop { } continue statement not inside a loop @description Illegal use of continue statement { } } Infinite @description Infinite loop { Condition variable is not updated in the loop @description Missing update statement results in infinite loop { } Condition variable is incorrectly updated in the loop @description Incorrect update results in infinite loop { } Value against which condition variable is compared is also modified @description Moving terminal value results in infinite loop { } Assignment is used in condition @ Assignment operator is used instead of comparison in the condition { } Empty condition in for loop @description When condition is left blank, it is treated as true in for loop { } Condition is a constant - either always true or always false @description Condition is a constant expression that never changes { } } Mixed @description Mixed loops { Multiple Dependent @description Multiple dependent loops of different types in code { } Nested Dependent @description Nested dependent loops of different types in code { } } Accumulator @description Use of accumulator variables in loops { } } // end Iteration Recursion # 4 25 { Base Case { Condition { } Action { } } Recursive Case { Condition { } Action { } } } } // end Repetition Abstraction { Control { Function { Definition { Local variable { Name overlap @description Variables with the same name in two different functions { } // Distinct // { // } } // Formal parameter is re-declared as a local variable in the function // { // } Re-declaring a variable that has already been declared @description Error - Formal parameter is re-declared as a local variable in the function { } return statement missing in the definition of a function with non-void return type @description Error - return statement missing in the definition of a function with non-void return type { } Data type of the value in the return statement is incompatible with the return type of the function @description Error - Data type of the returned value is incompatible with the return type of the function { } return statement is not the last statement in the function @description Error - Return is not the last statement in the function { } Multiple return statements @description Function has multiple return statements { } Default { Correct @description Correct use of default values for parameters { } Error { Definition @description Error in the definition of a function providing default values for parameters { } Call @description Error in the call to a function which provides default values for parameters { } } } } Prototype @description Prototype of a function { } Call { // Call as statement // { // } Call as expression @description Function called in an expression { } Calls to multiple functions as statements @description Calls to multiple functions in a program { } Multiple calls to the same function @description Multiple calls to the same function in a program { } Chained @description Chained function calls { } Function is called before it is defined/prototyped @description Function is called before it is defined/prototyped { } Value returned by the function is ignored by the caller @description Value returned by the function is ignored by the caller { } Caller tries to use the value returned by a function with void return type @description Caller tries to use the value returned by a function with void return type { } Data type of the value returned by the function call is incompatible with the expected data type in the caller @description Data type of the value returned by the function call is incompatible with the expected data type in the caller { } Recursive { Tail { void @description Tail recursive function with void return type { } nonVoid @description Tail recursive function with non-void return type { } } Head { void @description Head recursive function with void return type { } nonVoid @description Head recursive function with non-void return type { } } Both @description Recursive function with both head and tail recursion { } } } Parameter { Value { Variable { One @description One variable is passed by value { } Many @description Multiple variables are passed by value { } Repeated @description The same variable is passed by value multiple times in a function call { } } Constant @description The actual parameter passed by value is a literal constant { } Expression @description The actual parameter passed by value is an expression { } FunctionCall @description The actual parameter passed by value is itself a function call { } } Number of actual parameters in the call not equal to the number of formal parameters in the definition @description Error - Number of actual parameters not the same as the number of formal parameters { } Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition @description Error - Data type of the actual parameter incompatible with the data type of the formal parameter { } Reference { Variable { One @description One variable passed by reference { } Many @description More than one variable passed by reference { } Repeated @description Same variable is passed multiple times by reference { } } Constant or expression is passed by reference @description Error - Constant or expression is passed by reference { } } Pointer @description Parameter is passed by reference using pointer { } // None // { // } Result { } ValueResult { } } } } Data Abstraction { Class { Function { Public { Wrt Class @description Accessing static public member function by client with respect to class name { } Wrt Object @description Accessing static public member function by client with respect to an object { } } Protected { By Client @description Accessing static protected member function by client { } } Private { By Client @description Accessing static private member function by client { } } } Variable { Public { Wrt Class @description Accessing static public data member by client with respect to class { } Wrt Object @description Accessing static public data member by client with respect to object { } By Class Function @description Accessing static public data member by static member function { } By Object Function @description Accessing static public data member by dynamic member function { } } Protected { By Client @description Accessing static protected data member by client { } By Class Function @description Accessing static protected data member by static member function { } By Object Function @description Accessing static protected data member by dynamic member function { } } Private { By Client @description Accessing static private data member by client { } By Class Function @description Accessing static private data member by static member function { } By Object Function @description Accessing static private data member by dynamic member function { } } } // end of Class.Variable } // end of Class Object { Variable { Public { By Client @descriptor Accessing public data member by client { } // By Class Function Class (static) function does not have access to public data member of the object @descriptor Accessing public data member by static member function { } By Object Function @descriptor Accessing public data member by dynamic member function { } By Composer @descriptor Accessing public data member by composing class { } Wrt Composer @descriptor Accessing public data member with respect to composing object by client { } By Inheritor @descriptor Accessing public data member by inheriting class { } Wrt Inheritor @descriptor Accessing public data member with respect to inheriting object by client { } By Ancestor @descriptor Accessing public data member by ancestor class { } Wrt Ancestor @descriptor Accessing public data member with respect to ancestor object by client { } } // end Object.Variable.Public Protected { // By Client Client code does not have access to protected data member of the object @descriptor Accessing protected data member by client { } // By Class Function Class (static) function does not have access to protected data member of the object @descriptor Accessing protected data member by static member function { } By Object Function @descriptor Accessing protected data member by dynamic member function { } By Composer @descriptor Accessing protected data member by composing class { } Wrt Composer @descriptor Accessing protected data member with respect to composing object by client { } By Inheritor @descriptor Accessing protected data member by inheriting class { } Wrt Inheritor @descriptor Accessing protected data member with respect to inheriting object by client { } By Ancestor @descriptor Accessing protected data member by ancestor class { } Wrt Ancestor @descriptor Accessing protected data member with respect to ancestor object by client { } } // end Object.Variable.Protected Private { // By Client Client code does not have access to private data member of the object @descriptor Accessing private data member by client { } // By Class Function Class (static) function does not have access to private data member of the object @descriptor Accessing private data member by static member function { } By Object Function @descriptor Accessing private data member by dynamic member function { } By Composer @descriptor Accessing private data member by composing class { } Wrt Composer @descriptor Accessing private data member with respect to composing object by client { } By Inheritor @descriptor Accessing private data member by inheriting class { } Wrt Inheritor @descriptor Accessing private data member with respect to inheriting object by client { } By Ancestor @descriptor Accessing private data member by ancestor class { } Wrt Ancestor @descriptor Accessing private data member with respect to ancestor object by client { } } // end Object.Variable.Private } // end Object.Variable Constructor { By Client @descriptor Execution of constructor code with respect to object { } By Composer @descriptor Execution of constructor code by composing class constructor { } Inheritor { Coopted @descriptor Execution of constructor code when inheriting class's constructor calls it { } Not Coopted @descriptor Execution of constructor code when inheriting class's constructor does not call it { } } Number of actual parameters in the call not equal to the number of formal parameters in the definition @description Mismatch in the number of parameters passed to constructor { } Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition @description Mismatch in the data type of parameter passed to constructor { } } // end Object.Constructor Destructor { By Client @descriptor Execution of destructor code with respect to object { } By Composer @descriptor Execution of destructor code by composing class destructor { } By Inheritor @descriptor Execution of destructor code from inheriting class's destructor { } } // end Object.Destructor Selector { By Client @descriptor Execution of selectors with respect to object { } By Composer @descriptor Execution of selectors by composing class function { } Inheritor { Not Overridden @descriptor Execution of selectors by client with respect to inheriting object which does not override it (C++ only) { } Overridden { Coopted { NonPolymorphic @descriptor Execution of selectors by client with respect to inheriting object which overrides it, calls it, and behavior is not polymorphic (C++ only) { } Polymorphic @descriptor Execution of selectors by client with respect to inheriting object which overrides it, calls it and behavior is polymorphic { } } Not Coopted { NonPolymorphic @descriptor Execution of selectors by client with respect to inheriting object which overrides it, does not call it, and behavior is not polymorphic (C++ only) { } Polymorphic @descriptor Execution of selectors by client with respect to inheriting object which overrides it, does not call it and behavior is polymorphic { } } } } Value returned by the function is ignored by the caller @description Value returned by the selector is ignored by the caller { } Referencing variable before initializing its value @description Selector is called before the corresponding data member is initialized { } } // end Object.Selector Mutator { By Client @descriptor Execution of mutators with respect to object { } By Composer @descriptor Execution of mutators by composing class function { } Inheritor { Not Overridden @descriptor Execution of mutators by client with respect to inheriting object which does not override it (C++ only) { } Overridden { Coopted { NonPolymorphic @descriptor Execution of mutators by client with respect to inheriting object which overrides it, calls it, and behavior is not polymorphic (C++ only) { } Polymorphic @descriptor Execution of mutators by client with respect to inheriting object which overrides it, calls it and behavior is polymorphic { } } Not Coopted { NonPolymorphic @descriptor Execution of mutators by client with respect to inheriting object which overrides it, does not call it, and behavior is not polymorphic (C++ only) { } Polymorphic @descriptor Execution of mutators by client with respect to inheriting object which overrides it, does not call it and behavior is polymorphic { } } } } Value returned by the function is ignored by the caller @description Value returned by mutator is ignored by the caller { } Number of actual parameters in the call not equal to the number of formal parameters in the definition @description Mismatch in the number of parameters passed to mutator { } Mutator.Data type of the actual parameter in the call is incompatible with the data type of the formal parameter in the definition @description Mismatch in the data type of parameter passed to mutator { } } // end Object.Mutator Function { Public { Wrt Composer @descriptor Accessing public member function with respect to composing object by client { } Wrt Inheritor @descriptor Accessing public member function with respect to inheriting object by client { } By Ancestor @descriptor Accessing public member function by ancestor class { } Wrt Ancestor @descriptor Accessing public member function with respect to ancestor object by client { } } Protected { // By Client Client code does not have access to protected member function of the object @descriptor Accessing protected member function by client { } By Composer @descriptor Accessing protected member function by composing class { } Wrt Composer @descriptor Accessing protected member function with respect to composing object by client { } By Inheritor @descriptor Accessing protected member function by inheriting class { } Wrt Inheritor @descriptor Accessing protected member function with respect to inheriting object by client { } By Ancestor @descriptor Accessing protected member function by ancestor class { } Wrt Ancestor @descriptor Accessing protected member function with respect to ancestor object by client { } } Private { // By Client Client code does not have access to private member function of the object @descriptor Accessing private member function by client { } By Composer @descriptor Accessing private member function by composing class { } Wrt Composer @descriptor Accessing private member function with respect to composing object by client { } By Inheritor @descriptor Accessing private member function by inheriting class { } Wrt Inheritor @descriptor Accessing private member function with respect to inheriting object by client { } By Ancestor @descriptor Accessing private member function by ancestor class { } Wrt Ancestor @descriptor Accessing private member function with respect to ancestor object by client { } } } // end Object.Function Initialization { Basic object @description Initialization of an object during declaration { } Composed object @description Initialization of a composed object during declaration { } Inherited object @description Initialization of an inherited object during declaration { } } Assignment { Aggregate { // Assigning to class Object cannot be assigned to a class @description Assigning to class instead of object { } Assigning object to variable @description Assigning one object to another object of same class { } Assigning base object to derived variable @description Assigning base class object to derived class variable { } Assigning derived object to base variable @description Assigning derived class object to base class variable { } Assigning derived object to different derived variable @description Assigning object of one derived class to variable of another derived class { } } } Parameter { Aggregate { Accessed @description Passing an entire object as parameter to a function where it is referenced { } Modified @description Passing an entire object as parameter to a function where it is modified { } } } Returned { By Composer @description Calling selector or mutator with respect to object returned by Composer { } } } // end of Object } // end of Data Abstraction } // end of Abstraction } // ends Control } // ends Program