CS265 Drexel Quizzes
(T/F)
Programs should always exit after they encounter an error - ✔✔False
(T/F)
It is a good idea to write down cases for a function before writing a function - ✔✔True
Black Box Testing - ✔✔*1)
...
CS265 Drexel Quizzes
(T/F)
Programs should always exit after they encounter an error - ✔✔False
(T/F)
It is a good idea to write down cases for a function before writing a function - ✔✔True
Black Box Testing - ✔✔*1) Implementation details are invisible*
*2) Code is tested to its specs:*
Inputs and outputs
Also tests for error codes and exceptions
*3) Can be written before the code is written*
(T/F)
After a bug is fixed, the code need not be tested again - ✔✔False
(T/F)
Assertions are used to state assumptions - ✔✔True
(T/F)
Test cases should include invalid input - ✔✔True
(T/F)
Programmers naturally assume their work is correct - ✔✔True
What things does a debugger allow you to do? - ✔✔-Set command-line args
-Eval any expression (involving vars currently in-scope)
-Step through program, line at a time
-Change value of vars
-Move the execution pointer around
-See where an executable crashed
-Follow along with source code as it executes
-Set Breakpoints
Complete testing (testing of all possible inputs) is often used to prove that a program works -
✔✔False
Why do we test code? - ✔✔Duh! To make sure we aren't being to deliver a broken program! No
one would hire a programmer to make a broken program
What are the general guidelines of a good interface? - ✔✔- Provide enough functionality so that
the user doesn't need to be aware of the implementation details
-Minimize side-effects. Document those that do exist
-It should provide no more functionality than is absolutely necessary
-Be consistent
(T/F)
Programmers to overlook deficiencies in their own work - ✔✔True
(T/F)
If you write good test cases for a function before you write it, then you don't need to add test
cases when you've finished the function - ✔✔False
What are the goals of testing? - ✔✔-Discover bugs, *not* show that the program works
-Reduce the risk of failure to an acceptable level
-Designing a test before writing the code is a great way to reduce bugs
White Box Testing - ✔✔-Details are visible
-Exercise all control paths
-Test border conditions
Name 3 Testing Guidelines - ✔✔-Test for the expected output/behavior
-Never be the last to test your own code
-Test error conditions
-Test border conditions
-Check that your program is not doing anything it shouldn't be doing
Filenames are case sensitive - ✔✔True
Shell commands are case sensitive - ✔✔True
The system administrator can look at your password - ✔✔False
The default shell on tux is tcsh - ✔✔False
Shell metacharacters are characters which have meaning to the shell - ✔✔True
What is a hidden file or directory? - ✔✔A filename that begins with a . (dot)
The shell: - ✔✔Is a command interpreter, provides a user interface
If your username is student12, write the absolute path of your home directory -
✔✔/home/student12
How do you refer to a file called maggie , located in directory /etc ? - ✔✔/etc/maggie
Show the command needed to see the contents of the HELLO shell variable (parameter) -
✔✔echo $HELLO
What is the relative pathname that refers to the parent directory? - ✔✔../?
Change the current (working) directory
Print the current (working) directory
End a terminal session
List the contents of a directory
View the contents of a file
Remove (delete) a file
[Show More]