Midterm II Flashcards
What are the advantages of the waterfall method
Natural flow
Widely used
Reinforces planning first
Clear milestones
What are the steps in the waterfall method
Gathering resources-design-implementation-testing-maintenance
What are the disadvantages of the waterfall method
Not practical
Difficult to implement change
Designers may not be aware of implementation difficulties
What are the steps of the rapid prototyping method
Gathering preliminary requirements
Fast prototyping
User evaluation of the prototype
Repeat
Advantages of rapid prototyping method
Ensures that product meets clients needs
Easy to implement change
Disadvantages of the rapid prototyping method
May not be able to have adequate user involvement
Cost of prototype development
Why test software?
Produce robust software Maintain reputation Lower cost (easier to fix bugs before release)
What do we test during the testing phase
Whether a program works
Input
Output
Set of conditions
How do we test?
Ask how can we make the program fail
Regular tests
Boundary tests
Error testing
What is white box testing
Use internal knowledge of implementation to guide the selection of test cases
This will achieve maximum code coverage
What is black box testing
Use specification to guide the selection of test cases
To achieve the maximum coverage of cases give in the specs
What is debugging
A methodical process of finding and reducing bugs or defects
What are the steps of debugging
Identify where things go wrong Track program state Current location in program Current value of variables Number of iterations through the loop Find when expected state does not match actual state
What is printf debugging
Use a print statement to print values of variables and program location
Print debugging strategies
Linear -start at the beginning and add printf until the end is reached
Binary -start in middle of program
Disadvantages of printf debugging
Time consuming
Modify recompile rerun
What is gdb
A source level debugger.
Maps the state to source code and alls to view variable values and set breakpoints
What is a breakpoint
Internal pausing place in the program
Allows programmers to print variable values and resume running till next break point
Max value of an int
2^16
Max value of an unsigned int
2^16-1
Float vs double
Float keeps 6 significant digits and double keeps 15
Char storage space
8 bits
getchar()
Reads a character and assigns it to a variable
putchar()
Prints the character in the brackets
What is an implicit conversion
Implicit conversions are type conversions handled by compilers
What are the two cases where implicit conversions take place
When operands in a math operation don’t have the same type they will convert to the more complex type
Int will convert to float will convert to double
Secondly when the type expressed doesn’t match the value assigned
Ex: int=8.34 becomes 8
How to tell compiler to convert types and what is this called
(type) expression
This is called explicit conversion